C# Класс Box2DX.Common.Vec2

A 2D column vector.
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
X float

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

Метод Описание
Cross ( Vec2 a, float s ) : Vec2

Perform the cross product on a vector and a scalar. In 2D this produces a vector.

Cross ( float s, Vec2 a ) : Vec2

Perform the cross product on a scalar and a vector. In 2D this produces a vector.

Cross ( Vec2 a, Vec2 b ) : float

Perform the cross product on two vectors. In 2D this produces a scalar.

Distance ( Vec2 a, Vec2 b ) : float
DistanceSquared ( Vec2 a, Vec2 b ) : float
Dot ( Vec2 a, Vec2 b ) : float

Peform the dot product on two vectors.

Length ( ) : float

Get the length of this vector (the norm).

LengthSquared ( ) : float

Get the length squared. For performance, use this instead of Length (if possible).

Normalize ( ) : float

Convert this vector into a unit vector. Returns the length.

Set ( float x, float y ) : void

Set this vector to some specified coordinates.

SetZero ( ) : void

Set this vector to all zeros.

Vec2 ( float x, float y ) : System

Construct using coordinates.

operator ( ) : Vec2
operator ( ) : bool

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

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

Perform the cross product on a vector and a scalar. In 2D this produces a vector.
public static Cross ( Vec2 a, float s ) : Vec2
a Vec2
s float
Результат Vec2

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

Perform the cross product on a scalar and a vector. In 2D this produces a vector.
public static Cross ( float s, Vec2 a ) : Vec2
s float
a Vec2
Результат Vec2

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

Perform the cross product on two vectors. In 2D this produces a scalar.
public static Cross ( Vec2 a, Vec2 b ) : float
a Vec2
b Vec2
Результат float

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

public static Distance ( Vec2 a, Vec2 b ) : float
a Vec2
b Vec2
Результат float

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

public static DistanceSquared ( Vec2 a, Vec2 b ) : float
a Vec2
b Vec2
Результат float

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

Peform the dot product on two vectors.
public static Dot ( Vec2 a, Vec2 b ) : float
a Vec2
b Vec2
Результат float

Length() публичный метод

Get the length of this vector (the norm).
public Length ( ) : float
Результат float

LengthSquared() публичный метод

Get the length squared. For performance, use this instead of Length (if possible).
public LengthSquared ( ) : float
Результат float

Normalize() публичный метод

Convert this vector into a unit vector. Returns the length.
public Normalize ( ) : float
Результат float

Set() публичный метод

Set this vector to some specified coordinates.
public Set ( float x, float y ) : void
x float
y float
Результат void

SetZero() публичный метод

Set this vector to all zeros.
public SetZero ( ) : void
Результат void

Vec2() публичный метод

Construct using coordinates.
public Vec2 ( float x, float y ) : System
x float
y float
Результат System

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

public static operator ( ) : Vec2
Результат Vec2

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

public static operator ( ) : bool
Результат bool

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

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

public float X
Результат float