示例#1
0
 public void Init(Verlet[] vs)
 {
     vertices = vs;
     Lengths = new float[vs.Length, vs.Length];
     for (int i = 0; i < vs.Length; i++)
     {
         for (int j = 0; j < vs.Length; j++)
         {
             Lengths[i, j] = Vector3.Distance(vs[i].Pos, vs[j].Pos);
         }
     }
 }
示例#2
0
        public Boat()
        {
            float L = 2, W = 1, H = 1, D = 0.5f;
            var   vs = new Verlet[]
            {
                new Verlet(L, 0, W),
                new Verlet(L, 0, -W),
                new Verlet(-L, 0, -W),
                new Verlet(-L, 0, W),
                new Verlet(0, H, 0),
                new Verlet(-L, -D, 0)
            };

            Init(vs);
        }
示例#3
0
        public Boat()
        {
            float L = 2, W = 1, H = 1, D = 0.5f;
            var vs = new Verlet[]
            {
                new Verlet(L,0,W),
                new Verlet(L,0,-W),
                new Verlet(-L,0,-W),
                new Verlet(-L,0, W),
                new Verlet(0,H,0),
                new Verlet(-L,-D,0)

            };
            Init(vs);
        }