Problem: Animation stops if its not visible in the camera

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
qez111
Posts: 54
Joined: Mon Apr 28, 2008 9:44 pm

Problem: Animation stops if its not visible in the camera

Post by qez111 »

Hi,
I have some animations (.X type) playing in the scene. It plays when the object is visible in front of the cam, but as soon as it moves away from the camera's visible zone, the animation stops. (I know the animation is stopped because the position X,Y,Z no longer change). But if I move the camera's position to bring the object back into the visible zone, the animation again resumes. But once the animation goes out of the visible range, it again stops. (I am using the normal camera - NOT FPS/MAYA).

How can I make the animation to play continuously, even if it is not visible in the camera range?

Thanks
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

what animation? an animation in the actual .x file right? and what XYZ are you referring to? the node's position? that doesn't change when an animation is played... so you mean the position of a bone?

i thought that animations would be carried out regardless of the frustrum culling (would be a nice feature to allow the animation to be culled or not maybe) but maybe it depends on where the actual animation is done.. i think i read recently that the SkinnedMesh animation is actually done in the render function or something, so yeah that would stop the animation playing if it were culled... that's just a drawback of the current animation system i guess.

so i would think the only way you can keep it animating whilst off screen (is it necessary to do so? presumably it is otherwise you wouldn't ask :lol:) is to stop it being frustrum culled so do node->setAutomaticCulling(EAC_OFF); This could give you a performance hit though as any node you prevent from being culled will be rendered every single frame so if you've got lots it could be bad.
Image Image Image
wuallen
Posts: 67
Joined: Thu Jan 25, 2007 3:07 am
Location: Shanghai

Post by wuallen »

I met a similar problem. I set a light and a animated node in front of the camera. At first it works well, but after the animated node walks out of the viewport of the camera, the light goes off. Maybe irrlicht thinks it doesn't need a light because no one is here, so irrlicht turns off the light to save energy. :)
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Well that again would be culling because the animated node gets culled as it's offscreen and so does its children, i.e. the light, so then the light doesn't have any lighting effect.
Image Image Image
Post Reply