MezzanineEngine 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
Mezzanine::Vector2 Class Reference

This is used to represent a point on a 2 dimentional area, such as a screen. More...

#include <vector2.h>

Public Member Functions

 Vector2 ()
 Default Constructor.
 
 Vector2 (const Real &xy)
 Single Real value Constructor. More...
 
 Vector2 (const Real &x, const Real &y)
 Real value Constructor. More...
 
 Vector2 (const Ogre::Vector2 &Vec)
 Ogre Value Constructor. More...
 
void ExtractOgreVector2 (const Ogre::Vector2 &Thiers)
 Copies an existing Ogre vector2. More...
 
Ogre::Vector2 GetOgreVector2 () const
 Gets a Ogre vector2. More...
 
Vector2Normalize ()
 Normalizes this Vector2. More...
 
Boolean operator!= (const Mezzanine::Vector2 &Vec2) const
 Equality Comparison Operator. More...
 
Boolean operator!= (const Ogre::Vector2 &Vec2) const
 Equality Comparison Operator. More...
 
Vector2 operator* (const Real &scalar) const
 Scaling by multiplication. More...
 
Vector2 operator* (const Vector2 &Vec2) const
 Multiplaction Operator. More...
 
Vector2operator*= (const Real &scalar)
 Scaling by multiplication. More...
 
Vector2operator*= (const Vector2 &Vec2)
 Multiplaction assignment Operator. More...
 
Vector2 operator+ (const Vector2 &Vec2) const
 Addition Operator. More...
 
Vector2operator+= (const Vector2 &Vec2)
 Addition assignment Operator. More...
 
Vector2 operator- (const Vector2 &Vec2) const
 Subraction Operator. More...
 
Vector2operator-= (const Vector2 &Vec2)
 Subraction assignment Operator. More...
 
Vector2 operator/ (const Real &scalar) const
 Scaling by Division. More...
 
Vector2 operator/ (const Vector2 &Vec2) const
 Division Operator. More...
 
Vector2operator/= (const Real &scalar)
 Scaling by Division. More...
 
Vector2operator/= (const Vector2 &Vec2)
 Division assignment Operator. More...
 
Boolean operator<= (const Mezzanine::Vector2 &Vec) const
 Less or Equal Comparison Operator. More...
 
Boolean operator== (const Mezzanine::Vector2 &Vec2) const
 Equality Comparison Operator. More...
 
Boolean operator== (const Ogre::Vector2 &Vec2) const
 Equality Comparison Operator. More...
 
Boolean operator>= (const Mezzanine::Vector2 &Vec) const
 Greater than or Equal Comparison Operator. More...
 
Vector2 Perpendicular () const
 Generates a Vector2 that is perpendicular to this vector. More...
 
void ProtoDeSerialize (const XML::Node &OneNode)
 Take the data stored in an XML and overwrite this instance of this object with it. More...
 
void ProtoSerialize (XML::Node &CurrentRoot) const
 Convert this class to an XML::Node ready for serialization. More...
 
void SetIdentity ()
 Sets the values of this vector2 to identity values(0,0).
 
void SetValues (const Real &x, const Real &y)
 Sets the X and Y values of this vector2. More...
 

Static Public Member Functions

static String SerializableName ()
 Get the name of the the XML tag this class will leave behind as its instances are serialized. More...
 

Public Attributes

Real X
 Coordinate on the X vector.
 
Real Y
 Coordinate on the Y vector.
 

Detailed Description

This is used to represent a point on a 2 dimentional area, such as a screen.

This contains an X and Y value used to represent coordinates. This also has a number of facilities to make converting to graphics subsystems as easy as possible.

Definition at line 65 of file vector2.h.

Constructor & Destructor Documentation

Mezzanine::Vector2::Vector2 ( const Real xy)

Single Real value Constructor.

Parameters
xyValue to set both x and y to.

Definition at line 58 of file vector2.cpp.

