Files
manim/scene/moving_camera_scene.py
Grant Sanderson 13d7228918 Revert "Merge branch 'master' of github.com:3b1b/manim into alt-calc"
This reverts commit 17a1ea6db500eddfdec75cc727b70737d892e961, reversing
changes made to c8c6e6d9ba77d42c8d50d8187ca2b0427da0079c.
2018-05-21 12:11:46 -07:00

33 lines
1.2 KiB
Python

from __future__ import absolute_import
from scene.scene import Scene
from camera.moving_camera import MovingCamera
from utils.iterables import list_update
class MovingCameraScene(Scene):
CONFIG = {
"camera_class": MovingCamera
}
def setup(self):
Scene.setup(self)
assert(isinstance(self.camera, MovingCamera))
self.camera_frame = self.camera.frame
# Hmm, this currently relies on the fact that MovingCamera
# willd default to a full-sized frame. Is that okay?
return self
def get_moving_mobjects(self, *animations):
moving_mobjects = Scene.get_moving_mobjects(self, *animations)
all_moving_mobjects = self.camera.extract_mobject_family_members(
moving_mobjects
)
movement_indicators = self.camera.get_mobjects_indicating_movement()
for movement_indicator in movement_indicators:
if movement_indicator in all_moving_mobjects:
# When one of these is moving, the camera should
# consider all mobjects to be moving
return list_update(self.mobjects, moving_mobjects)
return moving_mobjects