Spinning Topp Logo BlackTopp Studios
inc
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
Mezzanine::Vector3 Class Reference

This is used to represent a point in space, or a vector through space. More...

#include <vector3.h>

Public Types

typedef Real ChannelType
 What are the X, Y and Z channels implmented with.
 

Public Member Functions

 Vector3 ()
 Default Constructor. More...
 
 Vector3 (const Real &X, const Real &Y, const Real &Z)
 Real value Constructor. More...
 
 Vector3 (const Ogre::Vector3 &Vec)
 Ogre Value Constructor. More...
 
 Vector3 (const btVector3 &Vec)
 Bullet Value Constructor. More...
 
 Vector3 (const Mezzanine::Vector3 &Vec)
 Copy Constructor. More...
 
 Vector3 (XML::Node OneNode)
 Deserializing constructor. More...
 
const char * __str__ ()
 
Real AngleBetween (const Vector3 &Direction) const
 Gets the angle between this and another vector assuming both are directional vectors. More...
 
Vector3AntiPermute ()
 Shifts all of the components to the left. More...
 
Vector3Ceil (const Vector3 &Other)
 Sets each member of this Vector3 to the higher value between the two vector3s. More...
 
Vector3 CrossProduct (const Vector3 &Vec) const
 This is used to calculate the crossproduct of this and another vector. More...
 
Real Distance (const Vector3 &OtherVec) const
 Gets the distance between this and another vector. More...
 
Real DotProduct (const Vector3 &Vec) const
 This is used to calculate the dotproduct of this and another vector. More...
 
void ExtractBulletVector3 (const btVector3 &temp)
 Copies an existing Bullet vector3. More...
 
void ExtractOgreVector3 (const Ogre::Vector3 &temp)
 Copies an existing Ogre vector3. More...
 
Vector3Floor (const Vector3 &Other)
 Sets each member of this Vector3 to the lower value between the two vector3s. More...
 
Vector3 GetAntiPermute () const
 Gets a anti-permuted copy of this vector. More...
 
Real GetAxisValue (const StandardAxis &Axis) const
 Get The value associate with a certain Axis. More...
 
Real GetAxisValue (const Whole &Axis) const
 Get The value associate with a certain Axis. More...
 
RealGetAxisValue (const StandardAxis &Axis)
 Get The value associate with a certain Axis in such a way that it can readily be assigned in this Vector3. More...
 
RealGetAxisValue (const Whole &Axis)
 Get The value associate with a certain Axis in such a way that it can readily be assigned in this Vector3. More...
 
btVector3 GetBulletVector3 () const
 Gets a Bullet vector3. More...
 
Vector3 GetDirection (const Vector3 &Destination) const
 This will get the direction between two points. More...
 
Vector3 GetNormal () const
 This returns the normal for this relative to the origin. More...
 
Ogre::Vector3 GetOgreVector3 () const
 Gets a Ogre vector3. More...
 
Vector3 GetPermute () const
 Gets a permuted copy of this vector. More...
 
Quaternion GetRotationToAxis (const Vector3 &Axis, const Vector3 &FallBackAxis=Vector3()) const
 Gets the rotation needed to rotate this vector as an axis to another axis. More...
 
Vector3 Inverse ()
 This will inverse the reals in the vector. More...
 
Boole IsPerpendicular (const Vector3 &Perp) const
 Gets whether or not a vector is perpendicular to this one. More...
 
StandardAxis IsStandardUnitAxis () const
 Get a Unit Vector along the given Axis. More...
 
Boole IsZero () const
 Checks to see if the values of this vector are all zero. More...
 
Boole IsZeroLength () const
 Checks to see if the length of this vector is zero. More...
 
Real Length () const
 Gets the length of this vector. More...
 
Vector3Normalize ()
 This will change this point into it's own normal relative to the origin. More...
 
Boole operator!= (const Mezzanine::Vector3 &Vec) const
 Inequality Comparison Operator. More...
 
Boole operator!= (const btVector3 &Vec) const
 Inequality Comparison Operator. More...
 
Boole operator!= (const Ogre::Vector3 &Vec) const
 Inequality Comparison Operator. More...
 
Vector3 operator* (const Real &scalar) const
 Scaling by multiplication. More...
 
Vector3 operator* (const Vector3 &Vec) const
 Multiplaction Operator. More...
 
Vector3 operator* (const btVector3 &Vec) const
 Bullet Multiplication Operator. More...
 
Vector3 operator* (const Ogre::Vector3 &Vec) const
 Ogre Multiplication Operator. More...
 
Vector3operator*= (const Real &scalar)
 Scaling by multiplication. More...
 
Vector3operator*= (const Vector3 &Vec)
 Multiplaction Assignment Operator. More...
 
Vector3 operator+ (const Vector3 &Vec) const
 Addition Operator. More...
 
Vector3 operator+ (const btVector3 &Vec) const
 Bullet Addition Operator. More...
 
Vector3 operator+ (const Ogre::Vector3 &Vec) const
 Ogre Addition Operator. More...
 
Vector3operator+= (const Vector3 &Vec)
 Addition Assignment Operator. More...
 
Vector3 operator- ()
 Additive Inverse Operator. More...
 
Vector3 operator- (const Vector3 &Vec) const
 Subraction Operator. More...
 
Vector3 operator- (const btVector3 &Vec) const
 Bullet Subtraction Operator. More...
 
Vector3 operator- (const Ogre::Vector3 &Vec) const
 Ogre Subtraction Operator. More...
 
Vector3operator-= (const Vector3 &Vec)
 Subraction Assignment Operator. More...
 
Vector3 operator/ (const Real &scalar) const
 Scaling by Division. More...
 
Vector3 operator/ (const Vector3 &Vec) const
 Division Operator. More...
 
Vector3 operator/ (const btVector3 &Vec) const
 Bullet Division Operator. More...
 
Vector3 operator/ (const Ogre::Vector3 &Vec) const
 Ogre Division Operator. More...
 
Vector3operator/= (const Real &scalar)
 Scaling by Division. More...
 
Vector3operator/= (const Vector3 &Vec)
 Division Assignment Operator. More...
 
Boole operator<= (const Mezzanine::Vector3 &Vec) const
 Less or Equal Comparison Operator. More...
 
Vector3operator= (const btVector3 &Vec)
 Assignment operator to convert from Bullet Vectors. More...
 
Vector3operator= (const Ogre::Vector3 &Vec)
 Assignment operator to convert from Ogre Vectors. More...
 
Boole operator== (const Mezzanine::Vector3 &Vec) const
 Equality Comparison Operator. More...
 
Boole operator== (const btVector3 &Vec) const
 Equality Comparison Operator. More...
 
Boole operator== (const Ogre::Vector3 &Vec) const
 Equality Comparison Operator. More...
 
Boole operator>= (const Mezzanine::Vector3 &Vec) const
 Greater than or Equal Comparison Operator. More...
 
Real operator[] (const StandardAxis &Axis) const
 Get The value associate with a certain Axis. More...
 
Real operator[] (const Whole &Axis) const
 Get The value associate with a certain Axis. More...
 
Realoperator[] (const StandardAxis &Axis)
 Get The value associate with a certain Axis in such a way that it can readily be assigned in this Vector3. More...
 
Realoperator[] (const Whole &Axis)
 Get The value associate with a certain Axis in such a way that it can readily be assigned in this Vector3. More...
 
Vector3Permute ()
 Shifts all of the components to the right. More...
 
Vector3 Perpendicular () const
 Gets a vector that is perpendicular to this one. 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...
 
Vector3 Reflect (const Vector3 &Normal)
 Gets a reflection vector to the plane with the given normal. More...
 
void SetValues (const Real &X, const Real &Y, const Real &Z)
 Manually sets all the members of this vector3. More...
 
Real SquaredDistance (const Vector3 &OtherVec) const
 Gets the squared distance between this and another vector. More...
 
Real SquaredLength () const
 Gets the length of this vector squared. More...
 
void Zero ()
 Sets all the members of this vector3 to zero.
 

Static Public Member Functions

static String GetSerializableName ()
 Get the name of the the XML tag this class will leave behind as its instances are serialized. More...
 
static Vector3 Neg_Unit_X ()
 Gets a vector representing the negative X unit of a Vector3. More...
 
static Vector3 Neg_Unit_Y ()
 Gets a vector representing the negative Y unit of a Vector3. More...
 
static Vector3 Neg_Unit_Z ()
 Gets a vector representing the negative Z unit of a Vector3. More...
 
static Vector3 Unit_X ()
 Gets a vector representing the X unit of a Vector3. More...
 
static Vector3 Unit_Y ()
 Gets a vector representing the Y unit of a Vector3. More...
 
static Vector3 Unit_Z ()
 Gets a vector representing the Z unit of a Vector3. More...
 
static Vector3 UnitOnAxis (StandardAxis Axis)
 Get a Unit Vector along the given Axis. More...
 

Public Attributes

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

Detailed Description

This is used to represent a point in space, or a vector through space.

This contains an X, Y and a Z value used to represent coordinates. This also has a number of facilities to make converting from Physics subsystem vectors or graphics subsystems as easy as possible

Note
No operator<< existing in any scripting interface for this class

Definition at line 77 of file vector3.h.

Constructor & Destructor Documentation

Mezzanine::Vector3::Vector3 ( )

Default Constructor.

Basic all zero initialization constructor.

Definition at line 110 of file vector3.cpp.

Mezzanine::Vector3::Vector3 ( const Real X,
const Real Y,
const Real Z 
)

Real value Constructor.

Constructor that sets all three vectors.

Parameters
XCoordinate on the X vector.
YCoordinate on the Y vector.
ZCoordinate on the Z vector.

Definition at line 113 of file vector3.cpp.

Mezzanine::Vector3::Vector3 ( const Ogre::Vector3 &  Vec)
explicit

Ogre Value Constructor.

Constructor that sets all values to match the Ogre vector.

Parameters
VecThe vector to be copied to make this vector.

Definition at line 116 of file vector3.cpp.

Mezzanine::Vector3::Vector3 ( const btVector3 &  Vec)
explicit

Bullet Value Constructor.

Constructor that sets all values to match the Bullet vector.

Parameters
VecThe vector to be copied to make this vector.

Definition at line 119 of file vector3.cpp.

Mezzanine::Vector3::Vector3 ( const Mezzanine::Vector3 Vec)

Copy Constructor.

Parameters
VecThe other Mezzanine::Vector3 to copy to make this one.

Definition at line 122 of file vector3.cpp.

Mezzanine::Vector3::Vector3 ( XML::Node  OneNode)
explicit

Deserializing constructor.

Parameters
OneNodeThe XML node to deserialize from.

Definition at line 125 of file vector3.cpp.

Member Function Documentation

Real Mezzanine::Vector3::AngleBetween ( const Vector3 Direction) const

Gets the angle between this and another vector assuming both are directional vectors.

Note
The vectors provided do not need to be normalized.
Parameters
DirectionThe other directional vector to get the angular distance from.
Returns
Returns the angle between both directional vectors.

Definition at line 373 of file vector3.cpp.

Vector3 & Mezzanine::Vector3::AntiPermute ( )

Shifts all of the components to the left.

This assigns the Y component to X, the Z component to Y, and the X component to Z.

Returns
Returns a reference to this after being altered.

Definition at line 398 of file vector3.cpp.

Vector3 & Mezzanine::Vector3::Ceil ( const Vector3 Other)

Sets each member of this Vector3 to the higher value between the two vector3s.

Parameters
OtherThe other Vector to compare with.
Returns
Returns a reference to this.

Definition at line 536 of file vector3.cpp.

Vector3 Mezzanine::Vector3::CrossProduct ( const Vector3 Vec) const

This is used to calculate the crossproduct of this and another vector.

This creates a third vector, which should be on a line perpendicular to the line that contains the origin and the other vector

Thanks to the guys at Ogre3d for the well written version of this function that we based this on.

Parameters
Vecthe Vector to work with to create the cross product
Returns
A Vector3 containing crossproduct of this vector and Vec

Definition at line 338 of file vector3.cpp.

Real Mezzanine::Vector3::Distance ( const Vector3 OtherVec) const

Gets the distance between this and another vector.

This uses a 3d extension of pythagoras thereom to calculate the distance between this Vector3 and another.

Parameters
OtherVecThis is the other point to measure the distance to.
Returns
Returns a Real representing the distance.

Definition at line 449 of file vector3.cpp.

Real Mezzanine::Vector3::DotProduct ( const Vector3 Vec) const

This is used to calculate the dotproduct of this and another vector.

This calculates the sum of the products of X, Y and Z.

Thanks to the guys at Ogre3d for the well written version of this function that we based this on.

Parameters
VecThe vector to work with to create the cross product
Returns
This is the dotproduct of this vector and vec

Definition at line 347 of file vector3.cpp.

void Mezzanine::Vector3::ExtractBulletVector3 ( const btVector3 &  temp)

Copies an existing Bullet vector3.

This function will copy the values stored in an existing Bullet vector3 and set the values of this class to be the same.

Parameters
tempThe vector3 to be extracted.

Definition at line 565 of file vector3.cpp.

void Mezzanine::Vector3::ExtractOgreVector3 ( const Ogre::Vector3 &  temp)

Copies an existing Ogre vector3.

This function will copy the values stored in an existing Ogre vector3 and set the values of this class to be the same.

Parameters
tempThe vector3 to be extracted.

Definition at line 581 of file vector3.cpp.

Vector3 & Mezzanine::Vector3::Floor ( const Vector3 Other)

Sets each member of this Vector3 to the lower value between the two vector3s.

Parameters
OtherThe other Vector to compare with.
Returns
Returns a reference to this.

Definition at line 544 of file vector3.cpp.

Vector3 Mezzanine::Vector3::GetAntiPermute ( ) const

Gets a anti-permuted copy of this vector.

Returns
Returns a new Vector3 that has the values this vector would have if it were anti-permuted.

Definition at line 404 of file vector3.cpp.

Real Mezzanine::Vector3::GetAxisValue ( const StandardAxis Axis) const

Get The value associate with a certain Axis.

Parameters
AxisWhich axis to retrieve.
Note
Despite the multiple scripting overloads of this Method, only Real GetAxisValue(const Whole& Axis) const; exists in the scripting interface
Returns
Either X, Y or Z as indicated by the value passed in.

Definition at line 67 of file vector3.cpp.

Real Mezzanine::Vector3::GetAxisValue ( const Whole Axis) const

Get The value associate with a certain Axis.

Parameters
AxisWhich axis to retrieve.
Note
Despite the multiple scripting overloads of this Method, only Real GetAxisValue(const Whole& Axis) const; exists in the scripting interface
Returns
Either X, Y or Z as indicated by the value passed in.

Definition at line 78 of file vector3.cpp.

Real & Mezzanine::Vector3::GetAxisValue ( const StandardAxis Axis)

Get The value associate with a certain Axis in such a way that it can readily be assigned in this Vector3.

Parameters
AxisWhich axis to retrieve.
Returns
Either X, Y or Z as indicated by the value passed in.

Definition at line 81 of file vector3.cpp.

Real & Mezzanine::Vector3::GetAxisValue ( const Whole Axis)

Get The value associate with a certain Axis in such a way that it can readily be assigned in this Vector3.

Parameters
AxisWhich axis to retrieve.
Returns
Either X, Y or Z as indicated by the value passed in.

Definition at line 92 of file vector3.cpp.

btVector3 Mezzanine::Vector3::GetBulletVector3 ( ) const

Gets a Bullet vector3.

Creates a Bullet vector3 with values equal to this class and returns it.

Returns
A Bullet Vector3 containing the same value as the Mezzanine::Vector3

Definition at line 555 of file vector3.cpp.

Vector3 Mezzanine::Vector3::GetDirection ( const Vector3 Destination) const

This will get the direction between two points.

This returns the direction expressed as a vector between this vector and another provided vector.

Parameters
DestinationThe point in space to determine the direction for.
Returns
A normalized Vector3 that indicates the direction from this vector to another.

Definition at line 409 of file vector3.cpp.

Vector3 Mezzanine::Vector3::GetNormal ( ) const

This returns the normal for this relative to the origin.

This will return a vector that is 1 unit in away from the origin, if a line were starting and the origin it would pass through both the normal and the original point.

Returns
At a vector3 that is the normal of this Vector3 or 0,0,0 if the current Vector is all 0s

Definition at line 363 of file vector3.cpp.

Ogre::Vector3 Mezzanine::Vector3::GetOgreVector3 ( ) const

Gets a Ogre vector3.

Creates a Ogre vector3 with values equal to this class and returns it.

Returns
A Ogre Vector3 containing the same value as the Mezzanine::Vector3

Definition at line 572 of file vector3.cpp.

Vector3 Mezzanine::Vector3::GetPermute ( ) const

Gets a permuted copy of this vector.

Returns
Returns a new Vector3 that has the values this vector would have if it were permuted.

Definition at line 393 of file vector3.cpp.

Quaternion Mezzanine::Vector3::GetRotationToAxis ( const Vector3 Axis,
const Vector3 FallBackAxis = Vector3() 
) const

Gets the rotation needed to rotate this vector as an axis to another axis.

Parameters
AxisThe target axis to rotate to.
FallBackAxisIf the Dot produt of this and Axis are invalid FallBackAxis will be used instead otherwise, the rotation is calculated the hard way.
Returns
Returns a Quaternion representing the needed rotation to the specified axis.

Definition at line 474 of file vector3.cpp.

String Mezzanine::Vector3::GetSerializableName ( )
static

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

Returns
A string containing "Vector3"

Definition at line 631 of file vector3.cpp.

Vector3 Mezzanine::Vector3::Inverse ( )

This will inverse the reals in the vector.

This function will inverse all the reals in the vector.

Returns
A copy of of the current Vector3.

Definition at line 433 of file vector3.cpp.

Boole Mezzanine::Vector3::IsPerpendicular ( const Vector3 Perp) const

Gets whether or not a vector is perpendicular to this one.

Remarks
This simply checks if the dot product between these two vectors is zero.
Parameters
PerpThe other Vector3 to compare with.
Returns
Returns true if the provided vector is perpendicular to this one.

Definition at line 428 of file vector3.cpp.

StandardAxis Mezzanine::Vector3::IsStandardUnitAxis ( ) const

Get a Unit Vector along the given Axis.

Returns
The Corresponding StandardAxis if a Vector equal to Unit_X, Unit_Y or Unit_Z is passed in.

Definition at line 160 of file vector3.cpp.

Boole Mezzanine::Vector3::IsZero ( ) const

Checks to see if the values of this vector are all zero.

Returns
Returns true if all components of this vector are zero, false otherwise.

Definition at line 531 of file vector3.cpp.

Boole Mezzanine::Vector3::IsZeroLength ( ) const

Checks to see if the length of this vector is zero.

Returns
Returns true if this vector has zero length, false otherwise.

Definition at line 469 of file vector3.cpp.

Real Mezzanine::Vector3::Length ( ) const

Gets the length of this vector.

Returns
Returns a real representing the length of this vector.

Definition at line 459 of file vector3.cpp.

Vector3 Mezzanine::Vector3::Neg_Unit_X ( )
static

Gets a vector representing the negative X unit of a Vector3.

Returns
A Vector3(-1,0,0).

Definition at line 140 of file vector3.cpp.

Vector3 Mezzanine::Vector3::Neg_Unit_Y ( )
static

Gets a vector representing the negative Y unit of a Vector3.

Returns
A Vector3(0,-1,0).

Definition at line 143 of file vector3.cpp.

Vector3 Mezzanine::Vector3::Neg_Unit_Z ( )
static

Gets a vector representing the negative Z unit of a Vector3.

Returns
A Vector3(0,0,-1).

Definition at line 146 of file vector3.cpp.

Vector3 & Mezzanine::Vector3::Normalize ( )

This will change this point into it's own normal relative to the origin.

This will change this vector into one that is the same direction from the origin, but only one unit a away.

Returns
Returns a reference to this after being altered.

Definition at line 352 of file vector3.cpp.

Boole Mezzanine::Vector3::operator!= ( const Mezzanine::Vector3 Vec) const

Inequality Comparison Operator.

Returns
Returns true if X!=X, Y!=Y or Z!=Z. If all of those match this returns false.
Parameters
VecThis is the other Mezzanine::Vector3.

Definition at line 244 of file vector3.cpp.

Boole Mezzanine::Vector3::operator!= ( const btVector3 &  Vec) const

Inequality Comparison Operator.

Returns
Returns true if X!=getX(), Y!=getY() or Z!=getZ(). If all of those match this returns false.
Parameters
VecThis is an btVector3 that needs to be compared with this.

Definition at line 247 of file vector3.cpp.

Boole Mezzanine::Vector3::operator!= ( const Ogre::Vector3 &  Vec) const

Inequality Comparison Operator.

Returns
Returns true if X!=x, Y!=y or Z!=z. If all of those match this returns false.
Parameters
VecThis is an Ogre::Vector3 that needs to be compared with this.

Definition at line 250 of file vector3.cpp.

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

Scaling by multiplication.

This Multiplies X, Y and Z by scalar.

Returns
This returns a Vector3 that has been scaled.
Parameters
scalarThis is the amount to scale the Vector3 by.
Returns
A copy of Vector3 scaled by the amount passed.

Definition at line 206 of file vector3.cpp.

Vector3 Mezzanine::Vector3::operator* ( const Vector3 Vec) const

Multiplaction Operator.

