More spatial transform bugs + fixes


I have unfortunately found several more spatial transform bugs (it also affects math.TransformMatrixQuat indirectly, extra method required).

I discovered them soon after the correction of the previous translation bug.

I am sorry for sitting on this for so long but I had to go through my code and pick apart the spatial transform code, to make sure I wasn’t going mad !

The bugs, objects being set to a scale of 1 and a rotation of 0, when either interpolatMissing() is called, and/or the object is linked to the spatial controller (same nature as the previous translation bug), when no rotation or scaling transformations, have been set.

When attempting to correct the scale bug in the same way that the translation bug was corrected, I initially failed, due to another bug.

The following is the corrected code for SpatialTransformer.fillScales() (from line 292) :

if (start == keyframes.size()) { // if they are all null then fill
                // with identity
                for (int i = 0; i < keyframes.size(); i++)
                    pivots[objIndex].getScale( // pull original translation
                            ((PointInTime) keyframes.get(i)).look[objIndex]
                            .getScale()); // ...into object translation.
                continue; // we're done so lets break

The above is reasonable (same form as for the translation bug correction), but did not work. Some investigation revealed that the TransforMatrixQuat object 'look', contained in the PointInTime object, returned by keyframes.get(i), had an invalid scale. The scale did not match the scale of the original spatial object, therefore despite this

noted, I’ll have a look asap


This should help in testing :

The above is test code tests out all possible transform combinations, usage details are contained in the source.

thanks, you are very thorough. I appreciate that a lot.

Ok, this is in. It looks good. Also, I’ve added your test into jmetest as jmetest.renderer.TestSpatialTransform. Now if that darn pause tick on each cycle end was squashed in a way that still let all the models work right… :slight_smile:

Thanks yet again. Keep bug fixes coming in!

Updated. Let me know what you find.


I’m probably going to start a discussion off in developer general, what I have found w.r.t the rotation behaviour, is what I would call a “grey” bug (not technically a bug, but functionally a bug).