STATE_camera_get_height_above_ground

 

 


   Calculates the camera height above ground.
  
   Return value:
  		Returns the polygon below the camera. Returns NULL if there is nothing below.
  
   Parameters:
  		[IN] camera_handle: 
  				the camera handle
  
  		[IN] camera_size:
  				The function calculates an imagenary square around the camera.
  				The function calculates the height above ground of each corner of this square and
  				the height of the camera itself.
  				The function returned value is the minimum height above ground from the five measurments (4 corners and the camera location itself).
  				If camera_size==0, the function will only calculate and return the height of the camera point.
  				See the remarks section for "why do we need this parameter"
  
  		[OUT] height:
  				Through this parameter the function returns the calculated height above the ground
  			
   Remarks:
  		- What's the use of the camera_size parameter ?
  		  Imagine your player (the camera) is moving on a roof of a building
  		  When he passes the edge of the roof you detect it and start dropping the camera down
  		  This methos is not good because this way your player can get too close to the building walls.
  		  When using this function you will be able to detect when all of the player body is in
  		  the air and only then to start dropping the player down.
  
  		2) In many times the function STATE_engine_ignore_dynamic_objects_for_collision_detection(YES);
  		   will be called before dropping down the camera. This will make the camera fall through dynamic objects
  
   Example:
  		double height;
  		DWORD polygon=STATE_camera_get_height_above_ground(my_camera, 50, &height);
   

 

 

Go to page 1      Select API

 

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