You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* --modify reset() to not perform redundant object re-placement
After successful scene creation, reset is called, but the objects have all already been placed in their initial positions.
* --fix bindings
Don't expose the boolean in reset to python, should only be consumed from Simulator::reconfigure
Copy file name to clipboardExpand all lines: src/esp/physics/PhysicsManager.h
+16-8Lines changed: 16 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -264,16 +264,24 @@ class PhysicsManager : public std::enable_shared_from_this<PhysicsManager> {
264
264
265
265
/**
266
266
* @brief Reset the simulation and physical world.
267
-
* Sets the @ref worldTime_ to 0.0, changes the physical state of all objects back to their initial states. Only changes motion_type when scene_instance specified a motion type.
268
-
*/
269
-
virtualvoidreset() {
267
+
* Sets the @ref worldTime_ to 0.0, changes the physical
268
+
* state of all objects back to their initial states.
269
+
* Only changes motion_type when scene_instance specified a motion type.
270
+
* @param calledAfterSceneCreate If this is true, this is being called
271
+
* directly after a new scene was created and all the objects were placed
272
+
* appropriately, so bypass object placement reset code.
273
+
*/
274
+
virtualvoidreset(bool calledAfterSceneCreate) {
270
275
// reset object states from initial values (e.g. from scene instance)
271
276
worldTime_ = 0.0;
272
-
for (constauto& bro : existingObjects_) {
273
-
bro.second->resetStateFromSceneInstanceAttr();
274
-
}
275
-
for (constauto& bao : existingArticulatedObjects_) {
276
-
bao.second->resetStateFromSceneInstanceAttr();
277
+
if (!calledAfterSceneCreate) {
278
+
// No need to re-place objects after scene creation
279
+
for (constauto& bro : existingObjects_) {
280
+
bro.second->resetStateFromSceneInstanceAttr();
281
+
}
282
+
for (constauto& bao : existingArticulatedObjects_) {
0 commit comments