Bit more cleanup
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user