Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Trouble with local sim ObiSolver as child of interpolated Rigidbody
#3
(28-08-2018, 06:26 PM)josemendez Wrote: Hi there,

It is just not possible to do what you want.

When you parent the simulation to any transform (it does not matter if it's the RB or any of its children, the way it works is the same), it means the simulation will be performed in whatever space is defined by that transform. Now, in your case the simulation space is itself the result of the simulation.

Now consider what interpolation is, and why it is used in the first place:

- Physics engines consume time in equally sized "chunks".
- Rendering however can happen anytime, so with no interpolation we would see physics in a stop-motion fashion.
- If you want simulated objects to move smoothly every frame, you need to take the simulation results from the latest two physics steps and interpolate them right before rendering.

As you can see, the issue is that interpolation is not performed during the simulation but after it has taken place, right before rendering. By then Obi has already performed simulation using the non-interpolated rigidbody transforms. This is a cyclic dependency: the simulation would need its own result as input.

The closest you can get is by using the LateUpdate solver simulation order. This allows Obi to simulate after Unity's rigodbodies have performed interpolation. This unfortunately is not physically correct, as it will always slightly over or under estimate the timestep.

ThanksĀ for taking the time to write a very detailed response.

Looks like I will have to get creative. One other option I suppose is decreasing the physics timestep, but of course that can only be pushed so far.

UPDATE: Turns out I can do without interpolation! I was using interpolation due to shaky shadows, but it apparently that was due to a very small near plane on my camera... doh.
Reply


Messages In This Thread
RE: Trouble with local sim ObiSolver as child of interpolated Rigidbody - by jabza - 28-08-2018, 08:19 PM