|
Hi, I need to align a nodes Pivot point to that of another node. How can this be done?
There is a function Move() in INode that allows for the movement of pivot points only, but I am unsure of how to use it, specifically how to tell it which axes to move along. The following is my attempt at using it, where shapeDif is the point3 difference between the two node’s pivots.
Point3 translateXYZ(1,0,0);
Matrix3 Axe;
Axe.SetTranslate(translateXYZ);
shapeNode->Move(t, Axe, shapeDif, false, true, PIV_PIVOT_ONLY);
translateXYZ.x=0;
translateXYZ.y=1;
translateXYZ.z=0;
Axe.SetTranslate(translateXYZ);
shapeNode->Move(t, Axe, shapeDif, false, true, PIV_PIVOT_ONLY);
translateXYZ.x=0;
translateXYZ.y=0;
translateXYZ.z=1;
Axe.SetTranslate(translateXYZ);
shapeNode->Move(t, Axe, shapeDif, false, true, PIV_PIVOT_ONLY);
Move function ref. in sdk docs: http://download.autodesk.com/glo...a78f0d77df63620d5b378795b
any help would be greatly appreciated.
thanks
EDIT:
Was just a small case of sending the shapeDif with 0’s in axes that wasn’t being moved:
Point3 translateXYZ(1,0,0);
Matrix3 xAxe;
Point3 shapeDifBU = shapeDif;
shapeDif.y = 0;
shapeDif.z = 0;
xAxe.SetTranslate(translateXYZ);
shapeNode->Move(t, xAxe, shapeDif, false, true, PIV_PIVOT_ONLY);
translateXYZ.x=0;
translateXYZ.y=1;
translateXYZ.z=0;
shapeDif = shapeDifBU;
shapeDif.x = 0;
shapeDif.z = 0;
xAxe.SetTranslate(translateXYZ);
shapeNode->Move(t, xAxe, shapeDif, false, true, PIV_PIVOT_ONLY);
translateXYZ.x=0;
translateXYZ.y=0;
translateXYZ.z=1;
shapeDif = shapeDifBU;
shapeDif.x = 0;
shapeDif.y = 0;
xAxe.SetTranslate(translateXYZ);
shapeNode->Move(t, xAxe, shapeDif, false, true, PIV_PIVOT_ONLY);
|