User Tools

Site Tools


en:tutorials:cameras:fixing_camera_to_object

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:tutorials:cameras:fixing_camera_to_object [2018/02/13 20:46 (7 years ago)] – ↷ Page moved from tutorials:cameras:fixing_camera_to_object to en:tutorials:cameras:fixing_camera_to_object iarwainen:tutorials:cameras:fixing_camera_to_object [2022/12/06 13:39 (2 years ago)] (current) iarwain
Line 1: Line 1:
-====== Fixing the Camera to an Object ======+====== Fixing the Camera to an Object manually using a Clock ======
 If you wish the camera to be fixed on a moving object, you will need to use code to update it regularly. The camera's x and y coordinates are copied from the object, but not the z coordinate. If you wish the camera to be fixed on a moving object, you will need to use code to update it regularly. The camera's x and y coordinates are copied from the object, but not the z coordinate.
  
Line 24: Line 24:
 ... ...
  
-  orxClock_Register(orxClock_FindFirst(orx2F(-1.0f), orxCLOCK_TYPE_CORE), Update, orxNULL, orxMODULE_ID_MAIN, orxCLOCK_PRIORITY_NORMAL);+  orxClock_Register(orxClock_Get(orxCLOCK_KZ_CORE), Update, orxNULL, orxMODULE_ID_MAIN, orxCLOCK_PRIORITY_LOWER);
 ... ...
 </code> </code>
  
 +Please note the use of ''orxCLOCK_PRIORITY_LOWER'' instead of ''orxCLOCK_PRIORITY_NORMAL''. This mode ensures the camera is updated **//after//** all the objects which will ensure a rock solid lock.
 +
 +A more simple method is to [[en:tutorials:cameras:fixing_camera_to_object_by_parenting|parent a camera to an object]].
en/tutorials/cameras/fixing_camera_to_object.1518583574.txt.gz · Last modified: 2018/02/14 00:46 (7 years ago) (external edit)