ParticleAsset
ParticleAsset stores particle effect configuration. Load() parses a .mparticle MDF file. Modules are created based on [[modules]] array entries.
- Module
- AssetSystem
- Header
#include "AssetSystem/Assets/ParticleAsset.h"- Namespace
Mowo
Constructors
| Signature | Name | Description |
|---|---|---|
ParticleAsset() | ParticleAsset | |
~ParticleAsset() override | ~ParticleAsset |
Public functions
Function details
ParticleAsset
ParticleAsset()~ParticleAsset
~ParticleAsset() overrideLoad
bool Load(const std::string& path) overrideAsset interface
Unload
void Unload() overrideCreateGPU
bool CreateGPU(const GPUContext& ctx) overrideDestroyGPU
void DestroyGPU() overrideDestroyGPUIsFrameSafe
bool DestroyGPUIsFrameSafe() const overrideSaveToFile
bool SaveToFile(const std::string& path) constSerializeToString
std::string SerializeToString() constLoadFromString
bool LoadFromString(const std::string& source)CollectDependencyIDs
void CollectDependencyIDs(std::vector<UUID>& out) const overrideCollectDependencyPaths
void CollectDependencyPaths(std::vector<std::string>& out) const overrideGetName
const std::string& GetName() constBasic settings
GetDuration
float GetDuration() constIsLooping
bool IsLooping() constGetPlayOnAwake
bool GetPlayOnAwake() constGetEmissionRate
float GetEmissionRate() constEmission
GetMaxParticles
uint32_t GetMaxParticles() constGetBurstCount
int GetBurstCount() constGetLifetimeMin
float GetLifetimeMin() constLifetime
GetLifetimeMax
float GetLifetimeMax() constGetStartVelocity
Vec3 GetStartVelocity() constStart values
GetStartSpeedMin
float GetStartSpeedMin() constGetStartSpeedMax
float GetStartSpeedMax() constGetStartSizeMin
Vec2 GetStartSizeMin() constGetStartSizeMax
Vec2 GetStartSizeMax() constGetStartColor
Vec4 GetStartColor() constGetBillboardMode
BillboardMode GetBillboardMode() constRendering
GetBlendMode
ParticleBlendMode GetBlendMode() constGetDepthTest
bool GetDepthTest() constGetTextureID
UUID GetTextureID() constGetSimulationMode
ParticleSimulationMode GetSimulationMode() constGetVelocityStretch
float GetVelocityStretch() constGetStretchMax
float GetStretchMax() constGetRenderMode
ParticleRenderMode GetRenderMode() constGetMeshPath
const std::string& GetMeshPath() constGetMeshType
const std::string& GetMeshType() constGetShadingMode
ParticleShadingMode GetShadingMode() constGetModules
const std::vector<Scope<ParticleModule>>& GetModules() constModules
GetModules
std::vector<Scope<ParticleModule>>& GetModules()Mutable access for the particle editor — the editor authors the module set in place, then persists it through SaveToFile.
AddModule
ParticleModule* AddModule(Scope<ParticleModule> module)RemoveModuleAt
void RemoveModuleAt(size_t index)ClearModules
void ClearModules()CloneModulesTo
void CloneModulesTo(std::vector<Scope<ParticleModule>>& target) constClone modules for emitter component
ApplyTo
void ApplyTo(ParticleEmitterComponent& emitter) constPush every authored field onto an emitter. The asset is the authoring surface, so what a designer sets in the particle editor is what plays; fields the asset does not cover (seed, sub-UV, soft fade, cull distance) stay component-authored.
ToEmitterConfig
void ToEmitterConfig(struct FVfxEmitterConfig& config) constFlatten the asset into the neutral emitter config the VFX graph compiler also targets. This is the bridge that lets a property-authored emitter be represented as a graph (config -> FVfxGraphCompiler::BuildGraph).
SetName
void SetName(const std::string& name)SetDuration
void SetDuration(float duration)SetLoop
void SetLoop(bool loop)SetPlayOnAwake
void SetPlayOnAwake(bool play)SetEmissionRate
void SetEmissionRate(float rate)SetMaxParticles
void SetMaxParticles(uint32_t max)SetBurstCount
void SetBurstCount(int count)SetLifetime
void SetLifetime(float min, float max)SetStartVelocity
void SetStartVelocity(const Vec3& vel)SetStartSpeed
void SetStartSpeed(float min, float max)SetStartSize
void SetStartSize(const Vec2& min, const Vec2& max)SetStartColor
void SetStartColor(const Vec4& color)SetBillboardMode
void SetBillboardMode(BillboardMode mode)SetBlendMode
void SetBlendMode(ParticleBlendMode mode)SetDepthTest
void SetDepthTest(bool test)SetTextureID
void SetTextureID(UUID id)SetSimulationMode
void SetSimulationMode(ParticleSimulationMode mode)SetVelocityStretch
void SetVelocityStretch(float stretch)SetStretchMax
void SetStretchMax(float max)SetRenderMode
void SetRenderMode(ParticleRenderMode mode)SetMeshPath
void SetMeshPath(const std::string& path)SetMeshType
void SetMeshType(const std::string& type)SetShadingMode
void SetShadingMode(ParticleShadingMode mode)