Mezzanine::Vector2::Vector2 ( const Real x,
const Real y 
)

Real value Constructor.

Parameters
xCoordinate on the X vector.
yCoordinate on the Y vector.

Definition at line 61 of file vector2.cpp.

Mezzanine::Vector2::Vector2 ( const Ogre::Vector2 &  Vec)

Ogre Value Constructor.

Parameters
VecThe vector to be copied to make this vector.

Definition at line 64 of file vector2.cpp.

Member Function Documentation

void Mezzanine::Vector2::ExtractOgreVector2 ( const Ogre::Vector2 &  Thiers)

Copies an existing Ogre vector2.

Parameters
ThiersThe vector2 to be extracted.

Definition at line 75 of file vector2.cpp.

Ogre::Vector2 Mezzanine::Vector2::GetOgreVector2 ( ) const

Gets a Ogre vector2.

Returns
Returns an Ogre Vector2 with the same values as this.

Definition at line 67 of file vector2.cpp.

Vector2 & Mezzanine::Vector2::Normalize ( )

Normalizes this Vector2.

Returns
Returns a reference to this.

Definition at line 224 of file vector2.cpp.

Boolean Mezzanine::Vector2::operator!= ( const Mezzanine::Vector2 Vec2) const

Equality Comparison Operator.

Parameters
Vec2This is the other Mezzanine::Vector2.
Returns
Returns true if X!=X or Y!=Y, otherwise returns false.

Definition at line 102 of file vector2.cpp.

Boolean Mezzanine::Vector2::operator!= ( const Ogre::Vector2 &  Vec2) const

Equality Comparison Operator.

Parameters
Vec2This is the other Ogre::Vector2.
Returns
Returns true if X!=X or Y!=Y, otherwise returns false.

Definition at line 108 of file vector2.cpp.

Vector2 Mezzanine::Vector2::operator* ( const Real scalar) const

Scaling by multiplication.

Returns
This returns a Vector2 that has been scaled.
Parameters
scalarThis is the amount to scale the Vector2 by.

Definition at line 120 of file vector2.cpp.

Vector2 Mezzanine::Vector2::operator* ( const Vector2 Vec2) const

Multiplaction Operator.

Parameters
Vec2The other Vector2 to multiply by this.
Returns
Returns a new Vector2 that is the result of this operation.

Definition at line 172 of file vector2.cpp.

Vector2 & Mezzanine::Vector2::operator*= ( const Real scalar)

Scaling by multiplication.

Parameters
scalarThis is the amount to scale the Vector2 by.
Returns
Returns a reference to this.

Definition at line 139 of file vector2.cpp.

Vector2 & Mezzanine::Vector2::operator*= ( const Vector2 Vec2)

Multiplaction assignment Operator.

Parameters
Vec2The other Vector2 to multiply by this.
Returns
Returns a reference to this.

Definition at line 202 of file vector2.cpp.

Vector2 Mezzanine::Vector2::operator+ ( const Vector2 Vec2) const

Addition Operator.

Parameters
Vec2The other Vector2 to add to this.
Returns
Returns a new Vector2 that is the result of this operation.

Definition at line 156 of file vector2.cpp.

Vector2 & Mezzanine::Vector2::operator+= ( const Vector2 Vec2)

Addition assignment Operator.

Parameters
Vec2The other Vector2 to add to this.
Returns
Returns a reference to this.

Definition at line 188 of file vector2.cpp.

Vector2 Mezzanine::Vector2::operator- ( const Vector2 Vec2) const

Subraction Operator.

Parameters
Vec2The other Vector2 to subtract from this.
Returns
Returns a new Vector2 that is the result of this operation.

Definition at line 164 of file vector2.cpp.

Vector2 & Mezzanine::Vector2::operator-= ( const Vector2 Vec2)

Subraction assignment Operator.

Parameters
Vec2The other Vector2 to subtract from this.
Returns
Returns a reference to this.

