粒子组件 更多...
#include <Particle.h>
Public 成员函数 | |
| Particle () | |
| void | Load (std::string name) |
| 加载粒子资源. | |
| void | SetMaxSpeed (float speed) |
| 设置粒子发射最大初速度. | |
| void | SetMinSpeed (float speed) |
| 设置粒子发射最小初速度. | |
| void | SetSizeRange (float lower, float upper) |
| 设置大小范围(倍率系数) | |
| virtual void | Update (float deltaTime) override |
| virtual void | Render () override |
| 纯虚函数,继承的类都有它来实现渲染,world默认遍历函数实现渲染 | |
| void | SetCapacity (int capacity) |
| 设置粒子容量 | |
| void | SetGravity (int gravity) |
| 设置粒子重力 | |
| void | SetLifetime (int lifetime) |
| 设置单个粒子生命周期 | |
| void | SetIsLoop (bool isloop) |
| 设置粒子是否持续生产 | |
| void | SetInterval (float Interval) |
| void | SetFadingtime (float fadingtime) |
| void | SetPattern (ParticlePattern pattern) |
| void | SetCenter (Vector2D radius, Vector2D scoop) |
| 设置中心放射状参数 | |
| void | SetLine (float length, float angle) |
| 设置线性放射状参数 | |
Public 成员函数 继承自 SceneComponent | |
| void | AttachTo (SceneComponent *par) |
| 设置所属组件 | |
| void | DetachForm (SceneComponent *par) |
| 解除所属组件. | |
| virtual void | Destruct () |
| 解除场景组件绑定并销毁 | |
| virtual void | BeginPlay () override |
| 设置纯虚函数,把不能写在构造却需要优先实现的写在这. | |
| virtual void | EndPlay () override |
| 把一些不能写在析构函数的一些操作写在这里 | |
| Vector2D | GetLocalPosition () const |
| 获取相对坐标 | |
| float | GetLocalRotation () const |
| 获取相对角度 | |
| Vector2D | GetLocalScale () const |
| 获取相对缩放大小 | |
| Vector2D | GetWorldPosition () const |
| 获取场景组件的世界坐标 | |
| float | GetWorldRotation () const |
| 获取场景组件的世界旋转角度 | |
| Vector2D | GetWorldScale () const |
| 获取场景组件的世界的缩放大小 | |
| void | SetLocalPosition (const Vector2D &pos) |
| 设置相对坐标 | |
| void | SetLocalRotation (float rot) |
| 设置相对角度 | |
| void | SetLocalScale (const Vector2D &scale) |
| 设置相对缩放大小 | |
| void | AddPosition (const Vector2D &pos) |
| 加上一个坐标 | |
| void | AddRotation (float rot) |
| 加上一个角度 | |
Public 成员函数 继承自 Component | |
| void | SetOwner (class Object *owner) |
| 设置绑定对象. | |
| virtual void | Activate () |
| 激活组件 | |
| virtual void | Deactivate () |
| 停用组件 | |
| Object * | GetOwner () const |
| 获取绑定对象指针 | |
Public 成员函数 继承自 base | |
| base () | |
| virtual | ~base () |
| std::string | GetName () const |
| void | SetName (const std::string &name) |
Public 成员函数 继承自 LayerInterface | |
| LayerInterface () | |
| 构造图层顺序接口 | |
| ~LayerInterface () | |
| 析构图层顺序接口,从world图层顺序容器中删去这个类 | |
| void | SetLayer (int _layer) |
| 设置图层层级 要实现必须先把排好序的容器中删除已经排好序的对象,重新插入已经改变好的对象 | |
| int | GetLayer () const |
| 获取图层层级 | |
Public 成员函数 继承自 ImageInterface | |
| ~ImageInterface () | |
| 析构函数 释放所有开辟的图像句柄资源 | |
| BYTE | GetTransparency () const |
| 获取透明度 | |
| void | SetTransparency (BYTE transparency) |
| 设置透明度 | |
| bool | IsWave () |
| 是否已经开启了波幅 | |
| void | SetFilter (bool enable, COLORREF col=BLACK, int level=100) |
| 开启设置滤镜 会清空之前所有滤镜 | |
| void | AddFilter (FilterInfo filterInfo) |
| 添加滤镜 | |
| void | AddFilter (bool enable=true, COLORREF col=BLACK, int level=100, int layer=1) |
| 在滤镜上面继续添加滤镜 如果不写层级就会替换第一层 | |
| void | RemoveFilter () |
| 移除层级5滤镜 | |
| void | RemoveFilter (int layer) |
| 移除滤镜 | |
| void | EnableFilter () |
| 开关整体滤镜 | |
| void | EnableFilLayer (int layer) |
| 开关图层滤镜 | |
| void | ExitWave () |
| 关闭波幅 | |
| void | MeanBlur (unsigned level) |
| 均值模糊(建议在Gameplay开始前预处理使用) | |
| void | WaveFrom (int x, int y, int stonesize, int stoneweight) |
| 波纹 | |
| void | LoadSprite (std::string name) |
| 加载静态图像. | |
| void | SetStartAndEndLoc (Pair start, Pair end) |
| 截取非动画资源指定部分. | |
Private 成员函数 | |
| void | produce () |
| 生产器 | |
Private 属性 | |
| std::deque< ParticleInfo > | particle |
| 粒子容器 用于管理生产出来的每一个粒子 | |
| int | capacity = 0 |
| 粒子容量 | |
| float | maxSpeed = 1.f |
| 粒子最大初速度 | |
| float | minSpeed = 1.f |
| 粒子最小初速度 | |
| float | gravity = 9.8f |
| 重力加速度 | |
| float | lifetime = 1.f |
| 单个粒子的生命周期 | |
| bool | isLoop = true |
| 是否循环生产 | |
| float | Interval =0.1f |
| 生产间隔 | |
| float | fadingtime = 0 |
| 粒子逐渐消失的时间 | |
| IMAGE ** | images =nullptr |
| 动画帧数组 | |
| int | number = 0 |
| 动画粒子总帧数 | |
| time_point< steady_clock > | lasttime |
| 记录生产的时间点 | |
| Vector2D | sizeRange |
| 大小范围(倍率系数) | |
| ParticlePattern | pattern = ParticlePattern::Center |
| Vector2D | unitVector = Vector2D(0, 1) |
| 粒子方向单位向量 | |
| Vector2D | radius = Vector2D(0, 0) |
| 内外半径 [内径,外径] | |
| Vector2D | scoop = Vector2D(0, 360) |
| float | length = 1.f |
| 放射范围 [起始范围,结束范围] | |
| float | angle = 0.f |
| 相对于线的角度 | |
额外继承的成员函数 | |
Protected 成员函数 继承自 SceneComponent | |
| void | process_Destruct () |
| 销毁组件 | |
Protected 成员函数 继承自 ImageInterface | |
| void | RotateImage (double radian) |
| 旋转照片 | |
| void | FilterImage () |
| 给图片施加滤镜 滤镜实现 | |
Protected 属性 继承自 SceneComponent | |
| SceneComponent * | parent = nullptr |
| 父指针 | |
Protected 属性 继承自 Component | |
| class Object * | pOwner = nullptr |
| 处理控制逻辑 有对象物体的指针才能进行控制 | |
| bool | bIsEnabled = true |
| 是否激活 | |
Protected 属性 继承自 ImageInterface | |
| IMAGE * | sprite = nullptr |
| 存储指针节省空间 用来指向我们当前需要的从资源库查找到的地址 | |
| struct ImageInterface::SpriteInfo | spriteinfo |
| BYTE | alpha = 255 |
| 设置透明度 | |
| float | angle = 0 |
| 逆时针旋转角度 | |
| IMAGE * | copy = nullptr |
| 旋转图像句柄 | |
| IMAGE * | filter = nullptr |
| 滤镜图像句柄 | |
| bool | bFilterEnable = false |
| 滤镜开关 | |
| std::set< FilterInfo, FilterSort > | FilterLayer |
| 滤镜层级容器 按照指定层级来排序滤镜 | |
| IMAGE * | blur {} |
| 滤波之后的句柄 | |
| IMAGE * | wave {} |
| 波幅句柄 | |
| bool | bIsWave =false |
| 是否开启波幅 | |
粒子组件
|
inline |
| void Particle::Load | ( | std::string | name | ) |
加载粒子资源.
| [in] | name | 动画资源名 |
|
private |
生产器
相当于初始化粒子结构数据
|
overridevirtual |
|
inline |
设置粒子容量
设置中心放射状参数
| [in] | radius | 放射圆环的内外径 |
| [in] | scoop | 放射扇形的角度范围 |
|
inline |
|
inline |
设置粒子重力
|
inline |
|
inline |
设置粒子是否持续生产
|
inline |
设置单个粒子生命周期
|
inline |
设置线性放射状参数
| [in] | length | 放射线段长度 |
| [in] | angle | 线段与水平夹角 根据坐标系方向 |
|
inline |
设置粒子发射最大初速度.
| [in] | speed | 最大速度 |
|
inline |
设置粒子发射最小初速度.
| [in] | speed | 最小速度 |
|
inline |
|
inline |
设置大小范围(倍率系数)
| [in] | lower | 最小倍率 |
| [in] | upper | 最大倍率 |
|
overridevirtual |
重载 SceneComponent .
|
private |
相对于线的角度
|
private |
粒子容量
|
private |
粒子逐渐消失的时间
主要是实现过渡效果
|
private |
重力加速度
|
private |
动画帧数组
|
private |
生产间隔
|
private |
是否循环生产
|
private |
记录生产的时间点
|
private |
放射范围 [起始范围,结束范围]
线长度
|
private |
单个粒子的生命周期
|
private |
粒子最大初速度
|
private |
粒子最小初速度
|
private |
动画粒子总帧数
|
private |
粒子容器 用于管理生产出来的每一个粒子
|
private |
|
private |
大小范围(倍率系数)