allow rendering of (textured) heightfield in TinyRenderer and EGL.

Also update normals, if heightfield is updated.
This commit is contained in:
Erwin Coumans
2020-09-20 16:03:56 -07:00
parent 4f8f28233c
commit 1bd82e7d81
13 changed files with 404 additions and 100 deletions

View File

@@ -898,12 +898,12 @@ public:
int m_updateShapeIndex;
float* m_updateShapeVertices;
virtual void updateShape(int shapeIndex, float* vertices)
int m_updateNumShapeVertices;
virtual void updateShape(int shapeIndex, float* vertices, int numVertices)
{
m_updateShapeIndex = shapeIndex;
m_updateShapeVertices = vertices;
m_updateNumShapeVertices = numVertices;
m_cs->lock();
m_cs->setSharedParam(1, eGUIHelperUpdateShape);
workerThreadWait();
@@ -2040,7 +2040,7 @@ void PhysicsServerExample::updateGraphics()
case eGUIHelperUpdateShape:
{
B3_PROFILE("eGUIHelperUpdateShape");
m_multiThreadedHelper->m_childGuiHelper->updateShape(m_multiThreadedHelper->m_updateShapeIndex, m_multiThreadedHelper->m_updateShapeVertices);
m_multiThreadedHelper->m_childGuiHelper->updateShape(m_multiThreadedHelper->m_updateShapeIndex, m_multiThreadedHelper->m_updateShapeVertices, m_multiThreadedHelper->m_updateNumShapeVertices);
m_multiThreadedHelper->mainThreadRelease();
break;
}