观察Cascade粒子系统中的基本概念

5 篇文章 14 订阅

目标

参考《粒子系统的关键概念 | Unreal Engine Documentation》以及UE4源代码,尽可能对Cascade粒子系统中的以下概念有更深的了解:

  • 粒子系统(ParticleSystem)
  • 粒子发射器(ParticleEmitter)
  • 粒子系统模块(ParticleModule)
  • 发射器Actor

1. 粒子系统(ParticleSystem)

“粒子系统” 是一种资源,可以直接在内容浏览器中被创建:
在这里插入图片描述
双击这个资源可以进入Cascade粒子编辑器。

源代码中的定义和注释如下:

/**
 * A ParticleSystem is a complete particle effect that contains any number of ParticleEmitters. By allowing multiple emitters
 * in a system, the designer can create elaborate particle effects that are held in a single system. Once created using
 * Cascade, a ParticleSystem can then be inserted into a level or created in script.
 */
class UParticleSystem : public UFXSystemAsset

一个 “粒子系统” 完整表达了一个粒子特效,包含了任意数目的 “粒子发射器” ,设计师可以用它组合出复杂而精妙的效果并“装进”一个独立的系统中,随后可以放到关卡中或是由脚本创建。

UParticleSystem这个类的继承关系如下:

UObject
UFXSystemAsset
UParticleSystem
UNiagaraSystem

2. 粒子发射器(ParticleEmitter)

在这里插入图片描述
一个 “粒子发射器” 发射了一种特定类型的粒子,在一个 “粒子系统” 中可以添加任意数目的 “粒子发射器”

UParticleEmitter直接继承自UObject

class UParticleEmitter : public UObject

UParticleSystem 有发射器列表:

/** Emitters	- internal - the array of emitters in the system				*/
UPROPERTY(instanced)
TArray<UParticleEmitter*> Emitters;

3. 粒子模块(ParticleModule)

在这里插入图片描述
一个 “粒子模块” 定义了粒子的一种行为,被放到了 “粒子发射器” 中。

直接继承自UObject

class ENGINE_API UParticleModule : public UObject

它有多个具体的种类:

UParticleModule
UParticleModuleVelocityBase
UParticleModuleVectorFieldBase
UParticleModuleTypeDataBase
UParticleModuleTrailBase
UParticleModuleSubUVBase
UParticleModuleSpawnBase
UParticleModuleSizeBase
UParticleModuleRotationRateBase
UParticleModuleRotationBase
UParticleModuleRequired
UObject
UParticleModuleParameterBase
UParticleModuleOrientationBase
UParticleModuleOrbitBase
UParticleModuleMaterialBase
UParticleModuleLocationBase
UParticleModuleLightBase
UParticleModuleLifetimeBase
UParticleModuleKillBase
UParticleModuleEventBase
UParticleModuleColorBase
UParticleModuleCollisionBase
UParticleModuleCameraBase
UParticleModuleBeamBase
UParticleModuleAttractorBase
UParticleModuleAccelerationBase
UParticleModuleAccelerationOverLifetime
UParticleModuleAccelerationDragScaleOverLife
UParticleModuleAccelerationDrag
UParticleModuleAccelerationConstant
UParticleModuleAcceleration
UParticleModuleAttractorPointGravity
UParticleModuleAttractorPoint
UParticleModuleAttractorParticle
UParticleModuleAttractorLine
UParticleModuleBeamTarget
UParticleModuleBeamSource
UParticleModuleBeamNoise
UParticleModuleBeamModifier
UParticleModuleCameraOffset
UParticleModuleCollisionGPU
UParticleModuleCollision
UParticleModuleColorScaleOverLife
UParticleModuleColorOverLife
UParticleModuleColor
UParticleModuleColor_Seeded
UParticleModuleEventReceiverBase
UParticleModuleEventGenerator
UParticleModuleEventReceiverSpawn
UParticleModuleEventReceiverKillParticles
UParticleModuleKillHeight
UParticleModuleKillBox
UParticleModuleLifetime
UParticleModuleLifetime_Seeded
UParticleModuleLight
UParticleModuleLight_Seeded
UParticleModulePivotOffset
UParticleModuleSourceMovement
UParticleModuleLocationSkelVertSurface
UParticleModuleLocationPrimitiveTriangle
UParticleModuleLocationPrimitiveBase
UParticleModuleLocationEmitterDirect
UParticleModuleLocationEmitter
UParticleModuleLocationDirect
UParticleModuleLocationBoneSocket
UParticleModuleLocation
UParticleModuleLocation_Seeded
UParticleModuleLocationWorldOffset
UParticleModuleLocationWorldOffset_Seeded
UParticleModuleLocationPrimitiveSphere
UParticleModuleLocationPrimitiveCylinder
UParticleModuleLocationPrimitiveCylinder_Seeded
UParticleModuleLocationPrimitiveSphere_Seeded
UParticleModuleMeshMaterial
UParticleModuleOrbit
UParticleModuleOrientationAxisLock
UParticleModuleParameterDynamic
UParticleModuleParameterDynamic_Seeded
UParticleModuleRotationOverLifetime
UParticleModuleRotation
UParticleModuleMeshRotation
UParticleModuleMeshRotation_Seeded
UParticleModuleRotation_Seeded
UParticleModuleRotationRateMultiplyLife
UParticleModuleRotationRate
UParticleModuleMeshRotationRateOverLife
UParticleModuleMeshRotationRateMultiplyLife
UParticleModuleMeshRotationRate
UParticleModuleMeshRotationRate_Seeded
UParticleModuleRotationRate_Seeded
UParticleModuleSizeScaleBySpeed
UParticleModuleSizeScale
UParticleModuleSizeMultiplyLife
UParticleModuleSize
UParticleModuleSize_Seeded
UParticleModuleSpawnPerUnit
UParticleModuleSpawn
UParticleModuleSubUV
UParticleModuleSubUVMovie
UParticleModuleTrailSource
UParticleModuleTypeDataRibbon
UParticleModuleTypeDataMesh
UParticleModuleTypeDataGpu
UParticleModuleTypeDataBeam2
UParticleModuleTypeDataAnimTrail
UParticleModuleVectorFieldScaleOverLife
UParticleModuleVectorFieldScale
UParticleModuleVectorFieldRotationRate
UParticleModuleVectorFieldRotation
UParticleModuleVectorFieldLocal
UParticleModuleVectorFieldGlobal
UParticleModuleVelocityOverLifetime
UParticleModuleVelocityInheritParent
UParticleModuleVelocityCone
UParticleModuleVelocity
UParticleModuleVelocity_Seeded

《粒子系统参考 | Unreal Engine Documentation》中有详细的介绍。

4. 发射器Actor

“粒子系统” 从内容浏览器拖到关卡里,便可以创建一个 “发射器Actor”
在这里插入图片描述
AEmitter直接继承自AActor

class ENGINE_API AEmitter : public AActor

它拥有一个UParticleSystemComponent成员

class UParticleSystemComponent* ParticleSystemComponent;

UParticleSystemComponent联系了一个 “粒子系统” 作为“模板”:

class UParticleSystem* Template;

总结

总结他们的关系如下

使用1个作为模板
实例到关卡中
拥有多个_
被多个不同种类的_所定义
发射器Actor
粒子系统
粒子发射器
粒子模块
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值