Showing the changes to libraries/physics/src/ObjectMotionState.cpp (1 of 3 files). Show all
Unified · Split
| @@ -170,3 +170,16 @@ void ObjectMotionState::removeKinematicController() { · 169 unmodified lines | ||
| 170 | 170 | _kinematicController = NULL; |
| 171 | 171 | } |
| 172 | 172 | } |
| 173 | + | |
| 174 | +void ObjectMotionState::setRigidBody(btRigidBody* body) { | |
| 175 | + // give the body a (void*) back-pointer to this ObjectMotionState | |
| 176 | + if (_body != body) { | |
| 177 | + if (_body) { | |
| 178 | + _body->setUserPointer(NULL); | |
| 179 | + } | |
| 180 | + _body = body; | |
| 181 | + if (_body) { | |
| 182 | + _body->setUserPointer(this); | |
| 183 | + } | |
| 184 | + } | |
| 185 | +} | |