Request for better Striding support (WORD/ConvexHullShape)

Jack
Posts: 59
Joined: Thu Aug 31, 2006 11:51 am

Post by Jack »

1) I found that WORD (PHY_SHORT) indexes are not implemented in
void StridingMeshInterface::InternalProcessAllTriangles(InternalTriangleIndexCallback* callback,const SimdVector3& aabbMin,const SimdVector3& aabbMax) const

I noticed that you love OpenGL. I do not know index format for OpenGL, but in DirectX indexes are WORDs in most cases.

2) ConvexHullShape::ConvexHullShape(SimdPoint3* points,int numPoints)

It would be great if ConvexHullShape additionally accepts STRIDE.
For example, I have a concave model. I want to pass model vertex buffer directly to ConvexHullShape, but I can not do it because there is no STRIDE param. Instead I need to create intermediate SimdPoint3 buffer, copy vertexes, pass it to ConvexHullShape, delete SimdPoint3 buffer.

:)
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Post by Erwin Coumans »

Thanks for the feedback! Feedback is good for improvements/development!
Jack wrote:1) I found that WORD (PHY_SHORT) indexes are not implemented in
void StridingMeshInterface::InternalProcessAllTriangles(InternalTriangleIndexCallback* callback,const SimdVector3& aabbMin,const SimdVector3& aabbMax) const

I noticed that you love OpenGL. I do not know index format for OpenGL, but in DirectX indexes are WORDs in most cases.
I'll check it out and add a feature request for WORD/short indices.
2) ConvexHullShape::ConvexHullShape(SimdPoint3* points,int numPoints)

It would be great if ConvexHullShape additionally accepts STRIDE.
For example, I have a concave model. I want to pass model vertex buffer directly to ConvexHullShape, but I can not do it because there is no STRIDE param. Instead I need to create intermediate SimdPoint3 buffer, copy vertexes, pass it to ConvexHullShape, delete SimdPoint3 buffer.

:)
It is possible to use ConvexTriangleMeshShape, that takes a striding interface. For performance, a duplicate is probably better.

Would an additional constructor in ConvexHullShape (making a copy) useful for you? I'll add a second feature request.

Erwin
Jack
Posts: 59
Joined: Thu Aug 31, 2006 11:51 am

Post by Jack »

Erwin Coumans wrote:Thanks for the feedback! Feedback is good for improvements/development!

It is possible to use ConvexTriangleMeshShape, that takes a striding interface. For performance, a duplicate is probably better.
But if the model is concave? What will be if I pass cancave mesh to the ConvexTriangleMeshShape?
Erwin Coumans wrote: Would an additional constructor in ConvexHullShape (making a copy) useful for you? I'll add a second feature request.
You copy it into internal buffer in any case:

ConvexHullShape ::ConvexHullShape (SimdPoint3* points,int numPoints)
{
m_points.resize(numPoints);
for (int i=0;i<numPoints;i++)
m_points = points;
}

So, I think additional constructor is not necessary. Just third param with default value: Stride=sizeof(SimdPoint3).
Jack
Posts: 59
Joined: Thu Aug 31, 2006 11:51 am

Post by Jack »

Continue with minor issues. :)

In "Memeory2.h". Correct new/delete overrides must be:
void* __cdecl operator new(size_t sz) throw();
void* __cdecl operator new[](size_t sz) throw();
void __cdecl operator delete(void* m) throw();
void __cdecl operator delete[](void* m) throw();

__cdecl is important if you compile Bullet with non-cdecl default calling convention. Otherwise there are compilation errors...