Sign in to follow this  
toonist

ODE trimesh collision problem

Recommended Posts

I have been trying to figure out what is wrong with my ODE trimesh collision integration for the past few days, but I just can't figure it out. When a sphere (with physics) collides with a trimesh, it sinks into it and then shoots to a funny direction. Here is the code that I use to initialize my trimesh: -------------------------------------------------------------------------- triMeshData = dGeomTriMeshDataCreate(); dGeomTriMeshDataBuildSingle1(triMeshData, mesh->mb->vert, sizeof(f32)*3, mesh->mb->numVertices, mesh->mb->ODEVertIdx, sizeof(u32)*3, mesh->mb->numFaces*3, mesh->mb->normal); geom = dCreateTriMesh(Driver::getSceneManager()->space, triMeshData, 0, 0, 0); -------------------------------------------------------------------------- The position and physics (if either of them is set) are updated per frame. u32: typedef unsigned int f32: typedef float mesh->mb->vert: continuous one-dimensional array of vertice data (3 components, xyz) mesh->mb->ODEVertIdx: continuous one-dimensional array of vertex index data mesh->mb->normal: continuous one-deminsional array of normal data (3 components, xyz) [Edited by - toonist on May 24, 2007 8:08:31 AM]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this