C# Class Box2DX.Common.Vec2

A 2D column vector.
显示文件 Open project: danielpcox/Crisis-at-Swiss-Station Class Usage Examples

Public Properties

Property Type Description
X float

Public Methods

Method 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 method

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
return Vec2

Cross() public static method

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
return Vec2

Cross() public static method

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
return float

Distance() public static method

public static Distance ( Vec2 a, Vec2 b ) : float
a Vec2
b Vec2
return float

DistanceSquared() public static method

public static DistanceSquared ( Vec2 a, Vec2 b ) : float
a Vec2
b Vec2
return float

Dot() public static method

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

Length() public method

Get the length of this vector (the norm).
public Length ( ) : float
return float

LengthSquared() public method

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

Normalize() public method

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

Set() public method

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

SetZero() public method

Set this vector to all zeros.
public SetZero ( ) : void
return void

Vec2() public method

Construct using coordinates.
public Vec2 ( float x, float y ) : System
x float
y float
return System

operator() public static method

public static operator ( ) : Vec2
return Vec2

operator() public static method

public static operator ( ) : bool
return bool

Property Details

X public_oe property

public float X
return float