/// <summary>
 ///     Crear triangulo.
 ///     Calcula su plano y BoundingSphere
 /// </summary>
 public Triangle(Vector3 a, Vector3 b, Vector3 c)
 {
     A              = a;
     B              = b;
     C              = c;
     Plane          = Plane.FromPoints(a, b, c);
     BoundingSphere = TgcBoundingSphere.computeFromPoints(new[] { a, b, c }).toClass();
 }
Exemple #2
0
        /// <summary>
        ///     Crear Collider a partir de BoundingBox.
        ///     Crea el BoundingSphere del Collider.
        /// </summary>
        /// <param name="mesh">BoundingBox</param>
        /// <returns>Collider creado</returns>
        public static BoundingBoxCollider fromBoundingBox(TgcBoundingAxisAlignBox aabb)
        {
            var collider = new BoundingBoxCollider();

            collider.Aabb           = aabb;
            collider.BoundingSphere = TgcBoundingSphere.computeFromPoints(aabb.computeCorners()).toClass();
            return(collider);
        }
Exemple #3
0
 /// <summary>
 /// Crear triangulo.
 /// Calcula su plano y BoundingSphere
 /// </summary>
 public Triangle(Vector3 a, Vector3 b, Vector3 c)
 {
     this.a              = a;
     this.b              = b;
     this.c              = c;
     this.plane          = Plane.FromPoints(a, b, c);
     this.boundingSphere = TgcBoundingSphere.computeFromPoints(new Vector3[] { a, b, c }).toClass();
 }