C# Class Glare.Box2

A two-dimensional box that uses Length elements.
ファイルを表示 Open project: Burton-Radons/Alexandria Class Usage Examples

Public Properties

Property Type Description
Max System.Vector2
Min System.Vector2
Zero Box2

Public Methods

Method Description
Box2 ( Length minX, Length minY, Length maxX, Length maxY ) : System

Create a Box2 by providing minimum and maximum extents.

Box2 ( System.Vector2 min, System.Vector2 max ) : System

Create a Box2 by providing minimum and maximum extents.

Distance ( System.Vector2 point ) : Length

Get the closest distance between this Box2 and the Vector2.

Intersect ( System.Vector2 point ) : Containment

Get the intersection type between this box and the point.

NearestPointTo ( System.Vector2 point ) : System.Vector2

Get the nearest point between this Box2 and a Vector2. If the Vector2 is inside this Box2, it is returned untouched.

NearestPointTo ( System.Vector2 &point, System.Vector2 &result ) : void

Get the nearest point between this Box2 and a Vector2. If the Vector2 is inside this Box2, it is returned untouched.

Overlaps ( System.Vector2 point ) : bool

Get whether this Box2 inclusively intersects with the Vector2.

Random ( Random rng ) : System.Vector2

Get a random position within the box.

Random ( Random rng, System.Vector2 &result ) : void

Get a random position within the box.

Relative ( Length minX, Length minY, Length sizeX, Length sizeY ) : Box2

Create a Box2 by providing the minimum extent and the size of each side.

Relative ( System.Vector2 min, System.Vector2 size ) : Box2

Create a Box2 by providing the minimum extent and the size of each side.

Relative ( Length minX, Length minY, Length sizeX, Length sizeY, Box2 &result ) : void

Create a Box2 by providing the minimum extent and the size of each side.

Relative ( System.Vector2 min, System.Vector2 size, Box2 &result ) : void

Create a Box2 by providing the minimum extent and the size of each side.

ToString ( ) : string

Convert to a string representation of the Box2.

ToString ( string format, IFormatProvider provider ) : string

Convert to a string representation of the Box2.

Method Details

Box2() public method

Create a Box2 by providing minimum and maximum extents.
public Box2 ( Length minX, Length minY, Length maxX, Length maxY ) : System
minX Length
minY Length
maxX Length
maxY Length
return System

Box2() public method

Create a Box2 by providing minimum and maximum extents.
public Box2 ( System.Vector2 min, System.Vector2 max ) : System
min System.Vector2
max System.Vector2
return System

Distance() public method

Get the closest distance between this Box2 and the Vector2.
public Distance ( System.Vector2 point ) : Length
point System.Vector2
return Length

Intersect() public method

Get the intersection type between this box and the point.
public Intersect ( System.Vector2 point ) : Containment
point System.Vector2
return Containment

NearestPointTo() public method

Get the nearest point between this Box2 and a Vector2. If the Vector2 is inside this Box2, it is returned untouched.
public NearestPointTo ( System.Vector2 point ) : System.Vector2
point System.Vector2
return System.Vector2

NearestPointTo() public method

Get the nearest point between this Box2 and a Vector2. If the Vector2 is inside this Box2, it is returned untouched.
public NearestPointTo ( System.Vector2 &point, System.Vector2 &result ) : void
point System.Vector2
result System.Vector2
return void

Overlaps() public method

Get whether this Box2 inclusively intersects with the Vector2.
public Overlaps ( System.Vector2 point ) : bool
point System.Vector2
return bool

Random() public method

Get a random position within the box.
public Random ( Random rng ) : System.Vector2
rng System.Random
return System.Vector2

Random() public method

Get a random position within the box.
public Random ( Random rng, System.Vector2 &result ) : void
rng System.Random
result System.Vector2
return void

Relative() public static method

Create a Box2 by providing the minimum extent and the size of each side.
public static Relative ( Length minX, Length minY, Length sizeX, Length sizeY ) : Box2
minX Length
minY Length
sizeX Length
sizeY Length
return Box2

Relative() public static method

Create a Box2 by providing the minimum extent and the size of each side.
public static Relative ( System.Vector2 min, System.Vector2 size ) : Box2
min System.Vector2
size System.Vector2
return Box2

Relative() public static method

Create a Box2 by providing the minimum extent and the size of each side.
public static Relative ( Length minX, Length minY, Length sizeX, Length sizeY, Box2 &result ) : void
minX Length
minY Length
sizeX Length
sizeY Length
result Box2
return void

Relative() public static method

Create a Box2 by providing the minimum extent and the size of each side.
public static Relative ( System.Vector2 min, System.Vector2 size, Box2 &result ) : void
min System.Vector2
size System.Vector2
result Box2
return void

ToString() public method

Convert to a string representation of the Box2.
public ToString ( ) : string
return string

ToString() public method

Convert to a string representation of the Box2.
public ToString ( string format, IFormatProvider provider ) : string
format string
provider IFormatProvider
return string

Property Details

Max public_oe property

The maximum extents of the Box2.
public Vector2,System Max
return System.Vector2

Min public_oe property

The minimum extents of the Box2.
public Vector2,System Min
return System.Vector2

Zero public_oe static_oe property

Get an empty Box2 centred on the origin.
public static Box2,Glare Zero
return Box2