PolyVox  0.3.0-dev
Open source voxel management library
Public Member Functions | List of all members
PolyVox::Vector< Size, StorageType, OperationType > Class Template Reference

Represents a vector in space. More...

#include <Vector.h>

+ Inheritance diagram for PolyVox::Vector< Size, StorageType, OperationType >:

Public Member Functions

 Vector (void)
 Constructor.
 
 Vector (StorageType tFillValue)
 Constructor.
 
 Vector (StorageType x, StorageType y)
 Constructor.
 
 Vector (StorageType x, StorageType y, StorageType z)
 Constructor.
 
 Vector (StorageType x, StorageType y, StorageType z, StorageType w)
 Constructor.
 
 Vector (const Vector< Size, StorageType, OperationType > &vector)
 Copy Constructor.
 
template<typename CastType >
 Vector (const Vector< Size, CastType > &vector)
 Copy Constructor which performs casting.
 
 ~Vector (void)
 Destructor.
 
Vector< Size, StorageType,
OperationType > & 
operator= (const Vector< Size, StorageType, OperationType > &rhs)
 Assignment Operator.
 
bool operator== (const Vector< Size, StorageType, OperationType > &rhs) const
 Equality Operator.
 
bool operator!= (const Vector< Size, StorageType, OperationType > &rhs) const
 Inequality Operator.
 
bool operator< (const Vector< Size, StorageType, OperationType > &rhs) const
 Comparison Operator.
 
Vector< Size, StorageType,
OperationType > & 
operator+= (const Vector< Size, StorageType, OperationType > &rhs)
 Addition and Assignment Operator.
 
Vector< Size, StorageType,
OperationType > & 
operator-= (const Vector< Size, StorageType, OperationType > &rhs)
 Subtraction and Assignment Operator.
 
Vector< Size, StorageType,
OperationType > & 
operator*= (const Vector< Size, StorageType, OperationType > &rhs)
 Multiplication and Assignment Operator.
 
Vector< Size, StorageType,
OperationType > & 
operator/= (const Vector< Size, StorageType, OperationType > &rhs)
 Division and Assignment Operator.
 
Vector< Size, StorageType,
OperationType > & 
operator*= (const StorageType &rhs)
 Multiplication and Assignment Operator.
 
Vector< Size, StorageType,
OperationType > & 
operator/= (const StorageType &rhs)
 Division and Assignment Operator.
 
StorageType getElement (uint32_t index) const
 Element Access.
 
StorageType getX (void) const
 Get the x component of the vector.
 
StorageType getY (void) const
 Get the y component of the vector.
 
StorageType getZ (void) const
 Get the z component of the vector.
 
StorageType getW (void) const
 Get the w component of the vector.
 
void setElement (uint32_t index, StorageType tValue)
 Element Access.
 
void setElements (StorageType x, StorageType y)
 Element Access.
 
void setElements (StorageType x, StorageType y, StorageType z)
 Element Access.
 
void setElements (StorageType x, StorageType y, StorageType z, StorageType w)
 Element Access.
 
void setX (StorageType tX)
 Set the x component of the vector.
 
void setY (StorageType tY)
 Set the y component of the vector.
 
void setZ (StorageType tZ)
 Set the z component of the vector.
 
void setW (StorageType tW)
 Set the w component of the vector.
 
float length (void) const
 Get the length of the vector.
 
OperationType lengthSquared (void) const
 Get the squared length of the vector.
 
float angleTo (const Vector< Size, StorageType, OperationType > &vector) const
 Find the angle between this vector and that which is passed as a parameter.
 
Vector< Size, StorageType,
OperationType > 
cross (const Vector< Size, StorageType, OperationType > &vector) const
 Find the cross product between this vector and the vector passed as a parameter.
 
OperationType dot (const Vector< Size, StorageType, OperationType > &rhs) const
 Find the dot product between this vector and the vector passed as a parameter.
 
void normalise (void)
 Normalise the vector.
 

Detailed Description

template<uint32_t Size, typename StorageType, typename OperationType>
class PolyVox::Vector< Size, StorageType, OperationType >

Represents a vector in space.

