More fixes on intially hidden objects
This commit is contained in:
parent
403d61e754
commit
8119b59af0
@ -329,17 +329,11 @@ void TrackObject::reset()
|
|||||||
*/
|
*/
|
||||||
void TrackObject::setEnabled(bool enabled)
|
void TrackObject::setEnabled(bool enabled)
|
||||||
{
|
{
|
||||||
//if (m_enabled == enabled)
|
|
||||||
// return;
|
|
||||||
|
|
||||||
m_enabled = enabled;
|
m_enabled = enabled;
|
||||||
|
|
||||||
if (m_presentation != NULL)
|
if (m_presentation != NULL)
|
||||||
m_presentation->setEnable(m_enabled);
|
m_presentation->setEnable(m_enabled);
|
||||||
|
|
||||||
//if (enabled)
|
|
||||||
// reset();
|
|
||||||
|
|
||||||
if (getType() == "mesh")
|
if (getType() == "mesh")
|
||||||
{
|
{
|
||||||
if (m_physical_object != NULL)
|
if (m_physical_object != NULL)
|
||||||
@ -361,7 +355,26 @@ void TrackObject::setEnabled(bool enabled)
|
|||||||
|
|
||||||
void TrackObject::resetEnabled()
|
void TrackObject::resetEnabled()
|
||||||
{
|
{
|
||||||
setEnabled(m_initially_visible);
|
m_enabled = m_initially_visible;
|
||||||
|
|
||||||
|
if (m_presentation != NULL)
|
||||||
|
m_presentation->setEnable(m_initially_visible);
|
||||||
|
|
||||||
|
if (getType() == "mesh")
|
||||||
|
{
|
||||||
|
if (m_physical_object != NULL)
|
||||||
|
{
|
||||||
|
if (m_initially_visible)
|
||||||
|
m_physical_object->addBody();
|
||||||
|
else
|
||||||
|
m_physical_object->removeBody();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < m_movable_children.size(); i++)
|
||||||
|
{
|
||||||
|
m_movable_children[i]->resetEnabled();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user