new GLTFObject(model, pos3D)gltf.js:288Make the object and its parts, model.createObject is the usual way
const door = model.createObject(vec3(0, 0, 5));
door.play('open', false); // once, holding the last poseGLTFObject - A model as an object with a child per part, which plays the model's animations
Extends EngineObject3D
new GLTFObject(model, pos3D)gltf.js:288Make the object and its parts, model.createObject is the usual way
const door = model.createObject(vec3(0, 0, 5));
door.play('open', false); // once, holding the last poseanimation : GLTFAnimation|undefinedgltf.js:304The animation playing, or the last one, undefined for none
animationLoop : booleangltf.js:310Start again at the end, or stop there and hold the last pose
animationPlaying : booleangltf.js:312Whether it is moving through the animation now
animationSpeed : numbergltf.js:308How fast it plays, 1 is as made, negative plays it backward
animationTime : numbergltf.js:306Seconds into the animation
blendFrom : {animation?: GLTFAnimation, time?: number, speed?: number, loop?: boolean,
* nodes?: Map<number, GLTFNodeTRS>}|undefinedgltf.js:316model : GLTFModelgltf.js:301The model it shows
parts : Array<EngineObject3D>gltf.js:329The 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
poseNodes : Map<number, GLTFNodeTRS>|undefinedgltf.js:322poseWorldOf : (function(number): Matrix4)|undefinedgltf.js:325destroy(immediate)gltf.js:358Destroy the object and its parts, and free the meshes its skinned parts bend, which are its own
immediate boolean optionalgetJointMatrix(name) → Matrix4|undefinedgltf.js:470A node's matrix in the world as the model is posed now, by its name in the file, to hang something on a joint, a sword on a hand or a hat on a head; undefined when the model has no node of that name
name stringplay(animation, loop, speed, blend)gltf.js:373Play an animation from its start, at once or cross-faded from the pose it is in
animation string|number|GLTFAnimation optional, default 0Its name, its number in model.animations, or itself
loop boolean optional, default trueStart again at the end, or stop there
speed number optional, default 11 is as made, negative plays it backward from its end
blend number optional, default 0Seconds to cross-fade from the pose it is in, 0 to switch at once; the animation it comes from goes on through the fade, and a fade started during another fades from the mix there
setAnimationTime(time)gltf.js:406Put the parts where the animation has them at a time, playing or not
time numberSeconds into the animation
stop()gltf.js:402Stop the animation where it is, the parts hold that pose; a cross-fade going on stops too, holding the mix
update()gltf.js:443Move through the animation, and a cross-fade into it, called automatically each frame