This is a generl purpose vector class designed to represent both positions and directions. It is templatised on both size and data type but note that some of the operations do not make sense with integer types. For example it does not make conceptual sense to try and normalise an integer Vector.

Every Vector must have at at least two elements, and the first four elements of any vector are known as the X, Y, Z and W elements. Note that W is last even though it comes before X in the alphabet. These elements can be accessed through getX(), setX(), getY(), setY(), getZ(), setZ(), getW() and setW(), while other elements can be accessed through getElemen() and setElement().

This class includes a number of common mathematical operations (addition, subtraction, etc) as well as vector specific operations such as the dot and cross products. Note that this class is also templatised on an OperationType which is used for many internal calculations and some results. For example, the square of a vector's length will always be an integer if all the elements are integers, but the value might be outside that which can be represented by the StorageType. You don't need to worry about this as long as you are using the built in typedefs for common configurations.

Typedefs are provided for 2, 3 and 4 dimensional vector with int8_t, uint8_t, int16_t, uint6_t, int32_t, uint32_t, float and double types. These typedefs are used as follows:

Vector2DInt32 test(1,2); //Declares a 2 dimensional Vector of type int32_t.

Definition at line 65 of file Vector.h.

Constructor & Destructor Documentation

template<uint32_t Size, typename StorageType , typename OperationType >
Vector< Size, StorageType, OperationType >::Vector ( void  )

Constructor.

Creates a Vector object but does not initialise it.

Definition at line 31 of file Vector.inl.

template<uint32_t Size, typename StorageType, typename OperationType >
Vector< Size, StorageType, OperationType >::Vector ( StorageType  tFillValue)

Constructor.

Creates a Vector object and initialises all components with the given value.

Parameters
tFillValueThe value to write to every component.

Definition at line 40 of file Vector.inl.

template<uint32_t Size, typename StorageType, typename OperationType >
Vector< Size, StorageType, OperationType >::Vector ( StorageType  x,
StorageType  y 
)

Constructor.

Creates a Vector object and initialises it with given values.

Parameters
xThe X component to set.
yThe Y component to set.

Definition at line 54 of file Vector.inl.

template<uint32_t Size, typename StorageType, typename OperationType >
Vector< Size, StorageType, OperationType >::Vector ( StorageType  x,
StorageType  y,
StorageType  z 
)

Constructor.

Creates a Vector3D object and initialises it with given values.

Parameters
xThe X component to set.
yThe Y component to set.
zthe Z component to set.

Definition at line 69 of file Vector.inl.

template<uint32_t Size, typename StorageType, typename OperationType >
Vector< Size, StorageType, OperationType >::Vector ( StorageType  x,
StorageType  y,
StorageType  z,
StorageType  w 
)

Constructor.

Creates a Vector3D object and initialises it with given values.

Parameters
xThe X component to set.
yThe Y component to set.
zThe Z component to set.
wThe W component to set.

Definition at line 87 of file Vector.inl.

template<uint32_t Size, typename StorageType, typename OperationType>
Vector< Size, StorageType, OperationType >::Vector ( const Vector< Size, StorageType, OperationType > &  vector)

Copy Constructor.

Copy constructor builds object based on object passed as parameter.

Parameters
vectorA reference to the Vector to be copied.

Definition at line 102 of file Vector.inl.

template<uint32_t Size, typename StorageType , typename OperationType >
template<typename CastType >
Vector< Size, StorageType, OperationType >::Vector ( const Vector< Size, CastType > &  vector)
explicit

Copy Constructor which performs casting.

This copy constructor allows casting between vectors with different data types.

It makes it possible to use code such as:

Vector3DDouble v3dDouble(1.0,2.0,3.0); Vector3DFloat v3dFloat = static_cast<Vector3DFloat>(v3dDouble); //Casting

Parameters
vectorA reference to the Vector to be copied.

Definition at line 118 of file Vector.inl.

+ Here is the call graph for this function:

template<uint32_t Size, typename StorageType , typename OperationType >
Vector< Size, StorageType, OperationType >::~Vector ( void  )

Destructor.

Destroys the Vector.

