本文整理汇总了C++中BodyNode::getVisualizationShape方法的典型用法代码示例。如果您正苦于以下问题:C++ BodyNode::getVisualizationShape方法的具体用法?C++ BodyNode::getVisualizationShape怎么用?C++ BodyNode::getVisualizationShape使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BodyNode
的用法示例。
在下文中一共展示了BodyNode::getVisualizationShape方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: timeStepping
void timeStepping() override
{
mController->clearForces();
// Lesson 3
mController->addSPDForces();
// Lesson 4
mController->addAnkleStrategyForces();
// Lesson 6
mController->setWheelCommands();
// Apply body forces based on user input, and color the body shape red
if(mForceCountDown > 0)
{
BodyNode* bn = mWorld->getSkeleton("biped")->getBodyNode("h_abdomen");
const ShapePtr& shape = bn->getVisualizationShape(0);
shape->setColor(dart::Color::Red());
if(mPositiveSign)
bn->addExtForce(default_force * Eigen::Vector3d::UnitX(),
bn->getCOM(), false, false);
else
bn->addExtForce(-default_force*Eigen::Vector3d::UnitX(),
bn->getCOM(), false, false);
--mForceCountDown;
}
// Step the simulation forward
SimWindow::timeStepping();
}
示例2: setAllColors
void setAllColors(const SkeletonPtr& object, const Eigen::Vector3d& color)
{
// Set the color of all the shapes in the object
for(size_t i=0; i < object->getNumBodyNodes(); ++i)
{
BodyNode* bn = object->getBodyNode(i);
for(size_t j=0; j < bn->getNumVisualizationShapes(); ++j)
bn->getVisualizationShape(j)->setColor(color);
}
}
示例3: createHubo
SkeletonPtr createHubo()
{
dart::utils::DartLoader loader;
loader.addPackageDirectory("drchubo", DART_DATA_PATH"/urdf/drchubo");
SkeletonPtr hubo =
loader.parseSkeleton(DART_DATA_PATH"/urdf/drchubo/drchubo.urdf");
for(size_t i = 0; i < hubo->getNumBodyNodes(); ++i)
{
BodyNode* bn = hubo->getBodyNode(i);
if(bn->getName().substr(0, 7) == "Body_LF"
|| bn->getName().substr(0, 7) == "Body_RF"
|| bn->getName().substr(0, 7) == "Body_NK")
{
bn->remove();
--i;
}
}
hubo->setPosition(5, 0.97);
for(size_t i=1; i < hubo->getNumJoints(); ++i)
{
hubo->getJoint(i)->setActuatorType(Joint::VELOCITY);
}
for(size_t i=0; i < hubo->getNumBodyNodes(); ++i)
{
BodyNode* bn = hubo->getBodyNode(i);
for(size_t j=0; j < bn->getNumVisualizationShapes(); ++j)
{
const ShapePtr& shape = bn->getVisualizationShape(j);
shape->setColor(Eigen::Vector3d(0.2, 0.2, 0.2));
if(MeshShapePtr mesh = std::dynamic_pointer_cast<MeshShape>(shape))
mesh->setColorMode(MeshShape::SHAPE_COLOR);
}
}
hubo->setName("drchubo");
return hubo;
}