libgoatvr

diff src/mathutil.c @ 8:3d9ec6fe97d7

- added distortion mesh generation for the OpenHMD module (unfinished) - changed internal implementation function naming to use the vrimp_ prefix - added an opengl helper function to load extension entry points
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 20 Sep 2014 13:22:53 +0300
parents ded3d0a74e19
children
line diff
     1.1 --- a/src/mathutil.c	Fri Sep 19 15:16:51 2014 +0300
     1.2 +++ b/src/mathutil.c	Sat Sep 20 13:22:53 2014 +0300
     1.3 @@ -6,7 +6,7 @@
     1.4  
     1.5  static const float idmat[] = {1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1};
     1.6  
     1.7 -void rotation_matrix(const float *quat, float *matrix)
     1.8 +void vrimp_rotation_matrix(const float *quat, float *matrix)
     1.9  {
    1.10  	matrix[0] = 1.0 - 2.0 * quat[1] * quat[1] - 2.0 * quat[2] * quat[2];
    1.11  	matrix[1] = 2.0 * quat[0] * quat[1] + 2.0 * quat[3] * quat[2];
    1.12 @@ -26,10 +26,10 @@
    1.13  	matrix[12] = matrix[13] = matrix[14] = 0.0f;
    1.14  	matrix[15] = 1.0f;
    1.15  
    1.16 -	transpose_matrix(matrix);
    1.17 +	vrimp_transpose_matrix(matrix);
    1.18  }
    1.19  
    1.20 -void translation_matrix(const float *vec, float *matrix)
    1.21 +void vrimp_translation_matrix(const float *vec, float *matrix)
    1.22  {
    1.23  	memcpy(matrix, idmat, sizeof idmat);
    1.24  	matrix[12] = vec[0];
    1.25 @@ -37,7 +37,7 @@
    1.26  	matrix[14] = vec[2];
    1.27  }
    1.28  
    1.29 -void mult_matrix(float *dest, const float *m1, const float *m2)
    1.30 +void vrimp_mult_matrix(float *dest, const float *m1, const float *m2)
    1.31  {
    1.32  	int i, j;
    1.33  	float tmp[16];
    1.34 @@ -51,7 +51,7 @@
    1.35  	memcpy(dest, tmp, sizeof tmp);
    1.36  }
    1.37  
    1.38 -void transpose_matrix(float *matrix)
    1.39 +void vrimp_transpose_matrix(float *matrix)
    1.40  {
    1.41  	int i, j;
    1.42  	float tmp[16];
    1.43 @@ -64,7 +64,7 @@
    1.44  	memcpy(matrix, tmp, sizeof tmp);
    1.45  }
    1.46  
    1.47 -void print_matrix(const float *matrix)
    1.48 +void vrimp_print_matrix(const float *matrix)
    1.49  {
    1.50  	int i, j;
    1.51