How bullet physics shape will be initialized from the mesh object of powervr pod file with interleaved data?
How their world matrix will be used for the btTransform for the shape?
Bullet shapes with the imgtec powervr mesh object
-
- Posts: 1
- Joined: Fri Feb 12, 2010 10:11 am
-
- Posts: 2
- Joined: Thu Mar 18, 2010 9:54 pm
Re: Bullet shapes with the imgtec powervr mesh object
if you take a look at the DrawMesh function in one of their training courses you will see a GL function called 'glVertexAttribPointer'. Look at
glVertexAttribPointer(VERTEX_ARRAY, 3, GL_FLOAT, GL_FALSE, pMesh->sVertex.nStride, pMesh->sVertex.pData)
This is showing how to step through the data to pick out the vertices. Each vertex is 3*GL_FLOAT bytes in length, pMesh->sVertex.nStride shows you how many bytes there are between each vertex, and pMesh->sVertex.pData is a pointer to the first vertex in the data.
glVertexAttribPointer(VERTEX_ARRAY, 3, GL_FLOAT, GL_FALSE, pMesh->sVertex.nStride, pMesh->sVertex.pData)
This is showing how to step through the data to pick out the vertices. Each vertex is 3*GL_FLOAT bytes in length, pMesh->sVertex.nStride shows you how many bytes there are between each vertex, and pMesh->sVertex.pData is a pointer to the first vertex in the data.