Page 1 of 1

mCachedTransformOutOfDate after porting

Posted: Tue Jan 20, 2015 2:10 pm
by ghiboz
hi all!
in debug I have this error: i've read the docs but I don't know where to find the error...
I have my scene that is contained in a SCENE_STATIC node and the car that have the meshes into a SCENE_DYNAMIC node.
I use a code like ogre advanced framework with the renderOneFrame method..
I need to change something? (now compiles)

thanks in advance :)

Re: mCachedTransformOutOfDate after porting

Posted: Tue Jan 20, 2015 2:45 pm
by al2950
This will happen for a couple of reasons, and I expect quite a few people will see this as Ogre 1.x would implicitly update the transforms when things like _getDerivedPosition were called. Have you debugged it and seen what function call is triggering the assert?

Its most likely because you are calling something like _getDerivedPosition. If this is true you can explicitly call _getDerivedPositionUpdated instead.

There are some other reasons why this might happen which might be slightly more confusing, but I can help if you give a print out of your call stack.

Re: mCachedTransformOutOfDate after porting

Posted: Tue Jan 20, 2015 2:53 pm
by ghiboz
thanks!
I've changed _getDerivedPosition to _getDerivedPositionUpdated but the problem still persits.. and the call stack doesn't help me:
Image

Re: mCachedTransformOutOfDate after porting

Posted: Tue Jan 20, 2015 2:59 pm
by ghiboz
the problem is in the camera node update (i'm using ogre ccs) http://sourceforge.net/p/ogre-ccs/code/HEAD/tree/trunk/
here is the code incrimined:

Code: Select all

/**
 * @brief This class is internally used to notify the CameraControlSystem class the target scene node has been moved within the current frame
 */
class NodeListener : public Ogre::Node::Listener
{
public:
	NodeListener(CameraControlSystem* cam) : mCameraCS(cam){};
	~NodeListener(){};
	void nodeUpdated(const Ogre::Node *nod)
	{ 
		mCameraCS->update( mCameraCS->getTimeSinceLastFrameLastUpdate() );
	};
protected:
	Ogre::Real mTimeSinceLastFrame;
	CameraControlSystem* mCameraCS;
};
AFAIK the method is called when a node is moved between 2 frames.. if I comment this, it works perfectly :)

Re: mCachedTransformOutOfDate after porting

Posted: Tue Jan 20, 2015 3:13 pm
by al2950
:shock: , thats not helpful! I would sort your debugger out first!

_getDerirvedPosition thing applies to _getDeriviedOrienation, _getDerivedScale, convertLocalToWorld**, convertWorldToLocal, _getFullTransform functions as well. However simply using the *updated functions should not be a long term solution, but I can understand if you just want to get something working. This may also occur if you update a nodes transform, between updating the scene graph and rendering an object, however this is fairly unlikely if you are using renderOneFrame, unless you have some custom movableObjects that override _updateRenderQueue...

**EDIT** Just seen your latest post, I use an old version of CCS but I have not yet updated it to Ogre 2.0. But it defiantly has a bunch of _getDerived*** functions in it.

Re: mCachedTransformOutOfDate after porting

Posted: Tue Jan 20, 2015 3:23 pm
by ghiboz
al2950 wrote::shock: , thats not helpful! I would sort your debugger out first!

_getDerirvedPosition thing applies to _getDeriviedOrienation, _getDerivedScale, convertLocalToWorld**, convertWorldToLocal, _getFullTransform functions as well. However simply using the *updated functions should not be a long term solution, but I can understand if you just want to get something working. This may also occur if you update a nodes transform, between updating the scene graph and rendering an object, however this is fairly unlikely if you are using renderOneFrame, unless you have some custom movableObjects that override _updateRenderQueue...

**EDIT** Just seen your latest post, I use an old version of CCS but I have not yet updated it to Ogre 2.0. But it defiantly has a bunch of _getDerived*** functions in it.

ok! now works pefectly with the ..Updated functions and removing the nodeUpdated callback.. not a solution but a patch

Re: mCachedTransformOutOfDate after porting

Posted: Tue Jan 20, 2015 9:26 pm
by dark_sylinc
See section 2.8 "Ogre asserts mCachedAabbOutOfDate or mCachedTransformOutOfDate while in debug mode" of the Ogre 2.0 porting manual.

You only need to call one of the "*Updated" functions once so that the full transform gets recalculated and cached.