Ogre的粒子

13 篇文章 0 订阅
1 篇文章 0 订阅

花了点时间研究了一下Ogre的粒子系统



particle_system tsss
{
//普通属性
	cull_each true	
	emit_emitter_quota 3	
	iteration_interval 0	
	local_space false	
	material DefaultMaterial	
	nonvisible_update_timeout 0	
	particle_height 100	
	particle_width 20	
	quota 10000	
	renderer billboard	
//渲染器的属性
	sorted false	
	accurate_facing false	
	billboard_origin center	
	billboard_rotation_type texcoord	
	billboard_type oriented_common	
	common_direction 0 -1 0	
	common_up_vector 0 1 0	
	point_rendering false	
//发射器
	emitter Box
	{
		angle  0
		colour  1 1 1 1
		colour_range_start  1 1 1 1
		colour_range_end  1 1 1 1
		direction  0 -1 0
		emission_rate  100
		position  0 0 0
		velocity  50
		velocity_min  50
		velocity_max  50
		time_to_live  5
		time_to_live_min  5
		time_to_live_max  5
		duration  0
		duration_min  0
		duration_max  0
		repeat_delay  0
		repeat_delay_min  0
		repeat_delay_max  0
		name  
		emit_emitter  
		width  1000
		height  1000
		depth  0
	}
//Affactor
	affector LinearForce
	{
		force_vector 0 -200 0		
		force_application add		
	}
	
}
脚本里面

渲染器的属性是跟在普通属性后面的

发射器和Affactor分开用大括号写起来

枚举属性的方式都是去获取字典库 然后根据字典库来获取属性的字符串值

举一个Affactor的例子:

void EnumAffectorParameters( Ogre::ParticleAffector* affactor, StringMap& parameters )
{
	using namespace Ogre;

	ParamDictionary* dictionay =  affactor->getParamDictionary();

	if( NULL == dictionay )
		return;

	const ParameterList& list = dictionay->getParameters();

	for ( ParameterList::const_iterator it = list.begin(); it != list.end(); ++it )
	{
		const ParameterDef& def = *it;

		String value = affactor->getParameter( def.name.c_str() );

		parameters[def.name] = value;
	}
}



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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值