Constructor
new GLTFObject(model, pos3Dopt)
Make the object and its parts, model.createObject is the usual way
| Name | Type | Attributes | Description |
|---|---|---|---|
model | GLTFModel | ||
pos3D | Vector3 | <optional> |
- Source
const door = model.createObject(vec3(0, 0, 5));
door.play('open', false); // once, holding the last poseExtends
- EngineObject3D
Members
animation :GLTFAnimation|undefined
- GLTFAnimation |
undefined
| Type | Description |
|---|---|
| GLTFAnimation | | The animation playing, or the last one, undefined for none |
- Source
animationLoop
Properties| Type | Description |
|---|---|
| boolean | Start again at the end, or stop there and hold the last pose |
- Source
animationPlaying
Properties| Type | Description |
|---|---|
| boolean | Whether it is moving through the animation now |
- Source
animationSpeed
Properties| Type | Description |
|---|---|
| number | How fast it plays, 1 is as made, negative plays it backward |
- Source
animationTime
Properties| Type | Description |
|---|---|
| number | Seconds into the animation |
- Source
model
Properties| Type | Description |
|---|---|
| GLTFModel | The model it shows |
- Source
parts :Array.<EngineObject3D>
- Array.<EngineObject3D>
| Type | Description |
|---|---|
| Array.<EngineObject3D> | The child that draws each of the model's parts, in the order of model.parts, which an animation poses; one destroyed or taken off the object is left alone |
- Source
Methods
play(animationopt, loopopt, speedopt)
Play an animation from its start
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
animation | string | | <optional> | 0 | Its name, its number in model.animations, or itself |
loop | boolean | <optional> | true | Start again at the end, or stop there |
speed | number | <optional> | 1 | 1 is as made, negative plays it backward from its end |
- Source
setAnimationTime(time)
Put the parts where the animation has them at a time, playing or not
| Name | Type | Description |
|---|---|---|
time | number | Seconds into the animation |
- Source
stop()
Stop the animation where it is, the parts hold that pose
- Source
update()
Move through the animation, called automatically each frame
- Source