Thanks.
Animation for body flap
//*******Body flap
static UINT bfGrp[1] = { GRP_Group2 };
static MGROUP_ROTATE BodyFlap(midx, bfGrp, 1,
_V(0, -2.199202, - 12.13037), _V(-1,0,0), (float)(34.2*RAD));
anim_bodyflap = CreateAnimation(0.34);
AddAnimationComponent(anim_bodyflap, 0, 1, &BodyFlap);
Delta glider:
CreateControlSurface3 (AIRCTRL_ELEVATOR, 1.4, 1.7, _V( 0,0,-7.2), AIRCTRL_AXIS_XPOS, 1.0, anim_elevator);
CreateControlSurface3 (AIRCTRL_RUDDER, 0.8, 1.7, _V( 0,0,-7.2), AIRCTRL_AXIS_YPOS, 1.0, anim_rudder);
hlaileron = CreateControlSurface3 (AIRCTRL_AILERON, 0.3, 1.7, _V( 7.5,0,-7.2), AIRCTRL_AXIS_XPOS, 1.0, anim_raileron);
hraileron = CreateControlSurface3 (AIRCTRL_AILERON, 0.3, 1.7, _V(-7.5,0,-7.2), AIRCTRL_AXIS_XNEG, 1.0, anim_laileron);
CreateControlSurface3 (AIRCTRL_ELEVATORTRIM, 0.3, 1.7, _V( 0,0,-7.2), AIRCTRL_AXIS_XPOS, 1.0, anim_elevatortrim);
DOc:
17.57.3.37 void VESSEL::CreateControlSurface ( AIRCTRL_TYPE type, double area, double dCl, const VECTOR3 & ref, int axis = AIRCTRL_AXIS_AUTO, UINT anim = (UINT)-1 ) const Creates an aerodynamic control surface. Parameters Generated on Wed Aug 24 2016 00:01:08 for Orbiter API by Doxygen434 CONTENTS type control surface type (see Aerodynamic control surface types) area control surface area [m2 ] dCl shift in lift coefficient achieved by fully extended control ref centre of pressure in vessel coordinates [m] axis rotation axis (see Control surface axis orientation) anim animation reference, if applicable Note Control surfaces include elevators, rudders, ailerons, flaps, etc. They can be used to control the vessel during atmospheric flight. When selecting automatic axis control (axis=AIRCTRL_AXIS_AUTO), the following axes will be used for given control surfaces: Elevator XPOS Rudder YPOS Aileron XPOS if ref.x > 0, XNEG otherwise Flap XPOS For ailerons, at least 2 control surfaces should be defined (e.g. on left and right wing) with opposite rotation axes, to obtain the angular momentum for banking the vessel. Elevators typically use the XPOS axis, assuming the that the centre of pressure is aft of the centre of gravity. If pitch control is provided by a canard configuration ahead of the CoG, XNEG should be used instead. The centre of pressure defined by the ref parameter is the point at which the lift and drag forces for the control surface are applied. To improve performance, multiple control surfaces may sometimes be defined by a single call to Create←- ControlSurface. For example, the elevator controls on the left and right wing may be combined by setting a centered attack point. Control surfaces can be animated, by passing an animation reference to CreateControlSurface. The animation reference is obtained when creating the animation with CreateAnimation. The animation should support a state in the range from 0 to 1, with neutral surface position at state 0.5.
16.23.2.1 enum AIRCTRL_TYPE Control surfaces provide attitude and drag control during atmospheric flight. See also VESSEL::CreateControlSurface, VESSEL::CreateControlSurface2, VESSEL::CreateControlSurface3 Enumerator AIRCTRL_ELEVATOR elevator control (pitch control) AIRCTRL_RUDDER rudder control (yaw control) AIRCTRL_AILERON aileron control (bank control) AIRCTRL_FLAP flaps (lift, drag control) AIRCTRL_ELEVATORTRIM elevator trim AIRCTRL_RUDDERTRIM rudder trim
As I understand it. When you use the rudder keys. it changes the AIRCTRL_RUDDER. then this changes the rudder anim, right?
If i use the AIRCTRL_ELEVATORTRIM with this:
CreateControlSurface2(AIRCTRL_ELEVATORTRIM, 5, 1.75, _V(0, 0, -17), AIRCTRL_AXIS_XPOS) ,anim_bodyflap);
then as I change the elevator trim using ins/del the body flap moves.
Then how to set the anim_bodyflap on launch. I suppose you could on launch set animation (anim_bodyflap,0). That would move the body flap to 0 percent.
But would just change the anim_state but the control surface, right