Definition at line 195 of file vector2.cpp.

Vector2 Mezzanine::Vector2::operator/ ( const Real scalar) const

Scaling by Division.

Returns
This returns a Vector2 that has been scaled.
Parameters
scalarThis is the amount to scale the Vector2 by.

Definition at line 128 of file vector2.cpp.

Vector2 Mezzanine::Vector2::operator/ ( const Vector2 Vec2) const

Division Operator.

Parameters
Vec2The other Vector2 to divide by.
Returns
Returns a new Vector2 that is the result of this operation.

Definition at line 180 of file vector2.cpp.

Vector2 & Mezzanine::Vector2::operator/= ( const Real scalar)

Scaling by Division.

Parameters
scalarThis is the amount to scale the Vector2 by.
Returns
Returns a reference to this.

Definition at line 146 of file vector2.cpp.

Vector2 & Mezzanine::Vector2::operator/= ( const Vector2 Vec2)

Division assignment Operator.

Parameters
Vec2The other Vector2 to divide by.
Returns
Returns a reference to this.

Definition at line 209 of file vector2.cpp.

Boolean Mezzanine::Vector2::operator<= ( const Mezzanine::Vector2 Vec) const

Less or Equal Comparison Operator.

Returns true if X<=X and Y<=Y. If any of those do not hold this returns false.

Parameters
VecThis is the other Mezzanine::Vector2.
Note
Used primarily for testing. This is not implement for use with other kinds of Vector3 implementations as it is widely considered useless.

Definition at line 111 of file vector2.cpp.

Boolean Mezzanine::Vector2::operator== ( const Mezzanine::Vector2 Vec2) const

Equality Comparison Operator.

Parameters
Vec2This is the other Mezzanine::Vector2 to compare with.
Returns
Returns true if X==X and Y==Y, otherwise returns false.

Definition at line 99 of file vector2.cpp.

Boolean Mezzanine::Vector2::operator== ( const Ogre::Vector2 &  Vec2) const

Equality Comparison Operator.

Parameters
Vec2This is the other Ogre::Vector2.
Returns
Returns true if X==X and Y==Y, otherwise returns false.

Definition at line 105 of file vector2.cpp.

Boolean Mezzanine::Vector2::operator>= ( const Mezzanine::Vector2 Vec) const

Greater than or Equal Comparison Operator.

Returns true if X>=X and Y>=Y . If any of those do not hold this returns false.

Parameters
VecThis is the other Mezzanine::Vector2.
Note
Used primarily for testing. This is not implement for use with other kinds of Vector3 implementations as it is widely considered useless.

Definition at line 114 of file vector2.cpp.

Vector2 Mezzanine::Vector2::Perpendicular ( ) const

Generates a Vector2 that is perpendicular to this vector.

Returns
Returns a new Vector2 that is perpendicular to this.

Definition at line 219 of file vector2.cpp.

void Mezzanine::Vector2::ProtoDeSerialize ( const XML::Node OneNode)

Take the data stored in an XML and overwrite this instance of this object with it.

Parameters
OneNodeand XML::Node containing the data.

Definition at line 262 of file vector2.cpp.

void Mezzanine::Vector2::ProtoSerialize ( XML::Node CurrentRoot) const

Convert this class to an XML::Node ready for serialization.

Parameters
CurrentRootThe point in the XML hierarchy that all this vector2 should be appended to.

Definition at line 241 of file vector2.cpp.

String Mezzanine::Vector2::SerializableName ( )
static

Get the name of the the XML tag this class will leave behind as its instances are serialized.

Returns
A string containing "Vector2"

Definition at line 278 of file vector2.cpp.

void Mezzanine::Vector2::SetValues ( const Real x,
const Real y 
)

Sets the X and Y values of this vector2.

Parameters
xThe real that will have this vector's X member set to.
yThe real that will have this vector's Y member set to.

Definition at line 90 of file vector2.cpp.


The documentation for this class was generated from the following files: