THanks. I saw this in the SDK:
Instead of adding mesh groups to an animation, it is also possible to add a
local VECTOR3 array. To do this, set “mesh” to LOCALVERTEXLIST, and
set “grp” to MAKEGROUPARRAY(vtxptr), where vtxptr is the VECTOR3
array. “ngrp” is set to the number of vertices in the array. Example:
VECTOR3 vtx[2] = {_V(0,0,0), _V(1,0,-1)};
MGROUP_TRANSFORM *mt = new MGROUP_TRANSFORM (LOCALVERTEXLIST,
MAKEGROUPARRAY(vtx), 2);
AddAnimationComponent (anim, 0, 1, mt);
Transforming local vertices in this way does not have an effect on the visual
appearance of the animation, but it can be used by the module to keep track
of a transformed point during animation. The Atlantis module uses this
method to track a grappled satellite during animation of the RMS arm.
And in RMS code it is used here.
rms_anim[5] = new MGROUP_ROTATE (LOCALVERTEXLIST, MAKEGROUPARRAY(arm_tip), 3,
_V(-2.26,1.7,-6.5), _V(0,0,1), (float)(894*RAD)); // -447 .. +447
anim_arm_wr = CreateAnimation (0.5);
hAC_arm = AddAnimationComponent (anim_arm_wr, 0, 1, rms_anim[5], parent);
and this:
arm_tip[0] = _V(-2.26,1.71,-6.5);
arm_tip[1] = _V(-2.26,1.71,-7.5);
arm_tip[2] = _V(-2.26,2.71,-6.5);
But I don't see in the Atlantis Code where the mesh is set to LOCALVERTEXLIST
Change the last line of your code snippet:
Code:
AddAnimationComponent (anim_arm01a, 0, .5, arm1a, parent);
AddAnimationComponent (anim_arm01a, 0, .5, arm1av, parent);
Now, you only need to define the attachment point vertex list:
Code:
arm1a = new MGROUP_ROTATE (0, arm_groups1_2, 2,_V(-1.09,-.259,.2), _V(1,0,0), (float)(180*RAD));
arm1av = new MGROUP_ROTATE (LOCALVERTEXLIST, MAKEGROUPARRAY(iwillunderstandthecodesnippet), before_using_it
,_V(-1.09,-.259,.2), _V(1,0,0), (float)(180*RAD));