23#ifndef INCLUDED_VECTOR3D
24#define INCLUDED_VECTOR3D
47 const float&
operator[](
int index)
const {
return *((&
X)+index); }
52 return (
X == vector.
X &&
Y == vector.
Y &&
Z == vector.
Z);
106 return (
X * vector.
X +
114 temp.
X = (
Y * vector.
Z) - (
Z * vector.
Y);
115 temp.
Y = (
Z * vector.
X) - (
X * vector.
Z);
116 temp.
Z = (
X * vector.
Y) - (
Y * vector.
X);
131 sizeof(
CVector3D) ==
sizeof(
float) * 3u &&
135 "Vector3D should be properly layouted to use AsFloatArray");
float MaxComponent(const CVector3D &v)
Definition: Vector3D.cpp:93
Definition: FixedVector3D.h:25
Definition: Vector3D.h:31
bool operator==(const CVector3D &vector) const
Definition: Vector3D.h:50
const float & operator[](int index) const
Definition: Vector3D.h:47
PS::span< const float > AsFloatArray() const
Definition: Vector3D.h:126
CVector3D operator*(float value) const
Definition: Vector3D.h:86
bool operator!=(const CVector3D &vector) const
Definition: Vector3D.h:55
void Normalize()
Definition: Vector3D.cpp:74
CVector3D & operator*=(float value)
Definition: Vector3D.h:91
float LengthSquared() const
Definition: Vector3D.cpp:64
float Z
Definition: Vector3D.h:33
CVector3D()
Definition: Vector3D.h:40
static CVector3D Max()
Definition: Vector3D.cpp:40
CVector3D operator+(const CVector3D &vector) const
Definition: Vector3D.h:60
CVector3D(float x, float y, float z)
Definition: Vector3D.h:41
static CVector3D Min()
Definition: Vector3D.cpp:47
CVector3D & operator+=(const CVector3D &vector)
Definition: Vector3D.h:65
float Length() const
Definition: Vector3D.cpp:69
float Y
Definition: Vector3D.h:33
float Dot(const CVector3D &vector) const
Definition: Vector3D.h:104
CVector3D Cross(const CVector3D &vector) const
Definition: Vector3D.h:111
CVector3D & operator-=(const CVector3D &vector)
Definition: Vector3D.h:78
float X
Definition: Vector3D.h:33
CVector3D operator-(const CVector3D &vector) const
Definition: Vector3D.h:73
CVector3D Normalized() const
Definition: Vector3D.cpp:83
CVector3D operator-() const
Definition: Vector3D.h:99
float & operator[](int index)
Definition: Vector3D.h:46
int operator!() const
Definition: Vector3D.cpp:53
Simplifed version of std::span (C++20) as we don't support the original one yet.
Definition: Span.h:37