History

store backpointer to MotionState in btRigidBody

Andrew Meadows committed 11 years ago

Commit 549e3fa1 parent 4112acc3 files · +24 −8Browse files

Showing the changes to libraries/physics/src/ObjectMotionState.cpp (1 of 3 files). Show all

Unified · Split

libraries/physics/src/ObjectMotionState.cpp+13−0
@@ -170,3 +170,16 @@ void ObjectMotionState::removeKinematicController() { · 169 unmodified lines
170 _kinematicController = NULL;170 _kinematicController = NULL;
171 }171 }
172}172}
173
174void 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}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t