[Tizen] Add screen and client rotation itself function
[platform/core/uifw/dali-core.git] / dali / internal / update / render-tasks / scene-graph-camera.h
index 37aead6..f61ddc6 100644 (file)
@@ -100,6 +100,12 @@ public:
   void SetNode( const Node* node );
 
   /**
+   * Get the node this scene graph camera belongs to.
+   * @return node The owning node.
+   */
+  const Node* GetNode() const;
+
+  /**
    * @copydoc Dali::Internal::CameraActor::SetType
    */
   void SetType( Dali::Camera::Type type );
@@ -165,6 +171,21 @@ public:
   void SetTargetPosition( const Vector3& targetPosition );
 
   /**
+   * Sets the reflection plane
+   * @param[in] plane reflection plane
+   */
+  void SetReflectByPlane( const Vector4& plane );
+
+  /**
+   * Tests whether reflection is used
+   * @return True if used, False otherwise
+   */
+  bool GetReflectionUsed() const
+  {
+    return mUseReflection;
+  }
+
+  /**
    * Retrieve the view-matrix; this is double buffered for input handling.
    * @param[in] bufferIndex The buffer to read from.
    * @return The view-matrix.
@@ -277,6 +298,13 @@ private:
    */
   void UpdateFrustum( BufferIndex updateBufferIndex, bool normalize = true );
 
+  /**
+   * Adjust near plane for reflection
+   * @param perspective Perspective matrix
+   * @param clipPlane Clipping plane
+   */
+  void AdjustNearPlaneForPerspective( Matrix& perspective, const Vector4& clipPlane );
+
   uint32_t                  mUpdateViewFlag;       ///< This is non-zero if the view matrix requires an update
   uint32_t                  mUpdateProjectionFlag; ///< This is non-zero if the projection matrix requires an update
   int                       mProjectionRotation;   ///< The rotaion angle of the projection
@@ -297,6 +325,12 @@ public:  // PROPERTIES
   float                         mFarClippingPlane;
   Vector3                       mTargetPosition;
 
+  Dali::Matrix                  mReflectionMtx;
+  Dali::Vector4                 mReflectionPlane;
+  Dali::Vector4                 mReflectionEye;
+  bool                          mUseReflection{ false };
+  bool                          mUseReflectionClip{ false };
+
   InheritedMatrix mViewMatrix;           ///< The viewMatrix; this is double buffered for input handling.
   InheritedMatrix mProjectionMatrix;     ///< The projectionMatrix; this is double buffered for input handling.
 