Definition at line 130 of file Vector.inl.

Member Function Documentation

template<uint32_t Size, typename StorageType, typename OperationType>
float Vector< Size, StorageType, OperationType >::angleTo ( const Vector< Size, StorageType, OperationType > &  vector) const
inline

Find the angle between this vector and that which is passed as a parameter.

This function is commutative, such that a.angleTo(b) == b.angleTo(a).

The angle returned is in radians and varies between 0 and 3.14(pi). It is always positive.

Note
This function always returns a single precision floating point value, even when the StorageType is a double precision floating point value or an integer.
Parameters
vectorThe Vector to find the angle to.
Returns
The angle between them in radians.

Definition at line 593 of file Vector.inl.

+ Here is the call graph for this function:

template<uint32_t Size, typename StorageType, typename OperationType>
Vector< Size, StorageType, OperationType > Vector< Size, StorageType, OperationType >::cross ( const Vector< Size, StorageType, OperationType > &  vector) const
inline

Find the cross product between this vector and the vector passed as a parameter.

This function is used to calculate the cross product of two Vectors.

The cross product is the Vector which is perpendicular to the two given Vectors. It is worth remembering that, unlike the dot product, it is not commutative. E.g a.b != b.a. The cross product obeys the right-hand rule such that if the two vectors are given by the index finger and middle finger respectively then the cross product is given by the thumb.

Parameters
vectorThe vector to cross with this
Returns
The value of the cross product.
See Also
dot()

Definition at line 611 of file Vector.inl.

+ Here is the call graph for this function:

template<uint32_t Size, typename StorageType, typename OperationType>
OperationType Vector< Size, StorageType, OperationType >::dot ( const Vector< Size, StorageType, OperationType > &  rhs) const
inline

Find the dot product between this vector and the vector passed as a parameter.

Calculates the dot product of the Vector and the parameter.

This function is commutative, such that a.dot(b) == b.dot(a).

Parameters
rhsThe Vector to find the dot product with.
Returns
The value of the dot product.
See Also
cross()

Definition at line 627 of file Vector.inl.

template<uint32_t Size, typename StorageType , typename OperationType >
StorageType Vector< Size, StorageType, OperationType >::getElement ( uint32_t  index) const
inline

Element Access.

Returns the element at the given position.

Parameters
indexThe index of the element to return.
Returns
The element.

Definition at line 415 of file Vector.inl.

Referenced by PolyVox::LargeVolume< VoxelType >::flush(), PolyVox::operator<<(), PolyVox::LargeVolume< VoxelType >::prefetch(), and PolyVox::Vector< Size, StorageType, OperationType >::Vector().

template<uint32_t Size, typename StorageType , typename OperationType >
StorageType Vector< Size, StorageType, OperationType >::getW ( void  ) const
inline

Get the w component of the vector.

Returns
A const reference to the W component of a 4 dimensional Vector.

Definition at line 454 of file Vector.inl.

template<uint32_t Size, typename StorageType , typename OperationType >
StorageType Vector< Size, StorageType, OperationType >::getX ( void  ) const
inline

Get the x component of the vector.

Returns
A const reference to the X component of a 1, 2, 3, or 4 dimensional Vector.

Definition at line 425 of file Vector.inl.

