Esempio n. 1
0
        /**
         * @return punto centrale dell'AABB
         */
        public Vec3 Center()
        {
            Vec3 res = min.Add(max);

            res = res.Mult(0.5f);
            return(res);
        }
Esempio n. 2
0
        public void UpdatePosition(float dt)
        {
            Vec3 acc = new Vec3(Force.X, Force.Y, Force.Z);

            acc.Normalize();
            acc = acc.Mult(Force.W);
            acc = new Vec3(acc.Mult(Mass));

            var pNext = new List <Vec3> ();

            for (var i = 0; i < VertexNow.Count; i++)
            {
                var pNow = VertexNow [i];
                var pOld = VertexOld [i];
                pNext.Add(pNow * 2 - pOld + acc * dt * dt);
            }
            VertexOld = VertexNow;
            VertexNow = pNext;
        }
        public void UpdatePosition(float dt)
        {
            Vec3 acc = new Vec3 (Force.X, Force.Y, Force.Z);
            acc.Normalize();
            acc = acc.Mult(Force.W);
            acc = new Vec3(acc.Mult (Mass));

            var pNext = new List<Vec3> ();
            for (var i = 0; i<VertexNow.Count; i++) {
                var pNow = VertexNow [i];
                var pOld = VertexOld [i];
                pNext.Add (pNow * 2 - pOld + acc * dt*dt);
            }
            VertexOld = VertexNow;
            VertexNow = pNext;
        }