Parameterizable three-dimensional vector data structure. More...
#include <mitsuba/mitsuba.h>
Public Types | |
| typedef T | Scalar |
| typedef TPoint3< T > | PointType |
| typedef detail::VectorLength < T, std::numeric_limits< T > ::is_integer >::type | LengthType |
Public Member Functions | |
| TVector3 () | |
| Construct a new vector without initializing it. More... | |
| TVector3 (T x, T y, T z) | |
| Initialize the vector with the specified X, Y and Z components. More... | |
| TVector3 (T val) | |
| Initialize all components of the the vector with the specified value. More... | |
| template<typename T2 > | |
| TVector3 (const TVector3< T2 > &v) | |
| Initialize the vector with the components of another vector data structure. More... | |
| template<typename T2 > | |
| TVector3 (const TPoint3< T2 > &p) | |
| Initialize the vector with the components of a point data structure. More... | |
| TVector3 (Stream *stream) | |
| Unserialize a vector from a binary data stream. More... | |
| TVector3 | operator+ (const TVector3 &v) const |
| Add two vectors and return the result. More... | |
| TVector3 | operator- (const TVector3 &v) const |
| Subtract two vectors and return the result. More... | |
| TVector3 & | operator+= (const TVector3 &v) |
| Add another vector to the current one. More... | |
| TVector3 & | operator-= (const TVector3 &v) |
| Subtract another vector from the current one. More... | |
| TVector3 | operator* (T f) const |
| Multiply the vector by the given scalar and return the result. More... | |
| TVector3 & | operator*= (T f) |
| Multiply the vector by the given scalar. More... | |
| TVector3 | operator- () const |
| Return a negated version of the vector. More... | |
| TVector3 | operator/ (T f) const |
| Divide the vector by the given scalar and return the result. More... | |
| TVector3 & | operator/= (T f) |
| Divide the vector by the given scalar. More... | |
| T & | operator[] (int i) |
| Index into the vector's components. More... | |
| T | operator[] (int i) const |
| Index into the vector's components (const version) More... | |
| T | lengthSquared () const |
| Return the squared 2-norm of this vector. More... | |
| LengthType | length () const |
| Return the 2-norm of this vector. More... | |
| bool | isZero () const |
| Return whether or not this vector is identically zero. More... | |
| bool | operator== (const TVector3 &v) const |
| Equality test. More... | |
| bool | operator!= (const TVector3 &v) const |
| Inequality test. More... | |
| void | serialize (Stream *stream) const |
| Serialize this vector to a binary data stream. More... | |
| std::string | toString () const |
| Return a readable string representation of this vector. More... | |
Public Attributes | |
| T | x |
| T | y |
| T | z |
Static Public Attributes | |
| static const int | dim = 3 |
| Number of dimensions. More... | |
Parameterizable three-dimensional vector data structure.
| typedef detail::VectorLength<T, std::numeric_limits<T>::is_integer>::type mitsuba::TVector3< T >::LengthType |
| typedef TPoint3<T> mitsuba::TVector3< T >::PointType |
| typedef T mitsuba::TVector3< T >::Scalar |
|
inline |
Construct a new vector without initializing it.
This construtor is useful when the vector will either not be used at all (it might be part of a larger data structure) or initialized at a later point in time. Always make sure that one of the two is the case! Otherwise your program will do computations involving uninitialized memory, which will probably lead to a difficult-to-find bug.
|
inline |
Initialize the vector with the specified X, Y and Z components.
|
inlineexplicit |
Initialize all components of the the vector with the specified value.
|
inlineexplicit |
Initialize the vector with the components of another vector data structure.
|
inlineexplicit |
Initialize the vector with the components of a point data structure.
|
inlineexplicit |
Unserialize a vector from a binary data stream.
|
inline |
Return whether or not this vector is identically zero.
|
inline |
Return the 2-norm of this vector.
|
inline |
Return the squared 2-norm of this vector.
|
inline |
Inequality test.
|
inline |
Multiply the vector by the given scalar and return the result.
|
inline |
Multiply the vector by the given scalar.
|
inline |
Add two vectors and return the result.
|
inline |
Add another vector to the current one.
|
inline |
Subtract two vectors and return the result.
|
inline |
Return a negated version of the vector.
|
inline |
Subtract another vector from the current one.
|
inline |
Divide the vector by the given scalar and return the result.
|
inline |
Divide the vector by the given scalar.
|
inline |
Equality test.
|
inline |
Index into the vector's components.
|
inline |
Index into the vector's components (const version)
|
inline |
Serialize this vector to a binary data stream.
|
inline |
Return a readable string representation of this vector.
|
static |
Number of dimensions.
| T mitsuba::TVector3< T >::x |
| T mitsuba::TVector3< T >::y |
| T mitsuba::TVector3< T >::z |