44 inline CalVector(): x(0.0f), y(0.0f), z(0.0f) {};
46 inline CalVector(
float vx,
float vy,
float vz): x(vx), y(vy), z(vz) {};
51 inline float& operator[](
unsigned int i)
56 inline const float& operator[](
unsigned int i)
const
68 inline void operator+=(
const CalVector& v)
76 inline void operator-=(
const CalVector& v)
83 inline void operator*=(
const float d)
92 inline void operator*=(
const CalMatrix &m)
97 x = m.dxdx*ox + m.dxdy*oy + m.dxdz*oz;
98 y = m.dydx*ox + m.dydy*oy + m.dydz*oz;
99 z = m.dzdx*ox + m.dzdy*oy + m.dzdz*oz;
102 inline void operator/=(
const float d)
109 inline bool operator==(
const CalVector& v)
const
111 return ((x == v.x) && (y == v.y) && (z == v.z));
114 inline bool operator!=(
const CalVector& v)
const
116 return !operator==(v);
119 inline void blend(
float d,
const CalVector& v)
133 inline float length()
const
135 return (
float)sqrt(x * x + y * y + z * z);
137 inline float normalize()
141 length = (float) sqrt(x * x + y * y + z * z);
143 float lenRecip = 1.0f / length;
153 void set(
float vx,
float vy,
float vz)