[原][粒子特效][spark]发射器emitter

深入浅出spark粒子特效连接:https://www.cnblogs.com/lyggqm/p/9956344.html

group添加emitter的方式:

eimtter:

上图是spark源码中发射器emitter的框架

我们开始逐个分析:

1.NormalEmitter

An emitter that emits particles following a Zone normals. 一个向另外一个zone(区域)方向发射粒子的喷射器。

The Zone used to derive the direction of emission can either be the emitter's zone or another zone that can be set with setNormalZone(Zone*).
If the normal zone is NULL the emitter's zone is used.

这里大家看到zone,如果有不理解,我在本文最后有大致介绍,这里就当成一个固定区域就行了

tank是此发射器包含多少粒子,发射完就不再发射,-1是无限多。

flow是每秒发射多少粒子

foreMin和foreMax是发射力度范围,也就是粒子初速度大小

normalZone是发射的方向区域

 总的来说,这个发射器是从一个区域,往另外一个区域发射粒子的喷射器!

一个例子:

我用一个圆柱形区域设置为生成区域,高处一个点为终点,

就形成了一个往指定区域方向移动的圆柱形

2.RandomEmitter

 

An emitter that emits in a random direction 随机方向发射粒子

一个例子:

用一个长方体作为出生位置,没有终点方向,形成了一个无序的长方体

3.SphericEmitter

 

An Emitter that emits particles in a portion of sphere.可调节角度的球形发射器

This Emitter can emit particles in a spheric way. To do that 2 angles and a direction Vector3D can be parametered :

  • The direction Vector3D defines the direction of the emitter.
  • The angles defines the area in between which wil be emitted the particles velocities.

 direction 球的0角度朝向

angleA和angleB 是从角度A到角度B之间都是喷射方向

一个例子:

建了一个喷射角度是0到180的半球形,喷射方向是可调节的球形角度

4.StaticEmitter

 

An Emitter that emits particles with no initial velocity.一个傻瓜喷射器

 一个例子:

没有方向,没有力度,只有喷出多少

5.StaightEmitter

 

 An Emitter that emits in a given direction.一个带方向的喷色器

 一个例子:

就是往一个某一个方向直喷,可以调节喷射力度

 

关于zone:

 这就各种形状的区域。

 

 

 

===============================================================================================================================================

以下为我自己代码设计:

SVRESPARK_EMITTER_STRUCT结构体:

变量名

类型

说明

iID

int

 

strZone

SVRESPARK_ZONE_STRUCT

 

eType

VRESPARK_EMITTER

种类

iFlow

int

流量

iTank

int

包含粒子总数

v3Direction

SVREVector3

方向

fForceMin

double

发射力度最小值

fForceMax

double

发射力度最大值

fParamMin

double

 

fParamMax

double

 

fParam

double

 

bParam

int

 

strNorZone

SVRESPARK_ZONE_STRUCT

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值