本文整理汇总了C++中ArRef::addRootPart方法的典型用法代码示例。如果您正苦于以下问题:C++ ArRef::addRootPart方法的具体用法?C++ ArRef::addRootPart怎么用?C++ ArRef::addRootPart使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArRef
的用法示例。
在下文中一共展示了ArRef::addRootPart方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
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;
}
}
示例2: attachTo
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);
}