mirror of
https://github.com/3b1b/manim.git
synced 2025-11-14 07:27:44 +00:00
Check for null orientation in getting euler angles
This commit is contained in:
parent
8d72340501
commit
fbde9e8bba
1 changed files with 5 additions and 2 deletions
|
|
@ -62,8 +62,11 @@ class CameraFrame(Mobject):
|
|||
self.set_orientation(self.default_orientation)
|
||||
return self
|
||||
|
||||
def get_euler_angles(self):
|
||||
return self.get_orientation().as_euler("zxz")[::-1]
|
||||
def get_euler_angles(self) -> np.ndarray:
|
||||
orientation = self.get_orientation()
|
||||
if all(orientation.as_quat() == [0, 0, 0, 1]):
|
||||
return np.zeros(3)
|
||||
return orientation.as_euler("zxz")[::-1]
|
||||
|
||||
def get_theta(self):
|
||||
return self.get_euler_angles()[0]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue