Kochol Game Engine  0.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
kge::math::Vector Class Reference

#include <Vector.h>

Public Member Functions

 Vector ()
 New Vector x=y=z=0.0f,w=1.0f;.
 Vector (float x, float y, float z, float w=1.0f)
 New Vector set the x, y, z.
 Vector (const gfx::Vertex3 &init)
 New Vector from vertex3.
void set (float _x, float _y, float _z, float _w=1.0f)
 New Vector from Vector.
void Reset ()
 Reset Vector to default values.
float GetLength () const
 Returns the vector length.
float GetSqrLength () const
 Badast avardane toole bordar be tavane 2.
void Negate ()
 jahate bordaro bar ax mikone.
void Normalize ()
 bordar ra be bordare Normal tabdil mikone.
float operator* (const Vector &v) const
 Dot product.
float operator* (const gfx::Vertex3 &v) const
 Dot product.
Vector operator- (const Vector &v) const
 Tafrighe do ta vector.
Vector operator- (const gfx::Vertex3 &v) const
 Tafrighe do ta vector.
Vector operator+ (const Vector &v) const
 Adds two vector.
void operator+= (const Vector &v)
 Adds two vector.
Vector operator* (float f) const
 Vector * float.
Vector operator/ (float f) const
 Vector / float.
void operator/= (float f)
 /= float
bool operator!= (const Vector &nv) const
 Checking for not equality.
bool operator== (const Vector &nv) const
 Checking for equal.
void Cross (const Vector &v1, const Vector &v2)
 Zarb khareji do ta Vector ke hasel Vectori hast amood bar on do.
void Cross (const gfx::Vertex3 &v1, const gfx::Vertex3 &v2)
 Cross two vertex3.

Public Attributes

union {
   float   v [4]
   struct {
      float   x
      float   y
      float   z
      float   w
   } 
}; 

Detailed Description

Definition at line 31 of file Vector.h.

Constructor & Destructor Documentation

kge::math::Vector::Vector ( )
inline

New Vector x=y=z=0.0f,w=1.0f;.

Definition at line 44 of file Vector.h.

kge::math::Vector::Vector ( float  x,
float  y,
float  z,
float  w = 1.0f 
)
inline

New Vector set the x, y, z.

Definition at line 48 of file Vector.h.

kge::math::Vector::Vector ( const gfx::Vertex3 init)

New Vector from vertex3.

Member Function Documentation

void kge::math::Vector::Cross ( const Vector v1,
const Vector v2 
)
inline
void kge::math::Vector::Cross ( const gfx::Vertex3 v1,
const gfx::Vertex3 v2 
)

Cross two vertex3.

float kge::math::Vector::GetLength ( ) const
inline

Returns the vector length.

Definition at line 87 of file Vector.h.

float kge::math::Vector::GetSqrLength ( ) const
inline

Badast avardane toole bordar be tavane 2.

Definition at line 93 of file Vector.h.

void kge::math::Vector::Negate ( )
inline

jahate bordaro bar ax mikone.

Definition at line 99 of file Vector.h.

void kge::math::Vector::Normalize ( )
inline

bordar ra be bordare Normal tabdil mikone.

Definition at line 108 of file Vector.h.

References kge::math::fEpsilon.

Referenced by kge::gfx::RecalculateNormals_Flat(), kge::gfx::RecalculateNormals_Smooth(), and kge::gfx::RecalculateNormals_Smooth32().

bool kge::math::Vector::operator!= ( const Vector nv) const
inline

Checking for not equality.

Definition at line 172 of file Vector.h.

References x, y, and z.

float kge::math::Vector::operator* ( const Vector v) const
inline

Dot product.

Definition at line 118 of file Vector.h.

References x, y, and z.

float kge::math::Vector::operator* ( const gfx::Vertex3 v) const

Dot product.

Vector kge::math::Vector::operator* ( float  f) const
inline

Vector * float.

Definition at line 150 of file Vector.h.

Vector kge::math::Vector::operator+ ( const Vector v) const
inline

Adds two vector.

Definition at line 136 of file Vector.h.

References x, y, and z.

void kge::math::Vector::operator+= ( const Vector v)
inline

Adds two vector.

Definition at line 142 of file Vector.h.

References x, y, and z.

Vector kge::math::Vector::operator- ( const Vector v) const
inline

Tafrighe do ta vector.

Definition at line 127 of file Vector.h.

References x, y, and z.

Vector kge::math::Vector::operator- ( const gfx::Vertex3 v) const

Tafrighe do ta vector.

Vector kge::math::Vector::operator/ ( float  f) const
inline

Vector / float.

Definition at line 156 of file Vector.h.

References kge::math::fEpsilon.

void kge::math::Vector::operator/= ( float  f)
inline

/= float

Definition at line 163 of file Vector.h.

References kge::math::fEpsilon.

bool kge::math::Vector::operator== ( const Vector nv) const
inline

Checking for equal.

Definition at line 185 of file Vector.h.

References x, y, and z.

void kge::math::Vector::Reset ( )
inline

Reset Vector to default values.

Definition at line 78 of file Vector.h.

void kge::math::Vector::set ( float  _x,
float  _y,
float  _z,
float  _w = 1.0f 
)
inline

New Vector from Vector.

Assignment operator Set the x,y,z w(optional)

Definition at line 74 of file Vector.h.

Referenced by kge::math::Ray::CalcPickingRay(), and kge::sn::Listener::Listener().

Member Data Documentation

union { ... }
float kge::math::Vector::v[4]

Definition at line 36 of file Vector.h.

float kge::math::Vector::w

Definition at line 39 of file Vector.h.


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