C# Class Glare.Box2d

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

Méthodes publiques

Свойство Type Description
Max Vector2d
Min Vector2d
Zero Box2d

Méthodes publiques

Méthode Description
Box2d ( Double minX, Double minY, Double maxX, Double maxY ) : System

Create a Box2d by providing minimum and maximum extents.

Box2d ( Vector2d min, Vector2d max ) : System

Create a Box2d by providing minimum and maximum extents.

Distance ( Vector2d point ) : Double

Get the closest distance between this Box2d and the Vector2d.

Intersect ( Vector2d point ) : Containment

Get the intersection type between this box and the point.

NearestPointTo ( Vector2d point ) : Vector2d

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

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

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

Overlaps ( Vector2d point ) : bool

Get whether this Box2d inclusively intersects with the Vector2d.

Random ( Random rng ) : Vector2d

Get a random position within the box.

Random ( Random rng, Vector2d &result ) : void

Get a random position within the box.

Relative ( Double minX, Double minY, Double sizeX, Double sizeY ) : Box2d

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

Relative ( Vector2d min, Vector2d size ) : Box2d

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

Relative ( Double minX, Double minY, Double sizeX, Double sizeY, Box2d &result ) : void

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

Relative ( Vector2d min, Vector2d size, Box2d &result ) : void

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

ToString ( ) : string

Convert to a string representation of the Box2d.

ToString ( string format, IFormatProvider provider ) : string

Convert to a string representation of the Box2d.

Method Details

Box2d() public méthode

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

Box2d() public méthode

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

Distance() public méthode

Get the closest distance between this Box2d and the Vector2d.
public Distance ( Vector2d point ) : Double
point Vector2d
Résultat Double

Intersect() public méthode

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

NearestPointTo() public méthode

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

NearestPointTo() public méthode

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

Overlaps() public méthode

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

Random() public méthode

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

Random() public méthode

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

Relative() public static méthode

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

Relative() public static méthode

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

Relative() public static méthode

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

Relative() public static méthode

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

ToString() public méthode

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

ToString() public méthode

Convert to a string representation of the Box2d.
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 Box2d.
public Vector2d Max
Résultat Vector2d

Min public_oe property

The minimum extents of the Box2d.
public Vector2d Min
Résultat Vector2d

Zero public_oe static_oe property

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