The three virtues of a programmer: Laziness, Impatience, and Hubris. – Larry Wall
UE3:EmitterPool (UDK)
Contents
- 1 Properties
- 1.1 ActiveComponents
- 1.2 bLogPoolOverflow
- 1.3 bLogPoolOverflowList
- 1.4 FreeMatInstConsts
- 1.5 FreeSMComponents
- 1.6 IdealMaterialInstanceConstants
- 1.7 IdealStaticMeshComponents
- 1.8 MaxActiveEffects
- 1.9 PoolComponents
- 1.10 PSCTemplate
- 1.11 RelativePSCs
- 1.12 SMC_MIC_CurrentReductionTime
- 1.13 SMC_MIC_ReductionTime
- 1.14 Default values
- 1.15 Subobjects
- 2 Structs
- 3 Functions
- Package:
- Engine
- Direct subclass:
- UTEmitterPool
- This class in other games:
- UT3
This is an auto-generated page and may need human attention. Please remove the {{autogenerated}} tag if the page seems reasonably complete or replace it with the {{expand}} tag if the page is not yet complete. |
this class manages a pool of ParticleSystemComponents it is meant to be used for single shot effects spawned during gameplay to reduce object overhead that would otherwise be caused by spawning dozens of Emitters
Properties[edit]
ActiveComponents[edit]
Type: array<ParticleSystemComponent>
components currently active
bLogPoolOverflow[edit]
Type: bool
Modifiers: globalconfig
option to log out the names of all active effects when the pool overflows
Default value: True
bLogPoolOverflowList[edit]
Type: bool
Modifiers: globalconfig
FreeMatInstConsts[edit]
Type: array<MaterialInstanceConstant>
Modifiers: private, const
The free MaterialInstanceConstants used by emitters in this pool
FreeSMComponents[edit]
Type: array<StaticMeshComponent>
Modifiers: private, const
The free StaticMeshComponents used by emitters in this pool
IdealMaterialInstanceConstants[edit]
Type: int
Default value: 250
IdealStaticMeshComponents[edit]
Type: int
The ideal number of StaticMeshComponents and MaterialInstanceConstants. If their counts are greater than this for more than ReductionTime, then they will be chopped down to their respective settings.
Default value: 250
MaxActiveEffects[edit]
Type: int
maximum allowed active components - if this is greater than 0 and is exceeded, the oldest active effect is taken
PoolComponents[edit]
Type: array<ParticleSystemComponent>
Modifiers: const
components currently in the pool
PSCTemplate[edit]
Type: ParticleSystemComponent
Modifiers: protected
template to base pool components off of - should not be used for effects or attached to anything
Default value: ParticleSystemComponent'ParticleSystemComponent0'
RelativePSCs[edit]
Type: array<EmitterBaseInfo>
SMC_MIC_CurrentReductionTime[edit]
Type: float
Modifiers: transient
SMC_MIC_ReductionTime[edit]
Type: float
The amount of time to allow the SMC and MIC arrays to be beyond their ideals.
Default value: 2.5
Default values[edit]
Property | Value |
---|---|
CollisionType | COLLIDE_CustomDefault |
TickGroup | TG_DuringAsyncWork |
Subobjects[edit]
ParticleSystemComponent0[edit]
Class: Engine.ParticleSystemComponent
Property | Value |
---|---|
AbsoluteRotation | True |
AbsoluteTranslation | True |
ReplacementPrimitive | None |
SecondsBeforeInactive | 0.0 |
Structs[edit]
EmitterBaseInfo[edit]
Modifiers: native
list of components that should be relative to an Actor
- ParticleSystemComponent PSC
- Actor Base
- Object.Vector RelativeLocation
- Object.Rotator RelativeRotation
Functions[edit]
Native functions[edit]
ClearPoolComponents[edit]
removes everything from the pool - does not touch currently active components
FreeMaterialInstanceConstants[edit]
internal - moves the MIConstants from given SMComponent to the pool free list
FreeStaticMeshComponents[edit]
internal - moves the SMComponents from given PSC to the pool free list
GetFreeMatInstConsts[edit]
internal - retrieves a MaterialInstanceConstant from the pool free list
Parameters:
- bCreateNewObject - If TRUE, create an MIC w/ the pool as its outer
Returns:
- MaterialInstanceConstant The MIC, NULL if none was available/created
GetFreeStaticMeshComponent[edit]
internal - retrieves a SMComponent from the pool free list
Parameters:
- bCreateNewObject - If TRUE, create an SMC w/ the pool as its outer
Returns:
- StaticMeshComponent The SMC, NULL if none was available/created
GetPooledComponent[edit]
internal - helper for spawning functions gets a component from the appropriate pool array (checks PerEmitterPools) includes creating a new one if necessary as well as taking one from the active list if the max number active has been exceeded
Returns:
- the ParticleSystemComponent to use
ReturnToPool[edit]
internal - detaches the given PSC and returns it to the pool
Other instance functions[edit]
OnParticleSystemFinished[edit]
set to each pool component's finished delegate to return it to the pool for custom lifetime PSCs, must be called manually when done with the component
SpawnEmitter[edit]
plays the specified effect at the given location and rotation, taking a component from the pool or creating as necessary
Parameters:
- EmitterTemplate - particle system to create
- SpawnLocation - location to place the effect in world space
- SpawnRotation - opt) - rotation to place the effect in world space
- AttachToActor - opt) - if specified, component will move along with this Actor
Returns:
- the ParticleSystemComponent the effect will use
Note: the component is returned so the caller can perform any additional modifications (parameters, etc), but it shouldn't keep the reference around as the component will be returned to the pool as soon as the effect is complete
SpawnEmitterCustomLifetime[edit]
spawns a pooled component that has a custom lifetime (controlled by the caller) the caller is responsible for attaching/detaching the component as well as calling our OnParticleSystemFinished() function when it is done with the component the pool may take the component back early - if it does, it will trigger the component's OnSystemFinished delegate so the caller can guarantee that it will be triggered
Parameters:
- EmitterTemplate - particle system to create
Returns:
- the ParticleSystemComponent to use
SpawnEmitterMeshAttachment[edit]
spawns a particle system attached to a SkeletalMeshComponent instead of to another Actor or to nothing as with SpawnEmitter(), the caller should avoid persistent references to the returned component as it will get automatically reclaimed when the effect is complete
Parameters:
- EmitterTemplate - particle system to create
- Mesh - mesh component to attach to
- AttachPointName - bone or socket to attach to
- bAttachToSocket - opt) - whether AttachPointName is a socket or bone name
- RelativeLoc - opt) - offset from bone location to place the effect (not used when attaching to socket)
- RelativeRot - opt) - offset from bone rotation to place the effect (not used when attaching to socket)
Returns:
- the ParticleSystemComponent the effect will use
Note: if the owning Actor is destroyed before the effect completes, the ParticleSystemComponent will end up being marked pending kill and therefore eventually destroyed as well. The pool handles this gracefully, although it's obviously suboptimal.