MCPcopy Create free account
hub / github.com/DanielChappuis/reactphysics3d / getOpenGLMatrix

Method getOpenGLMatrix

src/mathematics/Transform.cpp:43–53  ·  view source on GitHub ↗

Get the OpenGL matrix of the transform

Source from the content-addressed store, hash-verified

41
42// Get the OpenGL matrix of the transform
43void Transform::getOpenGLMatrix(decimal* openglMatrix) const {
44 const Matrix3x3& matrix = mOrientation.getMatrix();
45 openglMatrix[0] = matrix[0][0]; openglMatrix[1] = matrix[1][0];
46 openglMatrix[2] = matrix[2][0]; openglMatrix[3] = 0.0;
47 openglMatrix[4] = matrix[0][1]; openglMatrix[5] = matrix[1][1];
48 openglMatrix[6] = matrix[2][1]; openglMatrix[7] = 0.0;
49 openglMatrix[8] = matrix[0][2]; openglMatrix[9] = matrix[1][2];
50 openglMatrix[10] = matrix[2][2]; openglMatrix[11] = 0.0;
51 openglMatrix[12] = mPosition.x; openglMatrix[13] = mPosition.y;
52 openglMatrix[14] = mPosition.z; openglMatrix[15] = 1.0;
53}

Callers 2

computeTransformMethod · 0.80

Calls 1

getMatrixMethod · 0.80

Tested by 1