Files
bluflame/meshTools/meshTools/include/math/vec3.h
2026-04-18 22:31:51 +02:00

54 lines
1.2 KiB
C++

#pragma once
#include "Quaternion.h"
class vec3
{
public:
static const vec3 zero;
static const vec3 one;
static const vec3 up;
static const vec3 down;
static const vec3 left;
static const vec3 right;
static const vec3 forward;
static const vec3 back;
vec3();
vec3(float x, float y, float z);
vec3(const vec3& other);
~vec3();
float GetLength() const;
float GetLengthSq() const;
void Normalize();
static vec3 Mul(const vec3& a, const vec3& b);
static float Dot(const vec3& a, const vec3& b);
static vec3 Cross(const vec3& a, const vec3& b);
static vec3 Min(const vec3& a, const vec3& b);
static vec3 Max(const vec3& a, const vec3& b);
static float Distance(const vec3& a, const vec3& b);
static float DistanceSq(const vec3& a, const vec3& b);
vec3 operator- () const;
bool operator== (const vec3& other) const;
bool operator!= (const vec3& other) const;
vec3 operator+ (const vec3& other) const;
void operator+= (const vec3& other);
void operator-= (const vec3& other);
void operator/= (float other);
void operator*= (float other);
vec3 operator- (const vec3& other) const;
vec3 operator* (float other) const;
vec3 operator/ (float other) const;
vec3 operator* (const Quaternion& q) const;
public:
float x;
float y;
float z;
};