Improve a bit more movable objects in library

This commit is contained in:
Marianne Gagnon 2014-07-04 19:59:22 -04:00
parent 41c47e59be
commit 3f8bff33f3

View File

@ -96,11 +96,19 @@ const core::vector3df& TrackObjectPresentationSceneNode::getScale() const
void TrackObjectPresentationSceneNode::move(const core::vector3df& xyz, const core::vector3df& hpr,
const core::vector3df& scale)
const core::vector3df& scale)
{
if (m_node == NULL) return;
m_node->setPosition(xyz);
if (m_node->getParent() != NULL)
{
scene::ISceneNode* parent = m_node->getParent();
m_node->setPosition(xyz - parent->getAbsolutePosition());
}
else
{
m_node->setPosition(xyz);
}
m_node->setRotation(hpr);
m_node->setScale(scale);
m_node->updateAbsolutePosition();