interactive objects parametrization
This commit is contained in:
@@ -2,16 +2,16 @@
|
||||
import { Group, AnimationMixer, LoopPingPong, Vector3 } from "three";
|
||||
import { GLTFLoader } from "three/examples/jsm/loaders/GLTFLoader";
|
||||
import { assignMaterial, assignParams } from "@/lib/MeshUtils";
|
||||
import { Game1 } from "./PuzzleGame1";
|
||||
import { Game2 } from "./PuzzleGame2";
|
||||
import { PuzzleGame1 } from "./PuzzleGame1";
|
||||
import { PuzzleGame2 } from "./PuzzleGame2";
|
||||
// import { Game3 } from "./games/Game3";
|
||||
import { Game4 } from "./PuzzleGame4";
|
||||
import { PuzzleGame4 } from "./PuzzleGame4";
|
||||
// import { Game5 } from "./games/Game5";
|
||||
// import { Game6 } from "./games/Game6";
|
||||
import { TextObject } from "./TextObject";
|
||||
import { ImageObject } from "./ImageObject";
|
||||
|
||||
const games = {Game1, Game2, Game4};
|
||||
const games = {PuzzleGame1, PuzzleGame2, PuzzleGame4};
|
||||
|
||||
class InteractiveObject {
|
||||
constructor(obj, context) {
|
||||
@@ -75,12 +75,12 @@ class InteractiveObject {
|
||||
assignMaterial(mesh, obj, context);
|
||||
resolve(mesh);
|
||||
break;
|
||||
case 'Game1':
|
||||
case 'Game2':
|
||||
case 'Game3':
|
||||
case 'Game4':
|
||||
case 'Game5':
|
||||
case 'Game6':
|
||||
case 'PuzzleGame1':
|
||||
case 'PuzzleGame2':
|
||||
case 'PuzzleGame3':
|
||||
case 'PuzzleGame4':
|
||||
case 'PuzzleGame5':
|
||||
case 'PuzzleGame6':
|
||||
var game = new games[obj.type](context, obj.args[0], obj.args[1], obj.args[2]);
|
||||
mesh = game.object;
|
||||
mesh.game = game;
|
||||
@@ -129,16 +129,14 @@ class InteractiveObject {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// function textObject(text, context){
|
||||
// const geometry = new TextGeometry( text, {
|
||||
// font: context.font,
|
||||
// size: .05,
|
||||
// height: .01,
|
||||
// curveSegments: 1
|
||||
// } );
|
||||
// return new Mesh(geometry, context.fontMaterial);
|
||||
// }
|
||||
const InteractiveObjectTypes = [
|
||||
{
|
||||
id: 'PuzzleGame1', name: 'Puzzle Game 1'
|
||||
}, {
|
||||
id: 'MazeQuizGame', name: 'Maze Quiz Game'
|
||||
}, {
|
||||
id: 'VideoPlayer', name: 'Video Player'
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
export {InteractiveObject}
|
||||
export { InteractiveObject, InteractiveObjectTypes }
|
||||
Reference in New Issue
Block a user