Exemplo n.º 1
0
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();
	}	
}
Exemplo n.º 2
0
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);
}
Exemplo n.º 3
0
Vector3 Transform::getRightVector() const
{
    Vector3 v;
    getRightVector(&v);
    return v;
}
Exemplo n.º 4
0
		void Camera::strafeRight(Terrain::Block**** blocks, ivec3 cameraDifference) {
			cameraPosition += getRightVector() * deltaTime * mouseSpeed;
		}
Exemplo n.º 5
0
void Object3D::pitch(float angle)
{
	Vector3D axis;
	getRightVector(axis);
	rotate(axis, angle);
}
Exemplo n.º 6
0
void Object3D::getLeftVector(Vector3D& result)
{
	getRightVector(result);
	result.negate();
}