mirror of
https://github.com/recp/cglm.git
synced 2025-10-04 09:08:53 +00:00
print fn for vectors
This commit is contained in:
@@ -37,4 +37,58 @@ glm_mat4_print(mat4 matrix,
|
|||||||
#undef n
|
#undef n
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CGLM_INLINE
|
||||||
|
void
|
||||||
|
glm_vec4_print(vec4 vec,
|
||||||
|
FILE * __restrict ostream) {
|
||||||
|
int i;
|
||||||
|
|
||||||
|
#define m 4
|
||||||
|
|
||||||
|
fprintf(ostream, "Vector (%d):\n", m);
|
||||||
|
|
||||||
|
for (i = 0; i < m; i++)
|
||||||
|
fprintf(ostream, "\t%0.2f,", vec[i]);;
|
||||||
|
|
||||||
|
fprintf(ostream, "\n");
|
||||||
|
|
||||||
|
#undef m
|
||||||
|
}
|
||||||
|
|
||||||
|
CGLM_INLINE
|
||||||
|
void
|
||||||
|
glm_vec3_print(vec3 vec,
|
||||||
|
FILE * __restrict ostream) {
|
||||||
|
int i;
|
||||||
|
|
||||||
|
#define m 3
|
||||||
|
|
||||||
|
fprintf(ostream, "Vector (%d):\n", m);
|
||||||
|
|
||||||
|
for (i = 0; i < m; i++)
|
||||||
|
fprintf(ostream, "\t%0.2f,", vec[i]);;
|
||||||
|
|
||||||
|
fprintf(ostream, "\n");
|
||||||
|
|
||||||
|
#undef m
|
||||||
|
}
|
||||||
|
|
||||||
|
CGLM_INLINE
|
||||||
|
void
|
||||||
|
glm_versor_print(versor vec,
|
||||||
|
FILE * __restrict ostream) {
|
||||||
|
int i;
|
||||||
|
|
||||||
|
#define m 4
|
||||||
|
|
||||||
|
fprintf(ostream, "Versor (%d):\n", m);
|
||||||
|
|
||||||
|
for (i = 0; i < m; i++)
|
||||||
|
fprintf(ostream, "\t%0.2f,", vec[i]);;
|
||||||
|
|
||||||
|
fprintf(ostream, "\n");
|
||||||
|
|
||||||
|
#undef m
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* cglm_util_h */
|
#endif /* cglm_util_h */
|
||||||
|
Reference in New Issue
Block a user