mirror of
https://github.com/3b1b/manim.git
synced 2025-04-13 09:47:07 +00:00
25 lines
No EOL
823 B
Python
25 lines
No EOL
823 B
Python
from __future__ import absolute_import
|
|
|
|
from constants import *
|
|
|
|
from scene.scene import Scene
|
|
from camera.camera import MovingCamera
|
|
from topics.geometry import ScreenRectangle
|
|
|
|
class MovingCameraScene(Scene):
|
|
def setup(self):
|
|
self.camera_frame = ScreenRectangle(height = FRAME_HEIGHT)
|
|
self.camera_frame.set_stroke(width = 0)
|
|
self.camera = MovingCamera(
|
|
self.camera_frame, **self.camera_config
|
|
)
|
|
return self
|
|
|
|
def get_moving_mobjects(self, *animations):
|
|
# TODO: Code repetition from ZoomedScene
|
|
moving_mobjects = Scene.get_moving_mobjects(self, *animations)
|
|
if self.camera_frame in moving_mobjects:
|
|
# When the camera is moving, so is everything,
|
|
return self.mobjects
|
|
else:
|
|
return moving_mobjects |