Hummingbird Framework
 All Classes Functions Variables Modules Pages
hb::Vector3d Class Reference

A 3D vector. More...

#include <Vector3d.h>

Public Member Functions

 Vector3d ()
 Default constructor. More...
 
 Vector3d (double x, double y, double z)
 Contruct a Vector2d from two doubles. More...
 
 Vector3d (const Vector3d &v)
 Copy constructor. More...
 
 Vector3d (const Vector2d &v)
 Implicit cast from Vector2d (z = 0). More...
 
 Vector3d (const Vector2d &v, double z)
 Implicit cast from Vector2d setting the z component. More...
 
Vector3d rotatedXZ (double degrees) const
 Get the vector rotated over the XZ plane. More...
 
Vector3d rotatedXY (double degrees) const
 Get the vector rotated over the XY plane. More...
 
Vector3d rotatedYZ (double degrees) const
 Get the vector rotated over the YZ plane. More...
 
Vector3d multiply (const Vector3d &v) const
 Multiply two vectors component by component. More...
 
double module () const
 Get the module of the Vector3d. More...
 
Vector3d normalized () const
 Get the vector normalied. More...
 
Vector2d xy ()
 Get the Vector2d formed by the x and y components of the Vector3d. More...
 

Public Attributes

double x
 x component of the vector.
 
double y
 y component of the vector.
 
double z
 z component of the vector.
 

Detailed Description

A 3D vector.

Constructor & Destructor Documentation

hb::Vector3d::Vector3d ( )
inline

Default constructor.

All values to 0.

hb::Vector3d::Vector3d ( double  x,
double  y,
double  z 
)
inline

Contruct a Vector2d from two doubles.

Parameters
xValue of x component.
yValue of y component.
zValue of z component.
hb::Vector3d::Vector3d ( const Vector3d v)
inline

Copy constructor.

Parameters
vOriginal instance.
hb::Vector3d::Vector3d ( const Vector2d v)
inline

Implicit cast from Vector2d (z = 0).

Parameters
vOriginal Vector2d.
hb::Vector3d::Vector3d ( const Vector2d v,
double  z 
)
inline

Implicit cast from Vector2d setting the z component.

Parameters
vOrigina Vector2d.
zNew z value.

Member Function Documentation

double hb::Vector3d::module ( ) const
inline

Get the module of the Vector3d.

Returns
Module of the Vector3d.
Vector3d hb::Vector3d::multiply ( const Vector3d v) const
inline

Multiply two vectors component by component.

Returns
The resulting Vector3d.
Vector3d hb::Vector3d::normalized ( ) const
inline

Get the vector normalied.

Returns
A new instance of Vector3d being the normalized version of the original.
Vector3d hb::Vector3d::rotatedXY ( double  degrees) const

Get the vector rotated over the XY plane.

Parameters
degreesNumber of degrees to be rotated.
Returns
A new instance of Vector3d with the vector rotated.
Vector3d hb::Vector3d::rotatedXZ ( double  degrees) const

Get the vector rotated over the XZ plane.

Parameters
degreesNumber of degrees to be rotated.
Returns
A new instance of Vector3d with the vector rotated.
Vector3d hb::Vector3d::rotatedYZ ( double  degrees) const

Get the vector rotated over the YZ plane.

Parameters
degreesNumber of degrees to be rotated.
Returns
A new instance of Vector3d with the vector rotated.
Vector2d hb::Vector3d::xy ( )
inline

Get the Vector2d formed by the x and y components of the Vector3d.

Returns
A Vector2d formed by the x and y components of the Vector3d.

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