Help Applying custom forces - AddWind or AddParticleExternalForces? - 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 Applying custom forces - AddWind or AddParticleExternalForces? (/thread-535.html) |
Applying custom forces - AddWind or AddParticleExternalForces? - jabza - 16-04-2018 Hi, I'm generating Drag and Lift force vectors that I would like to apply directly, ideally avoiding AerodynamicConstraints. As far as I can tell, there are two ways to apply external forces to particles: Oni.AddWind and Oni.AddParticleExternalForces. I was wondering how these APIs differ, and when each should be used? Finally, for this situation, should I be applying forces differently if UsesCustomExternalForces is set, what exactly does this mean? Much appreciated. RE: Applying custom forces - AddWind or AddParticleExternalForces? - josemendez - 16-04-2018 (16-04-2018, 01:39 PM)jabza Wrote: Hi, Hi there, You should use AddParticleExternalForces(). AddWind() adds wind for each particle (direction and intensity vector), that is used to internally calculate drag and lift forces for all particles in each cloth triangle using the thin airfoil aerodynamic equations. AddParticleExternalForces directly applies a force to each particle. So if you are calculating your own drag/lift forces, you should use it instead of AddWind. UsesCustomExternalForces is deprecated and will be removed in 4.0. For now it sits there to ensure compatibility with old versions. It was used to differentiate between wind and external force, but now two separate methods exist (AddWind and AddParticleExternalForces) so it is no longer used. RE: Applying custom forces - AddWind or AddParticleExternalForces? - jabza - 16-04-2018 (16-04-2018, 02:30 PM)josemendez Wrote: Hi there, Great, thanks for the help. RE: Applying custom forces - AddWind or AddParticleExternalForces? - jabza - 16-04-2018 Just to add to this, does Oni.AddParticleExternalForce apply the force provided evenly accross all particles? IE: If my custom force magnitude is 10, and I have 2 particles, does each particle recieve a force of magnitude 5, or 10? And finally, am I expected to provide my force * Time.fixedDeltaTime, or is the timestep accounted for in Oni? Thanks again! RE: Applying custom forces - AddWind or AddParticleExternalForces? - josemendez - 16-04-2018 (16-04-2018, 08:09 PM)jabza Wrote: Just to add to this, does Oni.AddParticleExternalForce apply the force provided evenly accross all particles? Hi there, Forces always are applied over a given time (usually fixedDeltaTime). You don't need to multiply them by the delta yourself. If they were applied instantly they would not be called forces, but impulses . The force you pass is applied to all particles, it does not get divided by the amount of particles. In your example, both particles would receive a force of 10. |