Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rope that can be in water
#3
(09-11-2021, 03:56 PM)josemendez Wrote: Yes, you can add forces to individual particles, and get/set any particle property. See:
http://obi.virtualmethodstudio.com/manua...icles.html

You can also retrieve contact data and make spatial queries such as raycasts, box overlaps, etc:
http://obi.virtualmethodstudio.com/manua...sions.html
http://obi.virtualmethodstudio.com/manua...eries.html

Thanks for your answer, indeed I didn't saw the property externalForces in ObiSolver.

Here is an example :

Code:
for (int i = 0; i < actor.solverIndices.Length; ++i)
{

     // retrieve the particle index in the solver:
     int solverIndex = actor.solverIndices[i];
     
     if(IsUnderWater(actor.solver.positions[solverIndex])
         actor.solver.externalForces[solverIndex] = MyForceForUnderWater;
     else
         actor.solver.externalForces[solverIndex] = MyForceForAboveWater;
}
Reply


Messages In This Thread
Rope that can be in water - by lufydad - 09-11-2021, 03:26 PM
RE: Rope that can be in water - by josemendez - 09-11-2021, 03:56 PM
RE: Rope that can be in water - by lufydad - 09-11-2021, 04:56 PM
RE: Rope that can be in water - by josemendez - 10-11-2021, 10:14 AM
RE: Rope that can be in water - by lufydad - 10-11-2021, 10:22 AM