This method override makes the camera behave like a regular object, so it doesn't stay focused at the same point when it moves:
CL3D.CameraSceneNode.prototype.calculateViewMatrix = function () { this.getAbsoluteTransformation().getInverse(this.ViewMatrix); this.recalculateViewArea() };
This adds a 'move' method to SceneNodes, so you can more easily move in the direction it is facing:
CL3D.SceneNode.prototype.move = function(x, y, z) { var aim = new CL3D.Vect3d(); aim.X = x; aim.Y = y; aim.Z = z; this.getRelativeTransformation().rotateVect( aim ); this.Pos.X += aim.X; this.Pos.Y += aim.Y; this.Pos.Z += aim.Z; }
|