diff options
author | Alan Alpert <alan.alpert@nokia.com> | 2011-10-20 17:48:40 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-10-24 12:36:29 +0200 |
commit | d3ed664d23197397e3f140986841ea188cde8a65 (patch) | |
tree | 31a170320cba83a9c3a8b883e97dcae351797ad3 /examples | |
parent | 34cefb69b3f36d7eed9f50a2190459fbae0681de (diff) |
Fold Move into Affector
Since 'Move' was just a generic physics property affector, it makes
sense to fold it into the generic affector as an easier way of
implementing the common case of custom affector (and much faster, since
it doesn't hit JS).
For completeness in the Move behavior, 'once' now applies the effect of
affectors over a second in that one time, so as to avoid exposing the
simulation tick. This allows once to have actual meaning for continous
affectors.
Gravity is also going to be kept around as a convenience (although it
will change slightly), so just removing its deprecation warning.
Change-Id: Ieb52f8990445fe95f94070175a0f9beb6686324b
Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/declarative/particles/affectors/gravity.qml | 8 | ||||
-rw-r--r-- | examples/declarative/particles/affectors/move.qml | 13 |
2 files changed, 9 insertions, 12 deletions
diff --git a/examples/declarative/particles/affectors/gravity.qml b/examples/declarative/particles/affectors/gravity.qml index 47710e6306..dc55324f3a 100644 --- a/examples/declarative/particles/affectors/gravity.qml +++ b/examples/declarative/particles/affectors/gravity.qml @@ -82,12 +82,10 @@ Item { } ParticleSystem { id: sys } - Move { + Gravity { system: sys - acceleration: AngleDirection { - angle: ground.rotation + 90 - magnitude: 32 - } + acceleration: 32 + angle: ground.rotation + 90 } Emitter { system: sys diff --git a/examples/declarative/particles/affectors/move.qml b/examples/declarative/particles/affectors/move.qml index 93ff37bd74..bdeab335ad 100644 --- a/examples/declarative/particles/affectors/move.qml +++ b/examples/declarative/particles/affectors/move.qml @@ -66,12 +66,11 @@ Rectangle { height: 80 } - Move { + Affector { groups: ["A"] x: 120 width: 80 height: 80 - relative: true once: true position: PointDirection { x: 120; } } @@ -96,13 +95,12 @@ Rectangle { height: 10 } - Move { + Affector { groups: ["B"] x: 120 y: 240 width: 80 height: 80 - relative: true once: true speed: AngleDirection { angleVariation:360; magnitude: 72 } } @@ -123,18 +121,19 @@ Rectangle { size: 32 sizeVariation: 8 speed: PointDirection{ x: 80; xVariation: 10 } + acceleration: PointDirection { y: 10; x: 20; } width: 80 height: 80 } - Move { + Affector { groups: ["C"] x: 120 y: 400 width: 80 - height: 80 - relative: true + height: 120 once: true + relative: false acceleration: PointDirection { y: -80; } } |