Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rope that can be in water
#5
(10-11-2021, 10:14 AM)josemendez Wrote: Hi!

The externalForces array is undocumented on purpose, since it is used internally by Obi's force zones. It's easy to break force zones by tinkering with it: your code overwrites the content of externalForces, so force zones will cease to work. You could fix this by adding the force instead of setting it to a fixed value.

However, generally it's a better idea to apply forces to the velocities array like this:

Code:
actor.solver.velocities[solverIndex] += MyForceForUnderWater * actor.solver.invMasses[solverIndex] * deltaTime;

Since F=ma, and acceleration is a change in velocity over time, your change in velocity is = F/m*dt.

thank you for this clarification, it could indeed be useful Sonrisa
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