I have a arm tip defined here:
Then it is moved in the animation.
And then the attachment point is moved
h:
No issues. But I want to rotate the Y rotation in an instance. So if flip equals 1 then rotate they axis tip .
The part that isn't working so far is this:
Severity Code Description Project Path File Line Suppression State
Error C2228 left of '.x' must have class/struct/union DTV1 D:\Orbiter2016\Orbitersdk\samples\D2tv D:\Orbiter2016\Orbitersdk\samples\D2tv\d2tv.CPP 174
SOLVED. if (flip == 1) arm_tip[2] = _V(arm_tip[2].x, arm_tip[2].y+1, arm_tip[2].z);
arm_tip[0] = _V(-0.003, 1.377, -0.125);//-0.5, -2.1,-.15 x=y y=z z=x
arm_tip[1] = _V(-0.003, 0.377, -0.125);//-0.5, 3.1, -.15
arm_tip[2] = _V(-1.003, 1.377, -0.125);//1.5, -2.1, -.15
Then it is moved in the animation.
ANIMATIONCOMPONENT_HANDLE parent, parent1;
static UINT panGrp1[1] = { 3 };//pan
static UINT tiltGrp1[5] = { 4, 5, 6, 7, 8 };//tilt
anim_tilt = CreateAnimation(0.0);
anim_pan = CreateAnimation(0.0);
anim_LIGHT = CreateAnimation(0.0);
anim_SEATTACH = CreateAnimation(0.0);
BDY_anim[0] = new MGROUP_ROTATE(0, panGrp1, 1, _V(-0.003, 1.501, 0.042), _V(0, 1, 0), (float)(360 * RAD)); // -2 .. +145
BDY_anim[1] = new MGROUP_ROTATE(0, tiltGrp1, 5, _V(-0.003, 1.594, -0.022), _V(0, 0, 1), (float)(-180 * RAD)); // -2 .. +145 ANKLE BEND
BDY_anim[2] = new MGROUP_ROTATE(LOCALVERTEXLIST, MAKEGROUPARRAY(arm_tip), 3, _V(-0.003, 1.377, -0.125), _V(-1, 0, 0), (float)(894 * RAD)); // -447 .. +447
BDY_anim[3] = new MGROUP_ROTATE(LOCALVERTEXLIST, MAKEGROUPARRAY(arm_tip3), 3, _V(-0.166, 1.467, 0.253), _V(-1, 0, 0), (float)(894 * RAD)); // -447 .. +447
// rms1_anim[6] = new MGROUP_ROTATE(LOCALVERTEXLIST, MAKEGROUPARRAY(arm_tip3), 3, _V(-0.5, -2.1, -.15), _V(1, 0, 0), (float)(894 * RAD)); // -447 .. +447
parent = AddAnimationComponent(anim_pan, 0, 1, BDY_anim[0]);
parent1 = AddAnimationComponent(anim_tilt, 0, 1, BDY_anim[1], parent);
hAC_arm2 = AddAnimationComponent(anim_SEATTACH, 0, 1, BDY_anim[2], parent1);//lens
hAC_arm3 = AddAnimationComponent(anim_LIGHT, 0, 1, BDY_anim[3], parent1);//light
And then the attachment point is moved
void EVABOX1::clbkPostStep(double simt, double simdt, double mjd)
{
if (flip == 1) arm_tip[1] = _V(arm_tip.x, arm_tip.y+1, arm_tip.z);
else arm_tip[1] = _V(arm_tip.x, arm_tip.y , arm_tip.z);
xp0 = arm_tip[1] - arm_tip[0]; normalise(xp0);
xr0 = arm_tip[2] - arm_tip[0]; normalise(xr0);
SetAttachmentParams(TVlens, arm_tip[0], xp0, xr0);
h:
VECTOR3 arm_tip[3], arm_tip3[3];
No issues. But I want to rotate the Y rotation in an instance. So if flip equals 1 then rotate they axis tip .
The part that isn't working so far is this:
arm_tip[1] = _V(arm_tip.x, arm_tip.y+1, arm_tip.z);
Severity Code Description Project Path File Line Suppression State
Error C2228 left of '.x' must have class/struct/union DTV1 D:\Orbiter2016\Orbitersdk\samples\D2tv D:\Orbiter2016\Orbitersdk\samples\D2tv\d2tv.CPP 174
SOLVED. if (flip == 1) arm_tip[2] = _V(arm_tip[2].x, arm_tip[2].y+1, arm_tip[2].z);
Last edited: