0
0

Hi,

I spend some time trying to work out why the Geometry::setRotation wasn’t working as expected. I was setting the world space position and rotation but the Geometry rotation was inverted.

If i invert my world matrix then generate the forward and up it works correctly. This seems a little odd since the docs don’t mention this and the position is not inverted.

I’m using default coordinate system (left-handed) also tested this on fmod 4.2806 and 4.3201.

FMOD_RESULT result = FMOD_OK;
FMOD_VECTOR pos = {mat._41, mat._42, mat._43};
mpGeometry->setPosition(&pos);

MATRIX m = mat.GetInverse();
FMOD_VECTOR forward = m.TransformNormal(VECTOR3(0,0,1));
FMOD_VECTOR up = m.TransformNormal(VECTOR3(0,1,0));
mpGeometry->setRotation(&forward, &up);

regards,

chris.

  • You must to post comments
0
0

I just noticed this problem as well. I’m using right handed coordinates and I need to invert the z component of the forward vector to set the rotation as expected, otherwise the geometry rotates in the wrong direction.

I’m using 4.30.02, so maybe it’s already been addressed.

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.