viewar-guide
Advanced tools
Comparing version 0.6.2 to 0.7.1
{ | ||
"name": "viewar-guide", | ||
"version": "0.6.2", | ||
"version": "0.7.1", | ||
"description": "ViewAR Guide", | ||
@@ -5,0 +5,0 @@ "main": "dist/viewar-guide.js", |
@@ -229,6 +229,6 @@ import Vector3 from './math/vector3' | ||
await delay(250) // FlyIn animation should be completed before Wave | ||
await waitOut(body.animations[ 'Wave' ], { time: 0, loop: false }, STOP_OTHER_ANIMATIONS) | ||
await waitOut(body.animations[ 'Wave' ], { time: 0, loop: false }, false) | ||
await delay(33) | ||
void body.animations[ 'Idle' ].start({ time: 0, loop: true }, STOP_OTHER_ANIMATIONS) | ||
void body.animations[ 'Idle' ].start({ time: 0, loop: true }, false) | ||
/* | ||
@@ -235,0 +235,0 @@ void body.animate({ |
@@ -37,5 +37,17 @@ | ||
const hide = () => dependencies.queueSceneUpdate(() => instance.setVisible(false)) | ||
const showTalkingFace = () => dependencies.queueSceneUpdate(() => setPropertyValues(instance, talking)) | ||
const showNormalFace = () => dependencies.queueSceneUpdate(() => setPropertyValues(instance, neutral)) | ||
const showTalkingFace = () => dependencies.queueSceneUpdate(async() => { | ||
await setPropertyValues(instance, talking); | ||
if (instance.animations[ 'Talk' ]) { | ||
await instance.animations[ 'Talk' ].start({ time: 0, loop: true }, false) | ||
} | ||
}) | ||
const showNormalFace = () => dependencies.queueSceneUpdate(async() => { | ||
await setPropertyValues(instance, neutral) | ||
if (instance.animations[ 'Talk' ]) { | ||
await instance.animations[ 'Talk' ].stop(); | ||
} | ||
}) | ||
const setPropertyValues = (instance, properties) => { | ||
@@ -66,3 +78,3 @@ const validProperties = {}; | ||
const tickDelay = 1 | ||
const tickDelay = 3 | ||
@@ -89,23 +101,11 @@ let tick = 0 | ||
let frameDifference = 0; | ||
const processTick = (timerInfo) => { | ||
if (!poseUpdate) return | ||
// Only delay if frameDifference is positive => tick will automatically wait if it's too short. | ||
let durationInSeconds; | ||
if (frameDifference > 0) { | ||
durationInSeconds = (timerInfo.frameLength - frameDifference) / 1000; | ||
} else { | ||
durationInSeconds = timerInfo.frameLength / 1000; | ||
} | ||
poseQueue.push(Object.assign(new Pose(pose), { | ||
durationInSeconds, | ||
durationInSeconds: timerInfo.frameLength / 1000, | ||
})) | ||
frameDifference = timerInfo.timeElapsed - timerInfo.frameLength; | ||
// console.log(`Tick ${tick} took ${frameDifference}ms too long.`, durationInSeconds); | ||
tick = tick + 1 | ||
tick = tick + 3 | ||
if (tick % tickDelay === 0) { | ||
@@ -159,3 +159,3 @@ void addToPoseUpdateQueue(instance.id, poseQueue) | ||
poseQueue = [] | ||
await clearPoseUpdateQueue(instance.id); | ||
// await clearPoseUpdateQueue(instance.id); | ||
// const newPose = await dependencies.viewarApi.coreInterface.call('getInstancePose', instance.id); | ||
@@ -176,3 +176,3 @@ // pose.position.copy(newPose.position) | ||
poseUpdate = false | ||
clearInterval(updateInterval); | ||
// clearInterval(updateInterval); | ||
void clearPoseUpdateQueue(instance.id); | ||
@@ -179,0 +179,0 @@ updateInterval = 0; |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
186177