C# Class Box2DX.Common.Vec2

A 2D column vector.
Afficher le fichier Open project: danielpcox/Crisis-at-Swiss-Station Class Usage Examples

Méthodes publiques

Свойство Type Description
X float

Méthodes publiques

Méthode Description
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

Method Details

Cross() public static méthode

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
Résultat Vec2

Cross() public static méthode

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
Résultat Vec2

Cross() public static méthode

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
Résultat float

Distance() public static méthode

public static Distance ( Vec2 a, Vec2 b ) : float
a Vec2
b Vec2
Résultat float

DistanceSquared() public static méthode

public static DistanceSquared ( Vec2 a, Vec2 b ) : float
a Vec2
b Vec2
Résultat float

Dot() public static méthode

Peform the dot product on two vectors.
public static Dot ( Vec2 a, Vec2 b ) : float
a Vec2
b Vec2
Résultat float

Length() public méthode

Get the length of this vector (the norm).
public Length ( ) : float
Résultat float

LengthSquared() public méthode

Get the length squared. For performance, use this instead of Length (if possible).
public LengthSquared ( ) : float
Résultat float

Normalize() public méthode

Convert this vector into a unit vector. Returns the length.
public Normalize ( ) : float
Résultat float

Set() public méthode

Set this vector to some specified coordinates.
public Set ( float x, float y ) : void
x float
y float
Résultat void

SetZero() public méthode

Set this vector to all zeros.
public SetZero ( ) : void
Résultat void

Vec2() public méthode

Construct using coordinates.
public Vec2 ( float x, float y ) : System
x float
y float
Résultat System

operator() public static méthode

public static operator ( ) : Vec2
Résultat Vec2

operator() public static méthode

public static operator ( ) : bool
Résultat bool

Property Details

X public_oe property

public float X
Résultat float