Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  get position of particles
#2
Hi there!

From the API docs on GetParticlePosition:


Quote:Given a solver particle index, returns the position of that particle in world space.

Parameters:
solverIndex Index of the particle in the solver arrays.

Returns:
The position of a given particle in world space.

Since you're passing the same index to both calls (0), you get the same position, from the same particle.

You should use the following instead:

Code:
Debug.Log(cloth1.GetParticlePosition(cloth1.solverIndices[0]));
Debug.Log(cloth2.GetParticlePosition(cloth2.solverIndices[0]));

Note that particle indices come in two flavors: actor indices and solver indices. The first particle in the actor might be particle 237 (or any other) in the solver, depending on how many actors have been instantiated and in what order.

let me know how it goes!Sonrisa
Reply


Messages In This Thread
get position of particles - by orestissar - 19-02-2021, 10:44 AM
RE: get position of particles - by josemendez - 19-02-2021, 11:08 AM
RE: get position of particles - by orestissar - 19-02-2021, 02:49 PM
RE: get position of particles - by josemendez - 19-02-2021, 03:22 PM
RE: get position of particles - by orestissar - 19-02-2021, 03:52 PM
RE: get position of particles - by josemendez - 19-02-2021, 04:11 PM
RE: get position of particles - by orestissar - 22-02-2021, 02:59 PM