| Index: sky/sdk/lib/animation/mechanics.dart
|
| diff --git a/sky/sdk/lib/animation/mechanics.dart b/sky/sdk/lib/animation/mechanics.dart
|
| index 6a6cc4cad46f7f8c744afe9cd8ac06757e5ba1a8..664c29debc330ee3ec54ba913230dc816360ac0f 100644
|
| --- a/sky/sdk/lib/animation/mechanics.dart
|
| +++ b/sky/sdk/lib/animation/mechanics.dart
|
| @@ -21,6 +21,7 @@ class Particle extends System {
|
| velocity += impulse / mass;
|
| }
|
|
|
| + @override
|
| void update(double deltaT) {
|
| position += velocity * deltaT;
|
| }
|
| @@ -44,6 +45,7 @@ class ClosedBox extends Box {
|
| assert(min == null || max == null || min <= max);
|
| }
|
|
|
| + @override
|
| void confine(Particle p) {
|
| if (min != null) {
|
| p.position = math.max(min, p.position);
|
| @@ -69,6 +71,7 @@ class GeofenceBox extends Box {
|
| assert(onEscape != null);
|
| }
|
|
|
| + @override
|
| void confine(Particle p) {
|
| if (((min != null) && (p.position < min)) ||
|
| ((max != null) && (p.position > max)))
|
| @@ -84,6 +87,7 @@ class ParticleInBox extends System {
|
| box.confine(particle);
|
| }
|
|
|
| + @override
|
| void update(double deltaT) {
|
| particle.update(deltaT);
|
| box.confine(particle);
|
| @@ -100,6 +104,7 @@ class ParticleInBoxWithFriction extends ParticleInBox {
|
| : super(particle: particle, box: box),
|
| _sign = particle.velocity.sign;
|
|
|
| + @override
|
| void update(double deltaT) {
|
| double force = -_sign * friction * particle.mass * -kGravity;
|
| particle.applyImpulse(force * deltaT);
|
| @@ -130,6 +135,7 @@ class ParticleAndSpringInBox extends System {
|
| _applyInvariants();
|
| }
|
|
|
| + @override
|
| void update(double deltaT) {
|
| particle.applyImpulse(spring.force * deltaT);
|
| particle.update(deltaT);
|
| @@ -181,6 +187,7 @@ class ParticleClimbingRamp extends System {
|
| box.confine(particle);
|
| }
|
|
|
| + @override
|
| void update(double deltaT) {
|
| particle.update(deltaT);
|
| // Note that we apply the impulse from gravity after updating the particle's
|
| @@ -202,6 +209,7 @@ class Multisystem extends System {
|
| _currentSystem = system;
|
| }
|
|
|
| + @override
|
| void update(double deltaT) {
|
| _currentSystem.update(deltaT);
|
| }
|
|
|