[ODE] Heightfield / Collision.
gl
gl at ntlworld.com
Wed Feb 19 00:41:03 2003
This is a multi-part message in MIME format.
------=_NextPart_000_0078_01C2D7E9.016EDDF0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
> Hello,
Hi Fabian,
> /--\
> | | sphere
> \__/
> /\<-edge of two triangles
> / \
> / \<-triangle face
> / \
> /terrain \
>
> One thing is contact normals:
> In this case we had just two possible normals: one to the upper
> right, the other to the upper left. But you would the sphere expect
> to bounce upwards. This is the sphere-edge collision.
This is exactly the case I was thinking of, so let me attach a rough (hand
drawn) picture. I'm thinking that if the two resulting face contact normals
(green and blue) are combined, you do get the right resulting normal, right?
My reasoning is that you simply determine by how much the sphere is
penetrating the plane of a particular face (assuming it intersects the
triangle of course). You then simply scale this penetration by the face's
normal, and move onto the next face. You ultimately average all the
resulting vectors out.
As I said, I haven't done collision before (other than raycasting over
heightfields), so I may be wrong, but it'd be fun to be right : ). Let's
see...
--
gl
------=_NextPart_000_0078_01C2D7E9.016EDDF0
Content-Type: image/jpeg;
name="Untitled-1.jpg"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="Untitled-1.jpg"
/9j/4AAQSkZJRgABAgAAZABkAAD/7AARRHVja3kAAQAEAAAAHgAA/+4ADkFkb2JlAGTAAAAAAf/b
AIQAEAsLCwwLEAwMEBcPDQ8XGxQQEBQbHxcXFxcXHx4XGhoaGhceHiMlJyUjHi8vMzMvL0BAQEBA
QEBAQEBAQEBAQAERDw8RExEVEhIVFBEUERQaFBYWFBomGhocGhomMCMeHh4eIzArLicnJy4rNTUw
MDU1QEA/QEBAQEBAQEBAQEBA/8AAEQgAsQDPAwEiAAIRAQMRAf/EAKcAAQADAQEBAQAAAAAAAAAA
AAAEBQYDAQIHAQEAAwEBAQAAAAAAAAAAAAAAAQIDBAUGEAABBAEBBAUHCAgEBwAAAAABAAIDBAUR
ITESBkFRYSITcYGRoTJCFLHB0VKSIxUH8GJygjNDUxaywnOT4fGi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