From ad2e89f684a5b6fa19fcf6a4756caa099909805b Mon Sep 17 00:00:00 2001 From: Roz K Date: Tue, 27 Dec 2022 06:18:51 +0100 Subject: [PATCH] Cleanup mat4 setters. --- __init__.py | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/__init__.py b/__init__.py index f95d8f1..c718750 100644 --- a/__init__.py +++ b/__init__.py @@ -100,26 +100,10 @@ class mat4(ctypes.Structure): self.up = up self.origin = origin - def set_mat3_vec3(self, axes, origin): - self.right.set(*axes.right, 0.0) - self.forward.set(*axes.forward, 0.0) - self.up.set(*axes.up, 0.0) - self.origin.set(*origin, 1.0) - - def set_axes(self, right, forward, up): - self.right = right - self.forward = forward - self.up = up - - def set_axes_mat3(self, axes): - self.right.set(*axes.right, 0.0) - self.forward.set(*axes.forward, 0.0) - self.up.set(*axes.up, 0.0) - - def set_origin(self, origin): - self.origin = origin - - def set_origin_vec3(self, origin): + def set_vec3(self, right, forward, up, origin): + self.right.set(*right, 0.0) + self.forward.set(*forward, 0.0) + self.up.set(*up, 0.0) self.origin.set(*origin, 1.0) assert ctypes.sizeof(vec3) == ctypes.sizeof(ctypes.c_float) * 3