Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- `private void camMove(){
- Point3d newLoc = this.bob.getCurrLoc();
- // printTuple(newLoc, "newLoc");
- Vector3d trans = new Vector3d( -newLoc.x + this.bobPosn.x,
- 0, -newLoc.z + this.bobPosn.z);
- this.viewerTG.getTransform( this.t3d );
- this.movements3.setTranslation(trans); // overwrites previous translation
- this.t3d.mul(this.movements3);
- this.viewerTG.setTransform(this.t3d);
- this.bobPosn = newLoc; // save for next time
- }
- private void camRot(){
- this.viewerTG.getTransform( this.t3d );
- this.movements.setTranslation(new Vector3d(0,0,-this.ZOFFSET));
- this.t3d.mul(this.movements);
- this.camrot.rotY(-this.bob.drot); // overwrite previous rotation
- this.t3d.mul(this.camrot);
- this.movements2.setTranslation(new Vector3d(0,0,this.ZOFFSET));
- this.t3d.mul(this.movements2);
- this.viewerTG.setTransform(this.t3d);
- }
- public void gameupdate(){
- if (this.bob.drot != 0){
- camRot();
- }
- if ((this.bob.dx != 0)||(this.bob.dz != 0)){
- camMove();
- } `
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement