STATE_camera_move_with_collision_detection

 

 



  This is an important function. It helps in moving the camera nicely
  so it doesn't go through polygons.
  The function tries to move the camera to the given wanted location.
  If it is impossible because of collision, it tries to move as close as it can
  In every respected game, when the player moves towards a wall, his movement won't be stopped
  when he hits the wall. Instead the player will move smoothly along the wall.
  Using this function one can achieve this effect automatically. 
  
   Parameters:
  
  	DWORD camera, 
  			The camera that we want to move
  
  	double wanted_location[3], 
  			The location in world space coordinates where we want to move the camera
  
  	double camera_physical_width
  			The physical camera is actually a point though in order to 
  			simulate real life the engine apply real dimensions to the camera
  			The size of the camera is calculated as a square with the dimension 
  			camera_physical_width x camera_physical_width
  			The smaller this number is the more we will be able to get nearer to the walls in the world.
  			

  Return value
   Returns YES or NO. YES is returned if the camera was moved. NO is returned
   if the function could not move the camera at all
   

 

 

Go to page 1      Select API

 

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