Get rid of ContinualRotation

This commit is contained in:
Grant Sanderson 2019-02-11 13:22:22 -08:00
parent a73cbb8014
commit 04b4c1dad8
4 changed files with 7 additions and 30 deletions

View file

@ -70,27 +70,6 @@ class ContinualAnimationGroup(ContinualAnimation):
continual_animation.update(dt)
class ContinualRotation(ContinualAnimation):
CONFIG = {
"axis": OUT,
"rate": np.pi / 12, # Radians per second
"in_place": True,
"about_point": None,
}
def update_mobject(self, dt):
if self.about_point:
about_point = self.about_point
elif self.in_place:
about_point = self.mobject.get_center()
else:
about_point = ORIGIN
self.mobject.rotate(
dt * self.rate, axis=self.axis,
about_point=about_point
)
class ContinualMovement(ContinualAnimation):
CONFIG = {
"direction": RIGHT,

View file

@ -1144,7 +1144,7 @@ class TwoDScreenInOurThreeDWorld(AltTeacherStudentsScene, ThreeDScene):
run_time = 4,
added_anims = [MoveToTarget(everything, run_time = 4)],
)
self.add(ContinualRotation(everything, axis = UP, rate = 3*DEGREES))
always_rotate(everything, axis=UP, rate=3 * DEGREES)
self.wait(10)
class EveryOutputPointHasAColor(ColorMappedObjectsScene):

View file

@ -2406,11 +2406,9 @@ class IntroduceCurl(IntroduceVectorField):
label.add_background_rectangle()
label.next_to(arrows, DOWN)
self.add_foreground_mobjects(label)
self.add(ContinualRotation(
arrows, rate=u * 30 * DEGREES
))
always_rotate(arrows, rate=u * 30 * DEGREES)
self.play(
VFadeIn(arrows),
FadeIn(arrows),
FadeIn(label)
)
self.wait(2)
@ -2488,9 +2486,8 @@ class ShearCurl(IntroduceCurl):
)
twig.add(Dot(twig.get_center()))
twig.move_to(circle)
twig_rotation = ContinualRotation(
always_rotate(
twig, rate=-90 * DEGREES,
start_up_time=8,
)
self.play(FadeInFrom(twig, UP))

View file

@ -288,7 +288,7 @@ class AboutToyPuzzles(UtilitiesPuzzleScene, TeacherStudentsScene, ThreeDScene):
eulers.get_bottom(),
color = WHITE
)
self.add(ContinualRotation(cube, axis = UP))
always_rotate(cube, axis=UP)
self.play(
GrowArrow(arrow_to_eulers),
Write(eulers),
@ -1879,7 +1879,8 @@ class EulersFormulaForGeneralPlanarGraph(LightUpNodes, ThreeDScene):
self.play(FadeOut(self.vertices))
self.play(ReplacementTransform(regions, cube, run_time = 2))
cube.sort(lambda p : -p[2])
self.add(ContinualRotation(cube, axis = UP, in_place = False))
always_rotate(cube, axis=UP, about_point=ORIGIN)
self.add(cube)
self.wait(3)
self.play(
FadeOut(self.top_formula),