23-08-2019, 07:17 AM
(This post was last modified: 23-08-2019, 07:18 AM by josemendez.)
(22-08-2019, 06:13 PM)cubrman Wrote: Listen, I've just inserted the flipping code into ObiSolver.SimmulateStep(). It flips a GameObject into normal position just before the simulation and then flipps it back again at the end of the method. This did not help. And I am not talking about inverted normals - if they were the only issue, I would have flipped them in the shader by now - the problem is that the cloth kinda starts ignoring the colliders when flipped, even when I added the pre-flipping code. So I have a simple question: can I somehow ensure that the cloth can see the colliders (e.g. simmulate exactly like for the non-flipped cloth)? I have a very strong feeling that your suggestion to insert the flipping code into WaitForFixedUpdate() (meaning into the SimmulateStep()) was not the right one and you are omitting something. I have a strong suspission that I need to do something else to ensure that my GameObject is not flipped before the simulation, maybe change some variable? Btw, the Solver is sitting on a GameObject that itself gets flipped, maybe I should move it up the hierarchy so that it does not get flipped?
Hi,
Well, if you perform flipping every frame in WaitForFixedUpdate(), your mesh is not flipped before the simulation. WaitForFixedUpdate happens right after all objects have had all FixedUpdate() calls executed, so by then simulation is done.
Keep in mind that most colliders do not support negative scaling. This is because there must be a consistent inside/outside for collisions to be efficient. So if you're flipping your character colliders you must do so together with the cloth mesh.