[ODE] get triangle index of a trimesh
vicente conejeros
vicenteconejeros at hotmail.com
Fri Mar 10 12:05:05 MST 2006
thanks :D
----- Original Message -----
From: Jaroslav Sinecky
To: adastra at inorbit.com ; vicente conejeros
Cc: ODE mailing_list
Sent: Friday, March 10, 2006 10:21 AM
Subject: RE: [ODE] get triangle index of a trimesh
So here goes the patch, maybe someone finds it useful or you can include it in unstable. It's pretty simple: after dCollide returns, call
int triIndex = dGeomTriMeshGetTouchedTriangle(g1, contactIndex);
where contactIndex is the index in the list of returned contacts and g1 is the Trimesh geom involved in the collision.
disclaimer:
- Not implemented for ray or plane colliding with trimesh. Suppose should be similarily easy to implement though.
- There is static buffer (64) to hold indexes. I believe if this overflows, it shouldn't crash, just some asserts will come out.
- It's not completely robust, for example if you send contactIndex not consistent with immediately preceding dCollide call, result is undefined
Performance impact should be negligible though.
Cheers,
Jaroslav
-----Original Message-----
From: ode-bounces at q12.org [mailto:ode-bounces at q12.org]On Behalf Of adastra at inorbit.com
Sent: Thursday, March 09, 2006 12:22 PM
To: vicente conejeros
Cc: ODE mailing_list
Subject: Re: [ODE] get triangle index of a trimesh
I had the same problem with my indices. I just used my visualization software (VTK) to work it out.
I used GetCell() and then GetPoints() for each cell and made an array with that data.
Is there a way to do this using ODE without wasting processing time on finding the same index so many times?
Jemma
----- Original Message -----
From: "vicente conejeros"
To: ode at q12.org
Subject: [ODE] get triangle index of a trimesh
Date: Wed, 8 Mar 2006 14:44:22 -0300
i'm trying to get the index of a [trianglemesh-(sphere,box,etc)] collision. i have read the documentation of ode, but i haven't read anything about that
anyone knows how to make that?
sorry for my english
_______________________________________________
ODE mailing list
ODE at q12.org
http://q12.org/mailman/listinfo/ode
--
___________________________________________________
Play 100s of games for FREE! http://games.mail.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://q12.org/pipermail/ode/attachments/20060310/5f0f5361/attachment.htm
More information about the ODE
mailing list