[Bf-committers] 2.47 showstopper bug in the BGE.

Diego Hernan Borghetti bdiego at gmail.com
Sat Aug 16 17:32:18 CEST 2008


On Sat, 16 Aug 2008, Benoit Bolsee wrote:

Hello all:

> Hi,
>
> The bug fix in revision 16022 for bug #17450 was wrong: the formula used
> to extract scaling and rotation from the parent inverse transform was
> giving incorrect results for some type of matrix, leading to wrong
> position and orientation for parented objects with no scale applied:
>
> 	MT_Matrix3x3 inverseOrientation(parinvtrans.getRotation());
> 	parentinversenode->SetLocalOrientation(inverseOrientation);
>
> getRotation() only works correctly if there is no scaling in the
> transformation. The correct formula that follows Blender's internal math
> is as follow:
>
> 	MT_Matrix3x3 ori(parinvtrans.getBasis());
> 	MT_Vector3 x(ori.getColumn(0));
> 	MT_Vector3 y(ori.getColumn(1));
> 	MT_Vector3 z(ori.getColumn(2));
> 	MT_Vector3 scale(x.length(), y.length(), z.length());
> 	if (!MT_fuzzyZero(scale[0]))
> 		x /= scale[0];
> 	if (!MT_fuzzyZero(scale[1]))
> 		y /= scale[1];
> 	if (!MT_fuzzyZero(scale[2]))
> 		z /= scale[2];
> 	ori.setColumn(0, x);
>
> 	ori.setColumn(1, y);
>
> 	ori.setColumn(2, z);
>
> 	parentinversenode->SetLocalOrientation(ori);
>
> This bug affects 2.47 as revision 16022 was included in 2.47. It
> potentially affects all games with parented objects with no scale
> applied on the parent: in this situation the parent inverse node has
> scaling and the formula doesn't work correctly.
>
> I've fixed the bug in revision 16127 and I recommend to include it in
> 2.47.
>
> The game designer can get away with the bug by applying the scale on the
> parent objects, which is often recommended in the tutorials so the
> impact of this bug may be limited.

If this bug can be avoid and have a limited impact, it's really a
showstopper ?

Don't misunderstand me, I don't have problem to merge this fix and ask
to the platform that rerebuild again, but my point is that we always go
to have bugs, we can't fix all and if we start to postpone the release
for every bug we never go to release anything.

> Note that 2.47 contains a number of advanced improvements in the game
> engine that are not sufficiently tested. I expect more problems of that
> kind but this one is particularly visible.

And for the other side, if we go to have more of this problem, it's not
better release now and wait a couple of week and make a 2.47a ?

Please, this is only my opinion, so I want know what the rest think.


>
> /Benoit
>
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers
>

-- 
 			Diego


More information about the Bf-committers mailing list