add note in console to use seconds [not frames] for animations

This commit is contained in:
Leon van Kammen 2024-12-10 14:36:11 +00:00
parent edfab56347
commit 9c23a6e2a3
1 changed files with 5 additions and 5 deletions

View File

@ -2,7 +2,6 @@
xrf.frag.t = function(v, opts){
let { frag, mesh, model, camera, scene, renderer, THREE} = opts
// handle object media players
if( mesh && mesh.media ){
for( let i in mesh.media ) mesh.media[i].set("t",v)
@ -53,12 +52,13 @@ xrf.addEventListener('parseModel', (opts) => {
}
model.animations.map( (anim) => {
anim.optimize()
if( xrf.debug ) console.log("action: "+anim.name)
console.log("animation action: "+anim.name)
mixer.actions.push( mixer.clipAction( anim, model.scene ) )
})
mixer.play = (t) => {
let msg = `media fragment: ${t.x}-${t.y} seconds`
if( t.x > 49 ) msg += ", not frames (!)"
console.log(msg)
mixer.isPlaying = t.x !== undefined && t.x != t.y
mixer.updateLoop(t)
xrf.emit( mixer.isPlaying === false ? 'stop' : 'play',{isPlaying: mixer.isPlaying})