Closed midn1 closed 6 years ago
Hello. You should probably take a look at this example, it shows how to tie bullet to Horde3D. https://github.com/algts/Horde3DPhysics
Basically, it is done somewhat like that:
geoResource = h3dGetNodeParamI(h3dGetNodeParent(m_hordeID), H3DModel::GeoResI);
numVertices = h3dGetNodeParamI(m_hordeID, H3DMesh::VertREndI) - h3dGetNodeParamI(m_hordeID, H3DMesh::VertRStartI) + 1;
numTriangleIndices = h3dGetNodeParamI(m_hordeID, H3DMesh::BatchCountI);
vertRStart = h3dGetNodeParamI(m_hordeID, H3DMesh::VertRStartI);
vertexOffset = vertRStart * 3;
indexOffset = h3dGetNodeParamI(m_hordeID, H3DMesh::BatchStartI);
float* vertexBase = (float*) h3dMapResStream(geoResource, H3DGeoRes::GeometryElem, 0, H3DGeoRes::GeoVertPosStream, true, false);
As I understand, the float array consists of all the vertices, so every 3 floats is a new vertex?
Yes. Please note that geometry resource may contain vertex data for the whole scene. not just one mesh. That's exactly why vertRStart parameter is needed.
Thank you very much, not sure if this is even a good place to ask questions like these, but my forum account hasn't been activated for around 2 months, so this seemed like the next best spot.
Sorry, should be activated now
Thanks!
Planning on using soft bodies on Bullet, and I couldn't find any public function that would help me on this.