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

Method setFromOpenGL

src/mathematics/Transform.cpp:34–40  ·  view source on GitHub ↗

Set the transform from an OpenGL transform matrix

Source from the content-addressed store, hash-verified

32
33// Set the transform from an OpenGL transform matrix
34void Transform::setFromOpenGL(decimal* openglMatrix) {
35 Matrix3x3 matrix(openglMatrix[0], openglMatrix[4], openglMatrix[8],
36 openglMatrix[1], openglMatrix[5], openglMatrix[9],
37 openglMatrix[2], openglMatrix[6], openglMatrix[10]);
38 mOrientation = Quaternion(matrix);
39 mPosition.setAllValues(openglMatrix[12], openglMatrix[13], openglMatrix[14]);
40}
41
42// Get the OpenGL matrix of the transform
43void Transform::getOpenGLMatrix(decimal* openglMatrix) const {

Callers 1

Calls 2

QuaternionClass · 0.85
setAllValuesMethod · 0.45

Tested by 1