From: Matthias B. <ba...@ir...> - 2004-08-02 18:56:58
|
Timothy Stranex wrote: > From what I've found, dGeomTriMeshDataBuildSingle1 should only be used > with single precision numbers and dGeomTriMeshDataBuildDouble1 with > doubles. TriMeshData.build was using BuildSingle1 even if ODE was built > with double precision dReals resulting in incorrect vertex data. I've > fixed this in CVS by replacing the call to dGeomTriMeshDataBuildSingle1 > with one to dGeomTriMeshDataBuildSimple. ok. I haven't noticed those *BuildDouble functions and was still under the impression that trimesh won't work with doubles (why is there no double-trimesh binary then...?). Anyway, so if there are separate functions for floats and doubles we could also just use one of them without using dReals. In TriMeshData.build() we could just declare the variable "vp" and the member "vertex_buffer" as "float*" instead of "dReal*" and always use the float build function. Then we wouldn't need that unused 4th component again (that was the reason why I was switching from BuildSimple to the more complex version). As far as I can remember, Opcode always works with floats, right? So the above would save some more memory if ODE is compiled using doubles because our mesh buffer will use floats. > Furthermore, it seems that these functions take the number of > indices--not the number faces as was being passed before. This could > explain why ODE was ignoring some of the triangles. That's it! Thanks! Dropping meshes on a box seems to work now. By the way, if someone is using those meshes I was posting... note that the inertia tensor stored in the file is given with respect to the center of gravity and not the origin (I wasn't aware of that myself). - Matthias - |