BEPUphysics.CollisionShapes.ConvexShapes.TriangleShape.GetBoundingBox C# (CSharp) Метод

GetBoundingBox() публичный Метод

Gets the bounding box of the shape given a transform.
public GetBoundingBox ( RigidTransform &shapeTransform, BEPUutilities.BoundingBox &boundingBox ) : void
shapeTransform BEPUutilities.RigidTransform Transform to use.
boundingBox BEPUutilities.BoundingBox Bounding box of the transformed shape.
Результат void
        public override void GetBoundingBox(ref RigidTransform shapeTransform, out BoundingBox boundingBox)
        {
            Vector3 a, b, c;

            Vector3.Transform(ref vA, ref shapeTransform.Orientation, out a);
            Vector3.Transform(ref vB, ref shapeTransform.Orientation, out b);
            Vector3.Transform(ref vC, ref shapeTransform.Orientation, out c);

            Vector3.Min(ref a, ref b, out boundingBox.Min);
            Vector3.Min(ref c, ref boundingBox.Min, out boundingBox.Min);

            Vector3.Max(ref a, ref b, out boundingBox.Max);
            Vector3.Max(ref c, ref boundingBox.Max, out boundingBox.Max);

            boundingBox.Min.X += shapeTransform.Position.X - collisionMargin;
            boundingBox.Min.Y += shapeTransform.Position.Y - collisionMargin;
            boundingBox.Min.Z += shapeTransform.Position.Z - collisionMargin;
            boundingBox.Max.X += shapeTransform.Position.X + collisionMargin;
            boundingBox.Max.Y += shapeTransform.Position.Y + collisionMargin;
            boundingBox.Max.Z += shapeTransform.Position.Z + collisionMargin;
        }