Osiris Framework  0.3
OVector3 Class Reference

Represents three-dimentional vectors. More...

#include <OsirisSDK/OMath.h>

Inheritance diagram for OVector3:
OMathPrimitive< glm::vec3 >

Public Types

enum  Axis {
  X =0, Y, Z, R =0,
  Theta, Phi, G =1, B
}
 

Public Member Functions

 OVector3 ()
 Class constructor.
 
 OVector3 (const OVector3 &in)
 Class copy constructor.
 
 OVector3 (float val)
 Class constructor. More...
 
 OVector3 (float vx, float vy, float vz)
 Class constructor. More...
 
 OVector3 (const OMathPrimitive< glm::vec3 > &in)
 Copy constructor for the base template class.
 
virtual ~OVector3 ()
 Class destructor.
 
float & operator[] (Axis axis)
 Access operator for the vector components.
 
OVector3 cross (const OVector3 &in) const
 Vector cross product. More...
 
float dot (const OVector3 &in) const
 Vector dot product. More...
 
void setX (float val)
 Set the value for the cartesian X axis component.
 
void setY (float val)
 Set the value for the cartesian Y axis component.
 
void setZ (float val)
 Set the value for the cartesian Z axis component.
 
float x () const
 Returns the value of the cartesian X axis component.
 
float y () const
 Returns the value of the cartesian Y axis component.
 
float z () const
 Returns the value of the cartesian Z axis component.
 
void setR (float val)
 Set the value for the spherical radius component.
 
void setTheta (float val)
 Set the value for the spherical azimuthal component (in degrees).
 
void setPhi (float val)
 Set the value for the spherical polar component (in degrees).
 
float r () const
 Returns the value for the spherical radius component.
 
float theta () const
 Returns the value for the spherical azimuthal component (in degrees).
 
float phi () const
 Returns the value for the spherical polar component (in degrees).
 
OVector3 toSpherical () const
 Returns a new vector converted to spherical coordinates.
 
OVector3 toCartesian () const
 Returns a new vector converted to cartesian coordinates.
 
- Public Member Functions inherited from OMathPrimitive< glm::vec3 >
 OMathPrimitive ()
 Class constructor.
 
 OMathPrimitive (const OMathPrimitive< glm::vec3 > &in)
 Copy constructor.
 
virtual ~OMathPrimitive ()
 Class destructor.
 
OMathPrimitive< glm::vec3 > normalize ()
 Creates a normalized object out of the current one.
 
OMathPrimitive< glm::vec3 > & operator= (const OMathPrimitive< glm::vec3 > &in)
 
OMathPrimitive< glm::vec3 > & operator*= (const OMathPrimitive< glm::vec3 > &in)
 
OMathPrimitive< glm::vec3 > & operator*= (float x)
 
OMathPrimitive< glm::vec3 > operator* (const OMathPrimitive< glm::vec3 > &in) const
 
virtual OMathPrimitive< glm::vec3 > operator* (float x) const
 
OMathPrimitive< glm::vec3 > & operator+= (const OMathPrimitive< glm::vec3 > &in)
 
OMathPrimitive< glm::vec3 > operator+ (const OMathPrimitive< glm::vec3 > &in) const
 
OMathPrimitive< glm::vec3 > & operator-= (const OMathPrimitive< glm::vec3 > &in)
 
OMathPrimitive< glm::vec3 > operator- (const OMathPrimitive< glm::vec3 > &in) const
 
bool operator== (const OMathPrimitive< glm::vec3 > &in) const
 
bool operator!= (const OMathPrimitive< glm::vec3 > &in) const
 
const GLfloat * glArea () const
 Returns a pointer to the memory area to be used by OpenGL. For internal library usage only.
 

Static Public Member Functions

static OVector3 cross (const OVector3 &a, const OVector3 &b)
 Vector cross product. More...
 
static float dot (const OVector3 &a, const OVector3 &b)
 Vector dot product. More...
 

Additional Inherited Members

- Protected Attributes inherited from OMathPrimitive< glm::vec3 >
glm::vec3 _glmInternal
 

Detailed Description

Represents three-dimentional vectors.

Constructor & Destructor Documentation

OVector3::OVector3 ( float  val)

Class constructor.

Creates a OVector3 with all components with the same value.

Parameters
valThe value to be used by all of the three components.
OVector3::OVector3 ( float  vx,
float  vy,
float  vz 
)

Class constructor.

Creates a OVector3 taking in the values for each component (cartesian or spherical).

Member Function Documentation

OVector3 OVector3::cross ( const OVector3 in) const

Vector cross product.

Parameters
inRight value in the cross operation.
Returns
Resulting vector of the cross product.
OVector3 OVector3::cross ( const OVector3 a,
const OVector3 b 
)
static

Vector cross product.

Parameters
aLeft value of the operation.
bRight value of the operation.
Returns
Resulting vector of the cross product.
float OVector3::dot ( const OVector3 in) const

Vector dot product.

Parameters
inRight value in the dot operation.
Returns
Resulting vector of the dot product.
float OVector3::dot ( const OVector3 a,
const OVector3 b 
)
static

Vector dot product.

Parameters
inRight value in the dot operation.
Returns
Resulting value of the dot product.

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