mCachedTransformOutOfDate after porting

Discussion area about developing with Ogre2 branches (2.1, 2.2 and beyond)
Post Reply
User avatar
ghiboz
Goblin
Posts: 205
Joined: Wed Apr 25, 2007 9:47 pm
Location: Centallo (I)
Contact:

mCachedTransformOutOfDate after porting

Post by ghiboz » Tue Jan 20, 2015 2:10 pm

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 :)
0 x

al2950
OGRE Expert User
OGRE Expert User
Posts: 1202
Joined: Thu Dec 11, 2008 7:56 pm
Location: Bristol, UK
x 76

Re: mCachedTransformOutOfDate after porting

Post by al2950 » Tue Jan 20, 2015 2:45 pm

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.
0 x

User avatar
ghiboz
Goblin
Posts: 205
Joined: Wed Apr 25, 2007 9:47 pm
Location: Centallo (I)
Contact:

Re: mCachedTransformOutOfDate after porting

Post by ghiboz » Tue Jan 20, 2015 2:53 pm

thanks!
I've changed _getDerivedPosition to _getDerivedPositionUpdated but the problem still persits.. and the call stack doesn't help me:
Image
0 x

User avatar
ghiboz
Goblin
Posts: 205
Joined: Wed Apr 25, 2007 9:47 pm
Location: Centallo (I)
Contact:

Re: mCachedTransformOutOfDate after porting

Post by ghiboz » Tue Jan 20, 2015 2:59 pm

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 :)
0 x

al2950
OGRE Expert User
OGRE Expert User
Posts: 1202
Joined: Thu Dec 11, 2008 7:56 pm
Location: Bristol, UK
x 76

Re: mCachedTransformOutOfDate after porting

Post by al2950 » Tue Jan 20, 2015 3:13 pm

: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.
0 x

User avatar
ghiboz
Goblin
Posts: 205
Joined: Wed Apr 25, 2007 9:47 pm
Location: Centallo (I)
Contact:

Re: mCachedTransformOutOfDate after porting

Post by ghiboz » Tue Jan 20, 2015 3:23 pm

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
0 x

User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 4116
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 243
Contact:

Re: mCachedTransformOutOfDate after porting

Post by dark_sylinc » Tue Jan 20, 2015 9:26 pm

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.
0 x

Post Reply