22-12-2020, 09:49 PM
(22-12-2020, 10:16 AM)josemendez Wrote: Hi there,Hi, I tried bu unity crashes at m_SolverImpl.CollisionDetection(stepTime) at line 1396 in obiolver. I could not figure out. I have modified FixedUpdater to run in EditMode.
You can derive from the ObiUpdater class to update Obi whenever you want, including at edit time. See:
http://obi.virtualmethodstudio.com/tutor...aters.html
Also look up ObiUpdater in the API docs:
http://obi.virtualmethodstudio.com/api.html
You'll see it has several methods to advance the simulation: BeginStep, Substep, EndStep, and Interpolate. You can also check the different existing subclasses of ObiUpdater (ObiFixedUpdater, ObiLateUpdater, etc) for examples on how/when to call these methods. The typical pattern would be:
Code:BeginStep();
Substep();
Substep();
.
.
.
Substep();
EndStep();
Interpolate();
So: one call to BeginStep() (performs collision detection and clears up cached data), one or more calls to Substep() (advances simulation), one call to EndStep(); (calls collision callbacks) and one call to Interpolate(); (interpolates physics state and triggers rendering).
cheers!