2018-10-06 20:39:40 -07:00
|
|
|
#pragma once
|
2015-08-31 14:27:09 -07:00
|
|
|
|
2016-03-04 15:03:26 -08:00
|
|
|
#include "zeus/CVector3f.hpp"
|
2015-08-31 14:27:09 -07:00
|
|
|
|
2018-12-07 17:16:50 -08:00
|
|
|
namespace zeus {
|
|
|
|
class CUnitVector3f : public CVector3f {
|
2015-08-31 14:27:09 -07:00
|
|
|
public:
|
2018-12-07 17:16:50 -08:00
|
|
|
CUnitVector3f() : CVector3f(0.f, 1.f, 0.f) {}
|
2015-08-31 14:27:09 -07:00
|
|
|
|
2018-12-07 17:16:50 -08:00
|
|
|
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())
|
|
|
|
normalize();
|
|
|
|
}
|
2015-08-31 14:27:09 -07:00
|
|
|
};
|
2018-12-07 21:23:50 -08:00
|
|
|
} // namespace zeus
|