rhodonite
    Preparing search index...

    Class SphereCollider

    A sphere collider used for VRM spring bone physics simulation. This collider represents a spherical collision volume that can interact with bones to prevent them from penetrating through solid objects.

    Index
    • get baseSceneGraph(): SceneGraphComponent

      Gets the base scene graph component.

      Returns SceneGraphComponent

      The base scene graph component

    • get gizmo(): SphereColliderGizmo | undefined

      Gets the gizmo used to visualize this collider.

      Returns SphereColliderGizmo | undefined

      The gizmo instance, or undefined if not set

    • set gizmo(gizmo: SphereColliderGizmo | 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 collider.

      Returns Vector3

      The local position vector

    • get radius(): number

      Gets the radius of the collider.

      Returns number

      The radius value

    • get worldPosition(): Vector3

      Gets the world position of the collider.

      Returns Vector3

      The world position vector

    • Calculates collision information between this sphere collider and a bone.

      Parameters

      • bonePosition: Vector3

        The world position of the bone

      • boneRadius: number

        The radius of the bone for collision detection

      Returns { delta: IMutableVector3; distance: number; length: number }

      An object containing the collision direction and penetration distance

      • direction: The normalized vector pointing from the sphere center to the bone
      • distance: The penetration distance (negative if penetrating, positive if separated)
    • 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 the cached world position of the collider. Should be called once per frame before collision checks.

      Returns void