C# Class Protogame.BoundingBoxExtensions

These extension methods assist with converting between bounding boxes and rectangles.

Protogame's bounding box includes speed attributes, which the built-in MonoGame bounding box does not have.

Mostra file Open project: RedpointGames/Protogame

Public Methods

Method Description
CopyTo ( this rectangle, IBoundingBox boundingBox ) : void

Copies the specified XNA rectangle to the Protogame bounding box.

CopyTo ( this boundingBox, Rectangle rectangle ) : void

Copies the specified Protogame bounding box to the XNA rectangle.

ToBoundingBox ( this rectangle ) : IBoundingBox

Converts the specified XNA rectangle to a Protogame bounding box.

ToProtogame ( this boundingBox ) : IBoundingBox

Converts the specified XNA bounding box to a Protogame bounding box.

ToRectangle ( this boundingBox ) : Rectangle

Converts the specified Protogame bounding box to an XNA rectangle.

ToXna ( this boundingBox ) : Microsoft.Xna.Framework.BoundingBox

Converts the specified Protogame bounding box to an XNA bounding box.

Method Details

CopyTo() public static method

Copies the specified XNA rectangle to the Protogame bounding box.
public static CopyTo ( this rectangle, IBoundingBox boundingBox ) : void
rectangle this /// The XNA rectangle to copy from. ///
boundingBox IBoundingBox /// The Protogame bounding box to copy to. ///
return void

CopyTo() public static method

Copies the specified Protogame bounding box to the XNA rectangle.
public static CopyTo ( this boundingBox, Rectangle rectangle ) : void
boundingBox this /// The Protogame bounding box to copy from. ///
rectangle Microsoft.Xna.Framework.Rectangle /// The XNA rectangle to copy to. ///
return void

ToBoundingBox() public static method

Converts the specified XNA rectangle to a Protogame bounding box.
public static ToBoundingBox ( this rectangle ) : IBoundingBox
rectangle this /// The XNA rectangle to convert. ///
return IBoundingBox

ToProtogame() public static method

Converts the specified XNA bounding box to a Protogame bounding box.
public static ToProtogame ( this boundingBox ) : IBoundingBox
boundingBox this /// The XNA bounding box to convert. ///
return IBoundingBox

ToRectangle() public static method

Converts the specified Protogame bounding box to an XNA rectangle.
public static ToRectangle ( this boundingBox ) : Rectangle
boundingBox this /// The Protogame bounding box to convert. ///
return Microsoft.Xna.Framework.Rectangle

ToXna() public static method

Converts the specified Protogame bounding box to an XNA bounding box.
public static ToXna ( this boundingBox ) : Microsoft.Xna.Framework.BoundingBox
boundingBox this /// The Protogame bounding box to convert. ///
return Microsoft.Xna.Framework.BoundingBox