Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Manual tearing via cript
#3
Dedo arriba 
(09-10-2017, 11:32 AM)niZmo Wrote: All you have to do is call Tear(constaintIndex) on the rope script. Constraints are in between the particles, so if your rope has particles 0-20 the constraint indices will be 0-19. I found that the rope don’t like to be cut at 0 nore the last constraint. I get an out of range error when cutting the last constraint. Could be other code of mine messing it up, but just a heads up. Also make sure you have particles in your pool. Each cut needs one extra particle.

This. I couldn't have explained it better.

We should probably be checking that the range is correct inside Tear(), since tearing a constraint splits one of the particles at its ends: which one? the one with more mass, or a random one if both have the same. Torn particles (the original one and the new one added at the cut) then have their mass halved.

 In the edges of the rope of course, this can cause a cut to attempt to create an additional particle at the very beginning/end of the rope, which is illegal. We check for this whenever we use Tear() inside Obi, but it being a public function we should really perform the check inside of it. 

Thanks for pointing it out niZmo.
Reply


Messages In This Thread
Manual tearing via cript - by Kalidor - 09-10-2017, 10:29 AM
RE: Manual tearing via cript - by niZmo - 09-10-2017, 11:32 AM
RE: Manual tearing via cript - by josemendez - 09-10-2017, 02:13 PM
RE: Manual tearing via cript - by ctalDai - 31-07-2019, 06:48 AM
RE: Manual tearing via cript - by Kalidor - 10-10-2017, 09:56 AM
RE: Manual tearing via cript - by josemendez - 10-10-2017, 10:28 AM
RE: Manual tearing via cript - by Kalidor - 10-10-2017, 11:51 AM
RE: Manual tearing via cript - by josemendez - 10-10-2017, 03:14 PM
RE: Manual tearing via cript - by Kalidor - 10-10-2017, 03:44 PM
RE: Manual tearing via cript - by x-lab - 19-10-2017, 11:12 AM
RE: Manual tearing via cript - by josemendez - 19-10-2017, 11:43 AM
RE: Manual tearing via cript - by x-lab - 19-10-2017, 12:13 PM
RE: Manual tearing via cript - by josemendez - 19-10-2017, 01:09 PM
RE: Manual tearing via cript - by x-lab - 19-10-2017, 03:34 PM
RE: Manual tearing via cript - by josemendez - 19-10-2017, 04:13 PM
RE: Manual tearing via cript - by x-lab - 20-10-2017, 11:14 AM
RE: Manual tearing via cript - by josemendez - 20-10-2017, 11:58 AM
RE: Manual tearing via cript - by Sether - 15-01-2020, 04:09 PM
RE: Manual tearing via cript - by josemendez - 16-01-2020, 04:32 PM
RE: Manual tearing via cript - by Sether - 17-01-2020, 10:10 AM
RE: Manual tearing via cript - by zakur0 - 16-01-2020, 01:22 PM
RE: Manual tearing via cript - by josemendez - 16-01-2020, 04:37 PM