Delete all particles from a polygonal area within the physics simulation.



参数 描述
pointList A ds_list of points to use to create the polygon.

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


With this function you can delete (remove) all the particles that fall within the bounds of the defined polygonal area from the physics simulation in the current room. The function takes a (previously created) ds_list() containing the x/y position of each point of the polygon, with the even numbered positions in the list being the x coordinates, and odd numbered positions the y coordinates, ie: for a triangle, your list would have six entries, with entry 0, 2, and 4 being the x coordinates and 1, 3, and 5 being the y coordinates. The polygon will then be used to delete all the particles that fall within the defined area.

Note that the polygon defined must have at least three points, and at most 8.


var list = ds_list_create(p_list);
for (var i = 0; i < 5; i ++;)
   ds_list_add(p_list, mx[i]);
   ds_list_add(p_list, my[i]);

The above code will delete all particles found in the polygonal area defined by the points added to the ds_list.

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