MCPcopy Create free account
hub / github.com/bulletphysics/bullet3 / updateCamera

Method updateCamera

examples/OpenGLWindow/SimpleOpenGL2Renderer.cpp:96–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94}
95
96void SimpleOpenGL2Renderer::updateCamera(int upAxis)
97{
98 float projection[16];
99 float view[16];
100 getActiveCamera()->setAspectRatio((float)m_data->m_width / (float)m_data->m_height);
101 getActiveCamera()->setCameraUpAxis(upAxis);
102 m_data->m_camera.update(); //??
103 getActiveCamera()->getCameraProjectionMatrix(projection);
104 getActiveCamera()->getCameraViewMatrix(view);
105 GLfloat projMat[16];
106 GLfloat viewMat[16];
107 for (int i = 0; i < 16; i++)
108 {
109 viewMat[i] = view[i];
110 projMat[i] = projection[i];
111 }
112 glMatrixMode(GL_PROJECTION);
113 glLoadIdentity();
114 glMultMatrixf(projMat);
115
116 glMatrixMode(GL_MODELVIEW);
117 glLoadIdentity();
118 glMultMatrixf(viewMat);
119}
120
121void SimpleOpenGL2Renderer::removeAllInstances()
122{

Callers

nothing calls this directly

Calls 5

setAspectRatioMethod · 0.80
setCameraUpAxisMethod · 0.80
updateMethod · 0.45
getCameraViewMatrixMethod · 0.45

Tested by

no test coverage detected