zoukankan      html  css  js  c++  java
  • [原][粒子特效][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

     

  • 相关阅读:
    (11)模糊图片操作---均值模糊
    (10)绘制形状和文字
    (9)调整图像的亮度和对比度
    (8)图像混合
    (7)opencv图片内部的基本处理
    C#中的线程池使用(二)
    C#中的线程池使用(一)
    C#中线程的委托
    为PyCharm自动配置作者信息
    为PyCharm配置QT
  • 原文地址:https://www.cnblogs.com/lyggqm/p/9957039.html
Copyright © 2011-2022 走看看