mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +00:00
Use quick_point_from_proportion in MoveAlongPath
This commit is contained in:
parent
d8428585f8
commit
576a26493e
1 changed files with 3 additions and 2 deletions
|
@ -11,6 +11,7 @@ if TYPE_CHECKING:
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
from manimlib.mobject.mobject import Mobject
|
from manimlib.mobject.mobject import Mobject
|
||||||
|
from manimlib.mobject.types.vectorized_mobject import VMobject
|
||||||
|
|
||||||
|
|
||||||
class Homotopy(Animation):
|
class Homotopy(Animation):
|
||||||
|
@ -105,7 +106,7 @@ class MoveAlongPath(Animation):
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
mobject: Mobject,
|
mobject: Mobject,
|
||||||
path: Mobject,
|
path: VMobject,
|
||||||
suspend_mobject_updating: bool = False,
|
suspend_mobject_updating: bool = False,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
|
@ -113,5 +114,5 @@ class MoveAlongPath(Animation):
|
||||||
super().__init__(mobject, suspend_mobject_updating=suspend_mobject_updating, **kwargs)
|
super().__init__(mobject, suspend_mobject_updating=suspend_mobject_updating, **kwargs)
|
||||||
|
|
||||||
def interpolate_mobject(self, alpha: float) -> None:
|
def interpolate_mobject(self, alpha: float) -> None:
|
||||||
point = self.path.point_from_proportion(alpha)
|
point = self.path.quick_point_from_proportion(alpha)
|
||||||
self.mobject.move_to(point)
|
self.mobject.move_to(point)
|
||||||
|
|
Loading…
Add table
Reference in a new issue