~vladh/hare-glm

aaeede58ee49d6fd9cf2a22605f307b0d3ce23d7 — Vlad-Stefan Harbuz 3 months ago 36cdbeb main
affine.ha: rename translate_make and fix types
1 files changed, 6 insertions(+), 6 deletions(-)

M glm/affine.ha
M glm/affine.ha => glm/affine.ha +6 -6
@@ 1,13 1,13 @@
use math;

export fn translate_make(v: *v3) m4 = {
export fn translation_make(v: *v3) m4 = {
	const mat = m4_new_ident();
	v3_copy_to(v, glm::m4_col(&mat, 3));
	v3_copy_to(v, m4_col(&mat, 3): *v3);
	return mat;
};

export fn translate(m: *m4, v: *v3) void = {
	const mat = translate_make(v);
	const mat = translation_make(v);
	m4_mul_to(&mat, m, m);
};



@@ 23,9 23,9 @@ export fn rotation_make(angle: f32, axis: *v3) m4 = {
	v3_scale_to(&axisn, 1.0 - c, &v);
	v3_scale_to(&axisn, math::sinf64(angle), &vs);

	v3_scale_to(&axisn, v[0], m4_col(&r, 0));
	v3_scale_to(&axisn, v[1], m4_col(&r, 1));
	v3_scale_to(&axisn, v[2], m4_col(&r, 2));
	v3_scale_to(&axisn, v[0], m4_col(&r, 0): *v3);
	v3_scale_to(&axisn, v[1], m4_col(&r, 1): *v3);
	v3_scale_to(&axisn, v[2], m4_col(&r, 2): *v3);

	r[0][0] += c;
	r[1][0] -= vs[2];