mirror of
https://github.com/AxioDL/zeus.git
synced 2025-12-21 02:39:24 +00:00
Make vector constants class-scope
This commit is contained in:
@@ -224,7 +224,7 @@ public:
|
||||
return skNoRotation;
|
||||
|
||||
CRelAngle realAngle = zeus::clamp<CRelAngle>(-c, normalize_angle(std::acos(up.z) - std::acos(target.z)), c);
|
||||
return CQuaternion::fromAxisAngle(tmp.cross(kUpVec), realAngle) * q;
|
||||
return CQuaternion::fromAxisAngle(tmp.cross(CVector3f::skUp), realAngle) * q;
|
||||
}
|
||||
|
||||
CVector3f transform(const CVector3f& v) const { return rotate(*this, v); }
|
||||
|
||||
@@ -266,7 +266,7 @@ static inline CTransform CTransformFromScaleVector(const CVector3f& scale) { ret
|
||||
CTransform CTransformFromEditorEuler(const CVector3f& eulerVec);
|
||||
CTransform CTransformFromEditorEulers(const CVector3f& eulerVec, const CVector3f& origin);
|
||||
CTransform CTransformFromAxisAngle(const CVector3f& axis, float angle);
|
||||
CTransform lookAt(const CVector3f& pos, const CVector3f& lookPos, const CVector3f& up = kUpVec);
|
||||
CTransform lookAt(const CVector3f& pos, const CVector3f& lookPos, const CVector3f& up = CVector3f::skUp);
|
||||
}
|
||||
|
||||
#endif // CTRANSFORM_HPP
|
||||
|
||||
@@ -382,6 +382,17 @@ public:
|
||||
static const CVector3f skOne;
|
||||
static const CVector3f skNegOne;
|
||||
static const CVector3f skZero;
|
||||
static const CVector3f skForward;
|
||||
static const CVector3f skBack;
|
||||
static const CVector3f skLeft;
|
||||
static const CVector3f skRight;
|
||||
static const CVector3f skUp;
|
||||
static const CVector3f skDown;
|
||||
static const CVector3f skRadToDegVec;
|
||||
static const CVector3f skDegToRadVec;
|
||||
|
||||
static CVector3f radToDeg(const CVector3f& rad) { return rad * skRadToDegVec; }
|
||||
static CVector3f degToRad(const CVector3f& deg) { return deg * skDegToRadVec; }
|
||||
};
|
||||
|
||||
static inline CVector3f operator+(float lhs, const CVector3f& rhs)
|
||||
@@ -424,16 +435,6 @@ static inline CVector3f operator/(float lhs, const CVector3f& rhs)
|
||||
#endif
|
||||
}
|
||||
|
||||
extern const CVector3f kUpVec;
|
||||
extern const CVector3f kDownVec;
|
||||
extern const CVector3f kRightVec;
|
||||
extern const CVector3f kLeftVec;
|
||||
extern const CVector3f kForwardVec;
|
||||
extern const CVector3f kBackVec;
|
||||
extern const CVector3f kRadToDegVec;
|
||||
extern const CVector3f kDegToRadVec;
|
||||
inline CVector3f radToDeg(const CVector3f& rad) { return rad * kRadToDegVec; }
|
||||
inline CVector3f degToRad(const CVector3f& deg) { return deg * kDegToRadVec; }
|
||||
}
|
||||
|
||||
#endif // CVECTOR3F_HPP
|
||||
|
||||
Reference in New Issue
Block a user