Gorilla.Particle.Emitter
Unit Gorilla.Particle.Emitter.pas
Remarks
For including particle effects like fire, smoke, explosion and so one, use TGorillaParticleEmitter. Every particle property is configurable.Classes
- TGorillaParticleEmitterThread = class ( TThread )
- TGorillaParticleEmitter = class ( TGorillaMesh )
Records
- record TParticlePreset
- record TParticleVectorPreset
Enumerations
- enum TAllowedAxis = ( axX, axY, axZ ) ;
Constants
- const GORILLA_PARTICLE_TIME_DELTA : Integer = $3E8;
TParticlePreset
Fields
Methods
- public constructor Create ( const AMin : Integer; const AMax : Integer; const ADivisor : Integer; const ANegative : Boolean ) ;
- public function GetRandomValue ( ) : Single ; overload;
- public function GetRandomValue ( const ANegative : Boolean ) : Single ; overload;
- public function GetMinValue ( ) : Single ;
- public function GetMaxValue ( ) : Single ;
TParticleVectorPreset
TGorillaParticleEmitterThread
Ancestors
Members
TGorillaParticleEmitter
Basic particle emitter class.
Ancestors
Members
Fields
- private FCamera :
TCamera
- private FTimer :
TTimer
- private FFirstTick :
Int64
- private FLastTick :
Int64
- private FEmitting :
Boolean
- protected FReuse :
Boolean
- protected FAutoEmit :
Boolean
- protected FEmitParticles :
Integer
- protected FMaxParticles :
Integer
- protected FEmitTime :
Integer
- protected FMaxAutoEmitTime :
Integer
- protected FActive :
Boolean
- protected FAsync :
Boolean
- protected FThread :
TGorillaParticleEmitterThread
- protected FParticlePosition :
TParticleVectorPreset
- protected FParticleVelocity :
TParticleVectorPreset
- protected FParticleSize :
TParticlePreset
- protected FParticleAngle :
TParticlePreset
- protected FParticleWeight :
TParticlePreset
- protected FParticleGrowth :
TParticlePreset
- protected FParticleLifeTime :
TParticlePreset
- protected FUnused :
TGorillaParticleList
- protected FParticles :
TGorillaParticleList
- protected FBlendFunc :
TBlendEquationFunc
- protected FBlendSource :
TBlendFactor
- protected FBlendDest :
TBlendFactor
- protected FInfluencers :
TGorillaParticleInfluencerList
- protected FShowBounds :
Boolean
- protected FOnStart :
TNotifyEvent
- protected FOnStop :
TNotifyEvent
- protected FOnProcess :
TOnAutoEmitProcess
- protected FOnEmitted :
TOnParticleNotifyEvent
- protected FOnDispose :
TOnParticleNotifyEvent
Methods
- public constructor Create ( AOwner : TComponent ) ;
- public destructor Destroy ( ) ;
- protected function GetActive ( ) : Boolean ;
- protected procedure SetAsync ( AValue : Boolean ) ;
- protected procedure CreateThread ( ) ;
- protected procedure DestroyThread ( ) ;
- protected function GetEmitTime ( ) : Integer ;
- protected procedure SetEmitTime ( const AValue : Integer ) ;
- protected function GetTime ( ) : Single ;
- protected procedure SetBlendFunc ( AValue : TBlendEquationFunc ) ;
- protected procedure SetBlendSource ( AValue : TBlendFactor ) ;
- protected procedure SetBlendDest ( AValue : TBlendFactor ) ;
- protected function GetElapsedTime
(
)
: Int64
;
Returns the time between the first tick and the current tick count in milliseconds.
- protected function GetDeltaRawTime
(
)
: Int64
;
Returns the time between the latest tick and the current tick count in milliseconds.
- protected function GetDeltaTime
(
)
: Single
;
Returns the time between the latest tick and the current tick count divided by the GORILLA_PARTICLE_TIME_DELTA value (= 1000 ms)
- protected function GetThread ( ) : TThread ;
- protected procedure SetCamera ( const AValue : TCamera ) ; virtual;
- protected function GetReuse ( ) : Boolean ;
- protected procedure SetReuse ( const AValue : Boolean ) ;
- protected function GetAutoEmit ( ) : Boolean ;
- protected procedure SetAutoEmit ( const AValue : Boolean ) ;
- protected function GetEmitted ( ) : Integer ;
- protected function GetEmitParticles ( ) : Integer ;
- protected procedure SetEmitParticles ( const AValue : Integer ) ;
- protected function GetMaxParticles ( ) : Integer ;
- protected procedure SetMaxParticles ( const AValue : Integer ) ;
- protected function GetMaxAutoEmitTime ( ) : Integer ;
- protected procedure SetMaxAutoEmitTime ( const AValue : Integer ) ;
- protected function GetParticlePosition ( ) : TParticleVectorPreset ;
- protected function GetParticleVelocity ( ) : TParticleVectorPreset ;
- protected function GetParticleSize ( ) : TParticlePreset ;
- protected function GetParticleAngle ( ) : TParticlePreset ;
- protected function GetParticleWeight ( ) : TParticlePreset ;
- protected function GetParticleGrowth ( ) : TParticlePreset ;
- protected function GetParticleLifeTime ( ) : TParticlePreset ;
- protected procedure SetParticlePosition ( const AValue : TParticleVectorPreset ) ;
- protected procedure SetParticleVelocity ( const AValue : TParticleVectorPreset ) ;
- protected procedure SetParticleSize ( const AValue : TParticlePreset ) ;
- protected procedure SetParticleAngle ( const AValue : TParticlePreset ) ;
- protected procedure SetParticleGrowth ( const AValue : TParticlePreset ) ;
- protected procedure SetParticleWeight ( const AValue : TParticlePreset ) ;
- protected procedure SetParticleLifeTime ( const AValue : TParticlePreset ) ;
- protected procedure DoOnEmit ( ASender : TObject ) ;
- protected procedure Interpolate ( const ADeltaTime : Single; const AParticle : PGorillaParticle ) ; virtual;
- protected procedure DoDisposeParticle ( var AParticle : PGorillaParticle ) ; virtual;
- protected function IsAutoEmitExpired
(
)
: Boolean
;
Checks if the maximum auto emit time was reached and no more auto emittance is allowed.
- protected procedure Render ( ) ; override;
- protected procedure DoOnParticleListNotify ( ASender : TObject; const AItem : PGorillaParticle; AAction : TCollectionNotification ) ; virtual;
- protected procedure CreateParticleList ( ) ;
- protected procedure ApplyToBuffer ( ) ; virtual;
- protected function GetTextureAtlasFrameSize ( ) : TPointF ; virtual;
- protected function GetTextureAtlasOffset ( const ADeltaTime : Single ) : TPointF ; virtual;
- protected procedure Notification ( AComponent : TComponent; Operation : TOperation ) ; override;
- public procedure Start ( ) ; virtual;
- public procedure Stop ( ) ; virtual;
- public procedure ClearUnused ( ) ; virtual;
- public procedure Clear ( ) ; virtual;
- public function IsInsideOfObstacle ( const APos : TPoint3D ) : Boolean ;
- public function EmitParticle ( ) : PGorillaParticle ; overload virtual;
- public function EmitParticle ( const APosition : TPoint3D ) : PGorillaParticle ; overload virtual;
- public procedure SortByEyeDistance ( const APosition : TPoint3D ) ; virtual;
- public procedure ForceUpdate
(
)
;
Particle updates are handled by the internally used TTimer component. Sometimes you'll need to force particle updates independently.
Properties
- public Active : Booleanread GetActive
- public Time : Singleread GetTime
- public DeltaTime : Singleread GetDeltaTime
- public Particles : TList<Gorilla.Particle.PGorillaParticle>
Returns a list of the currently instanciated particles. This may not be equal to the merged mesh used to be rendered. This is just an abstraction layer.
read FParticles - public MeshData : TMeshData
Returns the internal mesh data instance.
- public Thread : TThread
Returns the async computation thread if Async is set to TRUE, otherwise nil will be returned.
read GetThread - published BlendFunc : TBlendEquationFunc
Get or set the blending function to be used for particles rendering.
read FBlendFunc
write SetBlendFunc - published BlendSource : TBlendFactor
Get or set the blending source factor to be used for particles rendering.
read FBlendSource
write SetBlendSource - published BlendDest : TBlendFactor
Get or set the blending destination factor to be used for particles rendering.
read FBlendDest
write SetBlendDest - published MaterialSource : TMaterialSource
- published Cursor : TCursor
- published DragMode : TDragMode
- published Position : TPosition3D
- published Scale : TPosition3D
- published RotationAngle : TPosition3D
- published Locked : Boolean
- published Width : Single
- published Height : Single
- published Depth : Single
- published Opacity : Single
- published Projection : TProjection
- published HitTest : Boolean
- published VisibleContextMenu : Boolean
- published TwoSide : Boolean
- published Visible : Boolean
- published ZWrite : Boolean
- published Camera : TCamera
- published Async : Boolean
- published EmitTime : Integer
- published Reuse : Boolean
- published AutoEmit : Boolean
- published Emitted : Integerread GetEmitted
- published EmitParticles : Integer
- published MaxParticles : Integer
- published MaxAutoEmitTime : Integer
- published ShowBounds : Boolean
Show or hide bounding box for emitted particles. At design time the bounding box will always be shown.
read FShowBounds
write FShowBounds - published ParticlePosition : TParticleVectorPreset
- published ParticleVelocity : TParticleVectorPreset
- published ParticleSize : TParticlePreset
- published ParticleAngle : TParticlePreset
- published ParticleWeight : TParticlePreset
- published ParticleGrowth : TParticlePreset
- published ParticleLifeTime : TParticlePreset
- published Influencers : TGorillaParticleInfluencerListread FInfluencers