Add always_depth_test option to ThreeDScene, default to true

This commit is contained in:
Grant Sanderson 2023-06-10 09:23:19 -07:00
parent 3e64111952
commit cb02066f22

View file

@ -1021,9 +1021,10 @@ class EndScene(Exception):
class ThreeDScene(Scene):
samples = 4
default_frame_orientation = (-30, 70)
always_depth_test = True
def add(self, *mobjects, set_depth_test: bool = True):
for mob in mobjects:
if set_depth_test and not mob.is_fixed_in_frame():
if set_depth_test and not mob.is_fixed_in_frame() and self.always_depth_test:
mob.apply_depth_test()
super().add(*mobjects)