C# Класс Glare.Box2

A two-dimensional box that uses Length elements.
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
Max System.Vector2
Min System.Vector2
Zero Box2

Открытые методы

Метод Описание
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.

Описание методов

Box2() публичный Метод

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
Результат System

Box2() публичный Метод

Create a Box2 by providing minimum and maximum extents.
public Box2 ( System.Vector2 min, System.Vector2 max ) : System
min System.Vector2
max System.Vector2
Результат System

Distance() публичный Метод

Get the closest distance between this Box2 and the Vector2.
public Distance ( System.Vector2 point ) : Length
point System.Vector2
Результат Length

Intersect() публичный Метод

Get the intersection type between this box and the point.
public Intersect ( System.Vector2 point ) : Containment
point System.Vector2
Результат Containment

NearestPointTo() публичный Метод

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
Результат System.Vector2

NearestPointTo() публичный Метод

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
Результат void

Overlaps() публичный Метод

Get whether this Box2 inclusively intersects with the Vector2.
public Overlaps ( System.Vector2 point ) : bool
point System.Vector2
Результат bool

Random() публичный Метод

Get a random position within the box.
public Random ( Random rng ) : System.Vector2
rng System.Random
Результат System.Vector2

Random() публичный Метод

Get a random position within the box.
public Random ( Random rng, System.Vector2 &result ) : void
rng System.Random
result System.Vector2
Результат void

Relative() публичный статический Метод

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
Результат Box2

Relative() публичный статический Метод

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
Результат Box2

Relative() публичный статический Метод

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
Результат void

Relative() публичный статический Метод

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
Результат void

ToString() публичный Метод

Convert to a string representation of the Box2.
public ToString ( ) : string
Результат string

ToString() публичный Метод

Convert to a string representation of the Box2.
public ToString ( string format, IFormatProvider provider ) : string
format string
provider IFormatProvider
Результат string

Описание свойств

Max публичное свойство

The maximum extents of the Box2.
public Vector2,System Max
Результат System.Vector2

Min публичное свойство

The minimum extents of the Box2.
public Vector2,System Min
Результат System.Vector2

Zero публичное статическое свойство

Get an empty Box2 centred on the origin.
public static Box2,Glare Zero
Результат Box2