IEnumerator Setup() { // Generate particles and add them to solver: yield return(StartCoroutine(rope.GeneratePhysicRepresentationForMesh())); rope.AddToSolver(null); // Fix first and last particle in place: rope.Solver.invMasses[rope.particleIndices[0]] = rope.invMasses[0] = 0; rope.Solver.invMasses[rope.particleIndices[rope.UsedParticles - 1]] = rope.invMasses[rope.UsedParticles - 1] = 0; }
IEnumerator Setup() { // Generate particles and add them to solver: yield return(StartCoroutine(rope.GeneratePhysicRepresentationForMesh())); rope.AddToSolver(null); // Fix first and last particle in place: rope.invMasses[0] = 0; rope.invMasses[rope.UsedParticles - 1] = 0; Oni.SetParticleInverseMasses(solver.OniSolver, new float[] { 0 }, 1, rope.particleIndices[0]); Oni.SetParticleInverseMasses(solver.OniSolver, new float[] { 0 }, 1, rope.particleIndices[rope.UsedParticles - 1]); }