Skip to content

Commit b9ddcd2

Browse files
committed
moved sync display to its own xr script
1 parent 6ef789e commit b9ddcd2

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

demos/sim_hand_poses/main.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,17 @@ class ManualSimHandScene extends xb.Script {
393393
}
394394
}
395395

396+
class DisplayedPoseSync extends xb.Script {
397+
constructor(syncDisplayedPose) {
398+
super();
399+
this._syncDisplayedPose = syncDisplayedPose;
400+
}
401+
402+
update() {
403+
this._syncDisplayedPose();
404+
}
405+
}
406+
396407
class GestureHUD extends xb.Script {
397408
init() {
398409
this._active = {
@@ -575,9 +586,8 @@ async function start() {
575586
const syncDisplayedPose = () => {
576587
syncControlsToRotations();
577588
updateJsonViews();
578-
requestAnimationFrame(syncDisplayedPose);
579589
};
580-
syncDisplayedPose();
590+
xb.add(new DisplayedPoseSync(syncDisplayedPose));
581591

582592
createPromptBubble(async (description) => {
583593
xb.core.options.ai.gemini.config = {

0 commit comments

Comments
 (0)