本文整理汇总了C++中LODNode::updateAbsolutePosition方法的典型用法代码示例。如果您正苦于以下问题:C++ LODNode::updateAbsolutePosition方法的具体用法?C++ LODNode::updateAbsolutePosition怎么用?C++ LODNode::updateAbsolutePosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LODNode
的用法示例。
在下文中一共展示了LODNode::updateAbsolutePosition方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: init
//.........这里部分代码省略.........
{
break;
}
}
}
}
// If at least one material is colorizable, add RenderInfo for it
if (colorized != NULL)
{
const float hue = colorized->getRandomHue();
if (hue > 0.0f)
{
m_render_info = std::make_shared<RenderInfo>(hue);
}
}
}
#endif
scene::ISceneNode *glownode = NULL;
bool is_movable = false;
if (lod_instance)
{
m_type = "lod";
TrackObjectPresentationLOD* lod_node =
new TrackObjectPresentationLOD(xml_node, parent, model_def_loader, m_render_info);
m_presentation = lod_node;
LODNode* node = (LODNode*)lod_node->getNode();
if (type == "movable" && parent != NULL)
{
// HACK: unparent movables from their parent library object if any,
// because bullet provides absolute transforms, not transforms relative
// to the parent object
node->updateAbsolutePosition();
core::matrix4 absTransform = node->getAbsoluteTransformation();
node->setParent(irr_driver->getSceneManager()->getRootSceneNode());
node->setPosition(absTransform.getTranslation());
node->setRotation(absTransform.getRotationDegrees());
node->setScale(absTransform.getScale());
}
glownode = node->getAllNodes()[0];
}
else
{
m_type = "mesh";
m_presentation = new TrackObjectPresentationMesh(xml_node,
m_enabled,
parent,
m_render_info);
scene::ISceneNode* node = ((TrackObjectPresentationMesh *)m_presentation)->getNode();
if (type == "movable" && parent != NULL)
{
// HACK: unparent movables from their parent library object if any,
// because bullet provides absolute transforms, not transforms relative
// to the parent object
node->updateAbsolutePosition();
core::matrix4 absTransform = node->getAbsoluteTransformation();
node->setParent(irr_driver->getSceneManager()->getRootSceneNode());
node->setPosition(absTransform.getTranslation());
// Doesn't seem necessary to set rotation here, TODO: not sure why
//node->setRotation(absTransform.getRotationDegrees());
node->setScale(absTransform.getScale());
is_movable = true;
}
示例2: init
//.........这里部分代码省略.........
}
else if (type == "action-trigger")
{
std::string action;
xml_node.get("action", &action);
m_name = action; //adds action as name so that it can be found by using getName()
m_presentation = new TrackObjectPresentationActionTrigger(xml_node);
}
else if (type == "billboard")
{
m_presentation = new TrackObjectPresentationBillboard(xml_node, parent);
}
else if (type=="cutscene_camera")
{
m_presentation = new TrackObjectPresentationEmpty(xml_node);
}
else
{
scene::ISceneNode *glownode = NULL;
bool is_movable = false;
if (lod_instance)
{
m_type = "lod";
TrackObjectPresentationLOD* lod_node =
new TrackObjectPresentationLOD(xml_node, parent, model_def_loader);
m_presentation = lod_node;
LODNode* node = (LODNode*)lod_node->getNode();
if (type == "movable" && parent != NULL)
{
// HACK: unparent movables from their parent library object if any,
// because bullet provides absolute transforms, not transforms relative
// to the parent object
node->updateAbsolutePosition();
core::matrix4 absTransform = node->getAbsoluteTransformation();
node->setParent(irr_driver->getSceneManager()->getRootSceneNode());
node->setPosition(absTransform.getTranslation());
node->setRotation(absTransform.getRotationDegrees());
node->setScale(absTransform.getScale());
}
glownode = node->getAllNodes()[0];
}
else
{
m_type = "mesh";
m_presentation = new TrackObjectPresentationMesh(xml_node,
m_enabled,
parent);
scene::ISceneNode* node = ((TrackObjectPresentationMesh *)m_presentation)->getNode();
if (type == "movable" && parent != NULL)
{
// HACK: unparent movables from their parent library object if any,
// because bullet provides absolute transforms, not transforms relative
// to the parent object
node->updateAbsolutePosition();
core::matrix4 absTransform = node->getAbsoluteTransformation();
node->setParent(irr_driver->getSceneManager()->getRootSceneNode());
node->setPosition(absTransform.getTranslation());
node->setRotation(absTransform.getRotationDegrees());
node->setScale(absTransform.getScale());
is_movable = true;
}
glownode = node;
}