Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to read out stretch
#3
Pregunta 
Thanks for your help, that sounds nice, the rough estimation would be totally sufficient for me. The cloth mesh is not tooo huge as well (ConstrainCount is 620). Maybe I could even skip every other Particle to optimize or so.
BUT.. the moment I divide distance / distanceBatch.restLengths[i] I get NaN!  Huh
So the final result is also NaN. Is this some weird floating point precision problem?


Also I am not sure about the GetParticlePosition ? Is it correct using it with cloth and the dot operator? It gave me red squigglies when I had it directly like in your example...

Code:
  float distance = Vector3.Distance(cloth.GetParticlePosition(distanceBatch.springIndices[i * 2]),
                                              cloth.GetParticlePosition(distanceBatch.springIndices[i * 2 + 1]));

Thank you!
J



Aha, it appears there are a few zeros in the distanceBath.restLengths. Checking and adding 0f instead seems to do the trick. Thanks again!
Reply


Messages In This Thread
How to read out stretch - by mbbmbbmm - 05-11-2017, 02:44 PM
RE: How to read out stretch - by josemendez - 05-11-2017, 03:34 PM
RE: How to read out stretch - by mbbmbbmm - 05-11-2017, 04:53 PM
RE: How to read out stretch - by josemendez - 05-11-2017, 05:41 PM