striding mesh interface

Post Reply
fullmetalcoder
Posts: 29
Joined: Mon May 19, 2008 5:01 pm

striding mesh interface

Post by fullmetalcoder »

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
reltham
Posts: 66
Joined: Fri Oct 12, 2007 6:28 pm
Location: San Diego

Re: striding mesh interface

Post by reltham »

Shouldn't indices always be unsigned?

It doesn't make sense to have negative indices into the vertex array.
fullmetalcoder
Posts: 29
Joined: Mon May 19, 2008 5:01 pm

Re: striding mesh interface

Post by fullmetalcoder »

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?
Post Reply