ModelComp
Defined in: packages/threeplay/src/plugins/assets/types.ts:55
Fields added by model(). Also satisfies the shape contract
(shape.kind === "model", mesh is the instanced scene root, a child of
object3d). Each instance owns an AnimationMixer, ticked with k.dt().
The object emits an "animEnd" event (with the animation name) when a
non-looping animation finishes.
Extends
Section titled “Extends”Methods
Section titled “Methods”add()?
Section titled “add()?”
optionaladd(this):void
Defined in: packages/threeplay/src/core/types.ts:63
Called when the object enters the scene (or when used on a live object).
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”curAnim()
Section titled “curAnim()”curAnim():
string|null
Defined in: packages/threeplay/src/plugins/assets/types.ts:68
Name of the playing animation, if any.
Returns
Section titled “Returns”string | null
destroy()?
Section titled “destroy()?”
optionaldestroy(this):void
Defined in: packages/threeplay/src/core/types.ts:69
Called when the object is destroyed or the component removed.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”fixedUpdate()?
Section titled “fixedUpdate()?”
optionalfixedUpdate(this):void
Defined in: packages/threeplay/src/core/types.ts:67
Called at the fixed physics rate (50 Hz by default).
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”inspect()?
Section titled “inspect()?”
optionalinspect(this):string|null|undefined
Defined in: packages/threeplay/src/core/types.ts:71
Short status line shown by the debug inspector.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”string | null | undefined
Inherited from
Section titled “Inherited from”isolateMaterials()?
Section titled “isolateMaterials()?”
optionalisolateMaterials():void
Defined in: packages/threeplay/src/plugins/shapes/types.ts:34
Optional. Makes the shape’s materials private to this object (clones them, once),
for shapes whose materials may be shared with other objects, like model().
color() and opacity() call it before writing to the materials.
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”onAnimEnd()
Section titled “onAnimEnd()”onAnimEnd(
fn):EventController
Defined in: packages/threeplay/src/plugins/assets/types.ts:70
Runs when a non-looping animation finishes.
Parameters
Section titled “Parameters”(name) => void
Returns
Section titled “Returns”playAnim()
Section titled “playAnim()”playAnim(
name,opts?):void
Defined in: packages/threeplay/src/plugins/assets/types.ts:64
Plays an animation by name, cross-fading from the current one. Calling it again for the animation that is already playing only updates its speed. Throws (listing the available names) if the model has no such animation.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”void
stopAnim()
Section titled “stopAnim()”stopAnim():
void
Defined in: packages/threeplay/src/plugins/assets/types.ts:66
Stops every animation (the model goes back to its bind pose).
Returns
Section titled “Returns”void
update()?
Section titled “update()?”
optionalupdate(this):void
Defined in: packages/threeplay/src/core/types.ts:65
Called once per frame.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”Properties
Section titled “Properties”anims:
string[]
Defined in: packages/threeplay/src/plugins/assets/types.ts:58
Names of the model’s animations.
conflicts?
Section titled “conflicts?”
optionalconflicts?:string[]
Defined in: packages/threeplay/src/core/types.ts:61
Ids of components that can’t be on the same object (checked both ways).
Inherited from
Section titled “Inherited from”id:
"shape"
Defined in: packages/threeplay/src/plugins/assets/types.ts:56
Unique name. Two components with the same id replace each other.
Overrides
Section titled “Overrides”mesh:
Object3D
Defined in: packages/threeplay/src/plugins/shapes/types.ts:28
Inherited from
Section titled “Inherited from”mixer:
AnimationMixer<AnimationMixerEventMap> |null
Defined in: packages/threeplay/src/plugins/assets/types.ts:72
Escape hatch: the instance’s mixer (null if the model has no animations).
require?
Section titled “require?”
optionalrequire?:string[]
Defined in: packages/threeplay/src/core/types.ts:59
Ids of components that must be present on the object.
Inherited from
Section titled “Inherited from”shape:
ShapeDesc
Defined in: packages/threeplay/src/plugins/shapes/types.ts:27