Search Results for

    Show / Hide Table of Contents

    Class ParticleEffect

    The particle system instance that plays the particles simulation in the game.

    Inheritance
    Object
    ScriptingObject
    SceneObject
    Actor
    ParticleEffect
    Inherited Members
    Actor::_box
    Actor::_drawCategory
    Actor::_drawNoCulling
    ScriptingObject::_gcHandle
    ScriptingObject::_id
    Actor::_isActive
    Actor::_isActiveInHierarchy
    Actor::_isEnabled
    Actor::_isHierarchyDirty
    Actor::_isPrefabRoot
    Actor::_layer
    Actor::_localTransform
    Actor::_name
    SceneObject::_parent
    Actor::_physicsScene
    SceneObject::_prefabID
    SceneObject::_prefabObjectID
    Actor::_scene
    Actor::_sphere
    Actor::_staticFlags
    Actor::_transform
    ScriptingObject::_type
    Actor::AddMovement(const Vector3& translation)
    Actor::AddMovement(const Vector3& translation, const Quaternion& rotation)
    Actor::AddScript()
    Actor::AddStaticFlags(StaticFlags flags)
    Actor::AddTag(const Tag& tag)
    Actor::AddTagRecursive(const Tag& tag)
    ParticleEffect
    Actor::BeginPlay(SceneBeginData* data)
    Actor::BreakPrefabLink()
    ScriptingObject::CanCast(const ScriptingTypeHandle& from, const ScriptingTypeHandle& to)
    ScriptingObject::CanCast(const MClass* from, const MClass* to)
    ScriptingObject::Cast(ScriptingObject* obj)
    ScriptingObject::ChangeID(const Guid& newId)
    Actor::ChangeScriptOrder(Script* script, int32 newIndex)
    Actor::Children
    Actor::Clone()
    ScriptingObject::CreateManaged()
    ScriptingObject::CreateManagedInternal()
    ScriptingObject::Deleted
    Object::DeleteObject(float timeToLive = 0.0f, bool useGameTime=false)
    Object::DeleteObjectNow()
    Actor::DEPRECATED("Use HasTag instead") const String& GetTag()
    Actor::DEPRECATED("Use AddTag instead") void SetTag(const StringView& value)
    ISerializable::DeserializeIfExists(DeserializeStream& stream, const char* memberName, ISerializeModifier* modifier)
    ParticleEffect
    Actor::DestroyChildren(float timeLeft = 0.0f)
    ScriptingObject::DestroyManaged()
    Actor::Draw(RenderContextBatch& renderContextBatch)
    Actor::FindActor(const StringView& name)
    Actor::FindActor(const MClass* type, bool activeOnly=false)
    Actor::FindActor(const MClass* type, const StringView& name)
    Actor::FindActor(const MClass* type, const Tag& tag, bool activeOnly=false)
    Actor::FindActor()
    Actor::FindActor(const Tag& tag)
    Actor::FindScript(const MClass* type)
    Actor::FindScript()
    Object::Flags
    Actor::FromBytes(const Span<byte>& data, Array<Actor* >& output, ISerializeModifier* modifier)
    Actor::FromBytes(const Span<byte>& data)
    Actor::FromBytes(const Span<byte>& data, const Dictionary<Guid, Guid, HeapAllocation>& idsMapping)
    ScriptingObject::FromInterface(void* interfaceObj, const ScriptingTypeHandle& interfaceType)
    ScriptingObject::FromInterface(T* interfaceObj)
    Actor::FromJson(const StringAnsiView& json)
    Actor::GetBox()
    Actor::GetBoxWithChildren()
    Actor::GetChild(int32 index)
    Actor::GetChild(const StringView& name)
    Actor::GetChild(const MClass* type)
    Actor::GetChild()
    Actor::GetChildren(const MClass* type)
    Actor::GetChildren()
    Actor::GetChildrenCount()
    ScriptingObject::GetClass()
    Actor::GetDirection()
    Actor::GetEditorBoxChildren()
    ScriptingObject::GetID()
    Actor::GetIsActive()
    Actor::GetLayer()
    Actor::GetLayerMask()
    Actor::GetLayerName()
    Actor::GetLocalOrientation()
    Actor::GetLocalPosition()
    Actor::GetLocalScale()
    Actor::GetLocalToWorldMatrix(Matrix& localToWorld)
    Actor::GetLocalToWorldMatrix(Double4x4& localToWorld)
    Actor::GetLocalTransform()
    ScriptingObject::GetManagedInstance()
    Actor::GetName()
    SceneObject::GetNamePath(Char separatorChar='/')
    Actor::GetOrAddChild()
    ScriptingObject::GetOrCreateManagedInstance()
    Actor::GetOrderInParent()
    Actor::GetOrientation()
    SceneObject::GetParent()
    Actor::GetPerInstanceRandom()
    Actor::GetPhysicsScene()
    Actor::GetPosition()
    SceneObject::GetPrefabID()
    SceneObject::GetPrefabObjectID()
    Actor::GetPrefabRoot()
    Actor::GetRotation()
    Actor::GetScale()
    Actor::GetScene()
    Actor::GetSceneObjectId()
    Actor::GetSceneRendering()
    Actor::GetScript(int32 index)
    Actor::GetScript(const MClass* type)
    Actor::GetScript()
    Actor::GetScriptByID(const Guid& id)
    Actor::GetScripts(const MClass* type)
    Actor::GetScripts()
    Actor::GetScriptsCount()
    Actor::GetSphere()
    Actor::GetStaticFlags()
    Actor::GetTransform()
    ScriptingObject::GetType()
    ScriptingObject::GetTypeHandle()
    Actor::GetWorldToLocalMatrix(Matrix& worldToLocal)
    Actor::GetWorldToLocalMatrix(Double4x4& worldToLocal)
    Actor::HasActorInChildren(Actor* a)
    Actor::HasActorInHierarchy(Actor* a)
    ScriptingObject::HasManagedInstance()
    SceneObject::HasParent()
    SceneObject::HasPrefabLink()
    Actor::HasScene()
    Actor::HasStaticFlag(StaticFlags flag)
    Actor::HasTag()
    Actor::HasTag(const Tag& tag)
    Actor::HasTag(const StringView& tag)
    Actor::HideFlags
    Actor::Initialize()
    Actor::InitializeHierarchy()
    Actor::Intersects(const Ray& ray, Real& distance, Vector3& normal)
    Actor::IntersectsItself(const Ray& ray, Real& distance, Vector3& normal)
    ScriptingObject::Is(const ScriptingTypeHandle& type)
    ScriptingObject::Is(const MClass* type)
    ScriptingObject::Is()
    Actor::IsActiveInHierarchy()
    SceneObject::IsDuringPlay()
    Actor::IsPrefabRoot()
    ScriptingObject::IsRegistered()
    Actor::IsStatic()
    Actor::IsTransformStatic()
    Actor::LinkPrefab(const Guid& prefabId, const Guid& prefabObjectId)
    Actor::LookAt(const Vector3& worldPos)
    Actor::LookAt(const Vector3& worldPos, const Vector3& worldUp)
    Actor::LookingAt(const Vector3& worldPos)
    Actor::LookingAt(const Vector3& worldPos, const Vector3& worldUp)
    ScriptingObject::NewObject(const ScriptingTypeHandle& typeHandle)
    ScriptingObject::NewObject()
    Actor::OnActiveChanged()
    Actor::OnBeginPlay()
    Actor::OnDebugDraw()
    Actor::OnDeleteObject()
    Actor::OnEndPlay()
    ScriptingObject::OnManagedInstanceDeleted()
    Actor::OnOrderInParentChanged()
    Actor::OnParentChanged()
    Actor::OnPhysicsSceneChanged(PhysicsScene* previous)
    ScriptingObject::OnScriptingDispose()
    Actor::OnStaticFlagsChanged()
    ScriptingObject::RegisterObject()
    Actor::RemoveStaticFlags(StaticFlags flags)
    Actor::RemoveTag(const Tag& tag)
    Actor::ResetLocalTransform()
    SceneObject::SceneObject(const SpawnParams& params)
    ScriptingObject::ScriptingObject(const SpawnParams& params)
    Actor::Scripts
    ParticleEffect
    ParticleEffect
    Actor::SetDirection(const Float3& value)
    Actor::SetIsActive(bool value)
    Actor::SetLayer(int32 layerIndex)
    Actor::SetLayerName(const StringView& value)
    Actor::SetLayerNameRecursive(const StringView& value)
    Actor::SetLayerRecursive(int32 layerIndex)
    Actor::SetLocalOrientation(const Quaternion& value)
    Actor::SetLocalPosition(const Vector3& value)
    Actor::SetLocalScale(const Float3& value)
    Actor::SetLocalTransform(const Transform& value)
    ScriptingObject::SetManagedInstance(MObject* instance)
    Actor::SetName(String&& value)
    Actor::SetName(const StringView& value)
    Actor::SetOrderInParent(int32 index)
    Actor::SetOrientation(const Quaternion& value)
    Actor::SetParent(Actor* value, bool worldPositionsStays, bool canBreakPrefabLink)
    Actor::SetParent(Actor* value, bool canBreakPrefabLink=true)
    SceneObject::SetParent(Actor* value)
    Actor::SetPhysicsScene(PhysicsScene* scene)
    Actor::SetPosition(const Vector3& value)
    Actor::SetRotation(const Matrix& value)
    Actor::SetScale(const Float3& value)
    Actor::SetStaticFlag(StaticFlags flag, bool value)
    Actor::SetStaticFlags(StaticFlags value)
    Actor::SetTransform(const Transform& value)
    ParticleEffect
    ParticleEffect
    Actor::Tags
    Actor::ToBytes(const Array<Actor* >& actors, MemoryWriteStream& output)
    Actor::ToBytes(const Array<Actor* >& actors)
    ScriptingObject::ToInterface(ScriptingObject* obj, const ScriptingTypeHandle& interfaceType)
    ScriptingObject::ToInterface(ScriptingObject* obj)
    Actor::ToJson()
    ScriptingObject::ToManaged(const ScriptingObject* obj)
    ScriptingObject::ToNative(MObject* obj)
    Actor::ToString()
    Actor::TreeExecute(Function<bool(Actor* , Params ...)>& action, Params ... args)
    Actor::TreeExecuteChildren(Function<bool(Actor* , Params ...)>& action, Params ... args)
    Actor::TryGetSerializedObjectsIds(const Span<byte>& data)
    ScriptingObject::UnregisterObject()
    Actor::UnregisterObjectHierarchy()
    ISerializable::~ISerializable()
    Object::~Object()
    SceneObject::~SceneObject()
    ScriptingObject::~ScriptingObject()
    Assembly: FlaxEngine.dll
    File: Engine/Particles/ParticleEffect.h
    Syntax
    public class ParticleEffect : public Actor

    Fields

    CustomViewRenderTask

    The custom render task used as a view information source (effect will use its render buffers and rendering resolution information for particles simulation).

    Declaration
    public ScriptingObjectReference<SceneRenderTask> CustomViewRenderTask
    Field Value
    ScriptingObjectReference<SceneRenderTask>

    DrawModes

    The draw passes to use for rendering this object.

    Declaration
    public DrawPass DrawModes = DrawPass::Default
    Field Value
    DrawPass

    FixedTimestep

    The fixed timestep for simulation updates. Used only if UpdateMode is set to FixedTimestep.

    Declaration
    public float FixedTimestep = 1.0f / 60.0f
    Field Value
    float

    Instance

    The instance data of the particle system.

    Declaration
    public ParticleSystemInstance Instance
    Field Value
    ParticleSystemInstance

    IsLooping

    Determines whether the particle effect should loop when it finishes playing.

    Declaration
    public bool IsLooping = true
    Field Value
    bool

    ParticleSystem

    The particle system to play.

    Declaration
    public AssetReference<ParticleSystem> ParticleSystem
    Field Value
    AssetReference<ParticleSystem>

    PlayOnStart

    Determines whether the particle effect should play on start.

    Declaration
    public bool PlayOnStart = true
    Field Value
    bool

    SimulationSpeed

    The particles simulation speed factor. Scales the particle system update delta time. Can be used to speed up or slow down the particles.

    Declaration
    public float SimulationSpeed = 1.0f
    Field Value
    float

    SortOrder

    The object sort order key used when sorting drawable objects during rendering. Use lower values to draw object before others, higher values are rendered later (on top). Can be used to control transparency drawing.

    Declaration
    public int8 SortOrder = 0
    Field Value
    int8

    UpdateMode

    The particles simulation update mode. Defines how to update particles emitter.

    Declaration
    public SimulationUpdateMode UpdateMode = SimulationUpdateMode::Realtime
    Field Value
    SimulationUpdateMode

    UpdateWhenOffscreen

    If true, the particle simulation will be updated even when an actor cannot be seen by any camera. Otherwise, the simulation will stop running when the actor is off-screen.

    Declaration
    public bool UpdateWhenOffscreen = true
    Field Value
    bool

    UseTimeScale

    Determines whether the particle effect should take into account the global game time scale for simulation updates.

    Declaration
    public bool UseTimeScale = true
    Field Value
    bool

    Methods

    Deserialize(DeserializeStream& stream, ISerializeModifier* modifier)

    Deserializes object from the input stream.

    Declaration
    public virtual void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override
    Parameters
    DeserializeStream stream

    The input stream.

    ISerializeModifier modifier

    The deserialization modifier object. Always valid.

    Overrides
    Actor::Deserialize(DeserializeStream& stream, ISerializeModifier* modifier)

    Draw(RenderContext& renderContext)

    Draws this actor. Called by Scene Rendering service. This call is more optimized than generic Draw (eg. geometry is rendered during all pass types but other actors are drawn only during GBufferFill pass).

    Declaration
    public virtual void Draw(RenderContext& renderContext) override
    Parameters
    RenderContext renderContext

    The rendering context.

    Overrides
    Actor::Draw(RenderContext& renderContext)

    EndPlay()

    Called when removing object from the game.

    Declaration
    protected virtual void EndPlay() override
    Overrides
    Actor::EndPlay()

    GetEditorBox()

    Gets actor bounding box (single actor, no children included) for editor tools.

    Declaration
    public virtual BoundingBox GetEditorBox() const override
    Returns
    BoundingBox

    Overrides
    Actor::GetEditorBox()

    GetIsPlaying()

    Gets whether or not the particle effect is playing.

    Declaration
    public bool GetIsPlaying() const
    Returns
    bool

    GetLastUpdateTime()

    Gets the last game time when particle system was updated. Value -1 indicates no previous updates.

    Declaration
    public float GetLastUpdateTime() const
    Returns
    float

    GetParameter(const StringView& emitterTrackName, const Guid& paramId)

    Gets the particle parameter.

    Declaration
    public ParticleEffectParameter* GetParameter(const StringView& emitterTrackName, const Guid& paramId)
    Parameters
    StringView emitterTrackName

    The emitter track name (in particle system asset).

    Guid paramId

    The emitter parameter ID (in particle emitter asset).

    Returns
    ParticleEffectParameter

    The effect parameter or null if failed to find.

    GetParameter(const StringView& emitterTrackName, const StringView& paramName)

    Gets the particle parameter.

    Declaration
    public ParticleEffectParameter* GetParameter(const StringView& emitterTrackName, const StringView& paramName)
    Parameters
    StringView emitterTrackName

    The emitter track name (in particle system asset).

    StringView paramName

    The emitter parameter name (in particle emitter asset).

    Returns
    ParticleEffectParameter

    The effect parameter or null if failed to find.

    GetParameters()

    Gets the effect parameters collection. Those parameters are instanced from the ParticleSystem that contains a linear list of emitters and every emitter has a list of own parameters.

    Declaration
    public Array<ParticleEffectParameter> GetParameters()
    Returns
    Array<ParticleEffectParameter>

    GetParametersOverrides()

    Declaration
    protected Array<ParticleEffect::ParameterOverride> GetParametersOverrides()
    Returns
    Array<ParticleEffect::ParameterOverride>

    GetParametersVersion()

    Gets the effect parameters collection version number. It can be used to track parameters changes that occur when particle system or one of the emitters gets reloaded/edited.

    Declaration
    public uint32 GetParametersVersion() const
    Returns
    uint32

    GetParameterValue(const StringView& emitterTrackName, const StringView& paramName)

    Gets the particle parameter value.

    Declaration
    public Variant GetParameterValue(const StringView& emitterTrackName, const StringView& paramName)
    Parameters
    StringView emitterTrackName

    The emitter track name (in particle system asset).

    StringView paramName

    The emitter parameter name (in particle emitter asset).

    Returns
    Variant

    The value.

    GetParticlesCount()

    Gets the particles count (total). GPU particles count is read with one frame delay (due to GPU execution).

    Declaration
    public int32 GetParticlesCount() const
    Returns
    int32

    GetRenderTask()

    Gets the render task to use for particles simulation (eg. depth buffer collisions or view information).

    Declaration
    public SceneRenderTask* GetRenderTask() const
    Returns
    SceneRenderTask

    GetTime()

    Gets the current time position of the particle system timeline animation playback (in seconds).

    Declaration
    public float GetTime() const
    Returns
    float

    HasContentLoaded()

    Returns true if actor has loaded content.

    Declaration
    public virtual bool HasContentLoaded() const override
    Returns
    bool

    Overrides
    Actor::HasContentLoaded()

    OnActiveInTreeChanged()

    Called when actor active in tree state gets changed.

    Declaration
    protected virtual void OnActiveInTreeChanged() override
    Overrides
    Actor::OnActiveInTreeChanged()

    OnDebugDrawSelected()

    Draws debug shapes for the selected actor and all child scripts.

    Declaration
    public virtual void OnDebugDrawSelected() override
    Overrides
    Actor::OnDebugDrawSelected()

    OnDisable()

    Called when actor gets removed from game systems. Occurs on EndPlay event or when actor gets inactivated in hierarchy. Use this event to unregister object from other game system (eg. audio).

    Declaration
    protected virtual void OnDisable() override
    Overrides
    Actor::OnDisable()

    OnEnable()

    Called when actor gets added to game systems. Occurs on BeginPlay event or when actor gets activated in hierarchy. Use this event to register object to other game system (eg. audio).

    Declaration
    protected virtual void OnEnable() override
    Overrides
    Actor::OnEnable()

    OnLayerChanged()

    Called when layer gets changed.

    Declaration
    public virtual void OnLayerChanged() override
    Overrides
    Actor::OnLayerChanged()

    OnTransformChanged()

    Called when actor transform gets changed.

    Declaration
    protected virtual void OnTransformChanged() override
    Overrides
    Actor::OnTransformChanged()

    Pause()

    Pauses the simulation.

    Declaration
    public void Pause()

    Play()

    Plays the simulation.

    Declaration
    public void Play()

    ResetParameters()

    Resets the particle system parameters to the default values from asset.

    Declaration
    public void ResetParameters()

    ResetSimulation()

    Resets the particles simulation state (clears the instance state data but preserves the instance parameters values).

    Declaration
    public void ResetSimulation()

    Serialize(SerializeStream& stream, const void* otherObj)

    Serializes object to the output stream compared to the values of the other object instance (eg. default class object). If other object is null then serialize all properties.

    Declaration
    public virtual void Serialize(SerializeStream& stream, const void* otherObj) override
    Parameters
    SerializeStream stream

    The output stream.

    void otherObj

    The instance of the object to compare with and serialize only the modified properties. If null, then serialize all properties.

    Overrides
    Actor::Serialize(SerializeStream& stream, const void* otherObj)

    SetLastUpdateTime(float time)

    Sets the last game time when particle system was updated. Value -1 indicates no previous updates.

    Declaration
    public void SetLastUpdateTime(float time)
    Parameters
    float time

    SetParametersOverrides(const Array<ParticleEffect::ParameterOverride>& value)

    Declaration
    protected void SetParametersOverrides(const Array<ParticleEffect::ParameterOverride>& value)
    Parameters
    Array<ParticleEffect::ParameterOverride> value

    SetParameterValue(const StringView& emitterTrackName, const StringView& paramName, const Variant& value)

    Set the particle parameter value.

    Declaration
    public void SetParameterValue(const StringView& emitterTrackName, const StringView& paramName, const Variant& value)
    Parameters
    StringView emitterTrackName

    The emitter track name (in particle system asset).

    StringView paramName

    The emitter parameter name (in particle emitter asset).

    Variant value

    The value to set.

    SetTime(float time)

    Sets the current time position of the particle system timeline animation playback (in seconds).

    Declaration
    public void SetTime(float time)
    Parameters
    float time

    SpawnParticles(int32 count, const StringView& emitterTrackName=String::Empty)

    Manually spawns additional particles into the simulation.

    Declaration
    public void SpawnParticles(int32 count, const StringView& emitterTrackName=String::Empty)
    Parameters
    int32 count

    Amount of particles to spawn.

    StringView emitterTrackName

    Name of the emitter track to spawn particles in. Empty if spawn particles into all tracks.

    Stop()

    Stops and resets the simulation.

    Declaration
    public void Stop()

    Sync()

    Synchronizes this instance data with the particle system and all emitters data.

    Declaration
    public void Sync()

    UpdateBounds()

    Updates the actor bounds.

    Declaration
    public void UpdateBounds()

    UpdateSimulation(bool singleFrame=false)

    Performs the full particles simulation update (postponed for the next particle manager update).

    Declaration
    public void UpdateSimulation(bool singleFrame=false)
    Parameters
    bool singleFrame

    True if update animation by a single frame only (time time since last engine update), otherwise will update simulation with delta time since last update.

    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright © 2012-2024 Wojciech Figat