STATE_engine_set_max_num_of_points_per_polygon

 

 


   Who needs this function ?
   -----------------------------
   This function is not very important. 99% of all users will never have to use it.
   Users who import code from other engines might need this function.
   This function is also useful if your code is built to support only triangles.
   Using this function one can limit the engine to use only triangles.

   What does it do ?
   -------------------
   Limits the number of points that are permitted per polygon.
   This function can be called at any time, before or after loading the world.
   This function will split polygons that have more points than what is permitted into smaller polygons.
   The engine is smart enough to isolate the internally created polygon fractions from
   the software API. For example if we limit the number of permitted points per polygon to 3
   in this case polygons with 10 points will be split to 8 triangles.
   When we use functions such as STATE_polygon_set_bitmap_fill() on one of the
   newly created fractions (triangles) the engine will be smart enough to set the given
   bitmap to all the fractions as if it is still one polygon.
  
   Remarks:
   -----------
   
   IMPORTANT:	Please note that polygons that have more than the permitted number of points will
  				deleted ! This means that one should consider all polygon handles as not legal
  				after calling this function.
  				Example:
  				DWORD floor_handle=STATE_polygon_get_handle_using_name("floor");
  				STATE_engine_set_max_num_of_points_per_polygon(4);
  				   If the polygon "floor" had more than 4 point, it was deleted. In this case we cannot use its handle any more
  				  Repeat the call to be sure that we get a valid handle
  				DWORD floor_handle=STATE_polygon_get_handle_using_name("floor");
  				  We now have a valid fraction of the floor (or the whole floor if it was not deleted)
  				API functions that are executed on the floor fraction will be carried out on all the fractions
  				that make the floor.
  
  
   Example:
  	STATE_engine_set_max_num_of_points_per_polygon(3);
  
   See also STATE_engine_get_max_num_of_points_per_polygon()

 

 

Go to page 1      Select API

 

Copyright © 2007 3DSTATE Corporation. www.3dstate.com