diff options
Diffstat (limited to 'scene/3d/visibility_notifier.cpp')
-rw-r--r-- | scene/3d/visibility_notifier.cpp | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/scene/3d/visibility_notifier.cpp b/scene/3d/visibility_notifier.cpp index 60097ad482..f3b5cde0eb 100644 --- a/scene/3d/visibility_notifier.cpp +++ b/scene/3d/visibility_notifier.cpp @@ -221,9 +221,6 @@ void VisibilityEnabler::_notification(int p_what){ return; - Node *from = this; - //find where current scene starts - for (Map<Node*,Variant>::Element *E=nodes.front();E;E=E->next()) { if (!visible) @@ -242,17 +239,9 @@ void VisibilityEnabler::_change_node_state(Node* p_node,bool p_enabled) { { RigidBody *rb = p_node->cast_to<RigidBody>(); - if (rb) { - - if (p_enabled) { - RigidBody::Mode mode = RigidBody::Mode(nodes[p_node].operator int()); - //rb->set_mode(mode); - rb->set_sleeping(false); - } else { - //rb->set_mode(RigidBody::MODE_STATIC); - rb->set_sleeping(true); - } - } + if (rb) + + rb->set_sleeping(!p_enabled); } { |