Referenced by PolyVox::Region::accumulate(), PolyVox::computeDecimatedCentralDifferenceGradient(), PolyVox::computeSmoothCentralDifferenceGradient(), PolyVox::computeSmoothSobelGradient(), PolyVox::Region::containsPoint(), PolyVox::Vector< Size, StorageType, OperationType >::cross(), PolyVox::LowPassFilter< SrcVolumeType, DstVolumeType, AccumulationType >::executeSAT(), PolyVox::LargeVolume< VoxelType >::flush(), PolyVox::RawVolume< VoxelType >::getVoxel(), PolyVox::SimpleVolume< VoxelType >::getVoxel(), PolyVox::LargeVolume< VoxelType >::getVoxel(), PolyVox::ConstVolumeProxy< VoxelType >::getVoxelAt(), PolyVox::Block< VoxelType >::getVoxelAt(), PolyVox::SimpleVolume< VoxelType >::Block::getVoxelAt(), PolyVox::BaseVolume< _VoxelType >::Sampler< DerivedVolumeType >::getVoxelAt(), PolyVox::RawVolume< VoxelType >::getVoxelAt(), PolyVox::SimpleVolume< VoxelType >::getVoxelAt(), PolyVox::LargeVolume< VoxelType >::getVoxelAt(), PolyVox::RawVolume< VoxelType >::getVoxelWithWrapping(), PolyVox::SimpleVolume< VoxelType >::getVoxelWithWrapping(), PolyVox::LargeVolume< VoxelType >::getVoxelWithWrapping(), PolyVox::Region::grow(), PolyVox::Node::operator<(), PolyVox::LargeVolume< VoxelType >::prefetch(), PolyVox::raycastWithEndpoints(), PolyVox::Region::setLowerCorner(), PolyVox::RawVolume< VoxelType >::Sampler::setPosition(), PolyVox::BaseVolume< _VoxelType >::Sampler< DerivedVolumeType >::setPosition(), PolyVox::SimpleVolume< VoxelType >::Sampler::setPosition(), PolyVox::LargeVolume< VoxelType >::Sampler::setPosition(), PolyVox::Region::setUpperCorner(), PolyVox::ConstVolumeProxy< VoxelType >::setVoxelAt(), PolyVox::SimpleVolume< VoxelType >::Block::setVoxelAt(), PolyVox::Block< VoxelType >::setVoxelAt(), PolyVox::RawVolume< VoxelType >::setVoxelAt(), PolyVox::SimpleVolume< VoxelType >::setVoxelAt(), PolyVox::LargeVolume< VoxelType >::setVoxelAt(), PolyVox::Region::shiftLowerCorner(), PolyVox::Region::shiftUpperCorner(), and PolyVox::Region::shrink().

template<uint32_t Size, typename StorageType , typename OperationType >
StorageType Vector< Size, StorageType, OperationType >::getY ( void  ) const
inline

Get the y component of the vector.

Returns
A const reference to the Y component of a 2, 3, or 4 dimensional Vector.

Definition at line 434 of file Vector.inl.

Referenced by PolyVox::Region::accumulate(), PolyVox::Region::containsPoint(), PolyVox::Vector< Size, StorageType, OperationType >::cross(), PolyVox::LowPassFilter< SrcVolumeType, DstVolumeType, AccumulationType >::executeSAT(), PolyVox::LargeVolume< VoxelType >::flush(), PolyVox::RawVolume< VoxelType >::getVoxel(), PolyVox::SimpleVolume< VoxelType >::getVoxel(), PolyVox::LargeVolume< VoxelType >::getVoxel(), PolyVox::ConstVolumeProxy< VoxelType >::getVoxelAt(), PolyVox::Block< VoxelType >::getVoxelAt(), PolyVox::SimpleVolume< VoxelType >::Block::getVoxelAt(), PolyVox::BaseVolume< _VoxelType >::Sampler< DerivedVolumeType >::getVoxelAt(), PolyVox::RawVolume< VoxelType >::getVoxelAt(), PolyVox::SimpleVolume< VoxelType >::getVoxelAt(), PolyVox::LargeVolume< VoxelType >::getVoxelAt(), PolyVox::RawVolume< VoxelType >::getVoxelWithWrapping(), PolyVox::SimpleVolume< VoxelType >::getVoxelWithWrapping(), PolyVox::LargeVolume< VoxelType >::getVoxelWithWrapping(), PolyVox::Region::grow(), PolyVox::Node::operator<(), PolyVox::LargeVolume< VoxelType >::prefetch(), PolyVox::raycastWithEndpoints(), PolyVox::Region::setLowerCorner(), PolyVox::RawVolume< VoxelType >::Sampler::setPosition(), PolyVox::BaseVolume< _VoxelType >::Sampler< DerivedVolumeType >::setPosition(), PolyVox::SimpleVolume< VoxelType >::Sampler::setPosition(), PolyVox::LargeVolume< VoxelType >::Sampler::setPosition(), PolyVox::Region::setUpperCorner(), PolyVox::ConstVolumeProxy< VoxelType >::setVoxelAt(), PolyVox::SimpleVolume< VoxelType >::Block::setVoxelAt(), PolyVox::Block< VoxelType >::setVoxelAt(), PolyVox::RawVolume< VoxelType >::setVoxelAt(), PolyVox::SimpleVolume< VoxelType >::setVoxelAt(), PolyVox::LargeVolume< VoxelType >::setVoxelAt(), PolyVox::Region::shiftLowerCorner(), PolyVox::Region::shiftUpperCorner(), and PolyVox::Region::shrink().

