C# Класс Glare.Box2d

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

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

Свойство Тип Описание
Max Vector2d
Min Vector2d
Zero Box2d

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

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

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

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

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

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

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

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

Get the closest distance between this Box2d and the Vector2d.
public Distance ( Vector2d point ) : Double
point Vector2d
Результат Double

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

The maximum extents of the Box2d.
public Vector2d Max
Результат Vector2d

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

The minimum extents of the Box2d.
public Vector2d Min
Результат Vector2d

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

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