C# Class fCraft.BoundingBox

Defines a 3D bounding box, in integer cartesian coordinates
显示文件 Open project: fragmer/fCraft Class Usage Examples

Public Properties

Property Type Description
Empty BoundingBox
XMin int

Public Methods

Method Description
BoundingBox ( Position p1, Position p2 ) : System
BoundingBox ( Position pos, int widthX, int widthY, int height ) : System
BoundingBox ( System.Xml.Linq.XElement root ) : System
BoundingBox ( int x1, int y1, int h1, int x2, int y2, int h2 ) : System
Contains ( BoundingBox other ) : bool

Checks if another bounding box is wholly contained inside this one.

Contains ( int x, int y, int h ) : bool

Checks if a given point is inside this bounding box.

GetIntersection ( BoundingBox other ) : BoundingBox

Returns a BoundingBox object that describes the space shared between this and another box. Returns BoundingBox.Empty if there is no intersection.

Insersects ( BoundingBox other ) : bool

Checks whether this bounding box intersects/touches another one.

Serialize ( ) : System.Xml.Linq.XElement
Serialize ( string customElementName ) : System.Xml.Linq.XElement

Method Details

BoundingBox() public method

public BoundingBox ( Position p1, Position p2 ) : System
p1 Position
p2 Position
return System

BoundingBox() public method

public BoundingBox ( Position pos, int widthX, int widthY, int height ) : System
pos Position
widthX int
widthY int
height int
return System

BoundingBox() public method

public BoundingBox ( System.Xml.Linq.XElement root ) : System
root System.Xml.Linq.XElement
return System

BoundingBox() public method

public BoundingBox ( int x1, int y1, int h1, int x2, int y2, int h2 ) : System
x1 int
y1 int
h1 int
x2 int
y2 int
h2 int
return System

Contains() public method

Checks if another bounding box is wholly contained inside this one.
public Contains ( BoundingBox other ) : bool
other BoundingBox
return bool

Contains() public method

Checks if a given point is inside this bounding box.
public Contains ( int x, int y, int h ) : bool
x int
y int
h int
return bool

GetIntersection() public method

Returns a BoundingBox object that describes the space shared between this and another box. Returns BoundingBox.Empty if there is no intersection.
public GetIntersection ( BoundingBox other ) : BoundingBox
other BoundingBox
return BoundingBox

Insersects() public method

Checks whether this bounding box intersects/touches another one.
public Insersects ( BoundingBox other ) : bool
other BoundingBox
return bool

Serialize() public method

public Serialize ( ) : System.Xml.Linq.XElement
return System.Xml.Linq.XElement

Serialize() public method

public Serialize ( string customElementName ) : System.Xml.Linq.XElement
customElementName string
return System.Xml.Linq.XElement

Property Details

Empty public_oe static_oe property

public static BoundingBox,fCraft Empty
return BoundingBox

XMin public_oe property

public int XMin
return int