Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Custom Gravity
#2
(10-02-2022, 10:52 AM)Sphax Wrote: I would like to know if anything is documented regarding the implementation of custom gravity for Obi Rope and Obi Soft Body.

Is there a way to apply a gravity force to each particle of a rope or a soft body? Or at least a way to apply a force to the whole object?

It looks like I can't find anything regarding that on the documentation.

Hi,

You can apply any external forces to each individual particle by writing into solver.externalForces, or solver.velocities if you want custom accelerations instead. The particles API is really powerful, you can get or set any particle property at any time by simply accessing an array. See:
http://obi.virtualmethodstudio.com/manua...icles.html

For an example of applying custom gravity to all particles within a trigger collider, see:
http://obi.virtualmethodstudio.com/manua...sions.html

You can also apply forces to the whole object, by using actor.AddForce(). See the ObiActor class API docs for details:
http://obi.virtualmethodstudio.com/api.html
Reply


Messages In This Thread
Custom Gravity - by Sphax - 10-02-2022, 10:52 AM
RE: Custom Gravity - by josemendez - 10-02-2022, 11:04 AM