Rig

new Rig()

Rig component manages a limb hierarchy for skeletal animation. Attaches to the root entity of a character and maps child entities as limbs.

Extends

Members

(readonly) properties

The entity that this component is attached to.

Inherited From

Methods

addLimb(name, entity) → {Rig}

Register a child entity as a limb.

Parameters:
NameTypeDescription
namestring

Limb name (e.g., "LegL", "ArmR").

entityEntity

The child entity representing this limb.

Returns:

This rig (for chaining).

Type: 
Rig

applyPose(pose)

Apply a pose to all limbs.

Parameters:
NameTypeDescription
posePose

The pose to apply.

autoDiscover()

Auto-discover limbs from child entities. Uses entity names as limb names.

deserialize(props)

Populates the component properties from a data object. Override this method for custom property handling.

Parameters:
NameTypeDescription
propsobject

The properties object (usually from JSON).

Inherited From

getLimb(name) → {Entity|null}

Get a limb entity by name.

Parameters:
NameTypeDescription
namestring

Limb name.

Returns:
Type: 
Entity | null

getLimbNames() → {Array.<string>}

Get all registered limb names.

Returns:
Type: 
Array.<string>