lianlab / bullet

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

The btConvexHullShape constructor treats passed in btScalar pointer as a pointer to an array of btVector3 preventing the use of packed vector formats #204

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create an array of points with a stride of 12-bytes with the last 
element of the array ending right before a boundary into unreadable memory
2. Construct a btConvexHullShape with the points, the number of points and 
the 12-byte stride

The copy is performed by casting the pointer into a btVector3 (which is 4 
floats) and thus will copy 4 floats at each point in the loop.  This makes 
strides under 16-bytes not work correctly in return for an improvement in 
the speed.  Note that because an external user is handing the constructor 
a pointer to a btScalar there is no real indication that this limitation 
exists.

This is in SVN revision 1555, but looking at the latest 
btConvexHullShape.cpp it doesn't look like this code has changed.

Original issue reported on code.google.com by shawn.ba...@gmail.com on 9 Mar 2009 at 4:07

GoogleCodeExporter commented 9 years ago

See also discusion here:
http://www.bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=9&t=3328

Good point, we'll look into fixing it for the next release.
Thanks a lot for reporting this and coming up with a fix!

Original comment by erwin.coumans on 9 Mar 2009 at 5:11

GoogleCodeExporter commented 9 years ago
It has been fixed now:
http://code.google.com/p/bullet/source/detail?r=1650

Thanks a lot for the report and fix!
Erwin

Original comment by erwin.coumans on 6 May 2009 at 7:13