Protogame.BoundingBoxExtensions.ToBoundingBox C# (CSharp) Méthode

ToBoundingBox() public static méthode

Converts the specified XNA rectangle to a Protogame bounding box.
public static ToBoundingBox ( this rectangle ) : IBoundingBox
rectangle this /// The XNA rectangle to convert. ///
Résultat IBoundingBox
        public static IBoundingBox ToBoundingBox(this Rectangle rectangle)
        {
            var bb = new BoundingBox
            {
                Width = rectangle.Width, 
                Height = rectangle.Height
            };
            bb.Transform.Assign(new DefaultTransform { LocalPosition = new Vector3(rectangle.X, rectangle.Y, 0) });
            return bb;
        }