rhodonite
    Preparing search index...

    Class CapsuleCollider

    A capsule-shaped collider used for VRM spring bone physics simulation. The capsule is defined by a position (head), tail position, and radius. It can detect collisions with spherical objects like bones.

    Index
    • get baseSceneGraph(): SceneGraphComponent

      Gets the base scene graph component.

      Returns SceneGraphComponent

      The base scene graph component

    • get gizmo(): CapsuleColliderGizmo | undefined

      Gets the gizmo used to visualize this collider.

      Returns CapsuleColliderGizmo | undefined

      The gizmo instance, or undefined if not set

    • set gizmo(gizmo: CapsuleColliderGizmo | undefined): void

      Sets the gizmo used to visualize this collider.

      Parameters

      Returns void

    • get isGizmoVisible(): boolean

      Gets whether the gizmo is currently visible.

      Returns boolean

      True if the gizmo exists and is visible

    • get position(): Vector3

      Gets the local position of the capsule's head.

      Returns Vector3

      The local position vector

    • get radius(): number

      Gets the radius of the capsule.

      Returns number

      The radius value

    • get tail(): Vector3

      Gets the local position of the capsule's tail.

      Returns Vector3

      The local tail position vector

    • Calculates collision information between this capsule collider and a spherical bone.

      Parameters

      • bonePosition: Vector3

        The world position of the bone

      • boneRadius: number

        The radius of the bone sphere

      Returns { direction: IMutableVector3; distance: number }

      An object containing the collision direction vector and penetration distance. If distance is negative, the bone is penetrating the capsule. The direction points from the capsule surface towards the bone center.

    • Destroys the gizmo if it exists.

      Returns void

    • Sets the visibility of the collider's gizmo. If the gizmo exists, it will be shown or hidden accordingly.

      Parameters

      • visible: boolean

        Whether the gizmo should be visible

      Returns void

    • Updates cached world positions for the capsule. Should be called once per frame before collision checks.

      Returns void