createFlyCircleAnimator

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
Van
Posts: 9
Joined: Fri Oct 29, 2004 3:31 am

createFlyCircleAnimator

Post by Van »

I am trying to make an object(node) orbit aother object (node).
I do not understand the syntax for createFlyCircleAnimator - specifically, the "center".

So, having TWO Nodes (Parent and Child), I want to have the CHILD orbit the Parent. How do I determine "center" of the Parent Node to supply it to createFlyCircleAnimator "center"?

I tried ParentNode->getPostion but that doesn't work.
Van
Posts: 9
Joined: Fri Oct 29, 2004 3:31 am

Post by Van »

Here is my code:
.....
scene::ISceneNodeAnimator* SChildAnim = 0;

ChildAnim = smgr->createFlyCircleAnimator (
vector3df(
ParentNode->getPosition().X,
ParentNode->getPosition().Y,
ParentNode->getPosition().Z
),
100.0f
);

ChildNode->addAnimator(ChildAnim);
ChildAnim->drop();
......

This code works - sort of.
The child will orbit the parent correclty, however, I can NOT control the ORBIT RADIUS. According to the documentation, the orbit radius variable should be in the "ParentNode->getPosition().Y" position. If I attempt to put anything else in there, the center of orbit is relocated but the radius of the orbit is the same. Know matter where I put the ChildAnim, it always rotates at the same orbit radius.

What am I doing wrong?
What is my goal? To have a sun with orbiting planets. The planets will have orbiting moons, etc. So, the location for the center of orbit changes depending on the location of the parent node.
Thulsa Doom
Posts: 63
Joined: Thu Aug 05, 2004 9:40 am
Location: Germany

Post by Thulsa Doom »

Hi Van,
I know exactly what you want to do, I faced the same problems.

On creation variables and constants are passed to any animator. The variables are influenced by the node it is attached to. Unfortunately in the case of the FlyCircleAnimator the radius is fixed and cannot be changed on runtime.

In the moment I'm working out a little demo for a new FlyCircleAnimator. It's not finished yet. It will feature a callback functionality. It is already possible to pass an additional variable to determine the plane of ecliptic on creation.

You may have a look at the german Irrlicht-Portal:
http://exelsior.ex.funpic.de/readarticl ... ticle_id=9

There I provided also a download link for an mscv6 project. As it is a german site i included an englisch readme in the source.
Van
Posts: 9
Joined: Fri Oct 29, 2004 3:31 am

Post by Van »

Ah, so I am not loosing my mind. The orbit is a fixed radius.
Ok, the documentation was missleadind.

Would be really nice if this function would handle a radius.
Thulsa Doom
Posts: 63
Joined: Thu Aug 05, 2004 9:40 am
Location: Germany

Post by Thulsa Doom »

Van wrote: ..
Would be really nice if this function would handle a radius.
On runtime?

Hehe..
If you would come along with the overhead and not so easy to use function interface?!

I'll give a callback in some day's, stay tuned.
Post Reply