Exemplo n.º 1
0
        public HitTriangle(Vertex3D[] rgv, ItemType itemType, IItem item) : base(itemType, item)
        {
            Rgv = rgv;

            /* NB: due to the swapping of the order of e0 and e1,
             * the vertices must be passed in counterclockwise order
             * (but rendering uses clockwise order!)
             */
            var e0 = Rgv[2].Clone().Sub(Rgv[0]);
            var e1 = Rgv[1].Clone().Sub(Rgv[0]);

            Normal = Vertex3D.CrossProduct(e0, e1);
            Normal.NormalizeSafe();

            Elasticity = 0.3f;
            SetFriction(0.3f);
            Scatter = 0;
        }