• ### Announcements

#### Archived

This topic is now archived and is closed to further replies.

# OBB<->Triangle Push Vector

## Recommended Posts

HI, I have Object orientated Bounding Boxes and triangle collision detection implmented, however i seem to be having problems on resolving the "Delta Push" vector. This vector is used to move the object (OBB) so it is not inter-penetrating the intersecting trangle. For a sphere this is simply the vector from the Triangle hit point (HP) to the centre of the sphere multiplied by the penetration distance. But with an OBB it is more difficult, for instance hitting a railing face on may produce a back and downwards force when it should be back only.

|-------|  Wrong, should be  |-------|
O|\      |                    O--->   |
| \     |                    |       |
|   x   |                    |   x   |
|       |
|       |    O Railing , looking along
|-------|    x centre of box

Now i could try and use the triangles normal, but if the triangle is edge on, or at an angle, ( A slope for example ) this will not work. i tried also selecting the most approprate box axis, using the x,y,z intersection distance, but this fails for certain conditions when the triangle is quite far inside, or the same distant on 2 or more axis. Any ideas? Dmmn my crap maths! [BTW: resources on the internet seem only either to report t/f intersection or the hit point, none seem to show how to get the Delta Push.]