From d3ed664d23197397e3f140986841ea188cde8a65 Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Thu, 20 Oct 2011 17:48:40 +1000 Subject: 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 --- examples/declarative/particles/affectors/gravity.qml | 8 +++----- examples/declarative/particles/affectors/move.qml | 13 ++++++------- 2 files changed, 9 insertions(+), 12 deletions(-) (limited to 'examples') 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; } } -- cgit v1.2.3