53 inline Vec3(
const float x,
const float y,
const float z)
57 inline Vec3(
const float v[3])
58 :
x(v[0]),
y(v[1]),
z(v[2])
62 {
return std::sqrt(
x*
x+
y*
y+
z*
z);}
65 {
float l=
length();
x/=l;
y/=l;
z/=l;
return l;}
80 {
x+=v.
x;
y+=v.
y;
z+=v.
z;
return *
this;}
87 return Vec3(std::min(
x,v.
x),std::min(
y,v.
y),std::min(
z,v.
z));
92 return Vec3(std::max(
x,v.
x),std::max(
y,v.
y),std::max(
z,v.
z));
98{
return stream<<v.
x<<
" "<<v.
y<<
" "<<v.
z;}
102 return Vec3(a*v.
x,a*v.
y,a*v.
z);
Definition PartioVec3.h:45
Vec3 operator*(const float a) const
Definition PartioVec3.h:70
float normalize()
Definition PartioVec3.h:64
float y
Definition PartioVec3.h:47
Vec3(const float x, const float y, const float z)
Definition PartioVec3.h:53
Vec3()
Definition PartioVec3.h:49
Vec3 min(const Vec3 &v) const
Definition PartioVec3.h:85
Vec3 operator+(const Vec3 &v) const
Definition PartioVec3.h:76
Vec3 operator-(const Vec3 &v) const
Definition PartioVec3.h:73
float length()
Definition PartioVec3.h:61
float x
Definition PartioVec3.h:47
Vec3 cross(const Vec3 &v) const
Definition PartioVec3.h:82
Vec3 max(const Vec3 &v) const
Definition PartioVec3.h:90
Vec3(const float v[3])
Definition PartioVec3.h:57
Vec3 operator+=(const Vec3 &v)
Definition PartioVec3.h:79
Vec3 normalized() const
Definition PartioVec3.h:67
float z
Definition PartioVec3.h:47
Vec3 operator*(const float a, const Vec3 &v)
Definition PartioVec3.h:100
std::ostream & operator<<(std::ostream &output, const Data< T, d > &v)
Definition PartioIterator.h:224