Set the gravity scale factor for all particles in a physics simulation.



参数 描述
scale The scaling factor to be applied to gravity for all particles.

返回: N/A(无返回值)


With this function you can set the gravity scale factor for particles in the physics simulation. The function is designed to help prevent instability in the physics simulation, especially when using very small particles which may behave unpredictably (i.e. break conservation of momentum) in scenarios such as explosions. Slowing these particles down by reducing gravity scale can stabilize their behaviour. This function is global in scope, in that it will change the gravity scale not just for new particles created after the change, but also for those already present in the simulation.

NOTE: Adjusting the number of update iterations per step (using the function physics_world_update_iterations can also affect the effect of gravity on particles. Larger iteration sizes confer greater resistance to gravity.



The above code will set the base properties for all particles in the simulation.

上一页: Soft Body Particles
下一页: physics_particle_get_max_count
© Copyright YoYo Games Ltd. 2018 All Rights Reserved