ClampedPhysicsSimulation class
A PhysicsSimulation that clamps the given simulation.
Modified version of Flutter's ClampedSimulation that implements the PhysicsSimulation interface.
- Inheritance
-
- Object
- PhysicsSimulation
- ClampedPhysicsSimulation
Constructors
- ClampedPhysicsSimulation.new(PhysicsSimulation simulation, {double xMin = double.negativeInfinity, double xMax = double.infinity, double dxMin = double.negativeInfinity, double dxMax = double.infinity})
-
Creates a ClampedPhysicsSimulation that clamps the given simulation.
const
Properties
- duration → double
-
The estimated duration of the simulation. Built-in simulations will
estimate this value either with the Newton's method or with the bisection
method.
no setteroverride
- dxMax → double
-
The maximum to apply to dx.
final
- dxMin → double
-
The minimum to apply to dx.
final
- end → double
-
The end position of the simulation.
finalinherited
- flipped → Curve
-
Returns a new curve that is the reversed inversion of this one.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- initialVelocity → double
-
The initial velocity of the simulation.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- simulation → PhysicsSimulation
-
The simulation being clamped. Calls to x, dx, and isDone are
forwarded to the simulation.
final
- start → double
-
The start position of the simulation.
finalinherited
- tolerance ↔ Tolerance
-
How close to the actual end of the simulation a value at a particular time
must be before isDone considers the simulation to be "done".
finalgetter/setter pairinherited
- xMax → double
-
The maximum to apply to x.
final
- xMin → double
-
The minimum to apply to x.
final
Methods
-
copyWith(
{Tolerance? tolerance, double? start, double? end, double? durationScale, Duration? duration, double? initialVelocity}) → PhysicsSimulation -
Creates a new instance of the simulation with optionally modified properties while
preserving the original simulation's behavior.
override
-
dx(
double time) → double -
The velocity of the object in the simulation at the given time.
override
-
isDone(
double time) → bool -
Whether the simulation is "done" at the given time.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
solveInitialVelocity(
double start, double end, double durationInSeconds) → double -
Calculates the initial velocity needed for the simulation to move from
start
toend
position in roughlydurationInSeconds
seconds.override -
toString(
) → String -
A string representation of this object.
override
-
transform(
double t) → double -
Returns the value of the curve at point
t
.inherited -
transformInternal(
double t) → double -
Returns the value of the curve at point
t
.inherited -
x(
double time) → double -
The position of the object in the simulation at the given time.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited