camera_projection_perspective_horizontal | |
camera_projection_perspective_vertical | |
camera_projection_orthogonal_horizontal | |
camera_projection_orthogonal_vertical | |
camera_projection_orthogonal |
Definition at line 43 of file camera.hpp.
00044 { 00045 camera_projection_perspective_horizontal = 1, 00046 camera_projection_perspective_vertical, 00047 camera_projection_orthogonal_horizontal, 00048 camera_projection_orthogonal_vertical, 00049 camera_projection_orthogonal 00050 };
mesh_mode_not_set | |
mesh_mode_polygon_fill | |
mesh_mode_edge_lines | |
mesh_mode_corner_points | |
mesh_mode_corner_normals | |
mesh_mode_polygon_centroids | |
mesh_mode_count |
Definition at line 39 of file mesh.hpp.
00040 { 00041 mesh_mode_not_set = 0, 00042 mesh_mode_polygon_fill, 00043 mesh_mode_edge_lines, 00044 mesh_mode_corner_points, 00045 mesh_mode_corner_normals, 00046 mesh_mode_polygon_centroids, 00047 mesh_mode_count 00048 };
Definition at line 36 of file render_target.hpp.
00037 { 00038 attachment_renderbuffer, 00039 attachment_texture 00040 };
uniform_type_matrix_4 | |
uniform_type_float | |
uniform_type_vec2 | |
uniform_type_vec3 | |
uniform_type_vec4 | |
uniform_type_int | |
uniform_type_uint | |
uniform_type_texture_2d | |
uniform_type_texture_cube |
Definition at line 43 of file uniform_bindings.hpp.
00044 { 00045 uniform_type_matrix_4, 00046 uniform_type_float, 00047 uniform_type_vec2, 00048 uniform_type_vec3, 00049 uniform_type_vec4, 00050 uniform_type_int, 00051 uniform_type_uint, 00052 uniform_type_texture_2d, 00053 uniform_type_texture_cube 00054 };
Definition at line 56 of file uniform_bindings.hpp.
00057 { 00058 logical_uniform_local_to_world, 00059 logical_uniform_world_to_local, 00060 logical_uniform_local_to_clip, 00061 logical_uniform_clip_to_local, 00062 logical_uniform_world_to_clip, 00063 logical_uniform_clip_to_world, 00064 logical_uniform_view_position_in_world, 00065 logical_uniform_generic_uniform 00066 };
Definition at line 37 of file vertex_format.hpp.
00038 { 00039 vertex_attribute_usage_none, 00040 vertex_attribute_usage_position, 00041 vertex_attribute_usage_normal, 00042 vertex_attribute_usage_tangent, 00043 vertex_attribute_usage_bitangent, 00044 vertex_attribute_usage_color, 00045 vertex_attribute_usage_weights, 00046 vertex_attribute_usage_matrix_indices, 00047 vertex_attribute_usage_texcoord, 00048 vertex_attribute_usage_id 00049 };
color renderstack::make_color_from_hsv | ( | vec3 const & | hsv | ) |
Definition at line 184 of file color.cpp.
00185 { 00186 float h = hsv.x; 00187 float s = hsv.y; 00188 float v = hsv.z; 00189 float r = 0.0f; 00190 float g = 0.0f; 00191 float b = 0.0f; 00192 float f; 00193 float p; 00194 float q; 00195 float t; 00196 int i; 00197 00198 if(s == 0.0f) 00199 { 00200 r = v; 00201 g = v; 00202 b = v; 00203 } 00204 else 00205 { 00206 if(h == 360.0f) 00207 { 00208 h = 0.0; 00209 } 00210 h = h / 60.0f; 00211 i = (int)(h); 00212 f = h - i; 00213 p = v * (1.0f - s ); 00214 q = v * (1.0f - (s * f )); 00215 t = v * (1.0f - (s * (1.0f - f))); 00216 switch(i) 00217 { 00218 case 0: 00219 { 00220 r = v; 00221 g = t; 00222 b = p; 00223 break; 00224 } 00225 case 1: 00226 { 00227 r = q; 00228 g = v; 00229 b = p; 00230 break; 00231 } 00232 case 2: 00233 { 00234 r = p; 00235 g = v; 00236 b = t; 00237 break; 00238 } 00239 case 3: 00240 { 00241 r = p; 00242 g = q; 00243 b = v; 00244 break; 00245 } 00246 case 4: 00247 { 00248 r = t; 00249 g = p; 00250 b = v; 00251 break; 00252 } 00253 case 5: 00254 { 00255 r = v; 00256 g = p; 00257 b = q; 00258 break; 00259 } 00260 default: 00261 { 00262 r = 1.0f; 00263 b = 1.0f; 00264 b = 1.0f; 00265 break; 00266 } 00267 } 00268 } 00269 return color(r, g, b); 00270 }
float renderstack::srgb_to_linear | ( | float | cs | ) |
float renderstack::linear_to_srgb | ( | float | cl | ) |
void renderstack::make_matrix_quaternion_xyz | ( | matrix & | m, | |
matrix & | mi, | |||
quaternion const & | q, | |||
vec3 const & | xyz | |||
) |
Definition at line 327 of file matrix.cpp.
00333 { 00334 float x2 = 2.0f * q.x; 00335 float y2 = 2.0f * q.y; 00336 float z2 = 2.0f * q.z; 00337 float xx = q.x * x2; 00338 float xy = q.x * y2; 00339 float xz = q.x * z2; 00340 float yy = q.y * y2; 00341 float yz = q.y * z2; 00342 float zz = q.z * z2; 00343 float wx = q.w * x2; 00344 float wy = q.w * y2; 00345 float wz = q.w * z2; 00346 00347 mi.m[0][0] = m.m[0][0] = 1.0f - yy - zz; 00348 mi.m[0][1] = m.m[1][0] = xy - wz; 00349 mi.m[0][2] = m.m[2][0] = xz + wy; 00350 m.m[3][0] = t.x; 00351 00352 mi.m[1][0] = m.m[0][1] = xy + wz; 00353 mi.m[1][1] = m.m[1][1] = 1.0f - xx - zz; 00354 mi.m[1][2] = m.m[2][1] = yz - wx; 00355 m.m[3][1] = t.y; 00356 00357 mi.m[2][0] = m.m[0][2] = xz - wy; 00358 mi.m[2][1] = m.m[1][2] = yz + wx; 00359 mi.m[2][2] = m.m[2][2] = 1.0f - xx - yy; 00360 m.m[3][2] = t.z; 00361 00362 mi.m[3][0] = mi.m[0][0] * -t.x + mi.m[1][0] * -t.y + mi.m[2][0] * -t.z; 00363 mi.m[3][1] = mi.m[0][1] * -t.x + mi.m[1][1] * -t.y + mi.m[2][1] * -t.z; 00364 mi.m[3][2] = mi.m[0][2] * -t.x + mi.m[1][2] * -t.y + mi.m[2][2] * -t.z; 00365 00366 mi.m[3][3] = m.m[3][3] = 1.0f; 00367 }
void renderstack::make_matrix_quaternion_xyz_scale | ( | matrix & | m, | |
matrix & | mi, | |||
quaternion const & | q, | |||
vec3 const & | xyz, | |||
vec3 const & | scaling | |||
) |
matrix renderstack::transpose | ( | matrix const & | m | ) |
matrix renderstack::inverse | ( | matrix const & | m | ) |
Definition at line 157 of file matrix.cpp.
00158 { 00159 vec4 x = m.column(0); 00160 vec4 y = m.column(1); 00161 vec4 z = m.column(2); 00162 vec4 w = m.column(3); 00163 vec4 x1 = cross(y, z, w); 00164 vec4 y1 = cross(z, w, x); 00165 vec4 z1 = cross(w, x, y); 00166 vec4 w1 = cross(x, y, z); 00167 float lx = dot(x, x1); 00168 float ly = dot(y, y1); 00169 float lz = dot(z, z1); 00170 float lw = dot(w, w1); 00171 00172 if( 00173 RS_NEAR_ZERO(lx) || 00174 RS_NEAR_ZERO(ly) || 00175 RS_NEAR_ZERO(lz) || 00176 RS_NEAR_ZERO(lw) 00177 ) 00178 { 00179 throw matrix_not_invertible_exception(); 00180 } 00181 00182 x1[0] /= lx; 00183 y1[0] /= ly; 00184 z1[0] /= lz; 00185 w1[0] /= lw; 00186 00187 return matrix(x1, y1, z1, w1); 00188 }
matrix renderstack::make_matrix_frustum_centered | ( | float | width, | |
float | height, | |||
float | nearv, | |||
float | farv | |||
) |
Definition at line 191 of file matrix.cpp.
00197 { 00198 float far_plus_near = farv + nearv; 00199 float far_minus_near = farv - nearv; 00200 float far_times_near = farv * nearv; 00201 00202 float x = RS_NEAR_ZERO(width ) ? 1.0f : ( 2.0f * nearv / width); 00203 float y = RS_NEAR_ZERO(height ) ? 1.0f : ( 2.0f * nearv / height); 00204 float c = RS_NEAR_ZERO(far_minus_near) ? 1.0f : ( -far_plus_near / far_minus_near); 00205 float d = RS_NEAR_ZERO(far_minus_near) ? 1.0f : (-2.0f * far_times_near / far_minus_near); 00206 00207 return matrix( 00208 x, 0.0f, 0.0f, 0.0f, 00209 0.0f, y, 0.0f, 0.0f, 00210 0.0f, 0.0f, c, d, 00211 0.0f, 0.0f, -1.0f, 0.0f 00212 ); 00213 }
matrix renderstack::make_matrix_frustum | ( | float | left, | |
float | right, | |||
float | bottom, | |||
float | top, | |||
float | nearv, | |||
float | farv | |||
) |
Definition at line 216 of file matrix.cpp.
00224 { 00225 float right_plus_left = right + left; 00226 float top_plus_bottom = top + bottom; 00227 float far_plus_near = farv + nearv; 00228 float right_minus_left = right - left; 00229 float top_minus_bottom = top - bottom; 00230 float far_minus_near = farv - nearv; 00231 float far_times_near = farv * nearv; 00232 00233 float x = RS_NEAR_ZERO(right_minus_left) ? 1.0f : ( 2.0f * nearv / right_minus_left); 00234 float y = RS_NEAR_ZERO(top_minus_bottom) ? 1.0f : ( 2.0f * nearv / top_minus_bottom); 00235 float a = RS_NEAR_ZERO(right_minus_left) ? 1.0f : ( right_plus_left / right_minus_left); 00236 float b = RS_NEAR_ZERO(top_minus_bottom) ? 1.0f : ( top_plus_bottom / top_minus_bottom); 00237 float c = RS_NEAR_ZERO(far_minus_near ) ? 1.0f : (-far_plus_near / far_minus_near); 00238 float d = RS_NEAR_ZERO(far_minus_near ) ? 1.0f : (-2.0f * far_times_near / far_minus_near); 00239 00240 return matrix( 00241 x, 0.0f, a, 0.0f, 00242 0.0f, y, b, 0.0f, 00243 0.0f, 0.0f, c, d, 00244 0.0f, 0.0f, -1.0f, 0.0f 00245 ); 00246 }
matrix renderstack::make_matrix_perspective_vertical | ( | float | fovy, | |
float | aspect, | |||
float | near_val, | |||
float | far_val | |||
) |
Definition at line 249 of file matrix.cpp.
00255 { 00256 float fov_tangent = tanf(fov_y_radians * 0.5f); 00257 float height = 2.0f * near_val * fov_tangent; 00258 float width = height * aspect; 00259 00260 return make_matrix_frustum_centered(width, height, near_val, far_val); 00261 }
matrix renderstack::make_matrix_perspective_horizontal | ( | float | fovx, | |
float | aspect, | |||
float | near_val, | |||
float | far_val | |||
) |
Definition at line 263 of file matrix.cpp.
00269 { 00270 float fov_tangent = tanf(fov_x_radians * 0.5f); 00271 float width = 2.0f * near_val * fov_tangent; 00272 float height = width / aspect; 00273 00274 return make_matrix_frustum_centered(width, height, near_val, far_val); 00275 }
matrix renderstack::make_matrix_orthogonal_centered | ( | float | width, | |
float | height, | |||
float | near_val, | |||
float | far_val | |||
) |
Definition at line 277 of file matrix.cpp.
00283 { 00284 float x = RS_NEAR_ZERO(width ) ? 1.0f : ( 2.0f / (float)(width) ); 00285 float y = RS_NEAR_ZERO(height ) ? 1.0f : ( 2.0f / (float)(height) ); 00286 float z = RS_TOLERANCE(near_val, far_val) ? 1.0f : (-2.0f / (float)(far_val - near_val)); 00287 00288 return matrix( 00289 x, 0.0f, 0.0f, 0.0f, 00290 0.0f, y, 0.0f, 0.0f, 00291 0.0f, 0.0f, z, 0.0f, 00292 0.0f, 0.0f, 0.0f, 1.0f 00293 ); 00294 }
matrix renderstack::make_matrix_orthogonal | ( | float | left, | |
float | right, | |||
float | bottom, | |||
float | top, | |||
float | near_val, | |||
float | far_val | |||
) |
Definition at line 296 of file matrix.cpp.
00304 { 00305 float r_plus_l = right + left; 00306 float t_plus_b = top + bottom; 00307 float f_plus_n = far_val + near_val; 00308 float r_minus_l = right - left; 00309 float t_minus_b = top - bottom; 00310 float f_minus_n = far_val - near_val; 00311 00312 float x = RS_NEAR_ZERO(r_minus_l) ? 1.0f : ( 2.0f / r_minus_l); 00313 float y = RS_NEAR_ZERO(t_minus_b) ? 1.0f : ( 2.0f / t_minus_b); 00314 float z = RS_NEAR_ZERO(f_minus_n) ? 1.0f : (-2.0f / f_minus_n); 00315 float tx = RS_NEAR_ZERO(r_minus_l) ? 0.0f : (-r_plus_l / r_minus_l); 00316 float ty = RS_NEAR_ZERO(t_minus_b) ? 0.0f : (-t_plus_b / t_minus_b); 00317 float tz = RS_NEAR_ZERO(f_minus_n) ? 0.0f : (-f_plus_n / f_minus_n); 00318 00319 return matrix( 00320 x, 0.0f, 0, tx, 00321 0.0f, y, 0, ty, 00322 0.0f, 0.0f, z, tz, 00323 0.0f, 0.0f, 0.0f, 1.0f 00324 ); 00325 }
matrix renderstack::make_matrix_translate | ( | vec3 const & | translation | ) |
matrix renderstack::make_matrix_scale | ( | vec3 const & | scaling | ) |
matrix renderstack::make_matrix_translate_scale | ( | vec3 const & | translation, | |
vec3 const & | scaling | |||
) |
void renderstack::make_matrix_hpb_xyz | ( | matrix & | m, | |
matrix & | mi, | |||
vec3 const & | hpb, | |||
vec3 const & | translation | |||
) |
Definition at line 481 of file matrix.cpp.
00487 { 00488 float A = cosf(hpb.y); 00489 float B = sinf(hpb.y); 00490 float C = cosf(hpb.x); 00491 float D = sinf(hpb.x); 00492 float E = cosf(hpb.z); 00493 float F = sinf(hpb.z); 00494 00495 { 00496 float DB = D * B; 00497 00498 mi.m[0][0] = m.m[0][0] = C * E + -DB * F; 00499 mi.m[0][1] = m.m[1][0] = C * -F + -DB * E; 00500 mi.m[0][2] = m.m[2][0] = -D * A; 00501 m.m[3][0] = t.x; 00502 } 00503 00504 { 00505 mi.m[1][0] = m.m[0][1] = A * F; 00506 mi.m[1][1] = m.m[1][1] = A * E; 00507 mi.m[1][2] = m.m[2][1] = -B; 00508 m.m[3][1] = t.y; 00509 } 00510 00511 { 00512 float CB = C * B; 00513 00514 mi.m[2][0] = m.m[0][2] = D * E + CB * F; 00515 mi.m[2][1] = m.m[1][2] = D * -F + CB * E; 00516 mi.m[2][2] = m.m[2][2] = C * A; 00517 m.m[3][2] = t.z; 00518 } 00519 00520 mi.m[3][0] = mi.m[0][0] * -t.x + mi.m[1][0] * -t.y + mi.m[2][0] * -t.z; 00521 mi.m[3][1] = mi.m[0][1] * -t.x + mi.m[1][1] * -t.y + mi.m[2][1] * -t.z; 00522 mi.m[3][2] = mi.m[0][2] * -t.x + mi.m[1][2] * -t.y + mi.m[2][2] * -t.z; 00523 mi.m[3][3] = 1.0f; 00524 m.m[0][3] = 0.0f; 00525 m.m[1][3] = 0.0f; 00526 m.m[2][3] = 0.0f; 00527 m.m[3][3] = 1.0f; 00528 }
void renderstack::make_matrix_hpb_xyz_scale | ( | matrix & | m, | |
matrix & | mi, | |||
vec3 const & | hpb, | |||
vec3 const & | translation, | |||
vec3 const & | scaling | |||
) |
Definition at line 530 of file matrix.cpp.
00537 { 00538 float A = cosf(hpb.y); 00539 float B = sinf(hpb.y); 00540 float C = cosf(hpb.x); 00541 float D = sinf(hpb.x); 00542 float E = cosf(hpb.z); 00543 float F = sinf(hpb.z); 00544 00545 { 00546 float DB = D * B; 00547 00548 mi.m[0][0] = m.m[0][0] = C * E + -DB * F; 00549 mi.m[0][1] = m.m[1][0] = C * -F + -DB * E; 00550 mi.m[0][2] = m.m[2][0] = -D * A; 00551 m.m[3][0] = t.x; 00552 } 00553 00554 { 00555 mi.m[1][0] = m.m[0][1] = A * F; 00556 mi.m[1][1] = m.m[1][1] = A * E; 00557 mi.m[1][2] = m.m[2][1] = -B; 00558 m.m[3][1] = t.y; 00559 } 00560 00561 { 00562 float CB = C * B; 00563 00564 mi.m[2][0] = m.m[0][2] = D * E + CB * F; 00565 mi.m[2][1] = m.m[1][2] = D * -F + CB * E; 00566 mi.m[2][2] = m.m[2][2] = C * A; 00567 m.m[3][2] = t.z; 00568 } 00569 00570 mi.m[3][0] = mi.m[0][0] * -t.x + mi.m[1][0] * -t.y + mi.m[2][0] * -t.z; 00571 mi.m[3][1] = mi.m[0][1] * -t.x + mi.m[1][1] * -t.y + mi.m[2][1] * -t.z; 00572 mi.m[3][2] = mi.m[0][2] * -t.x + mi.m[1][2] * -t.y + mi.m[2][2] * -t.z; 00573 00574 m.m[0][0] = m.m[0][0] * s.x; 00575 m.m[1][0] = m.m[1][0] * s.y; 00576 m.m[2][0] = m.m[2][0] * s.z; 00577 00578 m.m[0][1] = m.m[0][1] * s.x; 00579 m.m[1][1] = m.m[1][1] * s.y; 00580 m.m[2][1] = m.m[2][1] * s.z; 00581 00582 m.m[0][2] = m.m[0][2] * s.x; 00583 m.m[1][2] = m.m[1][2] * s.y; 00584 m.m[2][2] = m.m[2][2] * s.z; 00585 00586 { 00587 float isx = RS_NEAR_ZERO(s.x) ? 0.0f : 1.0f / s.x; 00588 float isy = RS_NEAR_ZERO(s.y) ? 0.0f : 1.0f / s.y; 00589 float isz = RS_NEAR_ZERO(s.z) ? 0.0f : 1.0f / s.z; 00590 00591 mi.m[0][0] = mi.m[0][0] * isx; 00592 mi.m[1][0] = mi.m[1][0] * isy; 00593 mi.m[2][0] = mi.m[2][0] * isz; 00594 mi.m[3][0] = mi.m[3][0] * isz; 00595 00596 mi.m[0][1] = mi.m[0][1] * isx; 00597 mi.m[1][1] = mi.m[1][1] * isy; 00598 mi.m[2][1] = mi.m[2][1] * isz; 00599 mi.m[3][1] = mi.m[3][1] * isz; 00600 00601 mi.m[0][2] = mi.m[0][2] * isx; 00602 mi.m[1][2] = mi.m[1][2] * isy; 00603 mi.m[2][2] = mi.m[2][2] * isz; 00604 mi.m[3][2] = mi.m[3][2] * isz; 00605 } 00606 00607 mi.m[3][3] = 1.0f; 00608 m.m[3][3] = 1.0f; 00609 }
quaternion renderstack::normalize | ( | quaternion const & | q | ) | [inline] |
Definition at line 86 of file quaternion.hpp.
00087 { 00088 float dot = q.x * q.x + q.y * q.y + q.z * q.z + q.w * q.w; 00089 float t = 1.5f - 0.5f * dot; 00090 return quaternion(q.x * t, q.y * t, q.z * t, q.w * t); 00091 }
float renderstack::dot | ( | vec2 const & | v1, | |
vec2 const & | v2 | |||
) | [inline] |
vec2 renderstack::normalize | ( | vec2 const & | v | ) | [inline] |
float renderstack::dot | ( | vec3 const & | v1, | |
vec3 const & | v2 | |||
) | [inline] |
vec3 renderstack::cross | ( | vec3 const & | v1, | |
vec3 const & | v2 | |||
) | [inline] |
vec3 renderstack::normalize | ( | vec3 const & | v | ) | [inline] |
float renderstack::radian_mod_2pi | ( | float | angle_radians | ) | [inline] |
vec3 renderstack::hpb_mod_2pi | ( | vec3 const & | hpb | ) | [inline] |
Definition at line 156 of file vec3.hpp.
00157 { 00158 float h = hpb.x; 00159 float p = hpb.y; 00160 float b = hpb.z; 00161 00162 while(h > RS_TWO_PI) h -= RS_TWO_PI; 00163 while(h < 0 ) h += RS_TWO_PI; 00164 while(p > RS_TWO_PI) p -= RS_TWO_PI; 00165 while(p < 0 ) p += RS_TWO_PI; 00166 while(b > RS_TWO_PI) b -= RS_TWO_PI; 00167 while(b < 0 ) b += RS_TWO_PI; 00168 00169 return vec3(h, p, b); 00170 }
float renderstack::dot | ( | vec4 const & | v1, | |
vec4 const & | v2 | |||
) | [inline] |
vec4 renderstack::normalize | ( | vec4 const & | v | ) | [inline] |
vec3 renderstack::homogenize | ( | vec4 const & | v | ) | [inline] |
vec4 renderstack::cross | ( | vec4 const & | r, | |
vec4 const & | s, | |||
vec4 const & | t | |||
) | [inline] |
Definition at line 159 of file vec4.hpp.
00160 { 00161 return vec4( 00162 r.y * s.z * t.w + r.z * s.w * t.y + r.w * s.y * t.z - r.y * s.w * t.z - r.z * s.y * t.w - r.w * s.z * t.y, 00163 r.x * s.w * t.z + r.z * s.x * t.w + r.w * s.z * t.x - r.x * s.z * t.w - r.z * s.w * t.x - r.w * s.x * t.z, 00164 r.x * s.y * t.w + r.y * s.w * t.x + r.w * s.x * t.y - r.x * s.w * t.y - r.y * s.x * t.w - r.w * s.y * t.x, 00165 r.x * s.z * t.y + r.y * s.x * t.z + r.z * s.y * t.x - r.x * s.y * t.z - r.y * s.z * t.x - r.z * s.x * t.y 00166 ); 00167 }
int renderstack::gl_size_of_type | ( | int | type_code | ) |
Definition at line 32 of file vertex_format.cpp.
00033 { 00034 switch(gl_type_code) 00035 { 00036 case GL_UNSIGNED_BYTE: return 1; 00037 case GL_BYTE: return 1; 00038 case GL_UNSIGNED_SHORT: return 2; 00039 case GL_SHORT: return 2; 00040 case GL_UNSIGNED_INT: return 4; 00041 case GL_INT: return 4; 00042 case GL_FLOAT: return 4; 00043 default: throw false; 00044 } 00045 }
void renderstack::make_matrix_quaternion_xyz | ( | matrix & | m, | |
matrix & | mi, | |||
quaternion const & | q, | |||
vec3 const & | t, | |||
vec3 const & | s | |||
) |
Definition at line 369 of file matrix.cpp.
00376 { 00377 float x2 = 2.0f * q.x; 00378 float y2 = 2.0f * q.y; 00379 float z2 = 2.0f * q.z; 00380 float xx = q.x * x2; 00381 float xy = q.x * y2; 00382 float xz = q.x * z2; 00383 float yy = q.y * y2; 00384 float yz = q.y * z2; 00385 float zz = q.z * z2; 00386 float wx = q.w * x2; 00387 float wy = q.w * y2; 00388 float wz = q.w * z2; 00389 00390 mi.m[0][0] = m.m[0][0] = 1.0f - yy - zz; 00391 mi.m[0][1] = m.m[1][0] = xy - wz; 00392 mi.m[0][2] = m.m[2][0] = xz + wy; 00393 m.m[3][0] = t.x; 00394 00395 mi.m[1][0] = m.m[0][1] = xy + wz; 00396 mi.m[1][1] = m.m[1][1] = 1.0f - xx - zz; 00397 mi.m[1][2] = m.m[2][1] = yz - wx; 00398 m.m[3][1] = t.y; 00399 00400 mi.m[2][0] = m.m[0][2] = xz - wy; 00401 mi.m[2][1] = m.m[1][2] = yz + wx; 00402 mi.m[2][2] = m.m[2][2] = 1.0f - xx - yy; 00403 m.m[3][2] = t.z; 00404 00405 mi.m[3][0] = mi.m[0][0] * -t.x + mi.m[1][0] * -t.y + mi.m[2][0] * -t.z; 00406 mi.m[3][1] = mi.m[0][1] * -t.x + mi.m[1][1] * -t.y + mi.m[2][1] * -t.z; 00407 mi.m[3][2] = mi.m[0][2] * -t.x + mi.m[1][2] * -t.y + mi.m[2][2] * -t.z; 00408 00409 m.m[0][0] = m.m[0][0] * s.x; 00410 m.m[1][0] = m.m[1][0] * s.y; 00411 m.m[2][0] = m.m[2][0] * s.z; 00412 00413 m.m[0][1] = m.m[0][1] * s.x; 00414 m.m[1][1] = m.m[1][1] * s.y; 00415 m.m[2][1] = m.m[2][1] * s.z; 00416 00417 m.m[0][2] = m.m[0][2] * s.x; 00418 m.m[1][2] = m.m[1][2] * s.y; 00419 m.m[2][2] = m.m[2][2] * s.z; 00420 00421 { 00422 float isx = RS_NEAR_ZERO(s.x) ? 0.0f : 1.0f / s.x; 00423 float isy = RS_NEAR_ZERO(s.y) ? 0.0f : 1.0f / s.y; 00424 float isz = RS_NEAR_ZERO(s.z) ? 0.0f : 1.0f / s.z; 00425 00426 mi.m[0][0] = mi.m[0][0] * isx; 00427 mi.m[1][0] = mi.m[1][0] * isy; 00428 mi.m[2][0] = mi.m[2][0] * isz; 00429 00430 mi.m[0][1] = mi.m[0][1] * isx; 00431 mi.m[1][1] = mi.m[1][1] * isy; 00432 mi.m[2][1] = mi.m[2][1] * isz; 00433 00434 mi.m[0][2] = mi.m[0][2] * isx; 00435 mi.m[1][2] = mi.m[1][2] * isy; 00436 mi.m[2][2] = mi.m[2][2] * isz; 00437 } 00438 m.m[0][3] = mi.m[0][3] = 0.0f; 00439 m.m[1][3] = mi.m[1][3] = 0.0f; 00440 m.m[2][3] = mi.m[2][3] = 0.0f; 00441 m.m[3][3] = mi.m[3][3] = 1.0f; 00442 }
matrix renderstack::matrix_make_translate_scale | ( | vec3 const & | t, | |
vec3 const & | s | |||
) |
Definition at line 444 of file matrix.cpp.
matrix renderstack::matrix_make_scale | ( | vec3 const & | s | ) |
Definition at line 457 of file matrix.cpp.
matrix renderstack::matrix_make_translate | ( | vec3 const & | t | ) |
Definition at line 469 of file matrix.cpp.