32 mpVector::mpVector(
float xx,
float yy,
float zz) :
36 mpVector::mpVector() : x(0), y(0), z(0)
38 mpVector::mpVector(
const mpVector& other) : x(other.x), y(other.y), z(other.z)
43 float length = sqrt(x*x + y*y + z*z);
44 if(!length)
return *
this;
51 float mpVector::Magnitude()
53 return sqrt(x*x + y*y + z*z);
58 return mpVector(y*other.z-z*other.y, z*other.x-x*other.z, x*other.y-y*other.x);
63 return mpVector(x - v.x, y - v.y, z - v.z);
68 return mpVector(x + v.x, y + v.y, z + v.z);
71 float mpVector ::operator * (
mpVector v)
73 return x*v.x + y*v.y + z*v.z;
75 mpVector mpVector::operator - (
float c)
80 mpVector mpVector::operator + (
float c)
85 mpVector mpVector::operator / (
float c)
90 mpVector mpVector::operator * (
float c)
95 void mpVector::operator = (
const mpVector& other)
107 mpVector::operator
char*()
const
109 return (
char*)wxString::Format(_T(
"(%f %f %f)"), x, y, z).char_str();
116 mp4Vector::mp4Vector() : x(0), y(0), z(0), val(0)
119 mp4Vector::mp4Vector(
float aa,
float bb,
float cc,
float dd) :
120 x(aa), y(bb), z(cc), val(dd)
123 mp4Vector::mp4Vector(
const mp4Vector& other) :
124 x(other.x), y(other.y), z(other.z), val(other.val)
127 mp4Vector::mp4Vector(
const mpVector& v,
const float value) :
128 x(v.x), y(v.x), z(v.z), val(value)
131 void mp4Vector::operator = (
const mp4Vector& v)
133 x = v.x; y = v.y; z = v.z; val = v.val;
136 void mp4Vector::operator = (
const mpVector& v)
138 x = v.x; y = v.y; z = v.z;
141 mp4Vector::operator
mpVector()
const
146 bool mp4Vector::operator == (
const mp4Vector& v)
const
148 return x == v.x && y == v.y && z == v.z && val == v.val;