diff --git a/public/static/meshes/scene-switcher/trophy.glb b/public/static/meshes/scene-switcher/trophy.glb index d43720a..092140a 100644 Binary files a/public/static/meshes/scene-switcher/trophy.glb and b/public/static/meshes/scene-switcher/trophy.glb differ diff --git a/src/components/InteractiveObjects/InteractiveObject.js b/src/components/InteractiveObjects/InteractiveObject.js index a70fbfe..bdc74e3 100644 --- a/src/components/InteractiveObjects/InteractiveObject.js +++ b/src/components/InteractiveObjects/InteractiveObject.js @@ -28,6 +28,8 @@ const InteractiveObjectsImports = { class InteractiveObject extends EventManager{ constructor(engine, obj) { super(); + this.minPoints = 0; + this.maxPoints = obj.points || 0; this.name = obj.name; return new Promise(async (resolve, reject) => { switch (obj.type || 'GenericObject') { diff --git a/src/components/InteractiveObjects/MazeQuizGame/MazeQuizGame.js b/src/components/InteractiveObjects/MazeQuizGame/MazeQuizGame.js index a88e1d2..95dd794 100644 --- a/src/components/InteractiveObjects/MazeQuizGame/MazeQuizGame.js +++ b/src/components/InteractiveObjects/MazeQuizGame/MazeQuizGame.js @@ -45,6 +45,10 @@ class MazeQuizGame extends EventManager { data.noPhysics = true; params.mazeFile = data.style || 'quiz-s2.gltf'; params.io = this; + + this.maxPoints = (data.points || 0) + (data.questionPoints||0) * data.questions.length; + this.minPoints = this.maxPoints - (data.questionPenalty||0) * data.questions.length; + return new Promise(async (resolve, reject)=>{ let questions = data.shuffle ? Utils.shuffleArray(data.questions) : data.questions; let def = this.generate(questions); diff --git a/src/components/InteractiveObjects/SceneSwitcher.js b/src/components/InteractiveObjects/SceneSwitcher.js index b1bac93..e7b27ae 100644 --- a/src/components/InteractiveObjects/SceneSwitcher.js +++ b/src/components/InteractiveObjects/SceneSwitcher.js @@ -1,5 +1,4 @@ -import { getBoundingBox, getBoundingBoxCenterPoint, getBoundingBoxMaxLength, centerOrigin } from "@/lib/MeshUtils"; -import { SphereGeometry, Mesh, MeshStandardMaterial, BackSide, Group } from "three"; +import { SphereGeometry, Mesh, MeshStandardMaterial, Group } from "three"; import { EventManager } from '@/lib/EventManager'; class SceneSwitcher extends EventManager{ @@ -11,9 +10,14 @@ class SceneSwitcher extends EventManager{ this.object = new Group() if (data.switchType == 'award'){ let gltf = await engine.load('trophy.glb', '/static/meshes/scene-switcher/'); - this.object.add(gltf.scene); + let awards = {}; + gltf.scene.traverse(o=>{ + awards[o.name] = o; + o.position.multiplyScalar(0); + }) + this.object.add(awards.silver); engine.motionQueue.add({ - o: gltf.scene, + o: awards.silver, a:{rotation: { y: k=>k*Math.PI*2 }}, r: true, t: 4 }) }else if(data.switchType == 'sphere'){