コード例 #1
0
ファイル: ObiRopeHelper.cs プロジェクト: 17cuA/Docking_Game
        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;
        }
コード例 #2
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]);
        }