[ODE] Merging multiple geoms into a single trimesh - a few issues
Megan Fox
shalinor at gmail.com
Wed Jan 12 15:25:07 MST 2005
A couple of questions on this topic -
1.) It's my assumption that welding edge vertices is fairly important,
that I absolutely should not take the lazy approach and just throw a
bunch of diverse meshes into a single buffer and hope it "just works"?
2.) Since I'm looking at turning my entire static world into a trimesh
(stop me if this is a bad idea, incidentally - the other option is to
leave my interiors as geoms like they are now, and only make exterior
terrain out of trimesh data), I need per-triangle owner object data.
I need to be able to tell which triangle is being collided with, so
that I can extract the object that that triangle belongs to and do
whatever collision-specific work is necessary between that object and
the collider (extract the material of the floor and play the proper
foot-to-material sound, that sort of thing).
Now as far as that goes, I see I could use the triangle-specific
collision callback, which would give me the two geoms and the triangle
in question being collided. Now that's just peachy, but I'm unclear
how that triangle callback interacts with the "real" callback.
To make sure I understand it - I'd get the main geom vs geom callback,
where one geom was the trimesh, and then I would get X number
triangle-specific callbacks between the trimesh geom and the colliding
object, 1 for each triangle collided. So I could make my primary
collision callback just ignore trimesh collisions, and stick the
segment of logic that deals with triangles only in that triangle
collision callback - right?
(with the triangle collision callback essentially building a list of
interacting pairs, discarding duplicates, then sending out the events
after collision has finished - same thing the main callback does, just
with a little more hunting in app-specific data)
3.) To reiterate - am I touched in the head for thinking I should go
with trimeshes for all static world geometry? My thinking here is
that, if weapons or what have you fall through the terrain anyways, it
doesn't make a spit of difference if weapons happen to not fall
through the ground inside houses - so I might as well make EVERYTHING
a trimesh, balance it properly, and just make sure nothing screws up
period.
Thanks,
-Megan Fox
More information about the ODE
mailing list