camera.c 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. class Camera extends Entity
  2. {
  3. /**
  4. \brief Returns active Camera instance (note: player's camera is not Camera instance - thus it return null)
  5. \return Camera \p active Camera instance
  6. */
  7. static proto native Camera GetCurrentCamera();
  8. /**
  9. \brief Returns FOV of current camera object
  10. \return float \p FOV of current camera object
  11. */
  12. static proto native float GetCurrentFOV();
  13. /**
  14. \brief Interpolation between camera instances (current camera becomes targetCamera at the end of interpolation)
  15. \param targetCamera \p to which camera we want to interpolate
  16. \param time \p true interpolation time
  17. \param type \p
  18. 0 = without dynamics
  19. 1 = first half - acceleration, second half deceleration
  20. 2 = first third - acceleration, second third - linear movement, last third - deceleration
  21. */
  22. static proto native void InterpolateTo(Camera targetCamera, float time, int type);
  23. /*!
  24. set near plane of camera
  25. \param nearPlane clamped internally to 0.01m
  26. */
  27. proto native void SetNearPlane(float nearPlane);
  28. /*!
  29. get near plane of camera
  30. */
  31. proto native float GetNearPlane();
  32. /**
  33. \brief Sets this camera as active
  34. */
  35. proto native void SetActive(bool active);
  36. /**
  37. \brief Is this camera active?
  38. \return bool \p true if this camera is active
  39. */
  40. proto native bool IsActive();
  41. /**
  42. \brief Field of View settings
  43. \param fov \p FOV angle in radians
  44. */
  45. proto native void SetFOV(float fov);
  46. /**
  47. \brief Depth of Field settings
  48. \param distance \p DOF distance parameter
  49. \param blur \p DOF blur parameter
  50. */
  51. proto native void SetFocus(float distance, float blur);
  52. /**
  53. \brief Orientation change by lookAt point
  54. \param targetPos \p where to look at
  55. */
  56. proto native void LookAt(vector targetPos);
  57. };
  58. //-----------------------------------------------------------------------------
  59. class FreeDebugCamera extends Camera
  60. {
  61. /**
  62. \brief Returns reference to FreeDebugCamera (it's singleton, thus only one instance is present)
  63. \return FreeDebugCamera \p reference to FreeDebugCamera instance
  64. */
  65. static proto native FreeDebugCamera GetInstance();
  66. /**
  67. \brief Sets cameras freeze state
  68. \param freezed \p true = don't allow camera movement
  69. */
  70. proto native void SetFreezed(bool freezed);
  71. /**
  72. \brief Returns if camera is freezed (you can't move it)
  73. \return bool \p true if camera is freezed
  74. */
  75. proto native bool IsFreezed();
  76. /**
  77. \brief Gets object that free camera is currently pointing at
  78. \return Object \p reference to Object that FreeDebugCamera is pointing to
  79. */
  80. proto native Object GetCrosshairObject();
  81. };