[ODE] Trimesh related runtime error
Tomek Zielinski
tomekziel at op.pl
Sun Jul 18 12:08:21 MST 2004
After investigating call stact I figured out ther Opcode::FCMin3 is the
culprit.
Call stack is as follows:
callbac->opcode::collide->opcode::_colidee->opcode::triboxcol->fcmin3->exception
so I guess sth is wrong with my tri data?
void CRendMesh::CreateTriMeshGeom( dGeomID &gid, dTriMeshDataID &tmid )
{
tmid = dGeomTriMeshDataCreate();
dGeomTriMeshDataBuildSingle(tmid, (float*)&pos[0].x, 12, pos.size(),
(const int*)&ind[0], ind.size(), 12 );
gid = dCreateTriMesh( gSceneGraph->getODESpace(), tmid, 0,0,0);
// gid = dCreateBox( gSceneGraph->getODESpace(), 20,20,7);
}
where pos and ind are valid vectors with continuos storage pool. I'll
keep trying to fix it but if you have any ideas feel free to share them
> Tomek Zielinski wrote:
>
>> Hi everybody!
>>
>> Short piece of my code:
>>
>> #define MAX_CONTACTS 1000
>> dContactGeom contact_array_helper[MAX_CONTACTS],
>> contact_array[MAX_CONTACTS];
>> unsigned int contact_num;
>>
>> // there are only a few geoms in my space so ythere is no need to test
>> for spaces
>> void nearCallback(void *data, dGeomID o1, dGeomID o2)
>> {
>>
>> // dwoch statykow nie kolidujemy
>> // if(dGeomGetBody(o1)==0 && dGeomGetBody(o2)==0 )
>> // return;
>>
>> // colliding two non-space geoms, so generate contact points
>> between o1 and o2
>> int num_contact = dCollide( o1, o2, MAX_CONTACTS,
>> contact_array_helper, sizeof(dContactGeom) ); // ODE ERROR
>>
>> // add these contact points to the simulation
>> for(unsigned int i=0; i<num_contact; i++)
>> contact_array[contact_num++] = contact_array_helper[i];
>> }
>>
>>
>> ...
>> ...
>>
>> contact_num = 0;
>> dSpaceCollide( odeSpace, NULL, nearCallback );
>>
>>
>>
>>
>>
>> I checked my code and I'm almost sure that setup is done properly. But
>> when two trimesh-bodies touches(even trimesh with box) i'm getting ODE
>> error "invalid operation for geom in locked
>> space(ode/src/collision_kernel.cpp:line301). So I checked it and it
>> turned out that 'ode/src/collision_kernel.cpp:line301' is inside
>> dGeomSetBody. I don't understand why dCollide calls dGeomSetBody -
>> what am I doing wrong?
>>
>>
>> ----
>>
>> I've just figured out that ODE itself is calling dGeomSetBody only
>> from dBodyDestroy, and dBodyDestroy is called only from
>> dTestDataStructures() which seems to be an internl ODE function... So
>> I'm a lot more confused...
>>
>>
>> -----
>>
>> I've just changed triMeshes into planes and boxes a
>> and now that error is gone and contact points are being generated...
>>
>>
>> -----
>>
>> So how can this runtime error happen?
>> _______________________________________________
>> ODE mailing list
>> ODE at q12.org
>> http://q12.org/mailman/listinfo/ode
>>
>
>
More information about the ODE
mailing list