Jump to content
audiocustoms

Set rotor to specific position

Recommended Posts

Hey,

 

how can i set a helicopter rotor to a defined position? I need this for propper folding animations so the animation always takes place in the same rotor position.

 

 

What i have by now:

 

In Objectbuilder the animation to rotate the blades is called "rotorH"

 

model.cfg

class HRotor
{
type="rotation";
source="rotorH";
selection="velka vrtule";
axis="velka osa";
minValue = 0;
maxValue = 1;
angle0 = 0;
angle1 = 6.2831855;
};

So what i want is, as soon as the packing animation stars to set the rotor rotation pos back to 0 (how the heli spawned). To do so i added following to class animationsources

config.cpp

class AnimationSources{
class rotorH
{
source = "user";
animPeriod = 0.001; //0.001;
initPhase = 0;
};

To test what i got, i placed the heli, named it h1 and open the console in editor and typed

h1 animate ["rotorH",0.5];

but nothing moves, so i tried to move the selection directly

h1 animate ["velka vrtule",0.5];

Same result, nothing happens....

 

Any ideas how set the rotor pos back to it's spawning pos?

 

 

Greez...

Share this post


Link to post
Share on other sites

In Objectbuilder the animation to rotate the blades is called "rotorH"

 

Looking at your model.cfg the animation is called HRotor. rotorH is the name of the animationsource, not the animation.

 

The syntax should be

_OBJECT animate ["HRotor", 0];

I can't guarantee that the above works since I haven't tried it on a heli rotor yet, but for certain the animate command uses the classname from under class Animations in your model.cfg as an argument, not the source name for that animation. Replace the 0 with whatever phase value gets the rotor in the position you want it in.

 

You don't need a custom rotorH animationsource class in your config since it's already one of the hardcoded sources for the helicopter simulation type. If you're adding a new 'user' sourced animation, it needs a different name.

Share this post


Link to post
Share on other sites

Hmmm... Strangely when i try to animate HRotor nothing happens. But when i create a new class in model.cfg >> class animations with exact the same values HRotor uses, i can animate it inGame.

But this is not the main problem. The thing is, when the chopper spawns blade #1 is lined up with the tail. Once the engine is started and stopped, the blade #1 could be somewere but doesn't line up with the tail again.

So the animation status is 0, no matter where the blade is pointing. Let's say after the engine stopped the blade #1 points 2 o'clock and i animate the rotor to 0, all it does is spinning 360° but not returning to the pos where it was on spawn (what i want it to do)...

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×