コード例 #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();
	}	
}
コード例 #2
0
ファイル: tests.c プロジェクト: aniabrown/AMRProject2
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);
}
コード例 #3
0
ファイル: Transform.cpp プロジェクト: aaweb/GamePlay
Vector3 Transform::getRightVector() const
{
    Vector3 v;
    getRightVector(&v);
    return v;
}
コード例 #4
0
		void Camera::strafeRight(Terrain::Block**** blocks, ivec3 cameraDifference) {
			cameraPosition += getRightVector() * deltaTime * mouseSpeed;
		}
コード例 #5
0
ファイル: Object3D.cpp プロジェクト: daiwei1999/AwayCPP
void Object3D::pitch(float angle)
{
	Vector3D axis;
	getRightVector(axis);
	rotate(axis, angle);
}
コード例 #6
0
ファイル: Object3D.cpp プロジェクト: daiwei1999/AwayCPP
void Object3D::getLeftVector(Vector3D& result)
{
	getRightVector(result);
	result.negate();
}