@@ -310,7 +344,7 @@ public:  // PROPERTIES
 
 inline void SetTypeMessage( EventThreadServices& eventThreadServices, const Camera& camera, Dali::Camera::Type parameter )
 {
-  typedef MessageValue1< Camera, Dali::Camera::Type > LocalType;
+  using LocalType = MessageValue1<Camera, Dali::Camera::Type>;
 
   // Reserve some memory inside the message queue
   uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
@@ -321,7 +355,7 @@ inline void SetTypeMessage( EventThreadServices& eventThreadServices, const Came
 
 inline void SetProjectionModeMessage( EventThreadServices& eventThreadServices, const Camera& camera, Dali::Camera::ProjectionMode parameter )
 {
-  typedef MessageValue1< Camera, Dali::Camera::ProjectionMode > LocalProjectionMode;
+  using LocalProjectionMode = MessageValue1<Camera, Dali::Camera::ProjectionMode>;
 
   // Reserve some memory inside the message queue
   uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalProjectionMode ) );
@@ -332,7 +366,7 @@ inline void SetProjectionModeMessage( EventThreadServices& eventThreadServices,
 
 inline void SetFieldOfViewMessage( EventThreadServices& eventThreadServices, const Camera& camera, float parameter )
 {
-  typedef MessageValue1< Camera, float > LocalType;
+  using LocalType = MessageValue1<Camera, float>;
 
   // Reserve some memory inside the message queue
   uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
@@ -343,7 +377,7 @@ inline void SetFieldOfViewMessage( EventThreadServices& eventThreadServices, con
 
 inline void SetAspectRatioMessage( EventThreadServices& eventThreadServices, const Camera& camera, float parameter )
 {
-  typedef MessageValue1< Camera, float > LocalType;
+  using LocalType = MessageValue1<Camera, float>;
 
   // Reserve some memory inside the message queue
   uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
@@ -354,7 +388,7 @@ inline void SetAspectRatioMessage( EventThreadServices& eventThreadServices, con
 
 inline void SetLeftClippingPlaneMessage( EventThreadServices& eventThreadServices, const Camera& camera, float parameter )
 {
-  typedef MessageValue1< Camera, float > LocalType;
+  using LocalType = MessageValue1<Camera, float>;
 
   // Reserve some memory inside the message queue
   uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
@@ -365,7 +399,7 @@ inline void SetLeftClippingPlaneMessage( EventThreadServices& eventThreadService
 
 inline void SetRightClippingPlaneMessage( EventThreadServices& eventThreadServices, const Camera& camera, float parameter )
 {
-  typedef MessageValue1< Camera, float > LocalType;
+  using LocalType = MessageValue1<Camera, float>;
 
   // Reserve some memory inside the message queue
   uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
@@ -376,7 +410,7 @@ inline void SetRightClippingPlaneMessage( EventThreadServices& eventThreadServic
 
 inline void SetTopClippingPlaneMessage( EventThreadServices& eventThreadServices, const Camera& camera, float parameter )
 {
-  typedef MessageValue1< Camera, float > LocalType;
+  using LocalType = MessageValue1<Camera, float>;
 
   // Reserve some memory inside the message queue
   uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
@@ -387,7 +421,7 @@ inline void SetTopClippingPlaneMessage( EventThreadServices& eventThreadServices
 
 inline void SetBottomClippingPlaneMessage( EventThreadServices& eventThreadServices, const Camera& camera, float parameter )
 {
-  typedef MessageValue1< Camera, float > LocalType;
+  using LocalType = MessageValue1<Camera, float>;
 
   // Reserve some memory inside the message queue
   uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
@@ -398,7 +432,7 @@ inline void SetBottomClippingPlaneMessage( EventThreadServices& eventThreadServi
 
 inline void SetNearClippingPlaneMessage( EventThreadServices& eventThreadServices, const Camera& camera, float parameter )
 {
-  typedef MessageValue1< Camera, float > LocalType;
+  using LocalType = MessageValue1<Camera, float>;
 
   // Reserve some memory inside the message queue
   uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
@@ -409,7 +443,7 @@ inline void SetNearClippingPlaneMessage( EventThreadServices& eventThreadService
 
 inline void SetFarClippingPlaneMessage( EventThreadServices& eventThreadServices, const Camera& camera, float parameter )
 {
-  typedef MessageValue1< Camera, float > LocalType;
+  using LocalType = MessageValue1<Camera, float>;
 
   // Reserve some memory inside the message queue
   uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
@@ -420,7 +454,7 @@ inline void SetFarClippingPlaneMessage( EventThreadServices& eventThreadServices
 
 inline void SetTargetPositionMessage( EventThreadServices& eventThreadServices, const Camera& camera, const Vector3& parameter )
 {
-  typedef MessageValue1< Camera, Vector3 > LocalType;
+  using LocalType = MessageValue1<Camera, Vector3>;
 
   // Reserve some memory inside the message queue
   uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
@@ -431,7 +465,7 @@ inline void SetTargetPositionMessage( EventThreadServices& eventThreadServices,
 
 inline void SetInvertYAxisMessage( EventThreadServices& eventThreadServices, const Camera& camera, bool parameter )
 {
-  typedef MessageValue1< Camera, bool > LocalType;
+  using LocalType = MessageValue1<Camera, bool>;
 
   // Reserve some memory inside the message queue
   uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );