Gorilla.Particle.Influencer
Unit Gorilla.Particle.Influencer.pasClasses
- TGorillaParticleInfluencer = class ( TFmxObject )
- TGorillaParticleInfluencerList = class ( {System.Generics.Collections}TObjectList<Gorilla.Particle.Influencer.TGorillaParticleInfluencer> )
- TGorillaLinearParticleInfluencer = class ( TGorillaParticleInfluencer )
- TGorillaSpiralParticleInfluencer = class ( TGorillaParticleInfluencer )
- TGorillaForceParticleInfluencer = class ( TGorillaParticleInfluencer )
- TGorillaGravityParticleInfluencer = class ( TGorillaForceParticleInfluencer )
- TGorillaWindParticleInfluencer = class ( TGorillaForceParticleInfluencer )
- TGorillaColoredParticleInfluencer = class ( TGorillaParticleInfluencer )
- TGorillaRandomColorParticleInfluencer = class ( TGorillaParticleInfluencer )
- TGorillaTrailedParticleInfluencer = class ( TGorillaParticleInfluencer )
- TGorillaTraktorInfluencer = class ( TGorillaParticleInfluencer )
- TGorillaObstacleInfluencer = class ( TGorillaParticleInfluencer )
- TGorillaPhysicsInfluencer = class ( TGorillaParticleInfluencer )
Records
- record TGorillaParticleUpdateCache
Enumerations
- enum TParticleObstacleKind = ( Sphere, Cube, Mesh ) ;
- enum TParticleObstacleSurface = ( Flow, Reflect ) ;
Constants
TParticleObstacleKind
Defines the kind of obstacle used for the obstacle influencer. The component provides 3 types of obstacles: sphere, cube and mesh. The mesh obstacle is very experimental!
TParticleObstacleSurface
Defines the type of surface interacting. Particles could reflect from surface or just flow around those.
TGorillaParticleInfluencer
The custom particle influencer class. Do not instanciate an object of this class directly. Create your individual effects by extending this class and overriding the Interpolate() method.
Ancestors
Members
Fields
Methods
- public constructor Create ( AOwner : TComponent ) ;
- public destructor Destroy ( ) ;
- protected procedure SetEmitter ( const AValue : TComponent ) ; virtual;
- protected procedure DoOnInterpolate
(
const
ADeltaTime :
Single; const
AParticle :
PGorillaParticle
)
;
abstract virtual;
The DoOnInterpolate() method will be called on every emitting step for every particle. The DeltaTime defines the time between the last step and now. The particle parameter is a pointer to a single particle.
- protected procedure DoOnEmitParticle
(
const
AParticle :
PGorillaParticle
)
;
virtual;
The DoOnEmitParticle method is used inside the influencer to react on particle emitation. Overwrite this method to implement individual behaviour.
- protected procedure DoOnDestroyParticle
(
const
AParticle :
PGorillaParticle
)
;
virtual;
The DoOnDestroyParticle method is used inside the influencer to react on particle destruction. Overwrite this method to implement individual behaviour.
- protected procedure Loaded ( ) ; override;
- protected procedure Notification ( AComponent : TComponent; Operation : TOperation ) ; override;
- public procedure Interpolate
(
const
ADeltaTime :
Single; const
AParticle :
PGorillaParticle
)
;
The Interpolate() method will be called on every emitting step for every particle. The DeltaTime defines the time between the last step and now. The particle parameter is a pointer to a single particle. Overwrite the abstract DoOnInterpolate() method in your extended influencer class.
- public procedure EmitParticleCallback
(
const
AParticle :
PGorillaParticle
)
;
The EmitParticleCallback() method is called from the emitter instance, when a particle is emitted. The influencer can react on this behaviour individually. To execute specific actions overwrite the protected abstract method DoOnEmitParticle() method.
- public procedure DestroyParticleCallback
(
const
AParticle :
PGorillaParticle
)
;
The DestroyParticleCallback() method is called from the emitter instance, when a particle is destroyed. The influencer can react on this behaviour individually. To execute specific actions overwrite the protected abstract method DoOnDestroyParticle() method.
Properties
- published Enabled : Boolean
- published Emitter : TComponent
Defines the operating emitter component. Any influence should be linked with a specific emitter. Otherwise it will not affect any particles.
read FEmitter
write SetEmitter
TGorillaParticleInfluencerList
Defines an objectlist for particle influencer instances.
Ancestors
Members
TGorillaLinearParticleInfluencer
Linear Influencer will apply changes to the particle on a linear algorithm. Velocity and growth will be simply added to position and size of each particle. This component is the fastest influencer.
Ancestors
Members
TGorillaSpiralParticleInfluencer
Spiral Influencer will change the position of particles depending on a spiral curve. Growth will be simply added to the size of each particle. This influencer can be used to simulate falling snowflakes, which do not fall linear, but in spirals.
Ancestors
Members
TGorillaForceParticleInfluencer
Forced Influencer is a custom influencer for particles with a specific force, like gravity. Do not use this influencer directly. Extend it and overwrite the interpolate method.
Ancestors
Members
TGorillaGravityParticleInfluencer
Gravity Influencer is the basic influencer class to simulate falling particles. The direction can be changed by applying the force vector. The ratio property manipulates the power of force.
Ancestors
Members
TGorillaWindParticleInfluencer
Wind Influencer is the basic class for manipulating particles by a wind effect. The component was designed to suite the beaufortskala for wind power. Use one of the following values as ratio value to apply realistic wind speed. Beaufortskala: still 0.0 - 0.2 m/s 0.3 - 1.6 m/s 1.6 - 3.4 m/s 3.4 - 5.5 m/s 5.5 - 8.0 m/s 8.0 - 10.8 m/s 10.8 - 13.9 m/s 13.9 - 17.2 m/s 17.2 - 20.8 m/s 20.8 - 24.5 m/s 24.5 - 28.5 m/s 28.5 - 32.7 m/s hurricane 32.7 - ...
Ancestors
Members
Fields
- private FDirection :
TPoint3D
- protected FBox :
TBoundingBox
- protected FOrigin :
TPoint3D
- protected FSize :
TPoint3D
Methods
- public constructor Create ( AOwner : TComponent ) ;
- public destructor Destroy ( ) ;
- protected procedure SetForce ( AValue : TPoint3D ) ; override;
- protected procedure SetOrigin ( AValue : TPoint3D ) ; virtual;
- protected procedure SetSize ( AValue : TPoint3D ) ; virtual;
- protected procedure RecalcData ( ) ;
- protected function BoundingBoxIntersects ( const APoint : TPoint3D ) : Boolean ;
- protected procedure DoOnInterpolate ( const ADeltaTime : Single; const AParticle : PGorillaParticle ) ; override;
- public function GetBoundingBox ( ) : TBoundingBox ;
Properties
TGorillaColoredParticleInfluencer
Colored Influencer is the basic component to manipulate the color of a particle. By default a start and end color is applied by the particle lifetime. If start and end color differs interpolation color is computed.
Ancestors
Members
Fields
Methods
- public constructor Create ( AOwner : TComponent ) ;
- public destructor Destroy ( ) ;
- protected function GetStartColor ( ) : TAlphaColorF ;
- protected procedure SetStartColor ( AValue : TAlphaColorF ) ;
- protected function GetEndColor ( ) : TAlphaColorF ;
- protected procedure SetEndColor ( AValue : TAlphaColorF ) ;
- protected procedure DoOnInterpolate ( const ADeltaTime : Single; const AParticle : PGorillaParticle ) ; override;
Properties
- published StartColor : TAlphaColorF
The starting color of a particle. This color will by applied on particle birth.
read GetStartColor
write SetStartColor - published EndColor : TAlphaColorF
The end color of a particle. This color is kind of destination color, when the lifetime of a particle is reached. If start and end color differs, the color will be interpolated on each step.
read GetEndColor
write SetEndColor
TGorillaRandomColorParticleInfluencer
Random color influencer computes a particle color randomly.
Ancestors
Members
TGorillaTrailedParticleInfluencer
Trailed Influencer is used to apply particle position to a given 3D path. Each particle will follow the complete path depending on its lifetime. So the length of the path is equal to the lifetime of each particle.
Ancestors
Members
Fields
- protected FPath :
TGorillaPath3DData
- protected FStart :
TPoint3D
- protected FSpline :
TGorillaSpline3D
- protected FPolygon :
TGorillaPolygon3D
Methods
- public constructor Create ( AOwner : TComponent ) ;
- public destructor Destroy ( ) ;
- protected procedure Setup ( ) ;
- protected procedure DoOnInterpolate ( const ADeltaTime : Single; const AParticle : PGorillaParticle ) ; override;
Properties
TGorillaTraktorInfluencer
Traktor Influencer is the basic class to define a destination point for particles, but only if they are in the affecting radius. This could be used to simulate black hole effects (gravitational force).
Ancestors
Members
Fields
Methods
- public constructor Create ( AOwner : TComponent ) ;
- public destructor Destroy ( ) ;
- protected procedure DoOnInterpolate ( const ADeltaTime : Single; const AParticle : PGorillaParticle ) ; override;
Properties
- published Center : TPoint3D
- published Radius : Single
- published Acceleration : Single
Defines the power of gravitational force. The higher this value is, the faster the particle will be sucked into the center of the trakor zone.
read FAcceleration
write FAcceleration
TGorillaObstacleInfluencer
Obstacle Influencer is a simple component to interact with obstacles. This influencer will not be exact on collision detection. For realistic results use the Physics Influencer component.
Ancestors
Members
Fields
- protected FCenter :
TPoint3D
- protected FRadius :
Single
- protected FAcceleration :
Single
- protected FKind :
TParticleObstacleKind
- protected FBox :
TBoundingBox
- protected FEmitInside :
Boolean
- protected FSurface :
TParticleObstacleSurface
- protected FElasticity :
Single
- protected FMesh :
TCustomMesh
Methods
- public constructor Create ( AOwner : TComponent ) ;
- public destructor Destroy ( ) ;
- protected procedure SetRadius ( AValue : Single ) ;
- protected procedure SetKind ( AValue : TParticleObstacleKind ) ;
- protected procedure UpdateBoundingBox ( ) ;
- protected procedure DoOnInterpolate ( const ADeltaTime : Single; const AParticle : PGorillaParticle ) ; override;
- protected procedure Notification ( AComponent : TComponent; Operation : TOperation ) ; override;
- public function Intersects ( const APosition : TPoint3D ) : Boolean ;
Properties
- published Center : TPoint3D
- published Radius : Single
- published Kind : TParticleObstacleKind
- published Acceleration : Single
Defines the acceleration on particle collision with the surface.
read FAcceleration
write FAcceleration - published EmitInside : Boolean
- published Surface : TParticleObstacleSurface
- published Elasticity : Single
Defines the power of reflection if surface = TParticleObstacleSurface.reflect
read FElasticity
write FElasticity - published Mesh : TCustomMesh
TGorillaPhysicsInfluencer
The physics influencer combines the Q3 Physics Engine with the particle system. All particles in the emitter will interact with the physics world. Use this influencer to implement realistic particle effects, where the particles should collide with 3d objects in the scene.
Ancestors
Members
Fields
- protected FPhysics :
TComponent
- protected FCache :
TCacheList<Gorilla.Particle.Influencer.TGorillaParticleUpdateCache>
Methods
- public constructor Create ( AOwner : TComponent ) ;
- public destructor Destroy ( ) ;
- protected procedure SetEmitter ( const AValue : TComponent ) ; override;
- protected procedure SetPhysics ( const AValue : TComponent ) ; virtual;
- protected procedure DoOnBeforeParticleDisposing ( ASender : TObject; const AParticle : PGorillaParticle ) ;
- protected procedure DoOnEndUpdateBodies ( ASender : TObject ) ;
- protected procedure DoOnSyncedFlushUpdateCache ( ) ;
- protected procedure DoOnFlushUpdateCache ( ) ;
- protected procedure DoOnQ3BodyUpdate ( ASender : TObject; const ACollider : TQ3Collider ) ;
- protected procedure DoOnInterpolate ( const ADeltaTime : Single; const AParticle : PGorillaParticle ) ; override;
- protected procedure DoOnEmitParticle ( const AParticle : PGorillaParticle ) ; override;
- protected procedure DoOnDestroyParticle ( const AParticle : PGorillaParticle ) ; override;
- protected procedure Notification ( AComponent : TComponent; Operation : TOperation ) ; override;