The spica renderer
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
spica::Vector3_< T > Class Template Reference

Three-dimensional vector. More...

#include <vector3d.h>

Public Types

using type = T
 

Public Member Functions

 Vector3_ ()
 The Vector3d constructor.
 
 Vector3_ (T x, T y, T z)
 The Vector3d constructor. More...
 
 Vector3_ (const std::string &str)
 
 Vector3_ (const Vector3_ &v)
 The Vector3d copy constructor.
 
virtual ~Vector3_ ()
 The Vector3d destructor.
 
Vector3_operator= (const Vector3_ &v)
 
Vector3_operator+= (const Vector3_ &v)
 
Vector3_operator+= (double x)
 
Vector3_operator-= (const Vector3_ &v)
 
Vector3_operator-= (double x)
 
Vector3_ operator- () const
 
Vector3_operator*= (const Vector3_ &v)
 Element-wise multiplication.
 
Vector3_operator*= (double s)
 
Vector3_operator/= (const Vector3_ &v)
 Element-wise division. More...
 
Vector3_operator/= (double s)
 Scalar multiplication. More...
 
operator[] (int i) const
 
bool operator== (const Vector3_ &v) const
 
bool operator!= (const Vector3_ &v) const
 
dot (const Vector3_ &v) const
 
Vector3_ cross (const Vector3_ &v) const
 
double norm () const
 
double squaredNorm () const
 
Vector3_ normalized () const
 
Vector3_ multiply (const Vector3_ &v) const
 
get (int d) const
 
std::string toString () const
 
x () const
 Get x.
 
y () const
 Get y.
 
z () const
 Get z.
 
T & xRef ()
 Get reference to x.
 
T & yRef ()
 Get reference to y.
 
T & zRef ()
 Get reference to z.
 

Static Public Member Functions

static T dot (const Vector3_ &v1, const Vector3_ &v2)
 
static Vector3_ cross (const Vector3_ &v1, const Vector3_ &v2)
 
static Vector3_ normalize (const Vector3_ &v)
 
static Vector3_ minimum (const Vector3_ &v1, const Vector3_ &v2)
 
static Vector3_ maximum (const Vector3_ &v1, const Vector3_ &v2)
 

Protected Attributes

x_
 
y_
 
z_
 

Detailed Description

template<class T>
class spica::Vector3_< T >

Three-dimensional vector.

Constructor & Destructor Documentation

template<class T>
spica::Vector3_< T >::Vector3_ ( x,
y,
z 
)

The Vector3d constructor.

Parameters
xx-coordinate
yy-coordinate
zz-coordinate
template<class T>
spica::Vector3_< T >::Vector3_ ( const std::string &  str)
Parameters
stringform vector

Member Function Documentation

template<class T >
Vector3_< T > & spica::Vector3_< T >::operator/= ( const Vector3_< T > &  v)

Element-wise division.

Parameters
vmultiplied vector
template<class T >
Vector3_< T > & spica::Vector3_< T >::operator/= ( double  s)

Scalar multiplication.

Parameters
smultiplied scalar

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