Inconsistent getStridingMeshInterface interface

ET3D
Posts: 4
Joined: Sun Oct 21, 2007 11:53 am

Inconsistent getStridingMeshInterface interface

Post by ET3D »

Several shapes can be created from a btStridingMeshInterface, but getting the interface back isn't consistent.

btTriangleMeshShape has a function getMeshInterface(), with both const and no-const versions.

btConvexTriangleMeshShape has a function called getStridingMesh(), but no const version.

btGImpactMeshShape doesn't have a way to get the mesh, as far as I could see, though its parts keep it.

A consistent way to get the striding mesh interface would be appreciated.
DevO
Posts: 95
Joined: Fri Mar 31, 2006 7:13 pm

Re: Inconsistent getStridingMeshInterface interface

Post by DevO »

btGImpactMeshShape doesn't have a way to get the mesh, as far as I could see, though its parts keep it.
btGImpactMeshShape has getPrimitiveManager() with will give you TrimeshPrimitiveManager with contains public btStridingMeshInterface *m_meshInterface.

Of course consistence is always good so this functions could be added to btGImpactMeshShape

Code: Select all

btStridingMeshInterface* getMeshInterface() 
{ return m_primitive_manager.m_meshInterface; }
const btStridingMeshInterface* getMeshInterface() const  
{ return m_primitive_manager.m_meshInterface; }
DevO
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Inconsistent getStridingMeshInterface interface

Post by Erwin Coumans »

Very true. I just changed btConvexTriangleMeshShape to use the same interface as btTriangleMeshShape:
http://bullet.svn.sourceforge.net/viewv ... h?view=log

Keep in mind that GIMPACT is not part of core Bullet src, so I don't have control of the interface. It would be up to Francisco Leon to make this change, but I don't expect troubles adding it.

Note that you shouldn't use btTriangleMeshShape directly. It is better to use the btBvhTriangleMeshShape, which adds bounding volume hierarchy for better performance.

Thanks,
Erwin
User avatar
projectileman
Posts: 109
Joined: Thu Dec 14, 2006 4:27 pm
Location: Colombia

Re: Inconsistent getStridingMeshInterface interface

Post by projectileman »

For getting the mesh interface from btGImpactMeshShape you must access to one of its mesh parts through the method getMeshPart(0) and then access to the Primitive Trimesh Manager though the function TrimeshPrimitiveManager * getTrimeshPrimitiveManager() and then access to the attribute m_meshInterface.