Page 1 of 1

addAnimatedMeshSceneNode hiccups [solved]

Posted: Tue Aug 18, 2009 3:58 pm
by Holiday
Howdy,
i have cars passing by randomly on the road
they are created, given two animators (one to drive straight and one to delete after they drive a certain time)

the mesh is preloaded, so when a new car creates with addAnimatedMeshSceneNode, the mesh it gets is already loaded from hdd. But the problem is, that when each car gets created, a small, but noticable hiccup appears in their movement.

Any way how to solve this?

Posted: Tue Aug 18, 2009 4:08 pm
by Lonesome Ducky
Have you tried the clone function? Say your node you want to clone is called car1, and the one you want the clone to be stored in is car2:

Code: Select all

IAnimatedMeshSceneNode* car2 = car1->clone()

Posted: Thu Aug 20, 2009 3:56 pm
by Holiday
well, the hiccups are gone but the clone method returns an ISceneNode, which i cannot add a shadowVolumeNode to and it doesnt clone the shadowVolumeNode attached to the original node..

Posted: Thu Aug 20, 2009 4:07 pm
by Lonesome Ducky
Even though you fixed the problem, I'd like to fix the code I gave you:

Code: Select all

IAnimatedMeshSceneNode* car2 = static_cast<IAnimatedMeshSceneNode*>(car1->clone());
I forgot that it returned just an ISceneNode.

Posted: Thu Aug 20, 2009 10:13 pm
by Holiday
works wonderful, thank you