I am to integrate Bullet into an Irrlicht project and I would like to avoid data duplication for my 3D models.
I have created my own mesh interface based on btStridingMeshInterface but I am facing a rather big issue :
Irrlicht uses UNSIGNED short integers as indices whereas Bullet expect SIGNED short integers when given
a PHY_SHORT indice type which is embarassing when a mesh has more than 32767 vertices...
As I don't want to enforce the use of a custom version of Bullet I'd be grateful if a fix could come soon. It
can be either of these :
* adding a PHY_UNSIGNED_SHORT (and possibly PHY_UNSIGNED_INT)
* replacing line 71 of btStridingMeshInterface.cpp :
short int* tri_indices= (short int*)(indexbase+gfxindex*indexstride);
with
unsigned short int* tri_indices= (unsigned short int*)(indexbase+gfxindex*indexstride);
This would be unlikely to bring side effect anyway as I can hardly imagine anyone willingly making use
of negative array indices...
regards
striding mesh interface
Re: striding mesh interface
Shouldn't indices always be unsigned?
It doesn't make sense to have negative indices into the vertex array.
It doesn't make sense to have negative indices into the vertex array.
-
- Posts: 29
- Joined: Mon May 19, 2008 5:01 pm
Re: striding mesh interface
Well, I would tend to agree with you but the code does not, which is a wee bit of a problem, don't you think?