Changeset 663
Legend:
 Unmodified
 Added
 Removed

trunk/src/matrix.h
r661 r663 27 27 ret[n] = (*this)[n] op val[n]; \ 28 28 return ret; \ 29 } \ 30 \ 31 template<typename U> \ 32 inline Vec##elems<T> operator op##=(Vec##elems<U> const &val) \ 33 { \ 34 return *this = (*this) op val; \ 29 35 } 30 36 … … 45 51 ret[n] = (*this)[n] op val; \ 46 52 return ret; \ 53 } \ 54 \ 55 inline Vec##elems<T> operator op##=(T const &val) \ 56 { \ 57 return *this = (*this) op val; \ 47 58 } 48 59 … … 115 126 }; 116 127 117 typedef Vec2<float> float2;118 typedef Vec2<int> int2;128 typedef Vec2<float> vec2; 129 typedef Vec2<int> vec2i; 119 130 120 131 template <typename T> struct Vec3 … … 131 142 }; 132 143 133 typedef Vec3<float> float3;134 typedef Vec3<int> int3;144 typedef Vec3<float> vec3; 145 typedef Vec3<int> vec3i; 135 146 136 147 template <typename T> struct Vec4 … … 148 159 }; 149 160 150 typedef Vec4<float> float4;151 typedef Vec4<int> int4;161 typedef Vec4<float> vec4; 162 typedef Vec4<int> vec4i; 152 163 153 164 #define SCALAR_GLOBAL(elems, op, U) \ … … 211 222 } 212 223 224 inline Mat4<T> operator +=(Mat4<T> const val) 225 { 226 return *this = *this + val; 227 } 228 213 229 inline Mat4<T> operator (Mat4<T> const val) const 214 230 { … … 218 234 ret[i][j] = v[i][j]  val[i][j]; 219 235 return ret; 236 } 237 238 inline Mat4<T> operator =(Mat4<T> const val) 239 { 240 return *this = *this  val; 220 241 } 221 242 … … 234 255 } 235 256 257 inline Mat4<T> operator *=(Mat4<T> const val) 258 { 259 return *this = *this * val; 260 } 261 236 262 inline Vec4<T> operator *(Vec4<T> const val) const 237 263 { … … 250 276 }; 251 277 278 typedef Mat4<float> mat4; 279 typedef Mat4<int> mat4i; 280 281 /* Aliases for deprecated stuff */ 282 typedef Vec2<float> float2; 283 typedef Vec2<int> int2; 284 typedef Vec3<float> float3; 285 typedef Vec3<int> int3; 286 typedef Vec4<float> float4; 287 typedef Vec4<int> int4; 252 288 typedef Mat4<float> float4x4; 253 289 typedef Mat4<int> int4x4; 
trunk/src/scene.cpp
r662 r663 138 138 // XXX: debug stuff 139 139 model_matrix = float4x4::translate(320.0f, 240.0f, 0.0f); 140 model_matrix = model_matrix *float4x4::rotate(data>angle, 1.0f, 0.0f, 0.0f);140 model_matrix *= float4x4::rotate(data>angle, 1.0f, 0.0f, 0.0f); 141 141 #if 0 142 142 static float f = 0.0f; 143 143 f += 0.01f; 144 model_matrix = model_matrix *float4x4::rotate(0.1f * sinf(f), 1.0f, 0.0f, 0.0f);145 model_matrix = model_matrix *float4x4::rotate(0.3f * cosf(f), 0.0f, 0.0f, 1.0f);146 #endif 147 model_matrix = model_matrix *float4x4::translate(320.0f, 240.0f, 0.0f);144 model_matrix *= float4x4::rotate(0.1f * sinf(f), 1.0f, 0.0f, 0.0f); 145 model_matrix *= float4x4::rotate(0.3f * cosf(f), 0.0f, 0.0f, 1.0f); 146 #endif 147 model_matrix *= float4x4::translate(320.0f, 240.0f, 0.0f); 148 148 // XXX: end of debug stuff 149 149
Note: See TracChangeset
for help on using the changeset viewer.