Allows for multiplaction from a Mezzanine::Vector3

Parameters
VecThis is the other Mezzanine::Vector3
Returns
A copy of the calculated Vector3 to allow chained expresions.

Definition at line 267 of file vector3.cpp.

Vector3 Mezzanine::Vector3::operator* ( const btVector3 &  Vec) const

Bullet Multiplication Operator.

Allows for multiplication between a Mezzanine::Vector3 and a btVector3

Parameters
VecThis is the btVector3 to be multiplied
Returns
A copy of the calculated Vector3 to allow chained expresions.

Definition at line 314 of file vector3.cpp.

Vector3 Mezzanine::Vector3::operator* ( const Ogre::Vector3 &  Vec) const

Ogre Multiplication Operator.

Allows for multiplying between a Mezzanine::Vector3 and a Ogre::Vector3

Parameters
VecThis is the Ogre::Vector3 to be multiplied.
Returns
A copy of the calculated Vector3 to allow chained expresions.

Definition at line 329 of file vector3.cpp.

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

Scaling by multiplication.

This Multiplies X, Y and Z by scalar and stores the changes in this Vector3.

Parameters
scalarThis is the amount to scale the Vector3 by.
Returns
A reference to the assigned Vector3 to allow chained expresions.

Definition at line 215 of file vector3.cpp.

Vector3 & Mezzanine::Vector3::operator*= ( const Vector3 Vec)

Multiplaction Assignment Operator.

Parameters
VecThe other Vector3 to be multiplied.
Returns
Returns a reference to this.

Definition at line 289 of file vector3.cpp.

Vector3 Mezzanine::Vector3::operator+ ( const Vector3 Vec) const

Addition Operator.

Allows for addition from a Mezzanine::Vector3

Parameters
VecThis is the other Mezzanine::Vector3
Returns
A copy of the calculated Vector3 to allow chained expresions.

Definition at line 261 of file vector3.cpp.

Vector3 Mezzanine::Vector3::operator+ ( const btVector3 &  Vec) const

Bullet Addition Operator.

Allows for addition between a Mezzanine::Vector3 and a btVector3

Parameters
VecThis is the btVector3 to be added
Returns
A copy of the calculated Vector3 to allow chained expresions.

Definition at line 308 of file vector3.cpp.

Vector3 Mezzanine::Vector3::operator+ ( const Ogre::Vector3 &  Vec) const

Ogre Addition Operator.

Allows for addition between a Mezzanine::Vector3 and a Ogre::Vector3

Parameters
VecThis is the Ogre::Vector3 to be added
Returns
A copy of the calculated Vector3 to allow chained expresions.

Definition at line 323 of file vector3.cpp.

Vector3 & Mezzanine::Vector3::operator+= ( const Vector3 Vec)

Addition Assignment Operator.

Parameters
VecThe other Vector3 to be added.
Returns
Returns a reference to this.

Definition at line 273 of file vector3.cpp.

Vector3 Mezzanine::Vector3::operator- ( )

Additive Inverse Operator.

Returns the opposite Vector3 relative to 0,0,0

Returns
A copy of Vector3 with the signs on each value flipped

Definition at line 200 of file vector3.cpp.

Vector3 Mezzanine::Vector3::operator- ( const Vector3 Vec) const

Subraction Operator.

Allows for subtraction from a Mezzanine::Vector3

Parameters
VecThis is the other Mezzanine::Vector3
Returns
A copy of the calculated Vector3 to allow chained expresions.

Definition at line 264 of file vector3.cpp.

Vector3 Mezzanine::Vector3::operator- ( const btVector3 &  Vec) const

Bullet Subtraction Operator.

Allows for subtraction between a Mezzanine::Vector3 and a btVector3

Parameters
VecThis is the btVector3 to be subtracted
Returns
A copy of the calculated Vector3 to allow chained expresions.

Definition at line 311 of file vector3.cpp.

Vector3 Mezzanine::Vector3::operator- ( const Ogre::Vector3 &  Vec) const

Ogre Subtraction Operator.

Allows for subtraction between a Mezzanine::Vector3 and a Ogre::Vector3

Parameters
VecThis is the Ogre::Vector3 to be subtracted
Returns
A copy of the calculated Vector3 to allow chained expresions.

Definition at line 326 of file vector3.cpp.

Vector3 & Mezzanine::Vector3::operator-= ( const Vector3 Vec)

Subraction Assignment Operator.

