Help Tearing in local space - Printable Version +- Obi Official Forum (https://obi.virtualmethodstudio.com/forum) +-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html) +--- Forum: Obi Cloth (https://obi.virtualmethodstudio.com/forum/forum-2.html) +--- Thread: Help Tearing in local space (/thread-532.html) |
Tearing in local space - jabza - 14-04-2018 Hello, So far ObiCloth has been a breeze to integrate into my project, very happy! However, the current issue I'm facing is with ObiTearableCloth. My solvers are setup to simulate in local space, but as a result projectiles seem to pass straight through my cloth. Switching the solver to world space does fix the issue (cloth tears on impact), but I require local space for my project. For reference, I use the projectiles that are included with the tearable cloth example scene. I spawn the projectiles as a child of the solver, but this appears to make no difference. Please see my ObiSolver below. I've also noticed that substeps seem to reduce, or completely prevent tearing? Any help on this matter would be greatly appreciated. Thanks in advance. RE: Tearing in local space - josemendez - 15-04-2018 (14-04-2018, 09:38 PM)jabza Wrote: Hello, Hi, This is a known limitation: rigidbody forces are ignored when interacting with a cloth in local space. As a result, the cloth can "feel" the rigidbodies you fling at it, but the rigidbodies are not affected by the cloth, thus allowed to pass right trough it (as they do with regular Unity cloth, which is also simulated in local space). Local space cloth is generally only used for character simulation, where this is a non-issue. May I ask why you need tearable cloth in local space? Regarding the question about substeps, note that tearing is implemented as: Code: if (constraint.force > threshold) Tear(); The constraint force is the force that the cloth needs to exert on itself to recover from external deformation. When you use smaller timesteps, the deformation experienced by the cloth in each timestep is smaller and so is the force. You should re-adjust the tearing thresholds. kind regards, RE: Tearing in local space - jabza - 15-04-2018 Thanks for the quick response. I've been using local space as world space produces unwanted movement in the cloth. There doesn't appear to be a 'worldvelocityscale' for world space solvers? My application is sailing simulation, where I am already calculating my own aerodynamic forces. Local space seems like the only option for me to have the most control over the cloth's movement. I should say im fine with projectiles passing through the cloth, the issue is that tears only seemed to occur every so often (unsatisfying). Could the collision not be being detected? But it sounds like I should be reducing the threshold quite a bit. There was two other tearable cloth questions I had: - Is there a way to see how much of the cloth has torn, as a percentage? - Allocated cloth tearing parameter doesn't appear to do anything. I assume a value of 0.25 will only allow a quarter of the cloth to be torn? Much appreciated. RE: Tearing in local space - jabza - 17-04-2018 Bump RE: Tearing in local space - josemendez - 17-04-2018 (15-04-2018, 12:35 PM)jabza Wrote: Thanks for the quick response. No, there's no world velocity scale for world space solvers, as velocities are already expressed in world space. (15-04-2018, 12:35 PM)jabza Wrote: My application is sailing simulation, where I am already calculating my own aerodynamic forces. Local space seems like the only option for me to have the most control over the cloth's movement. I have tested tearing in local space, and it seems to work ok. The only issue is that since cloth is not able to exert forces on the projectile, it passes trough much quicker than in world space. Reducing the tearing threshold somewhat alleviates this. (15-04-2018, 12:35 PM)jabza Wrote: - Is there a way to see how much of the cloth has torn, as a percentage? There's not a built-in way. You could modify the ApplyTearing() method, and count yourself how many edges have been torn, then compare that to the initial amount of edges in the topology. (15-04-2018, 12:35 PM)jabza Wrote: - Allocated cloth tearing parameter doesn't appear to do anything. I assume a value of 0.25 will only allow a quarter of the cloth to be torn? If you are referring to the "Tear Capacity" parameter, it determines the maximum % of the cloth that can be torn. Once that percentage is reached, the cloth won't tear further. |