addAnimatedMeshSceneNode hiccups [solved]

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Holiday
Posts: 42
Joined: Thu Apr 19, 2007 2:47 pm

addAnimatedMeshSceneNode hiccups [solved]

Post 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?
Last edited by Holiday on Thu Aug 20, 2009 10:13 pm, edited 1 time in total.
Lonesome Ducky
Competition winner
Posts: 1123
Joined: Sun Jun 10, 2007 11:14 pm

Post 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()
Holiday
Posts: 42
Joined: Thu Apr 19, 2007 2:47 pm

Post 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..
Lonesome Ducky
Competition winner
Posts: 1123
Joined: Sun Jun 10, 2007 11:14 pm

Post 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.
Holiday
Posts: 42
Joined: Thu Apr 19, 2007 2:47 pm

Post by Holiday »

works wonderful, thank you
Post Reply