| OLD | NEW |
| 1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 * Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 * found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 */ | |
| 5 | 4 |
| 6 /** @file matrix.cc | 5 /** @file matrix.cc |
| 7 * Implements simple matrix manipulation functions. | 6 * Implements simple matrix manipulation functions. |
| 8 */ | 7 */ |
| 9 | 8 |
| 10 //----------------------------------------------------------------------------- | 9 //----------------------------------------------------------------------------- |
| 11 #include <stdlib.h> | 10 #include <stdlib.h> |
| 12 #include <string.h> | 11 #include <string.h> |
| 13 #include "matrix.h" | 12 #include "matrix.h" |
| 14 #define deg_to_rad(x) (x * (M_PI / 180.0f)) | 13 #define deg_to_rad(x) (x * (M_PI / 180.0f)) |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 multiply_matrix(y_matrix, x_matrix, xy_matrix); | 130 multiply_matrix(y_matrix, x_matrix, xy_matrix); |
| 132 multiply_matrix(z_matrix, xy_matrix, mat); | 131 multiply_matrix(z_matrix, xy_matrix, mat); |
| 133 } | 132 } |
| 134 | 133 |
| 135 void translate_matrix(GLfloat x, GLfloat y, GLfloat z, Matrix_t mat) { | 134 void translate_matrix(GLfloat x, GLfloat y, GLfloat z, Matrix_t mat) { |
| 136 identity_matrix(mat); | 135 identity_matrix(mat); |
| 137 mat[12] += x; | 136 mat[12] += x; |
| 138 mat[13] += y; | 137 mat[13] += y; |
| 139 mat[14] += z; | 138 mat[14] += z; |
| 140 } | 139 } |
| OLD | NEW |