1$#include "Graphics/Camera.h"
2
3enum FillMode {};
4
5static const unsigned VO_NONE;
6static const unsigned VO_LOW_MATERIAL_QUALITY;
7static const unsigned VO_DISABLE_SHADOWS;
8static const unsigned VO_DISABLE_OCCLUSION;
9
10class 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(unsigned 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
32    float GetFarClip() const;
33    float GetNearClip() const;
34    float GetFov() const;
35    float GetOrthoSize() const;
36    float GetAspectRatio() const;
37    float GetZoom() const;
38    float GetLodBias() const;
39    unsigned GetViewMask() const;
40    unsigned GetViewOverrideFlags() const;
41    FillMode GetFillMode() const;
42    bool IsOrthographic() const;
43    bool GetAutoAspectRatio() const;
44    const Frustum& GetFrustum() const;
45    Matrix4 GetProjection() const;
46    Matrix4 GetGPUProjection() const;
47    const Matrix3x4& GetView() const;
48    void GetFrustumSize(Vector3& near, Vector3& far) const;
49    float GetHalfViewSize() const;
50    Frustum GetSplitFrustum(float nearClip, float farClip) const;
51    Frustum GetViewSpaceFrustum() const;
52    Frustum GetViewSpaceSplitFrustum(float nearClip, float farClip) const;
53    Ray GetScreenRay(float x, float y) const;
54    Vector2 WorldToScreenPoint(const Vector3& worldPos) const;
55    Vector3 ScreenToWorldPoint(const Vector3& screenPos) const;
56    const Vector2& GetProjectionOffset() const;
57    bool GetUseReflection() const;
58    const Plane& GetReflectionPlane() const;
59    bool GetUseClipping() const;
60    const Plane& GetClipPlane() const;
61
62    float GetDistance(const Vector3& worldPos) const;
63    float GetDistanceSquared(const Vector3& worldPos) const;
64    float GetLodDistance(float distance, float scale, float bias) const;
65    bool IsProjectionValid() const;
66    Matrix3x4 GetEffectiveWorldTransform() const;
67
68    tolua_property__get_set float farClip;
69    tolua_property__get_set float nearClip;
70    tolua_property__get_set float fov;
71    tolua_property__get_set float orthoSize;
72    tolua_property__get_set float aspectRatio;
73    tolua_property__get_set float zoom;
74    tolua_property__get_set float lodBias;
75    tolua_property__get_set unsigned viewMask;
76    tolua_property__get_set unsigned viewOverrideFlags;
77    tolua_property__get_set FillMode fillMode;
78    tolua_property__is_set bool orthographic;
79    tolua_property__get_set bool autoAspectRatio;
80    tolua_readonly tolua_property__get_set Frustum& frustum;
81    tolua_readonly tolua_property__get_set Matrix4 projection;
82    tolua_readonly tolua_property__get_set Matrix4 GPUProjection;
83    tolua_readonly tolua_property__get_set Matrix3x4& view;
84    tolua_readonly tolua_property__get_set float halfViewSize;
85    tolua_readonly tolua_property__get_set Frustum viewSpaceFrustum;
86    tolua_property__get_set Vector2& projectionOffset;
87    tolua_property__get_set bool useReflection;
88    tolua_property__get_set Plane& reflectionPlane;
89    tolua_property__get_set bool useClipping;
90    tolua_property__get_set Plane& clipPlane;
91    tolua_readonly tolua_property__is_set bool projectionValid;
92    tolua_readonly tolua_property__get_set Matrix3x4 effectiveWorldTransform;
93};
94
95