Torque2D Reference

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions | Friends | List of all members
Vector2 Struct Reference

More...

`#include <Vector2.h>`

Inheritance diagram for Vector2:

## Public Member Functions
| Vector2 (void)
| Constructors. More...
| Vector2 (const Vector2 &copy)
| Vector2 (const F32 x, const F32 y)
| Vector2 (const b2Vec2 &vec2)
| Vector2 (const Point2I &point)
| Vector2 (const Point2F &point)
| Vector2 (const Point2D &point)
| Vector2 (const char *pString)
Vector2 & | operator/= (const F32 s)
| Operators. More...
Vector2 & | operator+= (const Vector2 &v)
Vector2 & | operator-= (const Vector2 &v)
Vector2 | operator/ (F32 s) const
Vector2 | operator+ (const Vector2 &v) const
Vector2 | operator- (const Vector2 &v) const
Vector2 | operator- (void) const
bool | operator== (const Vector2 &v) const
bool | operator!= (const Vector2 &v) const
Vector2 | operator= (const Point2F &p)
| Operator 'Point2F' Support (Assignment/Conversion). More...
Vector2 | operator= (const Point2I &p)
| operator Point2F ()
Point2F | ToPoint2F (void) const
Vector2 | operator= (const b2Vec2 &p)
| Operator 'b2Vec2' Support (Assignment/Conversions). More...
void | setAngle (const F32 radians)
| Utility. More...
void | setPolar (const F32 radians, F32 length)
void | setString (const char *pString)
const Vector2 & | setZero ()
const Vector2 & | setOne ()
F32 | getAngle (void) const
F32 | getMinorAxis (void) const
F32 | getMajorAxis (void) const
Vector2 | getUnitDirection (void) const
bool | isNAN (void) const
bool | isEqualRange (const Vector2 &v, const F32 epsilon) const
bool | isEqual (const Vector2 &v) const
bool | notEqual (const Vector2 &v) const
bool | isXZero (void) const
bool | isYZero (void) const
bool | isZero (void) const
bool | notZero (void) const
F32 | Normalize (void)
F32 | Normalize (const F32 s)
Vector2 & | absolute (void)
Vector2 & | receiprocate (void)
Vector2 | getReceiprocate (void) const
Vector2 & | add (const Vector2 &v)
Vector2 & | sub (const Vector2 &v)
Vector2 & | mult (const Vector2 &v)
Vector2 & | div (const Vector2 &v)
Vector2 & | scale (F32 scale)
Vector2 & | scale (const Vector2 &v)
Vector2 & | rotate (F32 angle)
Vector2 & | rotate (const Vector2 &center, F32 angle)
Vector2 & | perp (void)
Vector2 | getPerp (void) const
F32 | dot (const Vector2 &v)
void | lerp (const Vector2 &v, const F32 time, Vector2 &out)
void | swap (Vector2 &v)
Vector2 & | clamp (const Vector2 &min, const Vector2 &max)
Vector2 & | clampZero (void)
Vector2 & | clampMin (const Vector2 &min)
Vector2 & | clampMax (const Vector2 &max)
void | rand (const Vector2 &min, const Vector2 &max)
void | round (const F32 epsilon=FLT_EPSILON)
StringTableEntry | stringThis (void) const
const char * | scriptThis (void) const

## Static Public Member Functions
static const Vector2 & | getZero ()
static const Vector2 & | getOne ()

## Friends
Vector2 | operator* (F32 s, const Vector2 &v)
Vector2 | operator* (const Vector2 &v, F32 s)
Vector2 | operator* (const Vector2 &v1, Vector2 &v2)
Vector2 | operator* (const Vector2 &v1, const Vector2 &v2)

## Detailed Description

## Constructor & Destructor Documentation

Vector2 | ( | void |  | ) |
| inline

Constructors.

Vector2 | ( | const Vector2 & | copy | ) |
| inline

Vector2 | ( | const F32 | x,
|  | const F32 | y
| ) |  |
| inline

Vector2 | ( | const b2Vec2 & | vec2 | ) |
| inline

Vector2 | ( | const Point2I & | point | ) |
| inline

Vector2 | ( | const Point2F & | point | ) |
| inline

Vector2 | ( | const Point2D & | point | ) |
| inline

Vector2 | ( | const char * | pString | ) |
| inline

## Member Function Documentation

Vector2& absolute | ( | void |  | ) |
| inline

Vector2& add | ( | const Vector2 & | v | ) |
| inline

Vector2& clamp | ( | const Vector2 & | min,
|  | const Vector2 & | max
| ) |  |
| inline

Vector2& clampMax | ( | const Vector2 & | max | ) |
| inline

