mons/mons_3d/include/transform.h

37 lines
1.2 KiB
C

#ifndef MONS_TRANSFORM_H
#define MONS_TRANSFORM_H
#include "mons_math/mat4.h"
#include "mons_math/vec3.h"
#include "mons_math/quat.h"
typedef struct mons_transform {
mons_vec3 translation;
mons_vec3 scale;
mons_quat rotation;
} mons_transform;
void mons_transform_translate(mons_transform *transform, struct mons_vec3 translation);
void mons_transform_rotate(mons_transform *transform, struct mons_quat rotation);
void mons_transform_scale(mons_transform *transform, struct mons_vec3 scale);
mons_mat4 mons_transform_matrix(mons_transform transform);
void mons_transform_set_translation(mons_transform *transform, struct mons_vec3 translation);
void mons_transform_set_rotation(mons_transform *transform, struct mons_quat rotation);
void mons_transform_set_scale(mons_transform *transform, struct mons_vec3 scale);
struct mons_vec3 mons_transform_forward(mons_transform transform);
struct mons_vec3 mons_transform_up(mons_transform transform);
struct mons_vec3 mons_transform_right(mons_transform transform);
void mons_transform_look_at(mons_transform *transform, mons_vec3 point, mons_vec3 up);
#define MONS_TRANSFORM_IDENTITY (mons_transform) {\
MONS_VEC3_ZERO,\
MONS_VEC3_ONE,\
MONS_QUAT_IDENTITY,\
}
#endif