zeus/include/CUnitVector.hpp

27 lines
438 B
C++
Raw Normal View History

2015-08-31 21:27:09 +00:00
#ifndef CUNITVECTOR_HPP
#define CUNITVECTOR_HPP
#include "CVector3f.hpp"
namespace Zeus
{
2015-10-25 19:31:41 +00:00
class alignas(16) CUnitVector3f : public CVector3f
2015-08-31 21:27:09 +00:00
{
public:
ZE_DECLARE_ALIGNED_ALLOCATOR();
2015-10-25 19:31:41 +00:00
CUnitVector3f()
: CVector3f(0, 1, 0)
{
}
CUnitVector3f(const CVector3f& vec, bool doNormalize = false)
2015-08-31 21:27:09 +00:00
: CVector3f(vec)
{
2015-10-25 19:31:41 +00:00
if (doNormalize && canBeNormalized())
2015-08-31 21:27:09 +00:00
normalize();
}
};
}
2015-08-31 21:27:09 +00:00
#endif