Preparing search index...

    The Capsule class represents a 3D capsule component in the scene. It extends the BaseScriptComponent and provides functionality for rendering and customizing the capsule's appearance.

    @component

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    api: Record<string, any>

    Generic object accessible by other instances of ScriptComponent. Use this object to store references to properties and methods that need to be accessible from other ScriptComponents.

    enabled: boolean

    If disabled, the Component will stop enacting its behavior.

    isEnabledInHierarchy: boolean

    Returns true if this Component, its SceneObject, and all of that SceneObjects parents are enabled.

    name: string
    sceneObject: SceneObject

    The SceneObject this component is on.

    uniqueIdentifier: string
    updatePriority: number

    Accessors

    • get backgroundColor(): vec4

      Gets the background color of the capsule.

      Returns vec4

      The current background color as a vec4.

    • set backgroundColor(value: vec4): void

      Sets the background color of the capsule.

      Parameters

      • value: vec4

        A vec4 representing the RGBA color to set as the background color.

      Returns void

    • get depth(): number

      get the depth of the capsule and updates its local scale accordingly.

      Returns number

      value - The new depth value to set for the capsule.

    • set depth(value: number): void

      Sets the depth of the capsule and updates its local scale accordingly.

      Parameters

      • value: number

        The new depth value to set for the capsule.

      Returns void

    • get renderMeshVisual(): RenderMeshVisual

      Gets the RenderMeshVisual instance associated with this capsule.

      Returns RenderMeshVisual

      The RenderMeshVisual instance.

    • get renderOrder(): number

      The render order of the Capsule 3D.

      Returns number

    • set renderOrder(value: number): void

      The render order of the Capsule 3D.

      Parameters

      • value: number

      Returns void

    • get size(): vec2

      Gets the size of the capsule as a 2D vector.

      Returns vec2

      The size of the capsule.

    • set size(value: vec2): void

      Sets the size of the capsule by updating its width and height. Adjusts the local scale of the capsule's transform to reflect the new size.

      Parameters

      • value: vec2

        A vec2 object representing the new size of the capsule, where x is the width and y is the height.

      Returns void

    Methods

    • Initializes the capsule component. This method sets up the mesh, material, size, and background color for the capsule. It ensures that the initialization process is only performed once.

      Returns void

    • Returns true if the object matches or derives from the passed in type.

      Parameters

      • type: string

      Returns boolean

    • Returns void