mirror of
https://github.com/3b1b/manim.git
synced 2025-11-16 08:57:58 +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)
|
self.set_orientation(self.default_orientation)
|
||||||
return self
|
return self
|
||||||
|
|
||||||
def get_euler_angles(self):
|
def get_euler_angles(self) -> np.ndarray:
|
||||||
return self.get_orientation().as_euler("zxz")[::-1]
|
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):
|
def get_theta(self):
|
||||||
return self.get_euler_angles()[0]
|
return self.get_euler_angles()[0]
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue