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.

Constructors

Properties

baseSceneGraph?: SceneGraphComponent

The base scene graph component used for world space transformations

position: Vector3 = ...

The position of the capsule's head in local space

radius: number = 0

The radius of the capsule

tail: Vector3 = ...

The position of the capsule's tail in local space

Methods

  • 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: Vector3;
        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.