template<uint32_t Size, typename StorageType , typename OperationType >
StorageType Vector< Size, StorageType, OperationType >::getZ ( void  ) const
inline

Get the z component of the vector.

Returns
A const reference to the Z component of a 3 or 4 dimensional Vector.

Definition at line 443 of file Vector.inl.

Referenced by PolyVox::Region::accumulate(), PolyVox::Region::containsPoint(), PolyVox::Vector< Size, StorageType, OperationType >::cross(), PolyVox::LowPassFilter< SrcVolumeType, DstVolumeType, AccumulationType >::executeSAT(), PolyVox::LargeVolume< VoxelType >::flush(), PolyVox::RawVolume< VoxelType >::getVoxel(), PolyVox::SimpleVolume< VoxelType >::getVoxel(), PolyVox::LargeVolume< VoxelType >::getVoxel(), PolyVox::ConstVolumeProxy< VoxelType >::getVoxelAt(), PolyVox::Block< VoxelType >::getVoxelAt(), PolyVox::SimpleVolume< VoxelType >::Block::getVoxelAt(), PolyVox::BaseVolume< _VoxelType >::Sampler< DerivedVolumeType >::getVoxelAt(), PolyVox::RawVolume< VoxelType >::getVoxelAt(), PolyVox::SimpleVolume< VoxelType >::getVoxelAt(), PolyVox::LargeVolume< VoxelType >::getVoxelAt(), PolyVox::RawVolume< VoxelType >::getVoxelWithWrapping(), PolyVox::SimpleVolume< VoxelType >::getVoxelWithWrapping(), PolyVox::LargeVolume< VoxelType >::getVoxelWithWrapping(), PolyVox::Region::grow(), PolyVox::Node::operator<(), PolyVox::LargeVolume< VoxelType >::prefetch(), PolyVox::raycastWithEndpoints(), PolyVox::Region::setLowerCorner(), PolyVox::RawVolume< VoxelType >::Sampler::setPosition(), PolyVox::BaseVolume< _VoxelType >::Sampler< DerivedVolumeType >::setPosition(), PolyVox::SimpleVolume< VoxelType >::Sampler::setPosition(), PolyVox::LargeVolume< VoxelType >::Sampler::setPosition(), PolyVox::Region::setUpperCorner(), PolyVox::ConstVolumeProxy< VoxelType >::setVoxelAt(), PolyVox::SimpleVolume< VoxelType >::Block::setVoxelAt(), PolyVox::Block< VoxelType >::setVoxelAt(), PolyVox::RawVolume< VoxelType >::setVoxelAt(), PolyVox::SimpleVolume< VoxelType >::setVoxelAt(), PolyVox::LargeVolume< VoxelType >::setVoxelAt(), PolyVox::Region::shiftLowerCorner(), PolyVox::Region::shiftUpperCorner(), and PolyVox::Region::shrink().

template<uint32_t Size, typename StorageType , typename OperationType >
float Vector< Size, StorageType, OperationType >::length ( void  ) const
inline

Get the length of the vector.

Note
This function always returns a single precision floating point value, even when the StorageType is a double precision floating point value or an integer.
Returns
The length of the Vector.

Definition at line 564 of file Vector.inl.

Referenced by PolyVox::Vector< Size, StorageType, OperationType >::angleTo().

template<uint32_t Size, typename StorageType , typename OperationType >
OperationType Vector< Size, StorageType, OperationType >::lengthSquared ( void  ) const
inline

Get the squared length of the vector.

