MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / g3_GetModelViewMatrix

Function g3_GetModelViewMatrix

renderer/HardwareTransforms.cpp:29–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27
28extern float Z_bias;
29void g3_GetModelViewMatrix(const vector *viewPos, const matrix *viewMatrix, float *mvMat) {
30 matrix localOrient = (*viewMatrix);
31 vector localPos = -(*viewPos);
32 mvMat[0] = localOrient.rvec.x;
33 mvMat[1] = localOrient.uvec.x;
34 mvMat[2] = localOrient.fvec.x;
35 mvMat[3] = 0.0f;
36 mvMat[4] = localOrient.rvec.y;
37 mvMat[5] = localOrient.uvec.y;
38 mvMat[6] = localOrient.fvec.y;
39 mvMat[7] = 0.0f;
40 mvMat[8] = localOrient.rvec.z;
41 mvMat[9] = localOrient.uvec.z;
42 mvMat[10] = localOrient.fvec.z;
43 mvMat[11] = 0.0f;
44 mvMat[12] = localPos * localOrient.rvec;
45 mvMat[13] = localPos * localOrient.uvec;
46 mvMat[14] = localPos * localOrient.fvec + Z_bias;
47 mvMat[15] = 1.0f;
48}
49
50void g3_TransformVert(float res[4], float pt[4], float a[4][4]) {
51 int y;

Callers 3

g3_StartFrameFunction · 0.85
rend_SetZBiasFunction · 0.85
g3_StartInstanceMatrixFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected