Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How many particles are defined for a given rope ?
#3
(10-11-2021, 10:32 AM)josemendez Wrote: There's not a closed formula that given rope length/resolution returns the number of particles in it, as this also depends on the shape of the rope, and specifically control point placement.

The blueprint is made of catmull-rom curve segments (aka "spans"). Each curve span calculates its own number of particles as:

Code:
particlesInSpan = 1 + Mathf.FloorToInt(spanLength / thickness * resolution);

Then the distance between particles is adjusted as:

Code:
float distance = spanLength / particlesInSpan;

This ensures there's always a particle at each blueprint control point (the point where two consecutive spans meet). However it also causes particle spacing (distance between particles) to vary slightly between spans. You can see the code used in ObiRopeBlueprint.cs, lines 52-82.

let me know if you need further help Sonrisa

thank you it's clearer.
Reply


Messages In This Thread
RE: How many particles are defined for a given rope ? - by lufydad - 10-11-2021, 02:09 PM