don't be afraid of the comma operator!
This commit is contained in:
parent
64502bdb80
commit
f620af29cd
2 changed files with 8 additions and 8 deletions
|
@ -205,10 +205,10 @@ void HUD::draw3D()
|
|||
float dx = 0.52056705; // tan(55/2)
|
||||
float dy = dx * 0.75; // assumes 4:3 aspect ratio
|
||||
float m[16];
|
||||
m[0] = dx; m[4] = 0; m[ 8] = 0; m[12] = 0;
|
||||
m[1] = 0; m[5] = dy; m[ 9] = 0; m[13] = 0;
|
||||
m[2] = 0; m[6] = 0; m[10] = 1; m[14] = 0;
|
||||
m[3] = 0; m[7] = 0; m[11] = 0; m[15] = 1;
|
||||
m[0] = dx, m[4] = 0, m[ 8] = 0, m[12] = 0;
|
||||
m[1] = 0, m[5] = dy, m[ 9] = 0, m[13] = 0;
|
||||
m[2] = 0, m[6] = 0, m[10] = 1, m[14] = 0;
|
||||
m[3] = 0, m[7] = 0, m[11] = 0, m[15] = 1;
|
||||
glMultMatrixf(m);
|
||||
|
||||
// Convert the 640x480 "HUD standard" coordinate space to a square
|
||||
|
|
|
@ -107,10 +107,10 @@ void HUD::Runway::draw()
|
|||
ssgGetModelviewMatrix(modelView);
|
||||
//Create a rotation matrix to correct for any offsets (other than default offsets) to the model view matrix
|
||||
sgMat4 xy; //rotation about the Rxy, negate the sin's on Ry
|
||||
xy[0][0] = cYaw; xy[1][0] = 0.0f; xy[2][0] = -sYaw; xy[3][0] = 0.0f;
|
||||
xy[0][1] = sPitch*-sYaw; xy[1][1] = cPitch; xy[2][1] = -sPitch*cYaw; xy[3][1] = 0.0f;
|
||||
xy[0][2] = cPitch*sYaw; xy[1][2] = sPitch; xy[2][2] = cPitch*cYaw; xy[3][2] = 0.0f;
|
||||
xy[0][3] = 0.0f; xy[1][3] = 0.0f; xy[2][3] = 0.0f; xy[3][3] = 1.0f;
|
||||
xy[0][0] = cYaw, xy[1][0] = 0.0f, xy[2][0] = -sYaw, xy[3][0] = 0.0f;
|
||||
xy[0][1] = sPitch*-sYaw, xy[1][1] = cPitch, xy[2][1] = -sPitch*cYaw, xy[3][1] = 0.0f;
|
||||
xy[0][2] = cPitch*sYaw, xy[1][2] = sPitch, xy[2][2] = cPitch*cYaw, xy[3][2] = 0.0f;
|
||||
xy[0][3] = 0.0f, xy[1][3] = 0.0f, xy[2][3] = 0.0f, xy[3][3] = 1.0f;
|
||||
//Re-center the model view
|
||||
sgPostMultMat4(modelView,xy);
|
||||
//copy float matrices to double
|
||||
|
|
Loading…
Reference in a new issue