| 79 | } |
| 80 | |
| 81 | void Scb::ObjectTracker::scheduleForRemove(Scb::Base& element) |
| 82 | { |
| 83 | ControlState::Enum state = element.getControlState(); |
| 84 | PxU32 flags = element.getControlFlags(); |
| 85 | |
| 86 | PX_ASSERT(!(flags & ControlFlag::eIS_RELEASED)); |
| 87 | |
| 88 | if(state == ControlState::eINSERT_PENDING) |
| 89 | { |
| 90 | // if it's inserted this frame, just remove it - it can't be dirty |
| 91 | //ML: this assert wont' work because buffered insert raises this flag. We have a unit test which called TEST_F(ObserverTest, OnRelease) to verify it |
| 92 | //PX_ASSERT(!(flags & ControlFlag::eIS_UPDATED)); |
| 93 | element.setControlState(ControlState::eNOT_IN_SCENE); |
| 94 | remove(element); |
| 95 | } |
| 96 | else if(state == ControlState::eIN_SCENE) |
| 97 | { |
| 98 | element.setControlState(ControlState::eREMOVE_PENDING); |
| 99 | if(!(flags & ControlFlag::eIS_UPDATED)) |
| 100 | insert(element); |
| 101 | } |
| 102 | else |
| 103 | { |
| 104 | PX_ALWAYS_ASSERT_MESSAGE("Trying to remove element not in scene."); |
| 105 | } |
| 106 | } |
| 107 | |
| 108 | void Scb::ObjectTracker::scheduleForUpdate(Scb::Base& element) |
| 109 | { |
no test coverage detected