mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +00:00
Changed mobject of ScreenTracker
This commit is contained in:
parent
ec610a9152
commit
c2b3e3f3e0
1 changed files with 24 additions and 20 deletions
|
@ -314,8 +314,9 @@ class SwitchOn(LaggedStart):
|
||||||
def __init__(self, light, **kwargs):
|
def __init__(self, light, **kwargs):
|
||||||
if (not isinstance(light,AmbientLight) and not isinstance(light,Spotlight)):
|
if (not isinstance(light,AmbientLight) and not isinstance(light,Spotlight)):
|
||||||
raise Exception("Only AmbientLights and Spotlights can be switched on")
|
raise Exception("Only AmbientLights and Spotlights can be switched on")
|
||||||
LaggedStart.__init__(self,
|
LaggedStart.__init__(
|
||||||
FadeIn, light, **kwargs)
|
self, FadeIn, light, **kwargs
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class SwitchOff(LaggedStart):
|
class SwitchOff(LaggedStart):
|
||||||
|
@ -333,8 +334,6 @@ class SwitchOff(LaggedStart):
|
||||||
light.submobjects = light.submobjects[::-1]
|
light.submobjects = light.submobjects[::-1]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Lighthouse(SVGMobject):
|
class Lighthouse(SVGMobject):
|
||||||
CONFIG = {
|
CONFIG = {
|
||||||
"file_name" : "lighthouse",
|
"file_name" : "lighthouse",
|
||||||
|
@ -344,7 +343,6 @@ class Lighthouse(SVGMobject):
|
||||||
def move_to(self,point):
|
def move_to(self,point):
|
||||||
self.next_to(point, DOWN, buff = 0)
|
self.next_to(point, DOWN, buff = 0)
|
||||||
|
|
||||||
|
|
||||||
class AmbientLight(VMobject):
|
class AmbientLight(VMobject):
|
||||||
|
|
||||||
# Parameters are:
|
# Parameters are:
|
||||||
|
@ -421,19 +419,6 @@ class AmbientLight(VMobject):
|
||||||
submob.set_fill(opacity = new_submob_alpha)
|
submob.set_fill(opacity = new_submob_alpha)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Spotlight(VMobject):
|
class Spotlight(VMobject):
|
||||||
|
|
||||||
CONFIG = {
|
CONFIG = {
|
||||||
|
@ -590,7 +575,6 @@ class Spotlight(VMobject):
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def dimming(self,new_alpha):
|
def dimming(self,new_alpha):
|
||||||
old_alpha = self.max_opacity
|
old_alpha = self.max_opacity
|
||||||
self.max_opacity = new_alpha
|
self.max_opacity = new_alpha
|
||||||
|
@ -623,7 +607,27 @@ class Spotlight(VMobject):
|
||||||
|
|
||||||
|
|
||||||
class ScreenTracker(ContinualAnimation):
|
class ScreenTracker(ContinualAnimation):
|
||||||
|
def __init__(self, light_source, **kwargs):
|
||||||
|
self.light_source = light_source
|
||||||
|
dummy_mob = Mobject()
|
||||||
|
ContinualAnimation.__init__(self, dummy_mob, **kwargs)
|
||||||
|
|
||||||
def update_mobject(self, dt):
|
def update_mobject(self, dt):
|
||||||
self.mobject.update()
|
self.light_source.update()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue