C# Class Glare.Box2i

A two-dimensional box that uses Int32 elements.
Afficher le fichier Open project: Burton-Radons/Alexandria Class Usage Examples

Méthodes publiques

Свойство Type Description
Max Vector2i
Min Vector2i
Zero Box2i

Méthodes publiques

Méthode Description
Box2i ( Int32 minX, Int32 minY, Int32 maxX, Int32 maxY ) : System

Create a Box2i by providing minimum and maximum extents.

Box2i ( Vector2i min, Vector2i max ) : System

Create a Box2i by providing minimum and maximum extents.

Distance ( Vector2i point ) : double

Get the closest distance between this Box2i and the Vector2i.

Intersect ( Vector2i point ) : Containment

Get the intersection type between this box and the point.

NearestPointTo ( Vector2i point ) : Vector2i

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

NearestPointTo ( Vector2i &point, Vector2i &result ) : void

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

Overlaps ( Vector2i point ) : bool

Get whether this Box2i inclusively intersects with the Vector2i.

Random ( Random rng ) : Vector2i

Get a random position within the box.

Random ( Random rng, Vector2i &result ) : void

Get a random position within the box.

Relative ( Int32 minX, Int32 minY, Int32 sizeX, Int32 sizeY ) : Box2i

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

Relative ( Vector2i min, Vector2i size ) : Box2i

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

Relative ( Int32 minX, Int32 minY, Int32 sizeX, Int32 sizeY, Box2i &result ) : void

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

Relative ( Vector2i min, Vector2i size, Box2i &result ) : void

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

ToString ( ) : string

Convert to a string representation of the Box2i.

ToString ( string format, IFormatProvider provider ) : string

Convert to a string representation of the Box2i.

Method Details

Box2i() public méthode

Create a Box2i by providing minimum and maximum extents.
public Box2i ( Int32 minX, Int32 minY, Int32 maxX, Int32 maxY ) : System
minX System.Int32
minY System.Int32
maxX System.Int32
maxY System.Int32
Résultat System

Box2i() public méthode

Create a Box2i by providing minimum and maximum extents.
public Box2i ( Vector2i min, Vector2i max ) : System
min Vector2i
max Vector2i
Résultat System

Distance() public méthode

Get the closest distance between this Box2i and the Vector2i.
public Distance ( Vector2i point ) : double
point Vector2i
Résultat double

Intersect() public méthode

Get the intersection type between this box and the point.
public Intersect ( Vector2i point ) : Containment
point Vector2i
Résultat Containment

NearestPointTo() public méthode

Get the nearest point between this Box2i and a Vector2i. If the Vector2i is inside this Box2i, it is returned untouched.
public NearestPointTo ( Vector2i point ) : Vector2i
point Vector2i
Résultat Vector2i

NearestPointTo() public méthode

Get the nearest point between this Box2i and a Vector2i. If the Vector2i is inside this Box2i, it is returned untouched.
public NearestPointTo ( Vector2i &point, Vector2i &result ) : void
point Vector2i
result Vector2i
Résultat void

Overlaps() public méthode

Get whether this Box2i inclusively intersects with the Vector2i.
public Overlaps ( Vector2i point ) : bool
point Vector2i
Résultat bool

Random() public méthode

Get a random position within the box.
public Random ( Random rng ) : Vector2i
rng System.Random
Résultat Vector2i

Random() public méthode

Get a random position within the box.
public Random ( Random rng, Vector2i &result ) : void
rng System.Random
result Vector2i
Résultat void

Relative() public static méthode

Create a Box2i by providing the minimum extent and the size of each side.
public static Relative ( Int32 minX, Int32 minY, Int32 sizeX, Int32 sizeY ) : Box2i
minX System.Int32
minY System.Int32
sizeX System.Int32
sizeY System.Int32
Résultat Box2i

Relative() public static méthode

Create a Box2i by providing the minimum extent and the size of each side.
public static Relative ( Vector2i min, Vector2i size ) : Box2i
min Vector2i
size Vector2i
Résultat Box2i

Relative() public static méthode

Create a Box2i by providing the minimum extent and the size of each side.
public static Relative ( Int32 minX, Int32 minY, Int32 sizeX, Int32 sizeY, Box2i &result ) : void
minX System.Int32
minY System.Int32
sizeX System.Int32
sizeY System.Int32
result Box2i
Résultat void

Relative() public static méthode

Create a Box2i by providing the minimum extent and the size of each side.
public static Relative ( Vector2i min, Vector2i size, Box2i &result ) : void
min Vector2i
size Vector2i
result Box2i
Résultat void

ToString() public méthode

Convert to a string representation of the Box2i.
public ToString ( ) : string
Résultat string

ToString() public méthode

Convert to a string representation of the Box2i.
public ToString ( string format, IFormatProvider provider ) : string
format string
provider IFormatProvider
Résultat string

Property Details

Max public_oe property

The maximum extents of the Box2i.
public Vector2i Max
Résultat Vector2i

Min public_oe property

The minimum extents of the Box2i.
public Vector2i Min
Résultat Vector2i

Zero public_oe static_oe property

Get an empty Box2i centred on the origin.
public static Box2i,Glare Zero
Résultat Box2i