Bit more cleanup

This commit is contained in:
2026-04-30 20:03:44 -05:00
parent 3d984e13c2
commit 2e43aa2c44
13 changed files with 132 additions and 84 deletions
+6 -3
View File
@@ -1,14 +1,17 @@
function CubeEntity() {
Entity.call(this);
this.add(POSITION);
this.add(MESH);
this.add(MATERIAL);
this.position.x = 0;
this.position.y = 0;
this.position.z = 0;
this.add(MESH);
this.add(MATERIAL);
}
Object.assign(CubeEntity.prototype, Entity.prototype);
CubeEntity.prototype = Object.create(Entity.prototype);
CubeEntity.prototype.constructor = CubeEntity;
CubeEntity.prototype.update = function() {
var speed = 3.0;
+2 -1
View File
@@ -3,11 +3,12 @@ var Cube = include('entities/cube.js');
function CubeScene() {
this.cam = new Entity();
this.cam.add(POSITION);
this.cam.add(CAMERA);
this.cam.position.x = 3;
this.cam.position.y = 3;
this.cam.position.z = 3;
this.cam.position.lookAt(0, 0, 0);
this.cam.add(CAMERA);
this.cube = new Cube();
}