Beispiel #1
0
        void rebuildMatrices()
        {
            if (!needsRebuild)
            {
                return;
            }
            needsRebuild = false;

            warp_Vector forward, up, right;

            forward = warp_Vector.sub(lookat, pos);
            up      = new warp_Vector(0f, 1f, 0f);
            right   = warp_Vector.getNormal(up, forward);
            up      = warp_Vector.getNormal(forward, right);

            forward.normalize();
            up.normalize();
            right.normalize();

            normalmatrix = new warp_Matrix(right, up, forward);
            normalmatrix.rotate(0, 0, rollfactor);
            matrix = normalmatrix.getClone();
            matrix.shift(pos.x, pos.y, pos.z);

            normalmatrix = normalmatrix.inverse();
            matrix       = matrix.inverse();
        }
Beispiel #2
0
		void rebuildMatrices()
		{
			if (!needsRebuild) return;
			needsRebuild=false;

			warp_Vector forward,up,right;

			forward=warp_Vector.sub(lookat,pos);
			up=new warp_Vector(0f,1f,0f);
			right=warp_Vector.getNormal(up,forward);
			up=warp_Vector.getNormal(forward,right);

			forward.normalize();
			up.normalize();
			right.normalize();

			normalmatrix=new warp_Matrix(right,up,forward);
			normalmatrix.rotate(0,0,rollfactor);
			matrix=normalmatrix.getClone();
			matrix.shift(pos.x,pos.y,pos.z);

			normalmatrix=normalmatrix.inverse();
			matrix=matrix.inverse();
		}
Beispiel #3
0
 public void rotate(float dx, float dy, float dz)
 {
     matrix.rotate(dx, dy, dz);
     normalmatrix.rotate(dx, dy, dz);
 }