Vector2& clampMin | ( | const Vector2 & | min | ) |
| inline

Vector2& clampZero | ( | void |  | ) |
| inline

Vector2& div | ( | const Vector2 & | v | ) |
| inline

F32 dot | ( | const Vector2 & | v | ) |
| inline

F32 getAngle | ( | void |  | ) | const
| inline

F32 getMajorAxis | ( | void |  | ) | const
| inline

F32 getMinorAxis | ( | void |  | ) | const
| inline

static const Vector2& getOne | ( |  | ) |
| inline static

Vector2 getPerp | ( | void |  | ) | const
| inline

Vector2 getReceiprocate | ( | void |  | ) | const
| inline

Vector2 getUnitDirection | ( | void |  | ) | const
| inline

static const Vector2& getZero | ( |  | ) |
| inline static

bool isEqual | ( | const Vector2 & | v | ) | const
| inline

bool isEqualRange | ( | const Vector2 & | v,
|  | const F32 | epsilon
| ) |  | const
| inline

bool isNAN | ( | void |  | ) | const
| inline

bool isXZero | ( | void |  | ) | const
| inline

bool isYZero | ( | void |  | ) | const
| inline

bool isZero | ( | void |  | ) | const
| inline

void lerp | ( | const Vector2 & | v,
|  | const F32 | time,
|  | Vector2 & | out
| ) |  |
| inline

Vector2& mult | ( | const Vector2 & | v | ) |
| inline

F32 Normalize | ( | void |  | ) |
| inline

F32 Normalize | ( | const F32 | s | ) |
| inline

bool notEqual | ( | const Vector2 & | v | ) | const
| inline

bool notZero | ( | void |  | ) | const
| inline

operator Point2F | ( |  | ) |
| inline

bool operator!= | ( | const Vector2 & | v | ) | const
| inline

Vector2 operator+ | ( | const Vector2 & | v | ) | const
| inline

Vector2& operator+= | ( | const Vector2 & | v | ) |
| inline

Vector2 operator- | ( | const Vector2 & | v | ) | const
| inline

Vector2 operator- | ( | void |  | ) | const
| inline

Vector2& operator-= | ( | const Vector2 & | v | ) |
| inline

Vector2 operator/ | ( | F32 | s | ) | const
| inline

Vector2& operator/= | ( | const F32 | s | ) |
| inline

Operators.

Vector2 operator= | ( | const Point2F & | p | ) |
| inline

Operator 'Point2F' Support (Assignment/Conversion).

Vector2 operator= | ( | const Point2I & | p | ) |
| inline

Vector2 operator= | ( | const b2Vec2 & | p | ) |
| inline

Operator 'b2Vec2' Support (Assignment/Conversions).

bool operator== | ( | const Vector2 & | v | ) | const
| inline

Vector2& perp | ( | void |  | ) |
| inline

void rand | ( | const Vector2 & | min,
|  | const Vector2 & | max
| ) |  |
| inline

Vector2& receiprocate | ( | void |  | ) |
| inline

Vector2& rotate | ( | F32 | angle | ) |
| inline

Vector2& rotate | ( | const Vector2 & | center,
|  | F32 | angle
| ) |  |
| inline

void round | ( | const F32 | epsilon = `FLT_EPSILON` | ) |
| inline

Vector2& scale | ( | F32 | scale | ) |
| inline

Vector2& scale | ( | const Vector2 & | v | ) |
| inline

const char* scriptThis | ( | void |  | ) | const
| inline

void setAngle | ( | const F32 | radians | ) |
| inline

Utility.

const Vector2& setOne | ( |  | ) |
| inline

void setPolar | ( | const F32 | radians,
|  | F32 | length
| ) |  |
| inline

void setString | ( | const char * | pString | ) |
| inline

const Vector2& setZero | ( |  | ) |
| inline

StringTableEntry stringThis | ( | void |  | ) | const
| inline

Vector2& sub | ( | const Vector2 & | v | ) |
| inline

void swap | ( | Vector2 & | v | ) |
| inline

Point2F ToPoint2F | ( | void |  | ) | const
| inline

## Friends And Related Function Documentation

Vector2 operator* | ( | F32 | s,
|  | const Vector2 & | v
| ) |  |
| friend

Vector2 operator* | ( | const Vector2 & | v,
|  | F32 | s
| ) |  |
| friend

Vector2 operator* | ( | const Vector2 & | v1,
|  | Vector2 & | v2
| ) |  |
| friend

Vector2 operator* | ( | const Vector2 & | v1,
|  | const Vector2 & | v2
| ) |  |
| friend

The documentation for this struct was generated from the following file:

- 2d/core/Vector2.h