Does anyone know how to use toEuler() with localOrientation so I can set angles via degrees and not a 3x3 matrix.
Thanks
Does anyone know how to use toEuler() with localOrientation so I can set angles via degrees and not a 3x3 matrix.
Thanks
The orientation attributes differentiate between rotation types. Therefore, create a rotation object from mathutils, and just use it
Something like this?
from mathutils import Euler
from math import radians
angles_degrees = [0.0, 0.0, 45.0]
def applyDegrees(cont):
if not cont.sensors[0].positive:
return
own = cont.owner
angle_radians = [radians(a) for a in angles_degrees] # better initialize this variable
own.localOrientation = Euler(angle_radians)