Removed exception specifiers from PolyVox. See http://stackoverflow.com/questions/88573/should-i-use-an-exception-specifier-in-c
They are also deprecated in C++11 anyway.
This commit is contained in:
parent
5c88f2e49f
commit
17054c6747
@ -67,7 +67,7 @@ namespace PolyVox
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Private assignment operator, so client code can't abuse this class.
|
//Private assignment operator, so client code can't abuse this class.
|
||||||
ConstVolumeProxy& operator=(const ConstVolumeProxy& rhs) throw()
|
ConstVolumeProxy& operator=(const ConstVolumeProxy& rhs)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,17 +55,17 @@ namespace PolyVox
|
|||||||
|
|
||||||
// The LowPassFilter uses this to convert between normal and accumulated types.
|
// The LowPassFilter uses this to convert between normal and accumulated types.
|
||||||
/// Copy constructor with cast
|
/// Copy constructor with cast
|
||||||
template <typename CastType> explicit Density(const Density<CastType>& density) throw()
|
template <typename CastType> explicit Density(const Density<CastType>& density)
|
||||||
{
|
{
|
||||||
m_uDensity = static_cast<Type>(density.getDensity());
|
m_uDensity = static_cast<Type>(density.getDensity());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator==(const Density& rhs) const throw()
|
bool operator==(const Density& rhs) const
|
||||||
{
|
{
|
||||||
return (m_uDensity == rhs.m_uDensity);
|
return (m_uDensity == rhs.m_uDensity);
|
||||||
};
|
};
|
||||||
|
|
||||||
bool operator!=(const Density& rhs) const throw()
|
bool operator!=(const Density& rhs) const
|
||||||
{
|
{
|
||||||
return !(*this == rhs);
|
return !(*this == rhs);
|
||||||
}
|
}
|
||||||
@ -93,7 +93,7 @@ namespace PolyVox
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// \return The current density of the voxel
|
/// \return The current density of the voxel
|
||||||
Type getDensity() const throw() { return m_uDensity; }
|
Type getDensity() const { return m_uDensity; }
|
||||||
/**
|
/**
|
||||||
* Set the density of the voxel
|
* Set the density of the voxel
|
||||||
*
|
*
|
||||||
@ -102,16 +102,16 @@ namespace PolyVox
|
|||||||
void setDensity(Type uDensity) { m_uDensity = uDensity; }
|
void setDensity(Type uDensity) { m_uDensity = uDensity; }
|
||||||
|
|
||||||
/// \return The maximum allowed density of the voxel
|
/// \return The maximum allowed density of the voxel
|
||||||
static Type getMaxDensity() throw() { return (std::numeric_limits<Type>::max)(); }
|
static Type getMaxDensity() { return (std::numeric_limits<Type>::max)(); }
|
||||||
/// \return The minimum allowed density of the voxel
|
/// \return The minimum allowed density of the voxel
|
||||||
static Type getMinDensity() throw() { return (std::numeric_limits<Type>::min)(); }
|
static Type getMinDensity() { return (std::numeric_limits<Type>::min)(); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Type m_uDensity;
|
Type m_uDensity;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename Type>
|
template <typename Type>
|
||||||
Density<Type> operator+(const Density<Type>& lhs, const Density<Type>& rhs) throw()
|
Density<Type> operator+(const Density<Type>& lhs, const Density<Type>& rhs)
|
||||||
{
|
{
|
||||||
Density<Type> result = lhs;
|
Density<Type> result = lhs;
|
||||||
result += rhs;
|
result += rhs;
|
||||||
@ -119,7 +119,7 @@ namespace PolyVox
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename Type>
|
template <typename Type>
|
||||||
Density<Type> operator-(const Density<Type>& lhs, const Density<Type>& rhs) throw()
|
Density<Type> operator-(const Density<Type>& lhs, const Density<Type>& rhs)
|
||||||
{
|
{
|
||||||
Density<Type> result = lhs;
|
Density<Type> result = lhs;
|
||||||
result -= rhs;
|
result -= rhs;
|
||||||
@ -127,7 +127,7 @@ namespace PolyVox
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename Type>
|
template <typename Type>
|
||||||
Density<Type> operator/(const Density<Type>& lhs, uint32_t rhs) throw()
|
Density<Type> operator/(const Density<Type>& lhs, uint32_t rhs)
|
||||||
{
|
{
|
||||||
Density<Type> result = lhs;
|
Density<Type> result = lhs;
|
||||||
result /= rhs;
|
result /= rhs;
|
||||||
|
@ -176,7 +176,7 @@ namespace PolyVox
|
|||||||
Sampler(LargeVolume<VoxelType>* volume);
|
Sampler(LargeVolume<VoxelType>* volume);
|
||||||
~Sampler();
|
~Sampler();
|
||||||
|
|
||||||
Sampler& operator=(const Sampler& rhs) throw();
|
Sampler& operator=(const Sampler& rhs);
|
||||||
|
|
||||||
VoxelType getSubSampledVoxel(uint8_t uLevel) const;
|
VoxelType getSubSampledVoxel(uint8_t uLevel) const;
|
||||||
inline VoxelType getVoxel(void) const;
|
inline VoxelType getVoxel(void) const;
|
||||||
|
@ -40,7 +40,7 @@ namespace PolyVox
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename VoxelType>
|
template <typename VoxelType>
|
||||||
typename LargeVolume<VoxelType>::Sampler& LargeVolume<VoxelType>::Sampler::operator=(const typename LargeVolume<VoxelType>::Sampler& rhs) throw()
|
typename LargeVolume<VoxelType>::Sampler& LargeVolume<VoxelType>::Sampler::operator=(const typename LargeVolume<VoxelType>::Sampler& rhs)
|
||||||
{
|
{
|
||||||
if(this == &rhs)
|
if(this == &rhs)
|
||||||
{
|
{
|
||||||
|
@ -48,18 +48,18 @@ namespace PolyVox
|
|||||||
Material() : m_uMaterial(0) {}
|
Material() : m_uMaterial(0) {}
|
||||||
Material(Type uMaterial) : m_uMaterial(uMaterial) {}
|
Material(Type uMaterial) : m_uMaterial(uMaterial) {}
|
||||||
|
|
||||||
bool operator==(const Material& rhs) const throw()
|
bool operator==(const Material& rhs) const
|
||||||
{
|
{
|
||||||
return (m_uMaterial == rhs.m_uMaterial);
|
return (m_uMaterial == rhs.m_uMaterial);
|
||||||
};
|
};
|
||||||
|
|
||||||
bool operator!=(const Material& rhs) const throw()
|
bool operator!=(const Material& rhs) const
|
||||||
{
|
{
|
||||||
return !(*this == rhs);
|
return !(*this == rhs);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// \return The current material value of the voxel
|
/// \return The current material value of the voxel
|
||||||
Type getMaterial() const throw() { return m_uMaterial; }
|
Type getMaterial() const { return m_uMaterial; }
|
||||||
/**
|
/**
|
||||||
* Set the material value of the voxel
|
* Set the material value of the voxel
|
||||||
*
|
*
|
||||||
|
@ -44,12 +44,12 @@ namespace PolyVox
|
|||||||
MaterialDensityPair() : m_uMaterial(0), m_uDensity(0) {}
|
MaterialDensityPair() : m_uMaterial(0), m_uDensity(0) {}
|
||||||
MaterialDensityPair(Type uMaterial, Type uDensity) : m_uMaterial(uMaterial), m_uDensity(uDensity) {}
|
MaterialDensityPair(Type uMaterial, Type uDensity) : m_uMaterial(uMaterial), m_uDensity(uDensity) {}
|
||||||
|
|
||||||
bool operator==(const MaterialDensityPair& rhs) const throw()
|
bool operator==(const MaterialDensityPair& rhs) const
|
||||||
{
|
{
|
||||||
return (m_uMaterial == rhs.m_uMaterial) && (m_uDensity == rhs.m_uDensity);
|
return (m_uMaterial == rhs.m_uMaterial) && (m_uDensity == rhs.m_uDensity);
|
||||||
};
|
};
|
||||||
|
|
||||||
bool operator!=(const MaterialDensityPair& rhs) const throw()
|
bool operator!=(const MaterialDensityPair& rhs) const
|
||||||
{
|
{
|
||||||
return !(*this == rhs);
|
return !(*this == rhs);
|
||||||
}
|
}
|
||||||
@ -72,14 +72,14 @@ namespace PolyVox
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
Type getDensity() const throw() { return m_uDensity; }
|
Type getDensity() const { return m_uDensity; }
|
||||||
Type getMaterial() const throw() { return m_uMaterial; }
|
Type getMaterial() const { return m_uMaterial; }
|
||||||
|
|
||||||
void setDensity(Type uDensity) { m_uDensity = uDensity; }
|
void setDensity(Type uDensity) { m_uDensity = uDensity; }
|
||||||
void setMaterial(Type uMaterial) { m_uMaterial = uMaterial; }
|
void setMaterial(Type uMaterial) { m_uMaterial = uMaterial; }
|
||||||
|
|
||||||
static Type getMaxDensity() throw() { return (0x01 << NoOfDensityBits) - 1; }
|
static Type getMaxDensity() { return (0x01 << NoOfDensityBits) - 1; }
|
||||||
static Type getMinDensity() throw() { return 0; }
|
static Type getMinDensity() { return 0; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Type m_uMaterial : NoOfMaterialBits;
|
Type m_uMaterial : NoOfMaterialBits;
|
||||||
|
@ -45,9 +45,9 @@ namespace PolyVox
|
|||||||
Region(int32_t iLowerX, int32_t iLowerY, int32_t iLowerZ, int32_t iUpperX, int32_t iUpperY, int32_t iUpperZ);
|
Region(int32_t iLowerX, int32_t iLowerY, int32_t iLowerZ, int32_t iUpperX, int32_t iUpperY, int32_t iUpperZ);
|
||||||
|
|
||||||
///Equality Operator.
|
///Equality Operator.
|
||||||
bool operator==(const Region& rhs) const throw();
|
bool operator==(const Region& rhs) const;
|
||||||
///Inequality Operator.
|
///Inequality Operator.
|
||||||
bool operator!=(const Region& rhs) const throw();
|
bool operator!=(const Region& rhs) const;
|
||||||
|
|
||||||
const Vector3DInt32& getLowerCorner(void) const;
|
const Vector3DInt32& getLowerCorner(void) const;
|
||||||
const Vector3DInt32& getUpperCorner(void) const;
|
const Vector3DInt32& getUpperCorner(void) const;
|
||||||
|
@ -87,7 +87,7 @@ namespace PolyVox
|
|||||||
Sampler(SimpleVolume<VoxelType>* volume);
|
Sampler(SimpleVolume<VoxelType>* volume);
|
||||||
~Sampler();
|
~Sampler();
|
||||||
|
|
||||||
Sampler& operator=(const Sampler& rhs) throw();
|
Sampler& operator=(const Sampler& rhs);
|
||||||
|
|
||||||
VoxelType getSubSampledVoxel(uint8_t uLevel) const;
|
VoxelType getSubSampledVoxel(uint8_t uLevel) const;
|
||||||
/// Get the value of the current voxel
|
/// Get the value of the current voxel
|
||||||
|
@ -43,7 +43,7 @@ namespace PolyVox
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename VoxelType>
|
template <typename VoxelType>
|
||||||
typename SimpleVolume<VoxelType>::Sampler& SimpleVolume<VoxelType>::Sampler::operator=(const typename SimpleVolume<VoxelType>::Sampler& rhs) throw()
|
typename SimpleVolume<VoxelType>::Sampler& SimpleVolume<VoxelType>::Sampler::operator=(const typename SimpleVolume<VoxelType>::Sampler& rhs)
|
||||||
{
|
{
|
||||||
if(this == &rhs)
|
if(this == &rhs)
|
||||||
{
|
{
|
||||||
|
@ -63,81 +63,81 @@ namespace PolyVox
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
///Constructor.
|
///Constructor.
|
||||||
Vector(Type x, Type y) throw();
|
Vector(Type x, Type y);
|
||||||
///Constructor.
|
///Constructor.
|
||||||
Vector(Type x, Type y, Type z) throw();
|
Vector(Type x, Type y, Type z);
|
||||||
///Constructor.
|
///Constructor.
|
||||||
Vector(Type x, Type y, Type z, Type w) throw();
|
Vector(Type x, Type y, Type z, Type w);
|
||||||
///Constructor
|
///Constructor
|
||||||
Vector(void) throw();
|
Vector(void);
|
||||||
///Copy Constructor.
|
///Copy Constructor.
|
||||||
Vector(const Vector<Size,Type>& vector) throw();
|
Vector(const Vector<Size,Type>& vector);
|
||||||
///Copy Constructor which performs casting.
|
///Copy Constructor which performs casting.
|
||||||
template <typename CastType> explicit Vector(const Vector<Size,CastType>& vector) throw();
|
template <typename CastType> explicit Vector(const Vector<Size,CastType>& vector);
|
||||||
///Destructor.
|
///Destructor.
|
||||||
~Vector(void) throw();
|
~Vector(void);
|
||||||
|
|
||||||
///Assignment Operator.
|
///Assignment Operator.
|
||||||
Vector<Size,Type>& operator=(const Vector<Size,Type>& rhs) throw();
|
Vector<Size,Type>& operator=(const Vector<Size,Type>& rhs);
|
||||||
///Equality Operator.
|
///Equality Operator.
|
||||||
bool operator==(const Vector<Size,Type>& rhs) const throw();
|
bool operator==(const Vector<Size,Type>& rhs) const;
|
||||||
///Inequality Operator.
|
///Inequality Operator.
|
||||||
bool operator!=(const Vector<Size,Type>& rhs) const throw();
|
bool operator!=(const Vector<Size,Type>& rhs) const;
|
||||||
///Comparison Operator.
|
///Comparison Operator.
|
||||||
bool operator<(const Vector<Size,Type>& rhs) const throw();
|
bool operator<(const Vector<Size,Type>& rhs) const;
|
||||||
///Addition and Assignment Operator.
|
///Addition and Assignment Operator.
|
||||||
Vector<Size,Type>& operator+=(const Vector<Size,Type> &rhs) throw();
|
Vector<Size,Type>& operator+=(const Vector<Size,Type> &rhs);
|
||||||
///Subtraction and Assignment Operator.
|
///Subtraction and Assignment Operator.
|
||||||
Vector<Size,Type>& operator-=(const Vector<Size,Type> &rhs) throw();
|
Vector<Size,Type>& operator-=(const Vector<Size,Type> &rhs);
|
||||||
///Multiplication and Assignment Operator.
|
///Multiplication and Assignment Operator.
|
||||||
Vector<Size,Type>& operator*=(const Vector<Size,Type> &rhs) throw();
|
Vector<Size,Type>& operator*=(const Vector<Size,Type> &rhs);
|
||||||
///Division and Assignment Operator.
|
///Division and Assignment Operator.
|
||||||
Vector<Size,Type>& operator/=(const Vector<Size,Type> &rhs) throw();
|
Vector<Size,Type>& operator/=(const Vector<Size,Type> &rhs);
|
||||||
///Multiplication and Assignment Operator.
|
///Multiplication and Assignment Operator.
|
||||||
Vector<Size,Type>& operator*=(const Type& rhs) throw();
|
Vector<Size,Type>& operator*=(const Type& rhs);
|
||||||
///Division and Assignment Operator.
|
///Division and Assignment Operator.
|
||||||
Vector<Size,Type>& operator/=(const Type& rhs) throw();
|
Vector<Size,Type>& operator/=(const Type& rhs);
|
||||||
|
|
||||||
///Element Access.
|
///Element Access.
|
||||||
Type getElement(uint32_t index) const throw();
|
Type getElement(uint32_t index) const;
|
||||||
///Get the x component of the vector.
|
///Get the x component of the vector.
|
||||||
Type getX(void) const throw();
|
Type getX(void) const;
|
||||||
///Get the y component of the vector.
|
///Get the y component of the vector.
|
||||||
Type getY(void) const throw();
|
Type getY(void) const;
|
||||||
///Get the z component of the vector.
|
///Get the z component of the vector.
|
||||||
Type getZ(void) const throw();
|
Type getZ(void) const;
|
||||||
///Get the w component of the vector.
|
///Get the w component of the vector.
|
||||||
Type getW(void) const throw();
|
Type getW(void) const;
|
||||||
|
|
||||||
///Element Access.
|
///Element Access.
|
||||||
void setElement(uint32_t index, Type tValue) throw();
|
void setElement(uint32_t index, Type tValue);
|
||||||
///Element Access.
|
///Element Access.
|
||||||
void setElements(Type x, Type y) throw();
|
void setElements(Type x, Type y);
|
||||||
///Element Access.
|
///Element Access.
|
||||||
void setElements(Type x, Type y, Type z) throw();
|
void setElements(Type x, Type y, Type z);
|
||||||
///Element Access.
|
///Element Access.
|
||||||
void setElements(Type x, Type y, Type z, Type w) throw();
|
void setElements(Type x, Type y, Type z, Type w);
|
||||||
///Set the x component of the vector.
|
///Set the x component of the vector.
|
||||||
void setX(Type tX) throw();
|
void setX(Type tX);
|
||||||
///Set the y component of the vector.
|
///Set the y component of the vector.
|
||||||
void setY(Type tY) throw();
|
void setY(Type tY);
|
||||||
///Set the z component of the vector.
|
///Set the z component of the vector.
|
||||||
void setZ(Type tZ) throw();
|
void setZ(Type tZ);
|
||||||
///Set the w component of the vector.
|
///Set the w component of the vector.
|
||||||
void setW(Type tW) throw();
|
void setW(Type tW);
|
||||||
|
|
||||||
///Get the length of the vector.
|
///Get the length of the vector.
|
||||||
double length(void) const throw();
|
double length(void) const;
|
||||||
///Get the squared length of the vector.
|
///Get the squared length of the vector.
|
||||||
double lengthSquared(void) const throw();
|
double lengthSquared(void) const;
|
||||||
///Find the angle between this vector and that which is passed as a parameter.
|
///Find the angle between this vector and that which is passed as a parameter.
|
||||||
double angleTo(const Vector<Size,Type>& vector) const throw();
|
double angleTo(const Vector<Size,Type>& vector) const;
|
||||||
///Find the cross product between this vector and the vector passed as a parameter.
|
///Find the cross product between this vector and the vector passed as a parameter.
|
||||||
Vector<Size,Type> cross(const Vector<Size,Type>& vector) const throw();
|
Vector<Size,Type> cross(const Vector<Size,Type>& vector) const;
|
||||||
///Find the dot product between this vector and the vector passed as a parameter.
|
///Find the dot product between this vector and the vector passed as a parameter.
|
||||||
Type dot(const Vector<Size,Type>& rhs) const throw();
|
Type dot(const Vector<Size,Type>& rhs) const;
|
||||||
///Normalise the vector.
|
///Normalise the vector.
|
||||||
void normalise(void) throw();
|
void normalise(void);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
//Values for the vector
|
//Values for the vector
|
||||||
@ -147,25 +147,25 @@ namespace PolyVox
|
|||||||
//Non-member overloaded operators.
|
//Non-member overloaded operators.
|
||||||
///Addition operator.
|
///Addition operator.
|
||||||
template <uint32_t Size,typename Type>
|
template <uint32_t Size,typename Type>
|
||||||
Vector<Size,Type> operator+(const Vector<Size,Type>& lhs, const Vector<Size,Type>& rhs) throw();
|
Vector<Size,Type> operator+(const Vector<Size,Type>& lhs, const Vector<Size,Type>& rhs);
|
||||||
///Subtraction operator.
|
///Subtraction operator.
|
||||||
template <uint32_t Size,typename Type>
|
template <uint32_t Size,typename Type>
|
||||||
Vector<Size,Type> operator-(const Vector<Size,Type>& lhs, const Vector<Size,Type>& rhs) throw();
|
Vector<Size,Type> operator-(const Vector<Size,Type>& lhs, const Vector<Size,Type>& rhs);
|
||||||
///Multiplication operator.
|
///Multiplication operator.
|
||||||
template <uint32_t Size,typename Type>
|
template <uint32_t Size,typename Type>
|
||||||
Vector<Size,Type> operator*(const Vector<Size,Type>& lhs, const Vector<Size,Type>& rhs) throw();
|
Vector<Size,Type> operator*(const Vector<Size,Type>& lhs, const Vector<Size,Type>& rhs);
|
||||||
///Division operator.
|
///Division operator.
|
||||||
template <uint32_t Size,typename Type>
|
template <uint32_t Size,typename Type>
|
||||||
Vector<Size,Type> operator/(const Vector<Size,Type>& lhs, const Vector<Size,Type>& rhs) throw();
|
Vector<Size,Type> operator/(const Vector<Size,Type>& lhs, const Vector<Size,Type>& rhs);
|
||||||
///Multiplication operator.
|
///Multiplication operator.
|
||||||
template <uint32_t Size,typename Type>
|
template <uint32_t Size,typename Type>
|
||||||
Vector<Size,Type> operator*(const Vector<Size,Type>& lhs, const Type& rhs) throw();
|
Vector<Size,Type> operator*(const Vector<Size,Type>& lhs, const Type& rhs);
|
||||||
///Division operator.
|
///Division operator.
|
||||||
template <uint32_t Size,typename Type>
|
template <uint32_t Size,typename Type>
|
||||||
Vector<Size,Type> operator/(const Vector<Size,Type>& lhs, const Type& rhs) throw();
|
Vector<Size,Type> operator/(const Vector<Size,Type>& lhs, const Type& rhs);
|
||||||
///Stream insertion operator.
|
///Stream insertion operator.
|
||||||
template <uint32_t Size, typename Type>
|
template <uint32_t Size, typename Type>
|
||||||
std::ostream& operator<<(std::ostream& os, const Vector<Size,Type>& vector) throw();
|
std::ostream& operator<<(std::ostream& os, const Vector<Size,Type>& vector);
|
||||||
|
|
||||||
//Some handy typedefs
|
//Some handy typedefs
|
||||||
///A 3D Vector of floats.
|
///A 3D Vector of floats.
|
||||||
|
@ -30,7 +30,7 @@ namespace PolyVox
|
|||||||
\param y y component to set.
|
\param y y component to set.
|
||||||
*/
|
*/
|
||||||
template <uint32_t Size,typename Type>
|
template <uint32_t Size,typename Type>
|
||||||
Vector<Size,Type>::Vector(Type x, Type y) throw()
|
Vector<Size,Type>::Vector(Type x, Type y)
|
||||||
{
|
{
|
||||||
m_tElements[0] = x;
|
m_tElements[0] = x;
|
||||||
m_tElements[1] = y;
|
m_tElements[1] = y;
|
||||||
@ -44,7 +44,7 @@ namespace PolyVox
|
|||||||
\param z z component to set.
|
\param z z component to set.
|
||||||
*/
|
*/
|
||||||
template <uint32_t Size,typename Type>
|
template <uint32_t Size,typename Type>
|
||||||
Vector<Size,Type>::Vector(Type x, Type y, Type z) throw()
|
Vector<Size,Type>::Vector(Type x, Type y, Type z)
|
||||||
{
|
{
|
||||||
m_tElements[0] = x;
|
m_tElements[0] = x;
|
||||||
m_tElements[1] = y;
|
m_tElements[1] = y;
|
||||||
@ -60,7 +60,7 @@ namespace PolyVox
|
|||||||
\param w w component to set.
|
\param w w component to set.
|
||||||
*/
|
*/
|
||||||
template <uint32_t Size,typename Type>
|
template <uint32_t Size,typename Type>
|
||||||
Vector<Size,Type>::Vector(Type x, Type y, Type z, Type w) throw()
|
Vector<Size,Type>::Vector(Type x, Type y, Type z, Type w)
|
||||||
{
|
{
|
||||||
m_tElements[0] = x;
|
m_tElements[0] = x;
|
||||||
m_tElements[1] = y;
|
m_tElements[1] = y;
|
||||||
@ -72,7 +72,7 @@ namespace PolyVox
|
|||||||
Creates a Vector object but does not initialise it.
|
Creates a Vector object but does not initialise it.
|
||||||
*/
|
*/
|
||||||
template <uint32_t Size, typename Type>
|
template <uint32_t Size, typename Type>
|
||||||
Vector<Size, Type>::Vector(void) throw()
|
Vector<Size, Type>::Vector(void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -81,7 +81,7 @@ namespace PolyVox
|
|||||||
\param vector A reference to the Vector to be copied.
|
\param vector A reference to the Vector to be copied.
|
||||||
*/
|
*/
|
||||||
template <uint32_t Size, typename Type>
|
template <uint32_t Size, typename Type>
|
||||||
Vector<Size, Type>::Vector(const Vector<Size, Type>& vector) throw()
|
Vector<Size, Type>::Vector(const Vector<Size, Type>& vector)
|
||||||
{
|
{
|
||||||
std::memcpy(m_tElements, vector.m_tElements, sizeof(Type) * Size);
|
std::memcpy(m_tElements, vector.m_tElements, sizeof(Type) * Size);
|
||||||
}
|
}
|
||||||
@ -97,7 +97,7 @@ namespace PolyVox
|
|||||||
*/
|
*/
|
||||||
template <uint32_t Size, typename Type>
|
template <uint32_t Size, typename Type>
|
||||||
template <typename CastType>
|
template <typename CastType>
|
||||||
Vector<Size, Type>::Vector(const Vector<Size, CastType>& vector) throw()
|
Vector<Size, Type>::Vector(const Vector<Size, CastType>& vector)
|
||||||
{
|
{
|
||||||
for(uint32_t ct = 0; ct < Size; ++ct)
|
for(uint32_t ct = 0; ct < Size; ++ct)
|
||||||
{
|
{
|
||||||
@ -109,7 +109,7 @@ namespace PolyVox
|
|||||||
Destroys the Vector.
|
Destroys the Vector.
|
||||||
*/
|
*/
|
||||||
template <uint32_t Size, typename Type>
|
template <uint32_t Size, typename Type>
|
||||||
Vector<Size, Type>::~Vector(void) throw()
|
Vector<Size, Type>::~Vector(void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -119,7 +119,7 @@ namespace PolyVox
|
|||||||
\return A reference to the result to allow chaining.
|
\return A reference to the result to allow chaining.
|
||||||
*/
|
*/
|
||||||
template <uint32_t Size, typename Type>
|
template <uint32_t Size, typename Type>
|
||||||
Vector<Size, Type>& Vector<Size, Type>::operator=(const Vector<Size, Type>& rhs) throw()
|
Vector<Size, Type>& Vector<Size, Type>::operator=(const Vector<Size, Type>& rhs)
|
||||||
{
|
{
|
||||||
if(this == &rhs)
|
if(this == &rhs)
|
||||||
{
|
{
|
||||||
@ -136,7 +136,7 @@ namespace PolyVox
|
|||||||
\see operator!=
|
\see operator!=
|
||||||
*/
|
*/
|
||||||
template <uint32_t Size, typename Type>
|
template <uint32_t Size, typename Type>
|
||||||
inline bool Vector<Size, Type>::operator==(const Vector<Size, Type> &rhs) const throw()
|
inline bool Vector<Size, Type>::operator==(const Vector<Size, Type> &rhs) const
|
||||||
{
|
{
|
||||||
bool equal = true;
|
bool equal = true;
|
||||||
for(uint32_t ct = 0; ct < Size; ++ct)
|
for(uint32_t ct = 0; ct < Size; ++ct)
|
||||||
@ -157,7 +157,7 @@ namespace PolyVox
|
|||||||
\see operator==
|
\see operator==
|
||||||
*/
|
*/
|
||||||
template <uint32_t Size, typename Type>
|
template <uint32_t Size, typename Type>
|
||||||
inline bool Vector<Size, Type>::operator!=(const Vector<Size, Type> &rhs) const throw()
|
inline bool Vector<Size, Type>::operator!=(const Vector<Size, Type> &rhs) const
|
||||||
{
|
{
|
||||||
return !(*this == rhs); //Just call equality operator and invert the result.
|
return !(*this == rhs); //Just call equality operator and invert the result.
|
||||||
}
|
}
|
||||||
@ -170,7 +170,7 @@ namespace PolyVox
|
|||||||
\see operator!=
|
\see operator!=
|
||||||
*/
|
*/
|
||||||
template <uint32_t Size, typename Type>
|
template <uint32_t Size, typename Type>
|
||||||
inline bool Vector<Size, Type>::operator<(const Vector<Size, Type> &rhs) const throw()
|
inline bool Vector<Size, Type>::operator<(const Vector<Size, Type> &rhs) const
|
||||||
{
|
{
|
||||||
for(uint32_t ct = 0; ct < Size; ++ct)
|
for(uint32_t ct = 0; ct < Size; ++ct)
|
||||||
{
|
{
|
||||||
@ -188,7 +188,7 @@ namespace PolyVox
|
|||||||
\return The resulting Vector.
|
\return The resulting Vector.
|
||||||
*/
|
*/
|
||||||
template <uint32_t Size, typename Type>
|
template <uint32_t Size, typename Type>
|
||||||
inline Vector<Size, Type>& Vector<Size, Type>::operator+=(const Vector<Size, Type>& rhs) throw()
|
inline Vector<Size, Type>& Vector<Size, Type>::operator+=(const Vector<Size, Type>& rhs)
|
||||||
{
|
{
|
||||||
for(uint32_t ct = 0; ct < Size; ++ct)
|
for(uint32_t ct = 0; ct < Size; ++ct)
|
||||||
{
|
{
|
||||||
@ -203,7 +203,7 @@ namespace PolyVox
|
|||||||
\return The resulting Vector.
|
\return The resulting Vector.
|
||||||
*/
|
*/
|
||||||
template <uint32_t Size, typename Type>
|
template <uint32_t Size, typename Type>
|
||||||
inline Vector<Size, Type>& Vector<Size, Type>::operator-=(const Vector<Size, Type>& rhs) throw()
|
inline Vector<Size, Type>& Vector<Size, Type>::operator-=(const Vector<Size, Type>& rhs)
|
||||||
{
|
{
|
||||||
for(uint32_t ct = 0; ct < Size; ++ct)
|
for(uint32_t ct = 0; ct < Size; ++ct)
|
||||||
{
|
{
|
||||||
@ -218,7 +218,7 @@ namespace PolyVox
|
|||||||
\return The resulting Vector.
|
\return The resulting Vector.
|
||||||
*/
|
*/
|
||||||
template <uint32_t Size, typename Type>
|
template <uint32_t Size, typename Type>
|
||||||
inline Vector<Size, Type>& Vector<Size, Type>::operator*=(const Vector<Size, Type>& rhs) throw()
|
inline Vector<Size, Type>& Vector<Size, Type>::operator*=(const Vector<Size, Type>& rhs)
|
||||||
{
|
{
|
||||||
for(uint32_t ct = 0; ct < Size; ++ct)
|
for(uint32_t ct = 0; ct < Size; ++ct)
|
||||||
{
|
{
|
||||||
@ -233,7 +233,7 @@ namespace PolyVox
|
|||||||
\return The resulting Vector.
|
\return The resulting Vector.
|
||||||
*/
|
*/
|
||||||
template <uint32_t Size, typename Type>
|
template <uint32_t Size, typename Type>
|
||||||
inline Vector<Size, Type>& Vector<Size, Type>::operator/=(const Vector<Size, Type>& rhs) throw()
|
inline Vector<Size, Type>& Vector<Size, Type>::operator/=(const Vector<Size, Type>& rhs)
|
||||||
{
|
{
|
||||||
for(uint32_t ct = 0; ct < Size; ++ct)
|
for(uint32_t ct = 0; ct < Size; ++ct)
|
||||||
{
|
{
|
||||||
@ -248,7 +248,7 @@ namespace PolyVox
|
|||||||
\return The resulting Vector.
|
\return The resulting Vector.
|
||||||
*/
|
*/
|
||||||
template <uint32_t Size, typename Type>
|
template <uint32_t Size, typename Type>
|
||||||
inline Vector<Size, Type>& Vector<Size, Type>::operator*=(const Type& rhs) throw()
|
inline Vector<Size, Type>& Vector<Size, Type>::operator*=(const Type& rhs)
|
||||||
{
|
{
|
||||||
for(uint32_t ct = 0; ct < Size; ++ct)
|
for(uint32_t ct = 0; ct < Size; ++ct)
|
||||||
{
|
{
|
||||||
@ -263,7 +263,7 @@ namespace PolyVox
|
|||||||
\return The resulting Vector.
|
\return The resulting Vector.
|
||||||
*/
|
*/
|
||||||
template <uint32_t Size, typename Type>
|
template <uint32_t Size, typename Type>
|
||||||
inline Vector<Size, Type>& Vector<Size, Type>::operator/=(const Type& rhs) throw()
|
inline Vector<Size, Type>& Vector<Size, Type>::operator/=(const Type& rhs)
|
||||||
{
|
{
|
||||||
for(uint32_t ct = 0; ct < Size; ++ct)
|
for(uint32_t ct = 0; ct < Size; ++ct)
|
||||||
{
|
{
|
||||||
@ -279,7 +279,7 @@ namespace PolyVox
|
|||||||
\return The resulting Vector.
|
\return The resulting Vector.
|
||||||
*/
|
*/
|
||||||
template <uint32_t Size,typename Type>
|
template <uint32_t Size,typename Type>
|
||||||
Vector<Size,Type> operator+(const Vector<Size,Type>& lhs, const Vector<Size,Type>& rhs) throw()
|
Vector<Size,Type> operator+(const Vector<Size,Type>& lhs, const Vector<Size,Type>& rhs)
|
||||||
{
|
{
|
||||||
Vector<Size,Type> result = lhs;
|
Vector<Size,Type> result = lhs;
|
||||||
result += rhs;
|
result += rhs;
|
||||||
@ -293,7 +293,7 @@ namespace PolyVox
|
|||||||
\return The resulting Vector.
|
\return The resulting Vector.
|
||||||
*/
|
*/
|
||||||
template <uint32_t Size,typename Type>
|
template <uint32_t Size,typename Type>
|
||||||
Vector<Size,Type> operator-(const Vector<Size,Type>& lhs, const Vector<Size,Type>& rhs) throw()
|
Vector<Size,Type> operator-(const Vector<Size,Type>& lhs, const Vector<Size,Type>& rhs)
|
||||||
{
|
{
|
||||||
Vector<Size,Type> result = lhs;
|
Vector<Size,Type> result = lhs;
|
||||||
result -= rhs;
|
result -= rhs;
|
||||||
@ -307,7 +307,7 @@ namespace PolyVox
|
|||||||
\return The resulting Vector.
|
\return The resulting Vector.
|
||||||
*/
|
*/
|
||||||
template <uint32_t Size,typename Type>
|
template <uint32_t Size,typename Type>
|
||||||
Vector<Size,Type> operator*(const Vector<Size,Type>& lhs, const Vector<Size,Type>& rhs) throw()
|
Vector<Size,Type> operator*(const Vector<Size,Type>& lhs, const Vector<Size,Type>& rhs)
|
||||||
{
|
{
|
||||||
Vector<Size,Type> result = lhs;
|
Vector<Size,Type> result = lhs;
|
||||||
result *= rhs;
|
result *= rhs;
|
||||||
@ -321,7 +321,7 @@ namespace PolyVox
|
|||||||
\return The resulting Vector.
|
\return The resulting Vector.
|
||||||
*/
|
*/
|
||||||
template <uint32_t Size,typename Type>
|
template <uint32_t Size,typename Type>
|
||||||
Vector<Size,Type> operator/(const Vector<Size,Type>& lhs, const Vector<Size,Type>& rhs) throw()
|
Vector<Size,Type> operator/(const Vector<Size,Type>& lhs, const Vector<Size,Type>& rhs)
|
||||||
{
|
{
|
||||||
Vector<Size,Type> result = lhs;
|
Vector<Size,Type> result = lhs;
|
||||||
result /= rhs;
|
result /= rhs;
|
||||||
@ -335,7 +335,7 @@ namespace PolyVox
|
|||||||
\return The resulting Vector.
|
\return The resulting Vector.
|
||||||
*/
|
*/
|
||||||
template <uint32_t Size,typename Type>
|
template <uint32_t Size,typename Type>
|
||||||
Vector<Size,Type> operator*(const Vector<Size,Type>& lhs, const Type& rhs) throw()
|
Vector<Size,Type> operator*(const Vector<Size,Type>& lhs, const Type& rhs)
|
||||||
{
|
{
|
||||||
Vector<Size,Type> result = lhs;
|
Vector<Size,Type> result = lhs;
|
||||||
result *= rhs;
|
result *= rhs;
|
||||||
@ -349,7 +349,7 @@ namespace PolyVox
|
|||||||
\return The resulting Vector.
|
\return The resulting Vector.
|
||||||
*/
|
*/
|
||||||
template <uint32_t Size,typename Type>
|
template <uint32_t Size,typename Type>
|
||||||
Vector<Size,Type> operator/(const Vector<Size,Type>& lhs, const Type& rhs) throw()
|
Vector<Size,Type> operator/(const Vector<Size,Type>& lhs, const Type& rhs)
|
||||||
{
|
{
|
||||||
Vector<Size,Type> result = lhs;
|
Vector<Size,Type> result = lhs;
|
||||||
result /= rhs;
|
result /= rhs;
|
||||||
@ -363,7 +363,7 @@ namespace PolyVox
|
|||||||
\return A reference to the output stream to allow chaining.
|
\return A reference to the output stream to allow chaining.
|
||||||
*/
|
*/
|
||||||
template <uint32_t Size, typename Type>
|
template <uint32_t Size, typename Type>
|
||||||
std::ostream& operator<<(std::ostream& os, const Vector<Size, Type>& vector) throw()
|
std::ostream& operator<<(std::ostream& os, const Vector<Size, Type>& vector)
|
||||||
{
|
{
|
||||||
os << "(";
|
os << "(";
|
||||||
for(uint32_t ct = 0; ct < Size; ++ct)
|
for(uint32_t ct = 0; ct < Size; ++ct)
|
||||||
@ -384,7 +384,7 @@ namespace PolyVox
|
|||||||
\return The element.
|
\return The element.
|
||||||
*/
|
*/
|
||||||
template <uint32_t Size, typename Type>
|
template <uint32_t Size, typename Type>
|
||||||
inline Type Vector<Size, Type>::getElement(uint32_t index) const throw()
|
inline Type Vector<Size, Type>::getElement(uint32_t index) const
|
||||||
{
|
{
|
||||||
return m_tElements[index];
|
return m_tElements[index];
|
||||||
}
|
}
|
||||||
@ -393,7 +393,7 @@ namespace PolyVox
|
|||||||
\return A const reference to the X component of a 1, 2, 3, or 4 dimensional Vector.
|
\return A const reference to the X component of a 1, 2, 3, or 4 dimensional Vector.
|
||||||
*/
|
*/
|
||||||
template <uint32_t Size, typename Type>
|
template <uint32_t Size, typename Type>
|
||||||
inline Type Vector<Size, Type>::getX(void) const throw()
|
inline Type Vector<Size, Type>::getX(void) const
|
||||||
{
|
{
|
||||||
return m_tElements[0];
|
return m_tElements[0];
|
||||||
}
|
}
|
||||||
@ -402,7 +402,7 @@ namespace PolyVox
|
|||||||
\return A const reference to the Y component of a 2, 3, or 4 dimensional Vector.
|
\return A const reference to the Y component of a 2, 3, or 4 dimensional Vector.
|
||||||
*/
|
*/
|
||||||
template <uint32_t Size, typename Type>
|
template <uint32_t Size, typename Type>
|
||||||
inline Type Vector<Size, Type>::getY(void) const throw()
|
inline Type Vector<Size, Type>::getY(void) const
|
||||||
{
|
{
|
||||||
return m_tElements[1];
|
return m_tElements[1];
|
||||||
}
|
}
|
||||||
@ -411,7 +411,7 @@ namespace PolyVox
|
|||||||
\return A const reference to the Z component of a 3 or 4 dimensional Vector.
|
\return A const reference to the Z component of a 3 or 4 dimensional Vector.
|
||||||
*/
|
*/
|
||||||
template <uint32_t Size, typename Type>
|
template <uint32_t Size, typename Type>
|
||||||
inline Type Vector<Size, Type>::getZ(void) const throw()
|
inline Type Vector<Size, Type>::getZ(void) const
|
||||||
{
|
{
|
||||||
return m_tElements[2];
|
return m_tElements[2];
|
||||||
}
|
}
|
||||||
@ -420,7 +420,7 @@ namespace PolyVox
|
|||||||
\return A const reference to the W component of a 4 dimensional Vector.
|
\return A const reference to the W component of a 4 dimensional Vector.
|
||||||
*/
|
*/
|
||||||
template <uint32_t Size, typename Type>
|
template <uint32_t Size, typename Type>
|
||||||
inline Type Vector<Size, Type>::getW(void) const throw()
|
inline Type Vector<Size, Type>::getW(void) const
|
||||||
{
|
{
|
||||||
return m_tElements[3];
|
return m_tElements[3];
|
||||||
}
|
}
|
||||||
@ -430,7 +430,7 @@ namespace PolyVox
|
|||||||
\param tValue The new value for the element.
|
\param tValue The new value for the element.
|
||||||
*/
|
*/
|
||||||
template <uint32_t Size, typename Type>
|
template <uint32_t Size, typename Type>
|
||||||
inline void Vector<Size, Type>::setElement(uint32_t index, Type tValue) throw()
|
inline void Vector<Size, Type>::setElement(uint32_t index, Type tValue)
|
||||||
{
|
{
|
||||||
m_tElements[index] = tValue;
|
m_tElements[index] = tValue;
|
||||||
}
|
}
|
||||||
@ -441,7 +441,7 @@ namespace PolyVox
|
|||||||
\param y y component to set.
|
\param y y component to set.
|
||||||
*/
|
*/
|
||||||
template <uint32_t Size,typename Type>
|
template <uint32_t Size,typename Type>
|
||||||
inline void Vector<Size,Type>::setElements(Type x, Type y) throw()
|
inline void Vector<Size,Type>::setElements(Type x, Type y)
|
||||||
{
|
{
|
||||||
m_tElements[0] = x;
|
m_tElements[0] = x;
|
||||||
m_tElements[1] = y;
|
m_tElements[1] = y;
|
||||||
@ -455,7 +455,7 @@ namespace PolyVox
|
|||||||
\param z z component to set.
|
\param z z component to set.
|
||||||
*/
|
*/
|
||||||
template <uint32_t Size,typename Type>
|
template <uint32_t Size,typename Type>
|
||||||
inline void Vector<Size,Type>::setElements(Type x, Type y, Type z) throw()
|
inline void Vector<Size,Type>::setElements(Type x, Type y, Type z)
|
||||||
{
|
{
|
||||||
m_tElements[0] = x;
|
m_tElements[0] = x;
|
||||||
m_tElements[1] = y;
|
m_tElements[1] = y;
|
||||||
@ -471,7 +471,7 @@ namespace PolyVox
|
|||||||
\param w w component to set.
|
\param w w component to set.
|
||||||
*/
|
*/
|
||||||
template <uint32_t Size,typename Type>
|
template <uint32_t Size,typename Type>
|
||||||
inline void Vector<Size,Type>::setElements(Type x, Type y, Type z, Type w) throw()
|
inline void Vector<Size,Type>::setElements(Type x, Type y, Type z, Type w)
|
||||||
{
|
{
|
||||||
m_tElements[0] = x;
|
m_tElements[0] = x;
|
||||||
m_tElements[1] = y;
|
m_tElements[1] = y;
|
||||||
@ -483,7 +483,7 @@ namespace PolyVox
|
|||||||
\param tX The new value for the X component of a 1, 2, 3, or 4 dimensional Vector.
|
\param tX The new value for the X component of a 1, 2, 3, or 4 dimensional Vector.
|
||||||
*/
|
*/
|
||||||
template <uint32_t Size, typename Type>
|
template <uint32_t Size, typename Type>
|
||||||
inline void Vector<Size, Type>::setX(Type tX) throw()
|
inline void Vector<Size, Type>::setX(Type tX)
|
||||||
{
|
{
|
||||||
m_tElements[0] = tX;
|
m_tElements[0] = tX;
|
||||||
}
|
}
|
||||||
@ -492,7 +492,7 @@ namespace PolyVox
|
|||||||
\param tY The new value for the Y component of a 2, 3, or 4 dimensional Vector.
|
\param tY The new value for the Y component of a 2, 3, or 4 dimensional Vector.
|
||||||
*/
|
*/
|
||||||
template <uint32_t Size, typename Type>
|
template <uint32_t Size, typename Type>
|
||||||
inline void Vector<Size, Type>::setY(Type tY) throw()
|
inline void Vector<Size, Type>::setY(Type tY)
|
||||||
{
|
{
|
||||||
m_tElements[1] = tY;
|
m_tElements[1] = tY;
|
||||||
}
|
}
|
||||||
@ -501,7 +501,7 @@ namespace PolyVox
|
|||||||
\param tZ The new value for the Z component of a 3 or 4 dimensional Vector.
|
\param tZ The new value for the Z component of a 3 or 4 dimensional Vector.
|
||||||
*/
|
*/
|
||||||
template <uint32_t Size, typename Type>
|
template <uint32_t Size, typename Type>
|
||||||
inline void Vector<Size, Type>::setZ(Type tZ) throw()
|
inline void Vector<Size, Type>::setZ(Type tZ)
|
||||||
{
|
{
|
||||||
m_tElements[2] = tZ;
|
m_tElements[2] = tZ;
|
||||||
}
|
}
|
||||||
@ -510,7 +510,7 @@ namespace PolyVox
|
|||||||
\param tW The new value for the W component of a 4 dimensional Vector.
|
\param tW The new value for the W component of a 4 dimensional Vector.
|
||||||
*/
|
*/
|
||||||
template <uint32_t Size, typename Type>
|
template <uint32_t Size, typename Type>
|
||||||
inline void Vector<Size, Type>::setW(Type tW) throw()
|
inline void Vector<Size, Type>::setW(Type tW)
|
||||||
{
|
{
|
||||||
m_tElements[3] = tW;
|
m_tElements[3] = tW;
|
||||||
}
|
}
|
||||||
@ -520,7 +520,7 @@ namespace PolyVox
|
|||||||
\return Length of the Vector.
|
\return Length of the Vector.
|
||||||
*/
|
*/
|
||||||
template <uint32_t Size, typename Type>
|
template <uint32_t Size, typename Type>
|
||||||
inline double Vector<Size, Type>::length(void) const throw()
|
inline double Vector<Size, Type>::length(void) const
|
||||||
{
|
{
|
||||||
return sqrt(lengthSquared());
|
return sqrt(lengthSquared());
|
||||||
}
|
}
|
||||||
@ -529,7 +529,7 @@ namespace PolyVox
|
|||||||
\return Squared length of the Vector.
|
\return Squared length of the Vector.
|
||||||
*/
|
*/
|
||||||
template <uint32_t Size, typename Type>
|
template <uint32_t Size, typename Type>
|
||||||
inline double Vector<Size, Type>::lengthSquared(void) const throw()
|
inline double Vector<Size, Type>::lengthSquared(void) const
|
||||||
{
|
{
|
||||||
double result = 0.0f;
|
double result = 0.0f;
|
||||||
for(uint32_t ct = 0; ct < Size; ++ct)
|
for(uint32_t ct = 0; ct < Size; ++ct)
|
||||||
@ -549,7 +549,7 @@ namespace PolyVox
|
|||||||
\return The angle between them in radians.
|
\return The angle between them in radians.
|
||||||
*/
|
*/
|
||||||
template <uint32_t Size, typename Type>
|
template <uint32_t Size, typename Type>
|
||||||
inline double Vector<Size, Type>::angleTo(const Vector<Size, Type>& vector) const throw()
|
inline double Vector<Size, Type>::angleTo(const Vector<Size, Type>& vector) const
|
||||||
{
|
{
|
||||||
return acos(dot(vector) / (vector.length() * this->length()));
|
return acos(dot(vector) / (vector.length() * this->length()));
|
||||||
}
|
}
|
||||||
@ -567,7 +567,7 @@ namespace PolyVox
|
|||||||
\see dot()
|
\see dot()
|
||||||
*/
|
*/
|
||||||
template <uint32_t Size, typename Type>
|
template <uint32_t Size, typename Type>
|
||||||
inline Vector<Size, Type> Vector<Size, Type>::cross(const Vector<Size, Type>& vector) const throw()
|
inline Vector<Size, Type> Vector<Size, Type>::cross(const Vector<Size, Type>& vector) const
|
||||||
{
|
{
|
||||||
Type i = vector.getZ() * this->getY() - vector.getY() * this->getZ();
|
Type i = vector.getZ() * this->getY() - vector.getY() * this->getZ();
|
||||||
Type j = vector.getX() * this->getZ() - vector.getZ() * this->getX();
|
Type j = vector.getX() * this->getZ() - vector.getZ() * this->getX();
|
||||||
@ -583,7 +583,7 @@ namespace PolyVox
|
|||||||
\see cross()
|
\see cross()
|
||||||
*/
|
*/
|
||||||
template <uint32_t Size, typename Type>
|
template <uint32_t Size, typename Type>
|
||||||
inline Type Vector<Size, Type>::dot(const Vector<Size, Type>& rhs) const throw()
|
inline Type Vector<Size, Type>::dot(const Vector<Size, Type>& rhs) const
|
||||||
{
|
{
|
||||||
Type dotProduct = static_cast<Type>(0);
|
Type dotProduct = static_cast<Type>(0);
|
||||||
for(uint32_t ct = 0; ct < Size; ++ct)
|
for(uint32_t ct = 0; ct < Size; ++ct)
|
||||||
@ -599,7 +599,7 @@ namespace PolyVox
|
|||||||
\note This function does not make much sense on integer Vectors.
|
\note This function does not make much sense on integer Vectors.
|
||||||
*/
|
*/
|
||||||
template <uint32_t Size, typename Type>
|
template <uint32_t Size, typename Type>
|
||||||
inline void Vector<Size, Type>::normalise(void) throw()
|
inline void Vector<Size, Type>::normalise(void)
|
||||||
{
|
{
|
||||||
Type tLength = this->length();
|
Type tLength = this->length();
|
||||||
//FIXME - throw div by zero exception?
|
//FIXME - throw div by zero exception?
|
||||||
|
@ -66,7 +66,7 @@ namespace PolyVox
|
|||||||
\return true if the Regions match.
|
\return true if the Regions match.
|
||||||
\see operator!=
|
\see operator!=
|
||||||
*/
|
*/
|
||||||
bool Region::operator==(const Region& rhs) const throw()
|
bool Region::operator==(const Region& rhs) const
|
||||||
{
|
{
|
||||||
return ((m_v3dLowerCorner == rhs.m_v3dLowerCorner) && (m_v3dUpperCorner == rhs.m_v3dUpperCorner));
|
return ((m_v3dLowerCorner == rhs.m_v3dLowerCorner) && (m_v3dUpperCorner == rhs.m_v3dUpperCorner));
|
||||||
}
|
}
|
||||||
@ -77,7 +77,7 @@ namespace PolyVox
|
|||||||
\return true if the Regions do not match.
|
\return true if the Regions do not match.
|
||||||
\see operator==
|
\see operator==
|
||||||
*/
|
*/
|
||||||
bool Region::operator!=(const Region& rhs) const throw()
|
bool Region::operator!=(const Region& rhs) const
|
||||||
{
|
{
|
||||||
return !(*this == rhs);
|
return !(*this == rhs);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user