Main Menu

Beta version of 1.13 available!

Started by EgonOlsen, January 24, 2007, 11:17:13 PM

Previous topic - Next topic

cyberkilla

It gives you everything in object space.

You would need to convert the vertex vectors into world space, and compare them
against the other model using a ray, or something like that:).
http://futurerp.net - Text Based MMORPG
http://beta.rpwar.com - 3D Isometric MMORPG

EgonOlsen

Cyber is right, it's all in object space. If you want it in world space, you've to transform it yourself. But most of the time, it's better to transform the collision source (i.e. what should be checked for collision with this mesh) into object space of the mesh in question by applying the inverse world transformation and transform the result back into world space. That way, you don't have to transform all of the vertices of the mesh.

AGP

Okay, how do I apply the inverse world transformation? And why would I then transform the result back into world space (presumably after the collision detection)?

cyberkilla

The invert of a matrix is just matrix.invert(), or matrix.invert3x3() to pretend its only rotational(if i understand right:)).
http://futurerp.net - Text Based MMORPG
http://beta.rpwar.com - 3D Isometric MMORPG

EgonOlsen

Quote from: AGP on March 02, 2007, 03:43:11 AM
And why would I then transform the result back into world space (presumably after the collision detection)?
To do something with it. You move into world space and so do your collision partners. But doing the detection in object space leads to a corrected movement vector in object space. You can't apply it into world space directly.