[ODE] Bug or feature?

Jon Watte hplus-ode at mindcontrol.org
Fri Apr 8 13:06:22 MST 2005


> I thought you could read it if you created it with the 
> GL_STREAM_DRAW_ARB parameter, in any case, VBO's have the drawback that 

The spec says you can only read it if it's mapped. You can map 
any kind of buffer (doesn't matter whether it's STREAM_DRAW or 
STATIC_READ or whatever).

> Thats what I am doing, but collision is not working, I believe this is 
> due to my data being a dynamic array of struct{float x,y,z} which is 
> mapped to a dVector3 (which is really 4) inside 
> dGeomTriMeshDataBuildSimple, I saw that v[0][0] is alright, but v[3][0] 
> gets garbaje due to the padding.

You should specify the correct vertex stride when building your 
geometry data.

> I think the "bug" is really in dGeomTriMeshDataBuildSimple.

The API works exactly as specified. I believe the problem is 
that you understood the API to work in a different way :-)
The fix on your end is easy; changing the API (which has been 
the way it's been for a long time with no problems) is rather 
less easy and has a huge impact on a lot of existing code.

Either use dVector3 in your data ("wasting" a float per vertex), 
or use dGeomTriMeshDataBuild(), passing a stride of 12 bytes.

Cheers,

			/ h+




More information about the ODE mailing list