public void setOrientation(Quaternion ori) { if (myIsDebugging == true) { myDebugCamera.setOrientation(ori); return; } Matrix4 m = new Matrix4(); ori.setMatrix(ref m); myOrientation = ori; updateViewMatrix(); }
public void tick(float dt) { //update axis from orientation myCamera.setOrientation(myViewOri); if (shiftDown) { myStepSize = defaultBigStepSize; } else { myStepSize = defaultStepSize; } //move based on keys if (moveForward == true) { myCamera.move(0.0f, 0.0f, myStepSize * dt); } if (moveBackward == true) { myCamera.move(0.0f, 0.0f, -myStepSize * dt); } if (moveLeft == true) { myCamera.move(-myStepSize * dt, 0.0f, 0.0f); } if (moveRight == true) { myCamera.move(myStepSize * dt, 0.0f, 0.0f); } if (moveUp == true) { myCamera.move(0.0f, myStepSize * dt, 0.0f); } if (moveDown == true) { myCamera.move(0.0f, -myStepSize * dt, 0.0f); } }