Camera.pkg 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. $#include "Graphics/Camera.h"
  2. enum FillMode {};
  3. enum ViewOverride
  4. {
  5. VO_NONE,
  6. VO_LOW_MATERIAL_QUALITY,
  7. VO_DISABLE_SHADOWS,
  8. VO_DISABLE_OCCLUSION,
  9. };
  10. class Camera : public Component
  11. {
  12. void SetNearClip(float nearClip);
  13. void SetFarClip(float farClip);
  14. void SetFov(float fov);
  15. void SetOrthoSize(float orthoSize);
  16. void SetOrthoSize(const Vector2& orthoSize);
  17. void SetAspectRatio(float aspectRatio);
  18. void SetFillMode(FillMode mode);
  19. void SetZoom(float zoom);
  20. void SetLodBias(float bias);
  21. void SetViewMask(unsigned mask);
  22. void SetViewOverrideFlags(ViewOverride flags);
  23. void SetOrthographic(bool enable);
  24. void SetAutoAspectRatio(bool enable);
  25. void SetProjectionOffset(const Vector2& offset);
  26. void SetUseReflection(bool enable);
  27. void SetReflectionPlane(const Plane& reflectionPlane);
  28. void SetUseClipping(bool enable);
  29. void SetClipPlane(const Plane& clipPlane);
  30. void SetProjection(const Matrix4& projection);
  31. float GetFarClip() const;
  32. float GetNearClip() const;
  33. float GetFov() const;
  34. float GetOrthoSize() const;
  35. float GetAspectRatio() const;
  36. float GetZoom() const;
  37. float GetLodBias() const;
  38. unsigned GetViewMask() const;
  39. ViewOverride GetViewOverrideFlags() const;
  40. FillMode GetFillMode() const;
  41. bool IsOrthographic() const;
  42. bool GetAutoAspectRatio() const;
  43. const Frustum& GetFrustum() const;
  44. Matrix4 GetProjection() const;
  45. Matrix4 GetGPUProjection() const;
  46. const Matrix3x4& GetView() const;
  47. void GetFrustumSize(Vector3& near, Vector3& far) const;
  48. float GetHalfViewSize() const;
  49. Frustum GetSplitFrustum(float nearClip, float farClip) const;
  50. Frustum GetViewSpaceFrustum() const;
  51. Frustum GetViewSpaceSplitFrustum(float nearClip, float farClip) const;
  52. Ray GetScreenRay(float x, float y) const;
  53. Vector2 WorldToScreenPoint(const Vector3& worldPos) const;
  54. Vector3 ScreenToWorldPoint(const Vector3& screenPos) const;
  55. const Vector2& GetProjectionOffset() const;
  56. bool GetUseReflection() const;
  57. const Plane& GetReflectionPlane() const;
  58. bool GetUseClipping() const;
  59. const Plane& GetClipPlane() const;
  60. float GetDistance(const Vector3& worldPos) const;
  61. float GetDistanceSquared(const Vector3& worldPos) const;
  62. float GetLodDistance(float distance, float scale, float bias) const;
  63. bool IsProjectionValid() const;
  64. Matrix3x4 GetEffectiveWorldTransform() const;
  65. tolua_property__get_set float farClip;
  66. tolua_property__get_set float nearClip;
  67. tolua_property__get_set float fov;
  68. tolua_property__get_set float orthoSize;
  69. tolua_property__get_set float aspectRatio;
  70. tolua_property__get_set float zoom;
  71. tolua_property__get_set float lodBias;
  72. tolua_property__get_set unsigned viewMask;
  73. tolua_property__get_set ViewOverride viewOverrideFlags;
  74. tolua_property__get_set FillMode fillMode;
  75. tolua_property__is_set bool orthographic;
  76. tolua_property__get_set bool autoAspectRatio;
  77. tolua_readonly tolua_property__get_set Frustum& frustum;
  78. tolua_readonly tolua_property__get_set Matrix4 projection;
  79. tolua_readonly tolua_property__get_set Matrix4 GPUProjection;
  80. tolua_readonly tolua_property__get_set Matrix3x4& view;
  81. tolua_readonly tolua_property__get_set float halfViewSize;
  82. tolua_readonly tolua_property__get_set Frustum viewSpaceFrustum;
  83. tolua_property__get_set Vector2& projectionOffset;
  84. tolua_property__get_set bool useReflection;
  85. tolua_property__get_set Plane& reflectionPlane;
  86. tolua_property__get_set bool useClipping;
  87. tolua_property__get_set Plane& clipPlane;
  88. tolua_readonly tolua_property__is_set bool projectionValid;
  89. tolua_readonly tolua_property__get_set Matrix3x4 effectiveWorldTransform;
  90. };