Add Bullet C API and pybullet API to set projective texture matrices.
This commit is contained in:
@@ -225,6 +225,8 @@ struct InternalDataRenderer : public GLInstanceRendererInternalData
|
||||
|
||||
GLfloat m_projectionMatrix[16];
|
||||
GLfloat m_viewMatrix[16];
|
||||
GLfloat m_projectiveTextureProjectionMatrix[16];
|
||||
GLfloat m_projectiveTextureViewMatrix[16];
|
||||
GLfloat m_viewMatrixInverse[16];
|
||||
|
||||
b3Vector3 m_lightPos;
|
||||
@@ -257,6 +259,8 @@ struct InternalDataRenderer : public GLInstanceRendererInternalData
|
||||
m_projectionMatrix[i]=0;
|
||||
m_viewMatrix[i]=0;
|
||||
m_viewMatrixInverse[i]=0;
|
||||
m_projectiveTextureProjectionMatrix[i]=0;
|
||||
m_projectiveTextureViewMatrix[i]=0;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1466,6 +1470,14 @@ void GLInstancingRenderer::setLightPosition(const double lightPos[3])
|
||||
m_data->m_lightPos[2] = lightPos[2];
|
||||
}
|
||||
|
||||
void GLInstancingRenderer::setProjectiveTextureMatrices(const float viewMatrix[16], const float projectionMatrix[16])
|
||||
{
|
||||
for (int i = 0; i < 16; i++)
|
||||
{
|
||||
m_data->m_projectiveTextureViewMatrix[i] = viewMatrix[i];
|
||||
m_data->m_projectiveTextureProjectionMatrix[i] = projectionMatrix[i];
|
||||
}
|
||||
}
|
||||
|
||||
void GLInstancingRenderer::updateCamera(int upAxis)
|
||||
{
|
||||
@@ -2180,7 +2192,7 @@ void GLInstancingRenderer::renderSceneInternal(int orgRenderMode)
|
||||
|
||||
// TODO: Expose the projective texture matrix setup. Temporarily set it to be the same as camera view projection matrix.
|
||||
GLfloat textureMVP[16];
|
||||
b3Matrix4x4Mul16(m_data->m_projectionMatrix,m_data->m_viewMatrix,textureMVP);
|
||||
b3Matrix4x4Mul16(m_data->m_projectiveTextureProjectionMatrix,m_data->m_projectiveTextureViewMatrix,textureMVP);
|
||||
|
||||
//float m_frustumZNear=0.1;
|
||||
//float m_frustumZFar=100.f;
|
||||
|
||||
@@ -131,6 +131,7 @@ public:
|
||||
virtual void setLightPosition(const float lightPos[3]);
|
||||
virtual void setLightPosition(const double lightPos[3]);
|
||||
void setLightSpecularIntensity(const float lightSpecularIntensity[3]);
|
||||
virtual void setProjectiveTextureMatrices(const float viewMatrix[16], const float projectionMatrix[16]);
|
||||
|
||||
virtual void resize(int width, int height);
|
||||
virtual int getScreenWidth()
|
||||
|
||||
Reference in New Issue
Block a user