mirror of https://github.com/AxioDL/zeus.git
Add normalize option to CUnitVector3f constructor
This commit is contained in:
parent
5551fccc5d
commit
857944512f
|
@ -11,7 +11,11 @@ public:
|
||||||
ZE_DECLARE_ALIGNED_ALLOCATOR();
|
ZE_DECLARE_ALIGNED_ALLOCATOR();
|
||||||
|
|
||||||
CUnitVector3f() : CVector3f(0, 1, 0) {}
|
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)
|
CUnitVector3f(const CVector3f& vec, bool doNormalize = true) : CVector3f(vec)
|
||||||
{
|
{
|
||||||
if (doNormalize && canBeNormalized())
|
if (doNormalize && canBeNormalized())
|
||||||
|
|
Loading…
Reference in New Issue