13 #ifndef _CS237_VEC3_HXX_
14 #define _CS237_VEC3_HXX_
17 #error "c237-vec3.hxx should not be included directly"
29 vec3 () : x(T(0)), y(T(0)), z(T(0)) { }
30 vec3 (
vec3 const &v) : x(v.x), y(v.y), z(v.z) { }
31 explicit vec3 (T xx) : x(xx), y(T(0)), z(T(0)) { }
32 explicit vec3 (T xx, T yy) : x(xx), y(yy), z(T(0)) { }
33 explicit vec3 (T xx, T yy, T zz) : x(xx), y(yy), z(zz) { }
34 explicit vec3 (
vec2<T> const &v) : x(v.x), y(v.y), z(T(0)) { }
35 explicit vec3 (
vec2<T> const &v, T zz) : x(v.x), y(v.y), z(zz) { }
40 T
const &
operator[] (
unsigned int const &i)
const;
74 std::ostream& operator<< (std::ostream& s, vec3<T>
const &v);
vec3(vec2< T > const &v)
Definition: cs237-vec3.hxx:34
vec3(T xx, T yy, T zz)
Definition: cs237-vec3.hxx:33
T length() const
the length (magnitude) of the vector
Definition: cs237-vec3.inl:120
vec3(T xx)
Definition: cs237-vec3.hxx:31
__detail::vec3< double > vec3d
Three-element, double-precision floating-point vectors.
Definition: cs237-vec3.hxx:81
T y
Definition: cs237-vec3.hxx:27
vec3 & operator-=(T const &s)
subtract a scalar from this vector
Definition: cs237-vec3.inl:74
vec3(vec3 const &v)
Definition: cs237-vec3.hxx:30
vec3(T xx, T yy)
Definition: cs237-vec3.hxx:32
template class for four-element vectors
Definition: cs237-types.hxx:27
vec3 & operator*=(T const &s)
multiply this vector by a scalar
Definition: cs237-vec3.inl:92
T x
Definition: cs237-vec3.hxx:27
vec3 & normalize()
normalize the vector
Definition: cs237-vec3.inl:126
vec3 & operator+=(T const &s)
add a scalar to this vector
Definition: cs237-vec3.inl:56
Definition: cs237-aabb.hxx:18
vec3()
Definition: cs237-vec3.hxx:29
vec3(vec2< T > const &v, T zz)
Definition: cs237-vec3.hxx:35
template class for three-element vectors
Definition: cs237-types.hxx:26
vec3 & operator=(vec3 const &v)
Definition: cs237-vec3.inl:32
T const & operator[](unsigned int const &i) const
Definition: cs237-vec3.inl:42
template class for two-element vectors
Definition: cs237-types.hxx:25
__detail::vec3< float > vec3f
Three-element, single-precision floating-point vectors.
Definition: cs237-vec3.hxx:79
vec3 & operator/=(T const &s)
divide this vector by a scalar
Definition: cs237-vec3.inl:110
T z
Definition: cs237-vec3.hxx:27