コード例 #1
0
        //find particle index
        public int FindIndex(List <MonoParticle> list, MonoParticle mp)
        {
            var index = 0;

            for (var i = 0; i < list.Count; i++)
            {
                if (list[i] != mp)
                {
                    continue;
                }
                index = i;
                break;
            }
            return(index);
        }
コード例 #2
0
ファイル: Triangle.cs プロジェクト: brockbarlow/Physics
        public SpringDamper Sd1, Sd2, Sd3;                                            //springdamper triangle objects
                                                                                      //TP1_P2, TP2_P3, TP3_P1

        public Triangle(MonoParticle mpOne, MonoParticle mpTwo, MonoParticle mpThree) //custom constructor
        {
            Tp1 = mpOne.Particle;                                                     //first triangle object equals monoparticle object mpone
            Tp2 = mpTwo.Particle;                                                     //second triangle object equals monoparticle object mptwo
            Tp3 = mpThree.Particle;                                                   //thrid triangel object equals monoparticle object three
        }