1 //
2 //  math.cpp
3 //  CubicVR2
4 //
5 //  Created by Charles J. Cliffe on 2013-02-22.
6 //  Copyright (c) 2013 Charles J. Cliffe. All rights reserved.
7 //
8 
9 #include "cubic_math.h"
10 
11 namespace CubicVR {
operator <<(std::ostream & strm,const vec4 & v)12     std::ostream& operator<<(std::ostream &strm, const vec4 &v) {
13         return strm << "{" << v.x << ", " << v.y << ", " << v.z << ", " << v.w << "}";
14     }
operator <<(std::ostream & strm,const vec3 & v)15     std::ostream& operator<<(std::ostream &strm, const vec3 &v) {
16         return strm << "{" << v.x << ", " << v.y << ", " << v.z << "}";
17     }
operator <<(std::ostream & strm,const vec2 & v)18     std::ostream& operator<<(std::ostream &strm, const vec2 &v) {
19         return strm << "{" << v.x << ", " << v.y << "}";
20     }
operator <<(std::ostream & strm,const mat4 & m)21     std::ostream& operator<<(std::ostream &strm, const mat4 &m) {
22         return strm << "{ " << m[0] << ", " << m[1] << ", " << m[2] << ", " << m[3] << endl
23         << "  " << m[4] << ", " << m[5] << ", " << m[6] << ", " << m[7] << endl
24         << "  " << m[8] << ", " << m[9] << ", " << m[10] << ", " << m[11] << endl
25         << "  " << m[12] << ", " << m[13] << ", " << m[14] << ", " << m[15] << " }" << endl;
26     }
27 }
28