Parameters
VecThe other Vector3 to be subtracted.
Returns
Returns a reference to this.

Definition at line 281 of file vector3.cpp.

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

Scaling by Division.

This Diisionn X, Y and Z by scalar.

Returns
This returns a Vector3 that has been scaled.
Parameters
scalarThis is the amount to scale the Vector3 by.
Returns
A copy of Vector3 scaled by the amount passed.

Definition at line 209 of file vector3.cpp.

Vector3 Mezzanine::Vector3::operator/ ( const Vector3 Vec) const

Division Operator.

Allows for division from a Mezzanine::Vector3

Parameters
VecThis is the other Mezzanine::Vector3
Returns
A copy of the calculated Vector3 to allow chained expresions.

Definition at line 270 of file vector3.cpp.

Vector3 Mezzanine::Vector3::operator/ ( const btVector3 &  Vec) const

Bullet Division Operator.

Allows for division between a Mezzanine::Vector3 and a btVector3

Parameters
VecThis is the btVector3 to be divided
Returns
A copy of the calculated Vector3 to allow chained expresions.

Definition at line 317 of file vector3.cpp.

Vector3 Mezzanine::Vector3::operator/ ( const Ogre::Vector3 &  Vec) const

Ogre Division Operator.

Allows for division between a Mezzanine::Vector3 and a Ogre::Vector3

Parameters
VecThis is the Ogre::Vector3 to be divided.
Returns
A copy of the calculated Vector3 to allow chained expresions.

Definition at line 332 of file vector3.cpp.

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

Scaling by Division.

This Division X, Y and Z by scalar and and stores the changes in this Vector3.

Parameters
scalarThis is the amount to scale the Vector3 by.
Returns
A reference to the assigned Vector3 to allow chained expresions.

Definition at line 223 of file vector3.cpp.

Vector3 & Mezzanine::Vector3::operator/= ( const Vector3 Vec)

Division Assignment Operator.

Parameters
VecThe other Vector3 to be divided.
Returns
Returns a reference to this.

Definition at line 297 of file vector3.cpp.

Boole Mezzanine::Vector3::operator<= ( const Mezzanine::Vector3 Vec) const

Less or Equal Comparison Operator.

Returns
Returns true if X<=X, Y<=Y and Z<=Z. If any of those do not hold this returns false.
Parameters
VecThis is the other Mezzanine::Vector3.
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 253 of file vector3.cpp.

Vector3 & Mezzanine::Vector3::operator= ( const btVector3 &  Vec)

Assignment operator to convert from Bullet Vectors.

This copies the x,y and z values from the bullet into this vector

Parameters
VecThis is a btVector3 that will be copied
Returns
A reference to the assigned Vector3 to allow chained expresions

Definition at line 181 of file vector3.cpp.

Vector3 & Mezzanine::Vector3::operator= ( const Ogre::Vector3 &  Vec)

Assignment operator to convert from Ogre Vectors.

This copies the x,y and z values from the bullet into this vector

Parameters
VecThis is a Ogre::Vector3 that will be copied.
Returns
A reference to the assigned Vector3 to allow chained expresions

Definition at line 189 of file vector3.cpp.

Boole Mezzanine::Vector3::operator== ( const Mezzanine::Vector3 Vec) const

Equality Comparison Operator.

Returns
Returns true if X==X, Y==Y and Z==Z. If any of those do not match this returns false.
Parameters
VecThis is the other Mezzanine::Vector3.

Definition at line 234 of file vector3.cpp.

Boole Mezzanine::Vector3::operator== ( const btVector3 &  Vec) const

Equality Comparison Operator.

Returns
Returns true if X==getX(), Y==getY() and Z==getZ(). If any of those do not match this returns false.
Parameters
VecThis is an btVector3 that needs to be compared with this.

Definition at line 237 of file vector3.cpp.

Boole Mezzanine::Vector3::operator== ( const Ogre::Vector3 &  Vec) const

Equality Comparison Operator.

Returns
Returns true if X==x, Y==y and Z==z. If any of those do not match this returns false.
Parameters
VecThis is an Ogre::Vector3 that needs to be compared with this.

Definition at line 240 of file vector3.cpp.

Boole Mezzanine::Vector3::operator>= ( const Mezzanine::Vector3 Vec) const

Greater than or Equal Comparison Operator.

Returns
Returns true if X>=X, Y>=Y and Z>=Z. If any of those do not hold this returns false.
Parameters
VecThis is the other Mezzanine::Vector3.
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 255 of file vector3.cpp.

