moonshineTheleocat / bullet

Automatically exported from code.google.com/p/bullet
Other
0 stars 0 forks source link

btGImpactShape signed indicies crash #663

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago

What steps will reproduce the problem?
1. Make a GImpact shape with a mesh strider for a mesh with > 65536 indicies.
2. raycast against it.
3. observe crash

What is the expected output? What do you see instead?
Expected behaviour is no crashes.

What version of the product are you using? On what operating system?
Win7 with bullet 2.8

Please provide any additional information below.

Problem is caused by by signed to unsigned mismatches, and can be resolved by 
adding a few "unsigned"'s through btGImpactShape.h.

see:
http://bulletphysics.org/Bullet/phpBB3/viewtopic.php?f=9&t=8437

for details.

Original issue reported on code.google.com by 0xC0DEF...@gmail.com on 25 Oct 2012 at 12:33

GoogleCodeExporter commented 9 years ago
What is your index type? 16 bit short or 32bit integer?

Both 16 bit short and 32bit unsigned int should be able to handle a mesh > 
65536 vertices.

Either way, I've applied a patch, see
https://code.google.com/p/bullet/source/detail?r=2627

Original comment by erwin.coumans on 7 Dec 2012 at 7:20

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
A short only has 32768 positive values whereas an unsigned short has 65536. So 
above 32768 verts was causing problems with short indicies. At least thats what 
I remember the problem being :).

Using 32 bits for indicies would future proof this more than simply adding the 
unsigned's, as then there is a couple of billion potential indicies.

Thanks for fixing!

Original comment by 0xC0DEF...@gmail.com on 11 Dec 2012 at 11:11

GoogleCodeExporter commented 9 years ago
ok, that makes more then then the original "for a mesh with > 65536 indicies."

Original comment by erwin.coumans on 12 Dec 2012 at 8:28