Add normalize option to CUnitVector3f constructor

This commit is contained in:
Jack Andersen 2017-04-08 10:39:55 -10:00
parent 5551fccc5d
commit 857944512f
1 changed files with 5 additions and 1 deletions

View File

@ -11,7 +11,11 @@ public:
ZE_DECLARE_ALIGNED_ALLOCATOR();
CUnitVector3f() : CVector3f(0, 1, 0) {}
CUnitVector3f(float x, float y, float z) : CVector3f(x, y, z) {}
CUnitVector3f(float x, float y, float z, bool doNormalize = true) : CVector3f(x, y, z)
{
if (doNormalize && canBeNormalized())
normalize();
}
CUnitVector3f(const CVector3f& vec, bool doNormalize = true) : CVector3f(vec)
{
if (doNormalize && canBeNormalized())