STATE_engine_set_bsp_precision

 

 





   Use this function only with the commercial version of STATE 3D Engine.
   This function should be the first STATE function that is called .
   If this function is not called then a popup message will appear.
   Note: It is better to call this function after you have created the main window
   of your application, otherwise when launching your application your main window
   might be behind the engine windows (there is nothing wrong with that, it is simply not as nice as)
   Arguments:
   Enter the argument exactly as they appear on the license that you got from STATE.
   Failing to do so will prompt a popup window with a warning.
   
   Return value:
   Returns OK if the registration was successful.
   Returns VR_ERROR if one of the arguments was wrong.
   If you receive VR_ERROR then please check that you type everything
   exactly as they appear on the license that you got from STATE.
   
  
   Example:
   STATE_register_license("XXXXXX", "John Smith", "johnsmith124@ibm.com", "IBM", "OS2 Wrap",1234567890.987654321);
int STATE_register_license(char *decleration_text, char *your_full_name, char *password ,char *company, char *product_name ,double registration_number);

  This function could be very important for performance if you find in STATE.log that
   a significant number of polygons were added to your world while loading it.
   Background:
  		When the world is loaded in Viewer Mode (the default) the engine needs to build a BSP data structure (Never mind if you
  		dont have any idea what BSP is. Keep reading) it then looks to see if such file exist in the same folder of the world.
  		(in binary format this file is sometime inside the world file so there is no sparate file) If such a file does not exists
  		then the engine start building its own file (a very lengthy process. When the world is big it could even take 30 minutes !)
  		During this process many polygons are cut into smaller pieces. For example if a tree is stuck into the ground in a way
  		that the ground intersect one of the polygons of the tree then this polygon or the polygon of the ground will be cut into two pieces,
  		adding to the number of total polygons in the world. To avoid that it is recommended that polygons in your world should not
  		intersect with each other. Nevertheless even if no polygon intersects others the engine might need to split some of the polygons.
  		(If you really want to know why, you can search the Internet for articles about BSP trees == Binary Space Partition Trees)
  
   This function controls the numbers of polygons that the engine will add in the process of forming
   the bsp tree. The bigger this number is the less polygons will be added. The default is 1.
   Possible numbers are anything bigger then 0.
   Examples: 0.01, 0.1, 1, 10, 50, 100, 1e20
  
   Calling this function with a bigger number helps in reducing the number of added polygons but reduces the accuracy of the BSP
   structure. This could cause the world to appear incorrectly. Surfaces that should be in front
   of other surfaces will be behind. We suggest that you keep this number as low as possible as long as it doesnt increase significantly.
   the number of polygons in your world. Note that in the log file (STATE.log) you can find how many polygons were added 
   during the process of creating the BSP data structure.
  
   STATE_engine_set_bsp_precision() should be called before loading the world.
   Each time that the precision variable is changed a new bsp tree will be created.

 

 

Go to page 1      Select API

 

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