Returns
The squared length of the Vector.

Definition at line 573 of file Vector.inl.

template<uint32_t Size, typename StorageType , typename OperationType >
void Vector< Size, StorageType, OperationType >::normalise ( void  )
inline

Normalise the vector.

Divides the i, j, and k components by the length to give a Vector of length 1.0.

If the vector is very short (or zero) then a divide by zero may cause elements to take on invalid values. You may want to check for this before normalising.

Note
You should not attempt to normalise a vector whose StorageType is an integer.

Definition at line 645 of file Vector.inl.

template<uint32_t Size, typename StorageType, typename OperationType>
bool Vector< Size, StorageType, OperationType >::operator!= ( const Vector< Size, StorageType, OperationType > &  rhs) const
inline

Inequality Operator.

Checks whether two Vectors are not equal.

Parameters
rhsThe Vector to compare to.
Returns
true if the Vectors do not match.
See Also
operator==

Definition at line 186 of file Vector.inl.

template<uint32_t Size, typename StorageType, typename OperationType>
Vector< Size, StorageType, OperationType > & Vector< Size, StorageType, OperationType >::operator*= ( const Vector< Size, StorageType, OperationType > &  rhs)
inline

Multiplication and Assignment Operator.

Multiplication operator multiplies corresponding elements of the two Vectors.

Parameters
rhsThe Vector to multiply by
Returns
The resulting Vector.

Definition at line 249 of file Vector.inl.

template<uint32_t Size, typename StorageType, typename OperationType>
Vector< Size, StorageType, OperationType > & Vector< Size, StorageType, OperationType >::operator*= ( const StorageType &  rhs)
inline

Multiplication and Assignment Operator.

Multiplication operator multiplies each element of the Vector by a number.

Parameters
rhsThe number the Vector is multiplied by.
Returns
The resulting Vector.

Definition at line 279 of file Vector.inl.

template<uint32_t Size, typename StorageType, typename OperationType>
Vector< Size, StorageType, OperationType > & Vector< Size, StorageType, OperationType >::operator+= ( const Vector< Size, StorageType, OperationType > &  rhs)
inline

Addition and Assignment Operator.

Addition operator adds corresponding elements of the two Vectors.

Parameters
rhsThe Vector to add
Returns
The resulting Vector.

Definition at line 219 of file Vector.inl.

template<uint32_t Size, typename StorageType, typename OperationType>
Vector< Size, StorageType, OperationType > & Vector< Size, StorageType, OperationType >::operator-= ( const Vector< Size, StorageType, OperationType > &  rhs)
inline

Subtraction and Assignment Operator.

Subtraction operator subtracts corresponding elements of one Vector from the other.

Parameters
rhsThe Vector to subtract
Returns
The resulting Vector.

Definition at line 234 of file Vector.inl.

template<uint32_t Size, typename StorageType, typename OperationType>
Vector< Size, StorageType, OperationType > & Vector< Size, StorageType, OperationType >::operator/= ( const Vector< Size, StorageType, OperationType > &  rhs)
inline

Division and Assignment Operator.

Division operator divides corresponding elements of one Vector by the other.

Parameters
rhsThe Vector to divide by
Returns
The resulting Vector.

Definition at line 264 of file Vector.inl.

template<uint32_t Size, typename StorageType, typename OperationType>
Vector< Size, StorageType, OperationType > & Vector< Size, StorageType, OperationType >::operator/= ( const StorageType &  rhs)
inline

Division and Assignment Operator.

Division operator divides each element of the Vector by a number.

Parameters
rhsThe number the Vector is divided by.
Returns
The resulting Vector.

Definition at line 294 of file Vector.inl.

template<uint32_t Size, typename StorageType, typename OperationType>
bool Vector< Size, StorageType, OperationType >::operator< ( const Vector< Size, StorageType, OperationType > &  rhs) const
inline

Comparison Operator.

Checks whether this vector is less than the parameter.

The metric is meaningless but it allows Vectors to me used as key in sdt::map, etc. This function is deprecated. You should specify a seperate comparator to the std:map if you need one.

