void Camera::rotate(float a, float x, float y, float z) { //rotate around the camera's axes (axises?) by a Vector3 vy=getUpVector()*y; Vector3 vx=getRightVector()*x; Vector3 vz=getCameraNorm()*z; Vector3 total=vx+vy+vz; if (total.length()>0.001) { total.normalise(); modelview.rotate(a,total.x,total.y,total.z); updateModelview(); } }
void t14(void){ double temp[4*2*4]; printf("\n*** Get Vectors\n"); printMatrix(4,4,4,a); getBottomVector(4,4,4,2,a,temp); printf("bottom\n"); printMatrix(2,4,4,temp); getTopVector(4,4,4,2,a,temp); printf("top\n"); printMatrix(2,4,4,temp); getLeftVector(4,4,4,2,a,temp); printf("left\n"); printMatrix(2,4,4,temp); getRightVector(4,4,4,2,a,temp); printf("right\n"); printMatrix(2,4,4,temp); getLowZVector(4,4,4,2,a,temp); printf("low z\n"); printMatrix(2,4,4,temp); getHighZVector(4,4,4,2,a,temp); printf("high z\n"); printMatrix(2,4,4,temp); }
Vector3 Transform::getRightVector() const { Vector3 v; getRightVector(&v); return v; }
void Camera::strafeRight(Terrain::Block**** blocks, ivec3 cameraDifference) { cameraPosition += getRightVector() * deltaTime * mouseSpeed; }
void Object3D::pitch(float angle) { Vector3D axis; getRightVector(axis); rotate(axis, angle); }
void Object3D::getLeftVector(Vector3D& result) { getRightVector(result); result.negate(); }