Cleanup mat4 setters.
This commit is contained in:
parent
6b33f8285c
commit
ad2e89f684
24
__init__.py
24
__init__.py
@ -100,26 +100,10 @@ class mat4(ctypes.Structure):
|
|||||||
self.up = up
|
self.up = up
|
||||||
self.origin = origin
|
self.origin = origin
|
||||||
|
|
||||||
def set_mat3_vec3(self, axes, origin):
|
def set_vec3(self, right, forward, up, origin):
|
||||||
self.right.set(*axes.right, 0.0)
|
self.right.set(*right, 0.0)
|
||||||
self.forward.set(*axes.forward, 0.0)
|
self.forward.set(*forward, 0.0)
|
||||||
self.up.set(*axes.up, 0.0)
|
self.up.set(*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):
|
|
||||||
self.origin.set(*origin, 1.0)
|
self.origin.set(*origin, 1.0)
|
||||||
|
|
||||||
assert ctypes.sizeof(vec3) == ctypes.sizeof(ctypes.c_float) * 3
|
assert ctypes.sizeof(vec3) == ctypes.sizeof(ctypes.c_float) * 3
|
||||||
|
Loading…
Reference in New Issue
Block a user