physics_particle_set_group_flags

使用此函数,可以更改一组粒子的组标志。group 值是使用函数 physics_particle_group_end() 创建粒子组时返回的值,而标志是以下常量的组合的返回值:

常量描述
phy_particle_group_flag_solidA solid particle group prevents other fixtures from lodging inside of it. Should anything penetrate it, the solid particle group pushes the offending fixture back out to its surface, making a a solid particle group possess an especially strong repulsive force.
phy_particle_group_flag_rigidRigid particle groups are ones whose shape does not change, even when they collide with other fixtures.

这些组标志使用位掩码来创建最终输出值,然后选中该值以设置组的不同基本属性(粒子标志设置的属性除外)。通过使用 "|" 来屏蔽相应的位(如下例所示),可以不使用任何、一个或两个常量。

 

语法:

physics_particle_set_group_flags(group, flags)

参数类型描述
groupPhysics Particle Group ID要设定的粒子组。
flagsPhysics Particle Group Flag Constant(s)要在粒子组上设置的标志。

 

返回:

N/A

 

例子:

var flags = phy_particle_group_flag_solid | phy_particle_group_flag_rigid;
physics_particle_set_group_flags(group, flags);

上述代码将创建一个变量来存储标志值,然后使用它来设置在变量 "group" 索引的组中创建的所有粒子的标志。