void
Skin0::createGeometries(ArRef<Skeleton> skeleton)
{
cout<<"Nb joints "<<skeleton->getNbJoints()<<endl;
for (unsigned int i(0);i<skeleton->getNbJoints();++i)
  {
  ArRef<Joint> joint = skeleton->accessJoint(i);
  cout<<"joint "<<joint->getName()<<endl;
  ArConstRef<Joint> parent = joint->getParent();
  if (parent.valid())
    { cout<<" -> parent is "<<parent->getName()<<endl; }
  else
    { cout<<" -> no parent"<<endl; }

  ArRef<Object3D> object = Object3D::NEW();
  object->setLocation(joint);
  object->attachTo(joint);
  ArRef<Sphere3D> sphere = Sphere3D::NEW();
  sphere->setRadius(0.1);
  ArRef<Shape3D> shape = Shape3D::NEW();
  shape->addRootPart(sphere);
  object->setShape(shape); 
  _objects.push_back(object);
  cout<<"skin New object"<<endl;
  }
}
Beispiel #2
0
KeyOrientation::KeyOrientation(ArCW& arCW, ArRef<C3DOF> c3dof) : Object3D(arCW), _c3dof(c3dof) {
  attachTo(_c3dof);

  //  ArRef<Material3D> mat = new_Material3D();
  ArRef<Material3D> mat = Material3D::NEW();
  mat->setDiffuseColor(0.0, 0.2, 0.8);

  //  _sphere = new_Sphere3D();
  _sphere = Sphere3D::NEW();
  _sphere->setRadius(0.2);
  _sphere->writeMaterial(mat);

  //  ArRef<Shape3D> sh = new_Shape3D();
  ArRef<Shape3D> sh = Shape3D::NEW();
  sh->addRootPart(_sphere);

  setShape(sh);
}