HOG2
Public Member Functions | Public Attributes | List of all members
recVec Class Reference

A generic vector (essentially the same as a point, but offers normalization) More...

#include <GLUtil.h>

Public Member Functions

 recVec ()
 
 recVec (GLdouble x_i, GLdouble y_i, GLdouble z_i)
 
void normalise ()
 Normalize a vector. More...
 
double length () const
 
recVec GetNormal (recVec v)
 
recVecoperator+= (const recVec &v)
 
recVecoperator-= (const recVec &v)
 
recVec operator- (const recVec &v)
 
recVecoperator*= (GLdouble val)
 
recVec operator* (const recVec &val) const
 

Public Attributes

GLdouble x
 
GLdouble y
 
GLdouble z
 

Detailed Description

A generic vector (essentially the same as a point, but offers normalization)

Definition at line 78 of file GLUtil.h.

Constructor & Destructor Documentation

◆ recVec() [1/2]

recVec::recVec ( )
inline

Definition at line 80 of file GLUtil.h.

References x, y, and z.

◆ recVec() [2/2]

recVec::recVec ( GLdouble  x_i,
GLdouble  y_i,
GLdouble  z_i 
)
inline

Definition at line 81 of file GLUtil.h.

Member Function Documentation

◆ GetNormal()

recVec recVec::GetNormal ( recVec  v)
inline

Definition at line 84 of file GLUtil.h.

References normalise(), x, y, and z.

◆ length()

double recVec::length ( ) const

Definition at line 56 of file GLUtil.cpp.

References x, y, and z.

Referenced by normalise().

◆ normalise()

void recVec::normalise ( )

Normalize a vector.

this really should be part of the recVec class – normalizes a vector

Definition at line 39 of file GLUtil.cpp.

References length(), x, y, and z.

Referenced by AirplaneEnvironment::AirplaneEnvironment(), Map::DoNormal(), GetNormal(), MCEnvironment::OpenGLDraw(), Map2DHeading::OpenGLDraw(), SteeringEnvironment::OpenGLDraw(), Directional2DEnvironment::OpenGLDraw(), and operator*().

◆ operator*()

recVec recVec::operator* ( const recVec val) const
inline

Definition at line 107 of file GLUtil.h.

References normalise(), x, y, and z.

◆ operator*=()

recVec& recVec::operator*= ( GLdouble  val)
inline

Definition at line 105 of file GLUtil.h.

References x, y, and z.

◆ operator+=()

recVec& recVec::operator+= ( const recVec v)
inline

Definition at line 99 of file GLUtil.h.

References x, y, and z.

◆ operator-()

recVec recVec::operator- ( const recVec v)
inline

Definition at line 103 of file GLUtil.h.

◆ operator-=()

recVec& recVec::operator-= ( const recVec v)
inline

Definition at line 101 of file GLUtil.h.

References x, y, and z.

Member Data Documentation

◆ x

GLdouble recVec::x

◆ y

GLdouble recVec::y

◆ z

GLdouble recVec::z

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