31#include "hpl1/engine/math/Vector2.h"
33#define VEC3_CONST_ARRAY(name, vec) const float name[] = {vec.x, vec.y, vec.z}
42 constexpr cVector3() : x(0), y(0), z(0) {
44 constexpr cVector3(T aVal) : x(aVal), y(aVal), z(aVal) {
46 constexpr cVector3(T aX, T aY, T aZ) : x(aX), y(aY), z(aZ) {
55 static cVector3 fromArray(
const float vec[3]) {
87 inline bool operator==(
const cVector3<T> &aVec)
const {
88 if (x == aVec.x && y == aVec.y && z == aVec.z)
94 inline bool operator!=(
const cVector3<T> &aVec)
const {
95 if (x == aVec.x && y == aVec.y && z == aVec.z)
101 inline bool operator<(
const cVector3<T> &aVec)
const {
109 inline bool operator>(
const cVector3<T> &aVec)
const {
245 inline cVector3<T> operator/(
const T &aVal)
const {
253 inline cVector3<T> operator*(
const T &aVal)
const {
261 inline cVector3<T> operator+(
const T &aVal)
const {
281 inline void FromVec(
const T *apVec) {
288 return sqrt(x * x + y * y + z * z);
291 inline T SqrLength() {
292 return x * x + y * y + z * z;
300 T length = sqrt(x * x + y * y + z * z);
303 if (length > 1e-08) {
304 T InvLength = 1.0f / length;
319 snprintf(buf, 512,
"%f : %f : %f", x, y, z);
324 tString ToFileString()
const {
326 snprintf(buf, 512,
"%g %g %g", x, y, z);
T Normalise()
Definition: Vector3.h:299