-
Notifications
You must be signed in to change notification settings - Fork 0
/
main-scene.js
47 lines (38 loc) · 1.92 KB
/
main-scene.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import {defs, tiny} from './examples/common.js';
import {Axes_Viewer, Axes_Viewer_Test_Scene} from "./examples/axes-viewer.js"
import {Collision_Demo, Inertia_Demo} from "./examples/collisions-demo.js"
import {Many_Lights_Demo} from "./examples/many-lights-demo.js"
import {Obj_File_Demo} from "./examples/obj-file-demo.js"
import {Scene_To_Texture_Demo} from "./examples/scene-to-texture-demo.js"
import {Surfaces_Demo} from "./examples/surfaces-demo.js"
import {Text_Demo} from "./examples/text-demo.js"
import {Transforms_Sandbox} from "./examples/transforms-sandbox.js"
import {Main_Project} from "./main-project.js";
// Pull these names into this module's scope for convenience:
const {
Vector, Vector3, vec, vec3, vec4, color, Matrix, Mat4, Light, Shape, Material, Shader, Texture, Scene,
Canvas_Widget, Code_Widget, Text_Widget
} = tiny;
// Now we have loaded everything in the files tiny-graphics.js, tiny-graphics-widgets.js, and common.js.
// This yielded "tiny", an object wrapping the stuff in the first two files, and "defs" for wrapping all the rest.
// ******************** Extra step only for when executing on a local machine:
// Load any more files in your directory and copy them into "defs."
// (On the web, a server should instead just pack all these as well
// as common.js into one file for you, such as "dependencies.js")
const Minimal_Webgl_Demo = defs.Minimal_Webgl_Demo;
Object.assign(defs,
{Axes_Viewer, Axes_Viewer_Test_Scene},
{Inertia_Demo, Collision_Demo},
{Many_Lights_Demo},
{Obj_File_Demo},
{Scene_To_Texture_Demo},
{Surfaces_Demo},
{Text_Demo},
{Transforms_Sandbox},
{Main_Project}
);
// ******************** End extra step
// (Can define Main_Scene's class here)
const Main_Scene = Main_Project;
const Additional_Scenes = [];
export {Main_Scene, Additional_Scenes, Canvas_Widget, Code_Widget, Text_Widget, defs}