Small changes for debugging Cubiquity.
This commit is contained in:
parent
aab1149e8f
commit
a10fcf8ecc
@ -117,4 +117,11 @@ freely, subject to the following restrictions:
|
|||||||
#define polyvox_shared_ptr boost::shared_ptr
|
#define polyvox_shared_ptr boost::shared_ptr
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
//#define USE_LARGE_VOLUME
|
||||||
|
#ifdef USE_LARGE_VOLUME
|
||||||
|
#define POLYVOX_VOLUME LargeVolume
|
||||||
|
#else
|
||||||
|
#define POLYVOX_VOLUME SimpleVolume
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -653,7 +653,10 @@ namespace PolyVox
|
|||||||
inline void Vector<Size, StorageType, OperationType>::normalise(void)
|
inline void Vector<Size, StorageType, OperationType>::normalise(void)
|
||||||
{
|
{
|
||||||
float fLength = this->length();
|
float fLength = this->length();
|
||||||
if(fLength <= 0.0)
|
|
||||||
|
// We could wait until the NAN occurs before throwing, but then we'd have to add some roll-back code.
|
||||||
|
// This seems like a lot of overhead for a common operation which should rarely go wrong.
|
||||||
|
if(fLength <= 0.0001)
|
||||||
{
|
{
|
||||||
POLYVOX_THROW(invalid_operation, "Cannot normalise a vector with a length of zero");
|
POLYVOX_THROW(invalid_operation, "Cannot normalise a vector with a length of zero");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user