-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathstr.c
24 lines (19 loc) · 772 Bytes
/
str.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <stdlib.h>
#include <stdio.h>
#include "gl-matrix.h"
void vec3_str(vec3_t vec, char *buffer) {
sprintf(buffer, "[%f, %f, %f]", vec[0], vec[1], vec[2]);
}
void mat3_str(mat3_t mat, char *buffer) {
sprintf(buffer, "[%f, %f, %f, %f, %f, %f, %f, %f, %f]", mat[0], mat[1], mat[2], mat[3], mat[4], mat[5], mat[6], mat[7], mat[8]);
}
void mat4_str(mat4_t mat, char *buffer) {
sprintf(buffer, "[%f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f]",
mat[0], mat[1], mat[2], mat[3],
mat[4], mat[5], mat[6], mat[7],
mat[8], mat[9], mat[10], mat[11],
mat[12], mat[13], mat[14], mat[15]);
}
void quat_str(quat_t quat, char *buffer) {
sprintf(buffer, "[%f, %f, %f, %f]", quat[0], quat[1], quat[2], quat[3]);
}