mirror of
https://github.com/bulletphysics/bullet3.git
synced 2026-08-19 09:39:50 +00:00
extend BVH and GImpact algorithms to accept meshes with UCHAR indices
This commit is contained in:
@@ -82,7 +82,13 @@ void CollisionShape2TriangleMesh(btCollisionShape* collisionShape, const btTrans
|
||||
|
||||
for (int j = 2; j >= 0; j--)
|
||||
{
|
||||
int graphicsindex = indicestype == PHY_SHORT ? ((unsigned short*)gfxbase)[j] : gfxbase[j];
|
||||
int graphicsindex;
|
||||
switch (indicestype) {
|
||||
case PHY_INTEGER: graphicsindex = gfxbase[j]; break;
|
||||
case PHY_SHORT: graphicsindex = ((unsigned short*)gfxbase)[j]; break;
|
||||
case PHY_UCHAR: graphicsindex = ((unsigned char*)gfxbase)[j]; break;
|
||||
default: btAssert(0);
|
||||
}
|
||||
if (type == PHY_FLOAT)
|
||||
{
|
||||
float* graphicsbase = (float*)(vertexbase + graphicsindex * stride);
|
||||
|
||||
Reference in New Issue
Block a user