本文整理汇总了C++中NodeData::initPrimitive方法的典型用法代码示例。如果您正苦于以下问题:C++ NodeData::initPrimitive方法的具体用法?C++ NodeData::initPrimitive怎么用?C++ NodeData::initPrimitive使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NodeData
的用法示例。
在下文中一共展示了NodeData::initPrimitive方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: resultPtr
std::shared_ptr<NodeData> EnvirePhysics::getInertialNode(const smurf::Inertial& inertial, const envire::core::FrameId& frame)
{
NodeData * result = new NodeData;
std::shared_ptr<NodeData> resultPtr(result);
urdf::Inertial inertialUrdf = inertial.getUrdfInertial();
result->init(inertial.getName());
result->initPrimitive(mars::interfaces::NODE_TYPE_SPHERE, mars::utils::Vector(0.1, 0.1, 0.1), inertialUrdf.mass);
result->groupID = inertial.getGroupId();
result->movable = true;
result->inertia[0][0] = inertialUrdf.ixx;
result->inertia[0][1] = inertialUrdf.ixy;
result->inertia[0][2] = inertialUrdf.ixz;
result->inertia[1][0] = inertialUrdf.ixy;
result->inertia[1][1] = inertialUrdf.iyy;
result->inertia[1][2] = inertialUrdf.iyz;
result->inertia[2][0] = inertialUrdf.ixz;
result->inertia[2][1] = inertialUrdf.iyz;
result->inertia[2][2] = inertialUrdf.izz;
result->inertia_set = true;
result->c_params.coll_bitmask = 0;
#ifdef DEBUG
LOG_DEBUG("[EnvirePhysics::getInertialNode] Inertial object's mass: %f", result->mass);
#endif
result->density = 0.0;
setPos(frame, resultPtr);
return resultPtr;
}
示例2: addFloor
void EnvireSmurfLoader::addFloor(const vertex_descriptor ¢er)
{
NodeData data;
data.init("floorData", Vector(0,0,0));
data.initPrimitive(interfaces::NODE_TYPE_BOX, Vector(25, 25, 0.1), 0.0001);
data.movable = false;
mars::sim::PhysicsConfigMapItem::Ptr item(new mars::sim::PhysicsConfigMapItem);
data.material.transparency = 0.5;
//data.material.ambientFront = mars::utils::Color(0.0, 1.0, 0.0, 1.0);
// TODO Fix the material data is lost in the conversion from/to configmap
data.material.emissionFront = mars::utils::Color(1.0, 1.0, 1.0, 1.0);
LOG_DEBUG("Color of the Item in the addFloor: %f , %f, %f, %f", data.material.emissionFront.a , data.material.emissionFront.b, data.material.emissionFront.g, data.material.emissionFront.r );
data.toConfigMap(&(item.get()->getData()));
control->graph->addItemToFrame(control->graph->getFrameId(center), item);
}