Ejemplo n.º 1
0
bool Link::Load(const pXmlTree tree){

  if(tree==NULL) return false;
  if(tree->GetName()!="Link") return false;

    WorldObject::Load(tree);

  //REALTYPE *array;
  /*
    mName = tree->GetData();
    tree->GetArray("CenterOfMass",&array);
    mCenterOfMass.Set(array);
    tree->GetArray("InertiaMatrix",&array);
    mInertia.mInertiaMoment.Set(array);

//#ifdef WAM_BADREF_CORRECTION
  if(tree->Find("RotorInertia")){
    Matrix dd(3,3);
    Matrix3 dd3;
    Vector d;
    d = Vector(array,tree->GetArray("RotorInertia",&array));
    dd.Diag(d);
    dd3.Set(dd.Array());
    mInertia.mInertiaMoment += dd3;
  }
//#endif

  mInertia.mMass = tree->Get("Mass",0.0);;
  mCenterOfMass.Mult(mInertia.mMass,mInertia.mLinearMoment);
  mInertia.mCenterOfMass = mCenterOfMass;
    */
  mJoint = JointConstructor::Create(tree->Find("Joint"));
  if(mJoint!=NULL)
    mJoint->SetChildLink(this);
  return true;
}