【学习笔记】cocos2d-x 粒子对象

来源:互联网 发布:淘宝大促活动有哪些 编辑:程序博客网 时间:2024/06/04 19:59
粒子对象的定义和结构(在文件include/CCParticleSystem.h里面):
typedef struct sCCParticle
{
CCPoint pos;//位置
CCPoint startPos;//起始位置
ccColor4F color;//颜色
ccColor4F deltaColor;//颜色变化

float size;//大小
float deltaSize;//大小变化

float rotation;//旋转角度
float delRotation;//旋转角度变化

ccTime timeTolive;//存在时间

struct{
CCPoint dir;//运动方向
float radialAccel;//径向加速度。逃离发射远点的速度
float tangentialAccel;//切向加速度。围绕发射原点旋转速度
}modeA;

struct {
float angle;//角度
float degreesPerSecond;//每秒的角度变化
float radius;//半径
float deltaRadius;//半径变化
}modeB;
}tCCParticle;//粒子对象