Arcade
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events
GameAPI.Vector2F Struct Reference

A two component vector of floats. More...

Public Member Functions

 Vector2F (float x, float y)
 Constructs a vector from the given X and Y components. More...
 
float Dot (Vector2F vec)
 Finds the scalar product of this vector and another. More...
 
Vector2F Rotate (float radians)
 Returns this vector rotated about the origin by the given number of radians. More...
 
Vector2F Rotate (Vector2F axis, float radians)
 Returns this vector rotated about a given axis by the given number of radians. More...
 
override bool Equals (object obj)
 
bool Equals (Vector2F vec)
 Tests for equality with another vector. More...
 
override int GetHashCode ()
 
override string ToString ()
 Gets a string representing this vector in (X, Y) format. More...
 

Static Public Member Functions

static operator Vector2I (Vector2F vec)
 
static Vector2F operator+ (Vector2F vec)
 The identity operator. More...
 
static Vector2F operator+ (Vector2F a, Vector2F b)
 Component-wise addition of a vector to another. More...
 
static Vector2F operator- (Vector2F vec)
 Finds the negation of a vector. More...
 
static Vector2F operator- (Vector2F a, Vector2F b)
 Component-wise subtraction of a vector from another. More...
 
static Vector2F operator* (Vector2F a, Vector2F b)
 Component-wise multiplication of a vector and another. More...
 
static Vector2F operator* (Vector2F vec, float val)
 Multiplies a vector by a scalar. More...
 
static Vector2F operator* (float val, Vector2F vec)
 Multiplies a vector by a scalar. More...
 
static Vector2F operator/ (Vector2F a, Vector2F b)
 Component-wise division of a vector by another. More...
 
static Vector2F operator/ (Vector2F vec, float val)
 Division of a vector by a scalar. More...
 
static Vector2F operator/ (float val, Vector2F vec)
 Division of a vector by a scalar. More...
 
static Vector2F FromAngle (float radians)
 Finds a normalized vector representation of the given angle in radians. More...
 

Public Attributes

float X
 Horizontal component. More...
 
float Y
 Vertical component. More...
 

Static Public Attributes

static readonly Vector2F Zero = new Vector2F(0f, 0f)
 A vector with zero for all components. More...
 
static readonly Vector2F UnitX = new Vector2F(1f, 0f)
 A normalized vector along the positive X axis. More...
 
static readonly Vector2F UnitY = new Vector2F(0f, 1f)
 A normalized vector along the positive Y axis. More...
 

Properties

float Length [get]
 Magnitude of the vector. More...
 
float ManhattanLength [get]
 Magnitude of the vector in Taxicab geometry. More...
 
float LengthSquared [get]
 Sum of each component squared. More...
 
Vector2F Normalized [get]
 Gets a normalized vector in the same direction as this one. More...
 
float Angle [get]
 Gets the angle of this vector from the positive X axis. More...
 
Vector2F Left [get]
 Gets a vector equal to this one rotated counter-clockwise by 90 degrees. More...
 
Vector2F Right [get]
 Gets a vector equal to this one rotated clockwise 90 degrees. More...
 
Vector2F Back [get]
 Gets a vector equal to this one rotated 180 degrees. More...
 

Detailed Description

A two component vector of floats.

Constructor & Destructor Documentation

GameAPI.Vector2F.Vector2F ( float  x,
float  y 
)
inline

Constructs a vector from the given X and Y components.

Member Function Documentation

float GameAPI.Vector2F.Dot ( Vector2F  vec)
inline

Finds the scalar product of this vector and another.

override bool GameAPI.Vector2F.Equals ( object  obj)
inline
bool GameAPI.Vector2F.Equals ( Vector2F  vec)
inline

Tests for equality with another vector.

static Vector2F GameAPI.Vector2F.FromAngle ( float  radians)
inlinestatic

Finds a normalized vector representation of the given angle in radians.

override int GameAPI.Vector2F.GetHashCode ( )
inline
static GameAPI.Vector2F.operator Vector2I ( Vector2F  vec)
inlineexplicitstatic
static Vector2F GameAPI.Vector2F.operator* ( Vector2F  a,
Vector2F  b 
)
inlinestatic

Component-wise multiplication of a vector and another.

static Vector2F GameAPI.Vector2F.operator* ( Vector2F  vec,
float  val 
)
inlinestatic

Multiplies a vector by a scalar.

static Vector2F GameAPI.Vector2F.operator* ( float  val,
Vector2F  vec 
)
inlinestatic

Multiplies a vector by a scalar.

static Vector2F GameAPI.Vector2F.operator+ ( Vector2F  vec)
inlinestatic

The identity operator.

static Vector2F GameAPI.Vector2F.operator+ ( Vector2F  a,
Vector2F  b 
)
inlinestatic

Component-wise addition of a vector to another.

static Vector2F GameAPI.Vector2F.operator- ( Vector2F  vec)
inlinestatic

Finds the negation of a vector.

static Vector2F GameAPI.Vector2F.operator- ( Vector2F  a,
Vector2F  b 
)
inlinestatic

Component-wise subtraction of a vector from another.

static Vector2F GameAPI.Vector2F.operator/ ( Vector2F  a,
Vector2F  b 
)
inlinestatic

Component-wise division of a vector by another.

static Vector2F GameAPI.Vector2F.operator/ ( Vector2F  vec,
float  val 
)
inlinestatic

Division of a vector by a scalar.

static Vector2F GameAPI.Vector2F.operator/ ( float  val,
Vector2F  vec 
)
inlinestatic

Division of a vector by a scalar.

Vector2F GameAPI.Vector2F.Rotate ( float  radians)
inline

Returns this vector rotated about the origin by the given number of radians.

Parameters
radiansAngle to rotate by.
Vector2F GameAPI.Vector2F.Rotate ( Vector2F  axis,
float  radians 
)
inline

Returns this vector rotated about a given axis by the given number of radians.

Parameters
axisPosition to rotate around.
radiansAngle to rotate by.
override string GameAPI.Vector2F.ToString ( )
inline

Gets a string representing this vector in (X, Y) format.

Member Data Documentation

readonly Vector2F GameAPI.Vector2F.UnitX = new Vector2F(1f, 0f)
static

A normalized vector along the positive X axis.

readonly Vector2F GameAPI.Vector2F.UnitY = new Vector2F(0f, 1f)
static

A normalized vector along the positive Y axis.

float GameAPI.Vector2F.X

Horizontal component.

float GameAPI.Vector2F.Y

Vertical component.

readonly Vector2F GameAPI.Vector2F.Zero = new Vector2F(0f, 0f)
static

A vector with zero for all components.

Property Documentation

float GameAPI.Vector2F.Angle
get

Gets the angle of this vector from the positive X axis.

Vector2F GameAPI.Vector2F.Back
get

Gets a vector equal to this one rotated 180 degrees.

Vector2F GameAPI.Vector2F.Left
get

Gets a vector equal to this one rotated counter-clockwise by 90 degrees.

float GameAPI.Vector2F.Length
get

Magnitude of the vector.

float GameAPI.Vector2F.LengthSquared
get

Sum of each component squared.

float GameAPI.Vector2F.ManhattanLength
get

Magnitude of the vector in Taxicab geometry.

Vector2F GameAPI.Vector2F.Normalized
get

Gets a normalized vector in the same direction as this one.

Vector2F GameAPI.Vector2F.Right
get

Gets a vector equal to this one rotated clockwise 90 degrees.