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

Method updateCamera

examples/OpenGLWindow/GLInstancingRenderer.cpp:1595–1620  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1593}
1594
1595void GLInstancingRenderer::updateCamera(int upAxis)
1596{
1597 b3Assert(glGetError() == GL_NO_ERROR);
1598 m_upAxis = upAxis;
1599
1600 m_data->m_activeCamera->setCameraUpAxis(upAxis);
1601 m_data->m_activeCamera->setAspectRatio((float)m_screenWidth / (float)m_screenHeight);
1602 m_data->m_defaultCamera1.update();
1603 m_data->m_activeCamera->getCameraProjectionMatrix(m_data->m_projectionMatrix);
1604 m_data->m_activeCamera->getCameraViewMatrix(m_data->m_viewMatrix);
1605 b3Scalar viewMat[16];
1606 b3Scalar viewMatInverse[16];
1607
1608 for (int i = 0; i < 16; i++)
1609 {
1610 viewMat[i] = m_data->m_viewMatrix[i];
1611 }
1612 b3Transform tr;
1613 tr.setFromOpenGLMatrix(viewMat);
1614 tr = tr.inverse();
1615 tr.getOpenGLMatrix(viewMatInverse);
1616 for (int i = 0; i < 16; i++)
1617 {
1618 m_data->m_viewMatrixInverse[i] = viewMatInverse[i];
1619 }
1620}
1621
1622void writeTextureToPng(int textureWidth, int textureHeight, const char* fileName, int numComponents)
1623{

Callers 12

updateMethod · 0.45
copyCameraImageDataMethod · 0.45
mainFunction · 0.45
setupSceneMethod · 0.45
mainFunction · 0.45
mainFunction · 0.45
setUpAxisMethod · 0.45
copyCameraImageDataGLMethod · 0.45
mainFunction · 0.45
RenderStereoTargetsMethod · 0.45
mainFunction · 0.45

Calls 6

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

Tested by

no test coverage detected