99% of the time this is caused by the user passing in bad values to ogre’s methods that transform scene nodes. If you give ogre a NAN (Not A Number, a floating point value made by doing bad things like dividing by zero) when moving, rotating or scaling a scene node, it will corrupt the transform matrix the node generates. This is then used to transform the bounding box, which now has NANs in it and triggers the exception.
The most common causes are:
– dividing by zero
– calling acos or asin with a number bigger than 1.0 or less than -1.0 (even a fraction outside that range is fatal. 1.0000001 will cause NANs)
The acos/asin stuff can be fixed by calling Ogre’s Math::ACos or Math::ASin instead, they protect against bad values.
Often acos is used with rotations. For example, you might normalise two vectors, get their dot product, then get the acos of that. The answer is the angle between them. That can be used to rotate an object to look at something. The dot product of two normalised vectors is theoretically between -1.0 and 1.0, but due to floating point errors if might be bigger or smaller by enough to break the acos, which then breaks the rotation, which then breaks the bounding box.