Help stutter move - Printable Version +- Obi Official Forum (https://obi.virtualmethodstudio.com/forum) +-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html) +--- Forum: Obi Fluid (https://obi.virtualmethodstudio.com/forum/forum-3.html) +--- Thread: Help stutter move (/thread-2507.html) Pages:
1
2
|
RE: stutter move - josemendez - 23-09-2020 Just to try and understand what you're trying to do: the idea is to have a full screen fluid simulation that can be controlled using the phone's movement, is this right? If so, a much simpler approach is to keep the container static and just set the gravity vector to point in the same direction reported by the phone. Back to the original problem presented: Quote:Here with that code that changes the value once in Update loop: Changing the angular velocity once will have no effect at all. You need to update it every frame, otherwise it is assumed to be zero for a kinematic rigidbody. Quote:In the next video, I'm modifying the angular velocity of the rigidbody with Is kinematic unchecked. As you could see, the fluid looks a bit behind the container but at least there is no stutter bug. Ideally, you'd subscribe to the solver's OnBeginStep event, and modify the rigidbody velocity there, before fluid simulation takes place. That would prevent the fluid from lagging behind the rigidbody (otherwise there's a 1 frame delay introduced). RE: stutter move - julienrobert - 23-09-2020 Oh wow I didn't think about the gravity! Thanks a lot! I owe you a beer! RE: stutter move - josemendez - 23-09-2020 (23-09-2020, 03:18 PM)julienrobert Wrote: Oh wow I didn't think about the gravity! Nice! I love beer Just keep in mind that gravity is expressed in the solver's local space. If your solver is at 0,0,0, zero rotation, unit scale, world and solver space are the same and no conversions will be needed. So you can just do: Code: solver.parameters.gravity = <your gravity> |