AGK for Pascal
ContentsIndexHome
PreviousUpNext
TAgkParticleEmitter.AddForce Method (Single, Single, TAgkVector)

Adds a force that will act at a given time in every particle's life. For example a force set to start at time 2 and end at time 3 will start influencing particles when they have been alive for 2 seconds. It will continue to act on those particles until they have been alive for 3 seconds.

Syntax
Pascal
procedure AddForce(const StartTime: Single; const EndTime: Single; const Acceleration: TAgkVector); overload;
Parameters 
Description 
const StartTime: Single 
The time (in seconds) in a particle's life at which this force should start having an effect. 
const EndTime: Single 
The time (in seconds) in a particle's life at which this force should stop having an effect. 
const Acceleration: TAgkVector 
The vector of the force's influence on a particle's speed in units per second. 

The force's influence is defined by an X and Y value that represent acceleration in units per second. For example a force with X=5 will adjust a particle's horizontal speed by adding 5 units for every second the force is active. If the force is only active for 0.5 seconds the particle would then be moving 2.5 units per second faster towards the right. Multiple forces can be acting on a particle at the same time if their timings overlap.

Copyright (c) 2012. All rights reserved.