PhysicsSimulator class abstract
Base contract for physics simulations.
All simulations produce position and velocity values as a function of time. They are used by MotionEngine.samplePhysics and by physics-based curves.
Implementations:
- SpringSim — mass-spring-damper
- FrictionSim — exponential deceleration (fling/scroll)
- GravitySim — uniform acceleration (gravity, projectiles)
- MagneticSim — inverse-square attraction (snap-to-point)
- Implementers
Constructors
- PhysicsSimulator()
-
const
Properties
Methods
-
isDone(
double t) → bool - True when the simulation has effectively come to rest.
-
normalized(
double t, {required double from, required double to}) → double -
Normalizes position to
0.0, 1.0based onfromandto. Useful for driving AnimationController.value. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
position(
double t) → double -
Position at time
t(seconds). -
sample(
{double durationSec = 2.0, int sampleHz = 60}) → List< double> -
Samples the simulation at
sampleHzfordurationSecseconds. -
settleDuration(
{double maxTime = 10.0, int resolution = 120}) → double -
Returns the time (seconds) at which isDone first becomes true,
sampled at
resolutionsteps per second. ReturnsmaxTimeif never done. -
toString(
) → String -
A string representation of this object.
inherited
-
velocity(
double t) → double -
Velocity at time
t(units/second).
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited