Example #1
0
        public void GetTriangleBoundingBox(int triangleIndex, ref BoundingBox boundingBox)
        {
            boundingBox = BoundingBox.CreateInvalid();
            Vector3 v1, v2, v3;

            GetVertex(Triangles[triangleIndex].I0, Triangles[triangleIndex].I1, Triangles[triangleIndex].I2, out v1, out v2, out v3);

            boundingBox.Include(
                v1,
                v2,
                v3);
        }
Example #2
0
        void IPrimitiveManagerBase.GetPrimitiveBox(int prim_index, out AABB primbox)
        {
            BoundingBox bbox = BoundingBox.CreateInvalid();
            Vector3     v1   = GetVertex(Triangles[prim_index].I0);
            Vector3     v2   = GetVertex(Triangles[prim_index].I1);
            Vector3     v3   = GetVertex(Triangles[prim_index].I2);

            bbox.Include(
                ref v1,
                ref v2,
                ref v3);

            primbox = new AABB()
            {
                m_min = bbox.Min.ToBullet(), m_max = bbox.Max.ToBullet()
            };
        }
Example #3
0
        public void GetTriangleBoundingBox(int triangleIndex, ref BoundingBox boundingBox)
        {
            boundingBox = BoundingBox.CreateInvalid();
            Vector3 v1, v2, v3;
            GetVertex(Triangles[triangleIndex].I0, Triangles[triangleIndex].I1, Triangles[triangleIndex].I2, out v1, out v2, out v3);

            boundingBox.Include(
                v1,
                v2,
                v3);
        }