OSG粒子系统

ParticleSystem : 是一个drawable,有很多属性可以设置。A particle system can only use one texture。
ModularEmitter: ModularEmitter->Emitter->ParticleProcessor->node :每帧都会产生新的粒子,最好使用 "conter"、"placer"、"shotter" achieve a wide variety of emitting styles
conter :tell the ModularEmitter how many particles it has to create for the current frame。然后会指示placer and shooter去设置粒子的位置和velocity vector。
Particle: 通過設置不同屬性来给粒子系统设置不同的粒子模板,可以给一个发射器设置不同的模板。
Program (ModularProgram) : create a Program. It is a particle processor just like the Emitter
class, but it allows to modify particle properties after they have been created. 创建多个Operator对象,然后将这些Operator对象加入到ModularProgram中。
Particle
counter
placer
shooter
program
emitter->setParticleTemplate(Particle)
emitter->setCounter(counter);
emitter->setParticleSystem(ps);
emitter->setPlacer(placer);
emitter->setShooter(shooter);
program->setParticleSystem(ps)
root->addchild(ps)
root->addchild(program)
root->addchild(emitter)
posted on 2023-09-13 15:18 Ultraman_X 阅读(95) 评论(0) 收藏 举报
浙公网安备 33010602011771号