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.

Constructors

Properties

Methods

Constructors

Properties

baseSceneGraph?: SceneGraphComponent

The base scene graph component that defines the transform space for this collider

position: Vector3 = ...

The local position of the sphere collider relative to its base scene graph node

radius: number = 0

The radius of the sphere collider

Methods

  • 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 {
        direction: IMutableVector3;
        distance: 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)