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.
- Source
Extends
Members
(readonly) properties
The entity that this component is attached to.
- Inherited From
- Source
Methods
addLimb(name, entity) → {Rig}
Register a child entity as a limb.
Parameters:
| Name | Type | Description |
|---|---|---|
name | string | Limb name (e.g., "LegL", "ArmR"). |
entity | Entity | The child entity representing this limb. |
- Source
Returns:
This rig (for chaining).
- Type:
- Rig
applyPose(pose)
Apply a pose to all limbs.
Parameters:
| Name | Type | Description |
|---|---|---|
pose | Pose | The pose to apply. |
- Source
autoDiscover()
Auto-discover limbs from child entities. Uses entity names as limb names.
- Source
deserialize(props)
Populates the component properties from a data object. Override this method for custom property handling.
Parameters:
| Name | Type | Description |
|---|---|---|
props | object | The properties object (usually from JSON). |
- Inherited From
- Source
getLimb(name) → {Entity|null}
Get a limb entity by name.
Parameters:
| Name | Type | Description |
|---|---|---|
name | string | Limb name. |
- Source
Returns:
- Type:
- Entity |
null
getLimbNames() → {Array.<string>}
Get all registered limb names.
- Source
Returns:
- Type:
- Array.<string>