mantaflow  0.10
A framework for fluid simulation
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
Manta::Vector3D< S > Class Template Reference

Basic inlined vector class. More...

#include <vectorbase.h>

Public Member Functions

 Vector3D ()
 Constructor.
 
 Vector3D (const Vector3D< S > &v)
 Copy-Constructor.
 
 Vector3D (const float *v)
 Copy-Constructor.
 
 Vector3D (const double *v)
 Copy-Constructor.
 
 Vector3D (S v)
 Construct a vector from one S.
 
 Vector3D (S vx, S vy, S vz)
 Construct a vector from three Ss.
 
const Vector3D< S > & operator= (const Vector3D< S > &v)
 Assignment operator.
 
const Vector3D< S > & operator= (S s)
 Assignment operator.
 
const Vector3D< S > & operator+= (const Vector3D< S > &v)
 Assign and add operator.
 
const Vector3D< S > & operator+= (S s)
 Assign and add operator.
 
const Vector3D< S > & operator-= (const Vector3D< S > &v)
 Assign and sub operator.
 
const Vector3D< S > & operator-= (S s)
 Assign and sub operator.
 
const Vector3D< S > & operator*= (const Vector3D< S > &v)
 Assign and mult operator.
 
const Vector3D< S > & operator*= (S s)
 Assign and mult operator.
 
const Vector3D< S > & operator/= (const Vector3D< S > &v)
 Assign and div operator.
 
const Vector3D< S > & operator/= (S s)
 Assign and div operator.
 
Vector3D< S > operator- () const
 Negation operator.
 
min () const
 Get smallest component.
 
max () const
 Get biggest component.
 
bool empty ()
 Test if all components are zero.
 
S & operator[] (unsigned int i)
 access operator
 
const S & operator[] (unsigned int i) const
 constant access operator
 
std::string toString () const
 debug output vector to a string
 
bool isValid () const
 test if nans are present
 
 Vector3D (S vx, S vy, S vz, S vDummy)
 For compatibility with 4d vectors (discards 4th comp)
 
template<>
const Vector3D< int > Zero (0, 0, 0)
 
template<>
const Vector3D< float > Zero (0.f, 0.f, 0.f)
 
template<>
const Vector3D< double > Zero (0., 0., 0.)
 
template<>
const Vector3D< float > Invalid (numeric_limits< float >::quiet_NaN(), numeric_limits< float >::quiet_NaN(), numeric_limits< float >::quiet_NaN())
 
template<>
const Vector3D< double > Invalid (numeric_limits< double >::quiet_NaN(), numeric_limits< double >::quiet_NaN(), numeric_limits< double >::quiet_NaN())
 
template<>
bool isValid () const
 
template<>
bool isValid () const
 
template<>
std::string toString () const
 Specialization for readable ints.
 
template<>
std::string toString () const
 

Public Attributes

union {
   S   value [3]
 
   struct {
      S   x
 
      S   y
 
      S   z
 
   } 
 
   struct {
      S   X
 
      S   Y
 
      S   Z
 
   } 
 
}; 
 actual values
 

Static Public Attributes

static const Vector3D< S > Zero
 zero element
 
static const Vector3D< S > Invalid
 

Detailed Description

template<class S>
class Manta::Vector3D< S >

Basic inlined vector class.


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