[ODE] Boxiangle collision
coding at natew.com
Fri May 10 00:33:02 2002
On Fri, 10 May 2002, Chris Campbell wrote:
> I think CPU efficiency is not too bad but memory like I said
> ('I will eventually need to do it some other way') will be an issue if
> you intend to make a lot of these.
Did you see the paper at http://www.codercorner.com/Opcode.htm ? There's
a link to a PDF at the bottom of the page, you might find it interesting
reading if you haven't seen it already.
> 1) The sphere falls in a 'valley' between two triangles, so we should really
> add them both as contacts in order to get the best reaction direction ->
> shouldn't ignore multiple contacts.
Sounds like the 'boiling' issue with stacked boxes.
> 2) The sphere falls on a perfectly flat heightmap, close to the edge between
> two triangles. If the sphere is low enough, it will be intersecting both
> triangles, but we should ignore the contact with the triangle that the
> sphere is not directly above -> should ignore multiple contacts.
> Now, ignoring multiple contacts is as easy as just using the contact with
> the deepest penetration. But when should it be done? :)
In case 2, the contact normals are parallel, so use the deepest one. In
case 1, the contact normals point in towards each other, so use both.
Now suppose the ball lands on a "ridge," between two triagles. Then what?
Create two contacts? Or create one contact, located at the point on the
edge that is closes to the center of the sphere, where the contact normal
is the line from the contact point to the sphere center?
In the third case, the contact normals point away from each other
(distance between contact_1 and contact_2 is less than distance between
(contact_1 + normal_1) and (contact_2 + normal_2)). I *think* that would
be a useful way to determine which case is which, but I dunno, I'm just
making this up as I go along.
4) The sphere rolls into a "divot" where THREE triangles share a vertex.
5) The sphere lands on a "peak" where three triangles share a vertex.
6) With small triangles and large spheres, the sphere could conceivably
intersect N triangles. Then what? Pick the nearest 2 or 3?
Redmond WA USA