Real Mezzanine::Vector3::operator[] ( const StandardAxis Axis) const

Get The value associate with a certain Axis.

Parameters
AxisWhich axis to retrieve.
Note
Despite the multiple scripting overloads of this Method, only Real GetAxisValue(const Whole& Axis) const; exists in the scripting interface
Returns
Either X, Y or Z as indicated by the value passed in.

Definition at line 95 of file vector3.cpp.

Real Mezzanine::Vector3::operator[] ( const Whole Axis) const

Get The value associate with a certain Axis.

Parameters
AxisWhich axis to retrieve.
Note
Despite the multiple scripting overloads of this Method, only Real GetAxisValue(const Whole& Axis) const; exists in the scripting interface
Returns
Either X, Y or Z as indicated by the value passed in.

Definition at line 98 of file vector3.cpp.

Real & Mezzanine::Vector3::operator[] ( const StandardAxis Axis)

Get The value associate with a certain Axis in such a way that it can readily be assigned in this Vector3.

Parameters
AxisWhich axis to retrieve.
Returns
Either X, Y or Z as indicated by the value passed in.

Definition at line 101 of file vector3.cpp.

Real & Mezzanine::Vector3::operator[] ( const Whole Axis)

Get The value associate with a certain Axis in such a way that it can readily be assigned in this Vector3.

Parameters
AxisWhich axis to retrieve.
Returns
Either X, Y or Z as indicated by the value passed in.

Definition at line 104 of file vector3.cpp.

Vector3 & Mezzanine::Vector3::Permute ( )

Shifts all of the components to the right.

This assigns the Z component to X, the X component to Y, and the Y component to Z.

Returns
Returns a reference to this after being altered.

Definition at line 387 of file vector3.cpp.

Vector3 Mezzanine::Vector3::Perpendicular ( ) const

Gets a vector that is perpendicular to this one.

Remarks
There are an infinite number of possibilities for 3 dimensions but this method will guarantee to generate one of them.
Returns
Returns a Vector3 that is guarenteed to be perpendicular to this vector.

Definition at line 414 of file vector3.cpp.

void Mezzanine::Vector3::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 614 of file vector3.cpp.

void Mezzanine::Vector3::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 vector3 should be appended to.

Definition at line 588 of file vector3.cpp.

Vector3 Mezzanine::Vector3::Reflect ( const Vector3 Normal)

Gets a reflection vector to the plane with the given normal.

Parameters
NormalThe normal of the plane being reflected off of.
Returns
Returns a Vector3 containing the reflection vector.

Definition at line 444 of file vector3.cpp.

void Mezzanine::Vector3::SetValues ( const Real X,
const Real Y,
const Real Z 
)

Manually sets all the members of this vector3.

Parameters
XValue to set for X.
YValue to set for Y.
ZValue to set for Z.

Definition at line 524 of file vector3.cpp.

Real Mezzanine::Vector3::SquaredDistance ( const Vector3 OtherVec) const

Gets the squared distance between this and another vector.

Parameters
OtherVecThis is the other point to measure the distance to.
Returns
Returns a Real representing the distance squared.

Definition at line 454 of file vector3.cpp.

Real Mezzanine::Vector3::SquaredLength ( ) const

Gets the length of this vector squared.

Returns
Returns a real representing the squared length of this vector.

Definition at line 464 of file vector3.cpp.

Vector3 Mezzanine::Vector3::Unit_X ( )
static

Gets a vector representing the X unit of a Vector3.

Returns
A Vector3(1,0,0).

Definition at line 131 of file vector3.cpp.

Vector3 Mezzanine::Vector3::Unit_Y ( )
static

Gets a vector representing the Y unit of a Vector3.

Returns
A Vector3(0,1,0).

Definition at line 134 of file vector3.cpp.

Vector3 Mezzanine::Vector3::Unit_Z ( )
static

Gets a vector representing the Z unit of a Vector3.

Returns
A Vector3(0,0,1).

Definition at line 137 of file vector3.cpp.

Vector3 Mezzanine::Vector3::UnitOnAxis ( StandardAxis  Axis)
static

Get a Unit Vector along the given Axis.

Parameters
AxisThe StandardAxis correlating to the Unit Vector you are retrieving
Returns
A vector one unit in length along the Axis specified.

Definition at line 149 of file vector3.cpp.


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