Parameters
rhsThe Vector to compare to.
Returns
true if this is less than the parameter
See Also
operator!=
Deprecated:

Definition at line 201 of file Vector.inl.

template<uint32_t Size, typename StorageType, typename OperationType>
Vector< Size, StorageType, OperationType > & Vector< Size, StorageType, OperationType >::operator= ( const Vector< Size, StorageType, OperationType > &  rhs)

Assignment Operator.

Assignment operator copies each element of first Vector to the second.

Parameters
rhsVector to assign to.
Returns
A reference to the result to allow chaining.

Definition at line 148 of file Vector.inl.

template<uint32_t Size, typename StorageType, typename OperationType>
bool Vector< Size, StorageType, OperationType >::operator== ( const Vector< Size, StorageType, OperationType > &  rhs) const
inline

Equality Operator.

Checks whether two Vectors are equal.

Parameters
rhsThe Vector to compare to.
Returns
true if the Vectors match.
See Also
operator!=

Definition at line 165 of file Vector.inl.

template<uint32_t Size, typename StorageType, typename OperationType >
void Vector< Size, StorageType, OperationType >::setElement ( uint32_t  index,
StorageType  tValue 
)
inline

Element Access.

Parameters
indexThe index of the element to set.
tValueThe new value for the element.

Definition at line 466 of file Vector.inl.

Referenced by PolyVox::LargeVolume< VoxelType >::flush(), and PolyVox::LargeVolume< VoxelType >::prefetch().

template<uint32_t Size, typename StorageType, typename OperationType >
void Vector< Size, StorageType, OperationType >::setElements ( StorageType  x,
StorageType  y 
)
inline

Element Access.

Sets several elements of a vector at once.

Parameters
xThe X component to set.
yThe Y component to set.

Definition at line 478 of file Vector.inl.

template<uint32_t Size, typename StorageType, typename OperationType >
void Vector< Size, StorageType, OperationType >::setElements ( StorageType  x,
StorageType  y,
StorageType  z 
)
inline

Element Access.

Sets several elements of a vector at once.

Parameters
xThe X component to set.
yThe Y component to set.
zThe Z component to set.

Definition at line 492 of file Vector.inl.

template<uint32_t Size, typename StorageType, typename OperationType >
void Vector< Size, StorageType, OperationType >::setElements ( StorageType  x,
StorageType  y,
StorageType  z,
StorageType  w 
)
inline

Element Access.

Sets several elements of a vector at once.

Parameters
xThe X component to set.
yThe Y component to set.
zThe Z component to set.
wThe W component to set.

Definition at line 509 of file Vector.inl.

template<uint32_t Size, typename StorageType, typename OperationType >
void Vector< Size, StorageType, OperationType >::setW ( StorageType  tW)
inline

Set the w component of the vector.

Parameters
tWThe new value for the W component of a 4 dimensional Vector.

Definition at line 552 of file Vector.inl.

template<uint32_t Size, typename StorageType, typename OperationType >
void Vector< Size, StorageType, OperationType >::setX ( StorageType  tX)
inline

Set the x component of the vector.

Parameters
tXThe new value for the X component of a 1, 2, 3, or 4 dimensional Vector.

Definition at line 523 of file Vector.inl.

Referenced by PolyVox::IteratorController< IteratorType >::moveForward(), and PolyVox::Node::Node().

template<uint32_t Size, typename StorageType, typename OperationType >
void Vector< Size, StorageType, OperationType >::setY ( StorageType  tY)
inline

Set the y component of the vector.

Parameters
tYThe new value for the Y component of a 2, 3, or 4 dimensional Vector.

Definition at line 532 of file Vector.inl.

Referenced by PolyVox::Node::Node().

template<uint32_t Size, typename StorageType, typename OperationType >
void Vector< Size, StorageType, OperationType >::setZ ( StorageType  tZ)
inline

Set the z component of the vector.

Parameters
tZThe new value for the Z component of a 3 or 4 dimensional Vector.

Definition at line 541 of file Vector.inl.

Referenced by PolyVox::MarchingCubesSurfaceExtractor< VolumeType, Controller >::execute(), and PolyVox::Node::Node().


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