Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update things #4

Merged
merged 9 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/world/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ class Render {
constructor(top) {
this.top = top;

this.scene = new THREE.Scene();

this.ScreenManager = new ScreenManager(this);

this.render();
Expand Down
11 changes: 6 additions & 5 deletions src/world/scene.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ import { ActionsInfoScreen } from "../screens/start/actionsInfo.js";
class Scene {
constructor(top) {
this.top = top;

this.scene = this.top.scene;

this.main();
};

main() {
var vrDisplay = this.top.vrDisplay;

// Create a three.js scene.
this.scene = new THREE.Scene();

// Create a three.js camera.
var camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 10000);

Expand All @@ -40,6 +40,7 @@ class Scene {
this.scene.add( light );

// Kick off the render loop.
const scope = this;
vrDisplay.requestAnimationFrame(animate);

// Create 3D objects.
Expand All @@ -54,7 +55,7 @@ class Scene {
scene.add(cube);*/

// Load Default Screen
this.top.ScreenManager.renderScreen(ActionsInfoScreen);
this.top.ScreenManager.renderScreen(new ActionsInfoScreen(this.top));

// Request animation frame loop function
var lastRender = 0;
Expand All @@ -69,7 +70,7 @@ class Scene {
controls.update();

// Render the scene.
effect.render(this.scene, camera);
effect.render(scope.scene, camera);

// Keep looping.
vrDisplay.requestAnimationFrame(animate);
Expand Down