-
-
Notifications
You must be signed in to change notification settings - Fork 79
Description
How can we, for example, pause the "cloth" simluation in the joints example (the grid of spheres), instantaneously rotate and translate the whole thing, then make it resume as if it had already been in the new position and orientation?
The problem I'm having is it is easy to create node graphs for certain use cases (such as a cloth), but then it is very difficult to transform them after the fact (nodes being suddenly "teleported" make it go haywire).
One solution is to create all bodies up front before physics starts. But the use case I'm after is transforming a body node graph mid-simulation.
For example, imagine in a game editor there's a flag waving in the wind. You click and drag to move it to a new location. While you are dragging, the physics on the bodies is paused. When you let go, the physics resumes exactly as if the flag was already in that new location.
What currently happens is if I transform a parent joint to move the flag, the flag cloth goes haywire. Obviously this is expected because a simple translation of the parent to a distant spot is like making it teleport and the engine is trying to accomodate the new constraints. But even if I translate/rotate all the bodies, it still goes haywire, so I think I am missing something.
What are all the things that need to be updated?
- joint directions? (delete and make new joints?)
- body velocities?
- body/joint angular velocities?
- etc?
Specifically, let's say that we're only transforming the cloth in the joints example.