[Tizen] Make some camera actor animatable & constraint input
[platform/core/uifw/dali-core.git] / dali / internal / update / render-tasks / scene-graph-camera.h
index f75f81b..2cc8912 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_SCENE_GRAPH_CAMERA_H
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  */
 
 // INTERNAL INCLUDES
-#include <dali/public-api/math/rect.h>
-#include <dali/public-api/actors/camera-actor.h>
+#include <dali/devel-api/actors/camera-actor-devel.h>
 #include <dali/internal/common/message.h>
+#include <dali/internal/common/type-abstraction-enums.h>
 #include <dali/internal/event/common/event-thread-services.h>
+#include <dali/internal/update/common/animatable-property.h>
 #include <dali/internal/update/common/double-buffered.h>
 #include <dali/internal/update/common/inherited-property.h>
+#include <dali/internal/update/nodes/node.h>
+#include <dali/public-api/actors/camera-actor.h>
+#include <dali/public-api/math/rect.h>
 
 namespace Dali
 {
-
 namespace Internal
 {
-
 // value types used by messages
-template <> struct ParameterType< Dali::Camera::Type >
-: public BasicType< Dali::Camera::Type > {};
-template <> struct ParameterType< Dali::Camera::ProjectionMode >
-: public BasicType< Dali::Camera::ProjectionMode > {};
+template<>
+struct ParameterType<Dali::Camera::Type>
+: public BasicType<Dali::Camera::Type>
+{
+};
+template<>
+struct ParameterType<Dali::Camera::ProjectionMode>
+: public BasicType<Dali::Camera::ProjectionMode>
+{
+};
 
 namespace SceneGraph
 {
-
-class Node;
 class SceneController;
 
+template<>
+class AnimatableProperty<Dali::Camera::ProjectionMode> : public AnimatableProperty<int>
+{
+public:
+  AnimatableProperty(Dali::Camera::ProjectionMode initialValue)
+  : AnimatableProperty<int>(static_cast<int>(initialValue))
+  {
+  }
+};
+template<>
+class AnimatableProperty<Dali::DevelCameraActor::ProjectionDirection> : public AnimatableProperty<int>
+{
+public:
+  AnimatableProperty(Dali::DevelCameraActor::ProjectionDirection initialValue)
+  : AnimatableProperty<int>(static_cast<int>(initialValue))
+  {
+  }
+};
+
 /**
  * Scene-graph camera object
  */
-class Camera
+class Camera : public Node
 {
 public:
-  static const Dali::Camera::Type DEFAULT_TYPE;
-  static const Dali::Camera::ProjectionMode DEFAULT_MODE;
-  static const bool  DEFAULT_INVERT_Y_AXIS;
-  static const float DEFAULT_FIELD_OF_VIEW;
-  static const float DEFAULT_ASPECT_RATIO;
-  static const float DEFAULT_LEFT_CLIPPING_PLANE;
-  static const float DEFAULT_RIGHT_CLIPPING_PLANE;
-  static const float DEFAULT_TOP_CLIPPING_PLANE;
-  static const float DEFAULT_BOTTOM_CLIPPING_PLANE;
-  static const float DEFAULT_NEAR_CLIPPING_PLANE;
-  static const float DEFAULT_FAR_CLIPPING_PLANE;
-  static const Vector2 DEFAULT_STEREO_BIAS;
-  static const Vector3 DEFAULT_TARGET_POSITION;
+  static const Dali::Camera::Type                          DEFAULT_TYPE;
+  static const Dali::Camera::ProjectionMode                DEFAULT_MODE;
+  static const Dali::DevelCameraActor::ProjectionDirection DEFAULT_PROJECTION_DIRECTION;
+  static const bool                                        DEFAULT_INVERT_Y_AXIS;
+  static const float                                       DEFAULT_FIELD_OF_VIEW;
+  static const float                                       DEFAULT_ORTHOGRAPHIC_SIZE;
+  static const float                                       DEFAULT_ASPECT_RATIO;
+  static const float                                       DEFAULT_LEFT_CLIPPING_PLANE;
+  static const float                                       DEFAULT_RIGHT_CLIPPING_PLANE;
+  static const float                                       DEFAULT_TOP_CLIPPING_PLANE;
+  static const float                                       DEFAULT_BOTTOM_CLIPPING_PLANE;
+  static const float                                       DEFAULT_NEAR_CLIPPING_PLANE;
+  static const float                                       DEFAULT_FAR_CLIPPING_PLANE;
+  static const Vector2                                     DEFAULT_STEREO_BIAS;
+  static const Vector3                                     DEFAULT_TARGET_POSITION;
 
   /**
    * Plane equation container for a plane of the view frustum
@@ -70,7 +97,7 @@ public:
   struct Plane
   {
     Vector3 mNormal;
-    float mDistance;
+    float   mDistance;
   };
 
   /**
@@ -78,8 +105,8 @@ public:
    */
   struct FrustumPlanes
   {
-    Plane mPlanes[ 6 ];
-    Vector3 mSign[ 6 ];
+    Plane   mPlanes[6];
+    Vector3 mSign[6];
   };
 
   /**
@@ -89,87 +116,165 @@ public:
   static Camera* New();
 
   /**
-   * Destructor
+   * Virtual destructor
    */
-  ~Camera();
+  ~Camera() override;
 
   /**
-   * Set the node this scene graph camera belongs to.
-   * @param[in] node The owning node.
+   * Overriden delete operator
+   * Deletes the camera from its global memory pool
    */
-  void SetNode( const Node* node );
-
-  /**
-   * Get the node this scene graph camera belongs to.
-   * @return node The owning node.
-   */
-  const Node* GetNode() const;
+  void operator delete(void* ptr);
 
   /**
    * @copydoc Dali::Internal::CameraActor::SetType
    */
-  void SetType( Dali::Camera::Type type );
+  void SetType(Dali::Camera::Type type);
 
   /**
    * @copydoc Dali::Internal::CameraActor::SetInvertYAxis
    */
-  void SetInvertYAxis( bool invertYAxis );
+  void SetInvertYAxis(bool invertYAxis);
 
   /**
-   * @copydoc Dali::Internal::CameraActor::SetProjectionMode
+   * Returns whether the Y axis is inverted.
+   * @return True if the Y axis is inverted, false otherwise.
    */
-  void SetProjectionMode( Dali::Camera::ProjectionMode projectionMode );
+  bool IsYAxisInverted() const
+  {
+    return mInvertYAxis[0];
+  }
 
   /**
-   * @copydoc Dali::Internal::CameraActor::SetFieldOfView
+   * @copydoc Dali::Internal::CameraActor::SetProjectionMode
    */
-  void SetFieldOfView( float fieldOfView );
+  void SetProjectionMode(Dali::Camera::ProjectionMode projectionMode);
 
   /**
-   * @copydoc Dali::Internal::CameraActor::SetAspectRatio
+   * @copydoc Dali::Internal::CameraActor::SetProjectionDirection
    */
-  void SetAspectRatio( float aspectRatio );
+  void SetProjectionDirection(Dali::DevelCameraActor::ProjectionDirection direction);
 
-   /**
+  /**
    * @copydoc Dali::Internal::CameraActor::SetLeftClippingPlane
    */
-  void SetLeftClippingPlane( float leftClippingPlane );
+  void SetLeftClippingPlane(float leftClippingPlane);
 
   /**
    * @copydoc Dali::Internal::CameraActor::SetRightClippingPlane
    */
-  void SetRightClippingPlane( float rightClippingPlane );
+  void SetRightClippingPlane(float rightClippingPlane);
 
   /**
    * @copydoc Dali::Internal::CameraActor::SetTopClippingPlane
    */
-  void SetTopClippingPlane( float topClippingPlane );
+  void SetTopClippingPlane(float topClippingPlane);
 
   /**
    * @copydoc Dali::Internal::CameraActor::SetBottomClippingPlane
    */
-  void SetBottomClippingPlane( float bottomClippingPlane );
+  void SetBottomClippingPlane(float bottomClippingPlane);
 
   /**
-   * @copydoc Dali::Internal::CameraActor::SetNearClippingPlane
+   * @copydoc Dali::Internal::CameraActor::RotateProjection
    */
-  void SetNearClippingPlane( float nearClippingPlane );
+  void RotateProjection(int rotationAngle);
 
   /**
-   * @copydoc Dali::Internal::CameraActor::SetFarClippingPlane
+   * @copydoc Dali::Internal::CameraActor::SetTarget
    */
-  void SetFarClippingPlane( float farClippingPlane );
+  void SetTargetPosition(const Vector3& targetPosition);
 
   /**
-   * @copydoc Dali::Internal::CameraActor::SetTarget
+   * @brief Bakes the field of view.
+   * @param[in] updateBufferIndex The current update buffer index.
+   * @param[in] fieldOfView The field of view.
+   */
+  void BakeFieldOfView(BufferIndex updateBufferIndex, float fieldOfView);
+
+  /**
+   * @brief Retrieve the field of view.
+   * @param[in] bufferIndex The buffer to read from.
+   * @return The field of view.
+   */
+  float GetFieldOfView(BufferIndex bufferIndex) const
+  {
+    return mFieldOfView[bufferIndex];
+  }
+
+  /**
+   * @brief Bakes the orthographic size.
+   * @param[in] updateBufferIndex The current update buffer index.
+   * @param[in] orthographicSize The orthographic size.
+   */
+  void BakeOrthographicSize(BufferIndex updateBufferIndex, float orthographicSize);
+
+  /**
+   * @brief Retrieve the orthographic size.
+   * @param[in] bufferIndex The buffer to read from.
+   * @return The orthographic size.
+   */
+  float GetOrthographicSize(BufferIndex bufferIndex) const
+  {
+    return mOrthographicSize[bufferIndex];
+  }
+
+  /**
+   * @brief Bakes the aspect ratio.
+   * @param[in] updateBufferIndex The current update buffer index.
+   * @param[in] aspectRatio The aspect ratio.
    */
-  void SetTargetPosition( const Vector3& targetPosition );
+  void BakeAspectRatio(BufferIndex updateBufferIndex, float aspectRatio);
+
+  /**
+   * @brief Retrieve the aspect ratio.
+   * @param[in] bufferIndex The buffer to read from.
+   * @return The aspect ratio.
+   */
+  float GetAspectRatio(BufferIndex bufferIndex) const
+  {
+    return mAspectRatio[bufferIndex];
+  }
+
+  /**
+   * @brief Bakes the near clipping plane distance.
+   * @param[in] updateBufferIndex The current update buffer index.
+   * @param[in] nearClippingPlane The near clipping plane distance.
+   */
+  void BakeNearClippingPlane(BufferIndex updateBufferIndex, float nearClippingPlane);
+
+  /**
+   * @brief Retrieve the near clipping plane distance.
+   * @param[in] bufferIndex The buffer to read from.
+   * @return The near clipping plane distance.
+   */
+  float GetNearClippingPlane(BufferIndex bufferIndex) const
+  {
+    return mNearClippingPlane[bufferIndex];
+  }
+
+  /**
+   * @brief Bakes the far clipping plane distance.
+   * @param[in] updateBufferIndex The current update buffer index.
+   * @param[in] farClippingPlane The far clipping plane distance.
+   */
+  void BakeFarClippingPlane(BufferIndex updateBufferIndex, float farClippingPlane);
+
+  /**
+   * @brief Retrieve the far clipping plane distance.
+   * @param[in] bufferIndex The buffer to read from.
+   * @return The far clipping plane distance.
+   */
+  float GetFarClippingPlane(BufferIndex bufferIndex) const
+  {
+    return mFarClippingPlane[bufferIndex];
+  }
 
   /**
    * Sets the reflection plane
    * @param[in] plane reflection plane
    */
-  void SetReflectByPlane( const Vector4& plane );
+  void SetReflectByPlane(const Vector4& plane);
 
   /**
    * Tests whether reflection is used
@@ -185,7 +290,7 @@ public:
    * @param[in] bufferIndex The buffer to read from.
    * @return The view-matrix.
    */
-  const Matrix& GetViewMatrix( BufferIndex bufferIndex ) const;
+  const Matrix& GetViewMatrix(BufferIndex bufferIndex) const;
 
   /**
    * @brief Check to see if a sphere lies within the view frustum.
@@ -196,7 +301,7 @@ public:
    *
    * @return false if the sphere lies outside of the frustum.
    */
-  bool CheckSphereInFrustum( BufferIndex bufferIndex, const Vector3& origin, float radius );
+  bool CheckSphereInFrustum(BufferIndex bufferIndex, const Vector3& origin, float radius) const;
 
   /**
    * @brief Check to see if a bounding box lies within the view frustum.
@@ -207,21 +312,68 @@ public:
    *
    * @return false if the cubeoid lies completely outside of the frustum, true otherwise
    */
-  bool CheckAABBInFrustum( BufferIndex bufferIndex, const Vector3& origin, const Vector3& halfExtents );
+  bool CheckAABBInFrustum(BufferIndex bufferIndex, const Vector3& origin, const Vector3& halfExtents) const;
+
+  /**
+   * @brief Calculate orthographic clipping box by this camera's orthographic size.
+   */
+  Dali::Rect<int32_t> GetOrthographicClippingBox(BufferIndex bufferIndex) const;
 
   /**
    * Retrieve the projection-matrix; this is double buffered for input handling.
    * @param[in] bufferIndex The buffer to read from.
    * @return The projection-matrix.
    */
-  const Matrix& GetProjectionMatrix( BufferIndex bufferIndex ) const;
+  const Matrix& GetProjectionMatrix(BufferIndex bufferIndex) const;
 
   /**
    * Retrieve the inverted view-projection-matrix; this is double buffered for input handling.
    * @param[in] bufferIndex The buffer to read from.
    * @return The inverse view-projection-matrix.
    */
-  const Matrix& GetInverseViewProjectionMatrix( BufferIndex bufferIndex ) const;
+  const Matrix& GetInverseViewProjectionMatrix(BufferIndex bufferIndex) const;
+
+  /**
+   * Retrieve the final projection-matrix; this is double buffered for input handling.
+   * @param[in] bufferIndex The buffer to read from.
+   * @return The projection-matrix that should be used to render.
+   */
+  const Matrix& GetFinalProjectionMatrix(BufferIndex bufferIndex) const;
+
+  /**
+   * Retrieve the projection mode property querying interface.
+   * @pre The camera is on-stage.
+   * @return The projection mode property querying interface.
+   */
+  const PropertyBase* GetProjectionMode() const;
+
+  /**
+   * Retrieve the field of view property querying interface.
+   * @pre The camera is on-stage.
+   * @return The field of view property querying interface.
+   */
+  const PropertyBase* GetFieldOfView() const;
+
+  /**
+   * Retrieve the aspect ratio property querying interface.
+   * @pre The camera is on-stage.
+   * @return The aspect ratio property querying interface.
+   */
+  const PropertyBase* GetAspectRatio() const;
+
+  /**
+   * Retrieve the near clipping plane distance property querying interface.
+   * @pre The camera is on-stage.
+   * @return The near clipping plane distance property querying interface.
+   */
+  const PropertyBase* GetNearPlaneDistance() const;
+
+  /**
+   * Retrieve the far clipping plane distance property querying interface.
+   * @pre The camera is on-stage.
+   * @return The far clipping plane distance property querying interface.
+   */
+  const PropertyBase* GetFarPlaneDistance() const;
 
   /**
    * Retrieve the projection-matrix property querying interface.
@@ -238,226 +390,242 @@ public:
   const PropertyInputImpl* GetViewMatrix() const;
 
   /**
+   * Retrieve the value of InvertYAxis property querying interface.
+   * @pre The camera is on-stage.
+   * @return The InvertYAxis property value querying interface.
+   */
+  const PropertyBase* GetInvertYAxis() const;
+
+  /**
+   * Retrieve the orthographic size property querying interface.
+   * @pre The camera is on-stage.
+   * @return The orthographic size property querying interface.
+   */
+  const PropertyBase* GetOrthographicSize() const;
+
+  /**
+   * Retrieve the value of Projection Direction property querying interface.
+   * @pre The camera is on-stage.
+   * @return The Projection Direction property value querying interface.
+   */
+  const PropertyBase* GetProjectionDirection() const;
+
+  /**
    * Updates view and projection matrices.
    * Called by the render task using the camera
    * @param[in] updateBufferIndex The buffer to read from.
    */
-  void Update( BufferIndex updateBufferIndex );
+  void Update(BufferIndex updateBufferIndex);
 
   /**
    * @return true if the view matrix of camera is updated this or the previous frame
    */
-  bool ViewMatrixUpdated();
+  bool ViewMatrixUpdated() const;
 
-private:
+  /**
+   * @return true if the projection matrix projection matrix relative properties are animated this or the previous frame
+   */
+  bool IsProjectionMatrixAnimated() const;
 
+private:
   /**
    * Constructor
    */
   Camera();
 
-  // Non copyable
-  // Undefined
-  Camera(const Camera&);
-  // Undefined
-  Camera& operator=(const Camera& rhs);
+  // Delete copy and move
+  Camera(const Camera&) = delete;
+  Camera(Camera&&)      = delete;
+  Camera& operator=(const Camera& rhs) = delete;
+  Camera& operator=(Camera&& rhs) = delete;
 
   /**
    * Recalculates the view matrix.
    * @param[in] bufferIndex The current update buffer index.
    * @return count how many frames ago the matrix was changed.
    */
-  uint32_t UpdateViewMatrix( BufferIndex updateBufferIndex );
+  uint32_t UpdateViewMatrix(BufferIndex updateBufferIndex);
 
   /**
    * Recalculates the projection matrix.
    * @param[in] bufferIndex The current update buffer index.
    * @return count how many frames ago the matrix was changed.
    */
-  uint32_t UpdateProjection( BufferIndex updateBufferIndex );
+  uint32_t UpdateProjection(BufferIndex updateBufferIndex);
 
 private:
-
   /**
    * @brief Extracts the frustum planes.
    *
    * @param[in] bufferIndex The current update buffer index.
    * @param[in] normalize will normalize plane equation coefficients by default.
    */
-  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 );
+  void UpdateFrustum(BufferIndex updateBufferIndex, bool normalize = true);
 
-  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
-  const Node*                   mNode;                 ///< The node this scene graph camera belongs to
+  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
 
-public:  // PROPERTIES
-  Dali::Camera::Type            mType;                 // Non-animatable
-  Dali::Camera::ProjectionMode  mProjectionMode;       // Non-animatable
-  bool                          mInvertYAxis;          // Non-animatable
+public:                           // PROPERTIES
+  Dali::Camera::Type                                              mType;                // Non-animatable
+  AnimatableProperty<Dali::Camera::ProjectionMode>                mProjectionMode;      // Non-animatable, constraint_input
+  AnimatableProperty<Dali::DevelCameraActor::ProjectionDirection> mProjectionDirection; // Non-animatable, constraint_input
+  AnimatableProperty<bool>                                        mInvertYAxis;         // Non-animatable, constraint_input
 
-  float                         mFieldOfView;
-  float                         mAspectRatio;
-  float                         mLeftClippingPlane;
-  float                         mRightClippingPlane;
-  float                         mTopClippingPlane;
-  float                         mBottomClippingPlane;
-  float                         mNearClippingPlane;
-  float                         mFarClippingPlane;
-  Vector3                       mTargetPosition;
+  AnimatableProperty<float> mFieldOfView;                                               // Animatable
+  AnimatableProperty<float> mOrthographicSize;                                          // Animatable
+  AnimatableProperty<float> mAspectRatio;                                               // Animatable
+  AnimatableProperty<float> mNearClippingPlane;                                         // Animatable
+  AnimatableProperty<float> mFarClippingPlane;                                          // Animatable
 
-  Dali::Matrix                  mReflectionMtx;
-  Dali::Vector4                 mReflectionPlane;
-  Dali::Vector4                 mReflectionEye;
-  bool                          mUseReflection{ false };
-  bool                          mUseReflectionClip{ false };
+  Vector3 mTargetPosition;
 
-  InheritedMatrix mViewMatrix;           ///< The viewMatrix; this is double buffered for input handling.
-  InheritedMatrix mProjectionMatrix;     ///< The projectionMatrix; this is double buffered for input handling.
+  Dali::Matrix  mReflectionMtx;
+  Dali::Vector4 mReflectionPlane;
+  Dali::Vector4 mReflectionEye;
+  bool          mUseReflection{false};
+  bool          mUseReflectionClip{false};
 
-  DoubleBuffered< FrustumPlanes > mFrustum;               ///< Clipping frustum; double buffered for input handling
-  DoubleBuffered< Matrix >        mInverseViewProjection; ///< Inverted viewprojection; double buffered for input handling
+  InheritedMatrix mViewMatrix;       ///< The viewMatrix; this is double buffered for input handling.
+  InheritedMatrix mProjectionMatrix; ///< The projectionMatrix; this is double buffered for input handling.
 
+  DoubleBuffered<FrustumPlanes> mFrustum;               ///< Clipping frustum; double buffered for input handling
+  DoubleBuffered<Matrix>        mInverseViewProjection; ///< Inverted viewprojection; double buffered for input handling
+  DoubleBuffered<Matrix>        mFinalProjection;       ///< Final projection matrix; double buffered for input handling
 };
 
 // Messages for Camera
 
-inline void SetTypeMessage( EventThreadServices& eventThreadServices, const Camera& camera, Dali::Camera::Type parameter )
+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 ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType));
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
-  new (slot) LocalType( &camera, &Camera::SetType, parameter );
+  new(slot) LocalType(&camera, &Camera::SetType, parameter);
 }
 
-inline void SetProjectionModeMessage( EventThreadServices& eventThreadServices, const Camera& camera, Dali::Camera::ProjectionMode parameter )
+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 ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalProjectionMode));
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
-  new (slot) LocalProjectionMode( &camera, &Camera::SetProjectionMode, parameter );
+  new(slot) LocalProjectionMode(&camera, &Camera::SetProjectionMode, parameter);
 }
 
-inline void SetFieldOfViewMessage( EventThreadServices& eventThreadServices, const Camera& camera, float parameter )
+inline void SetProjectionDirectionMessage(EventThreadServices& eventThreadServices, const Camera& camera, Dali::DevelCameraActor::ProjectionDirection parameter)
 {
-  typedef MessageValue1< Camera, float > LocalType;
+  using LocalProjectionDirection = MessageValue1<Camera, Dali::DevelCameraActor::ProjectionDirection>;
 
   // Reserve some memory inside the message queue
-  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalProjectionDirection));
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
-  new (slot) LocalType( &camera, &Camera::SetFieldOfView, parameter );
+  new(slot) LocalProjectionDirection(&camera, &Camera::SetProjectionDirection, parameter);
 }
 
-inline void SetAspectRatioMessage( EventThreadServices& eventThreadServices, const Camera& camera, float parameter )
+inline void BakeFieldOfViewMessage(EventThreadServices& eventThreadServices, const Camera& camera, float parameter)
 {
-  typedef MessageValue1< Camera, float > LocalType;
+  using LocalType = MessageDoubleBuffered1<Camera, float>;
 
   // Reserve some memory inside the message queue
-  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType));
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
-  new (slot) LocalType( &camera, &Camera::SetAspectRatio, parameter );
+  new(slot) LocalType(&camera, &Camera::BakeFieldOfView, parameter);
 }
 
-inline void SetLeftClippingPlaneMessage( EventThreadServices& eventThreadServices, const Camera& camera, float parameter )
+inline void BakeOrthographicSizeMessage(EventThreadServices& eventThreadServices, const Camera& camera, float parameter)
 {
-  typedef MessageValue1< Camera, float > LocalType;
+  using LocalType = MessageDoubleBuffered1<Camera, float>;
 
   // Reserve some memory inside the message queue
-  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType));
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
-  new (slot) LocalType( &camera, &Camera::SetLeftClippingPlane, parameter );
+  new(slot) LocalType(&camera, &Camera::BakeOrthographicSize, parameter);
 }
 
-inline void SetRightClippingPlaneMessage( EventThreadServices& eventThreadServices, const Camera& camera, float parameter )
+inline void BakeAspectRatioMessage(EventThreadServices& eventThreadServices, const Camera& camera, float parameter)
 {
-  typedef MessageValue1< Camera, float > LocalType;
+  using LocalType = MessageDoubleBuffered1<Camera, float>;
 
   // Reserve some memory inside the message queue
-  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType));
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
-  new (slot) LocalType( &camera, &Camera::SetRightClippingPlane, parameter );
+  new(slot) LocalType(&camera, &Camera::BakeAspectRatio, parameter);
 }
 
-inline void SetTopClippingPlaneMessage( EventThreadServices& eventThreadServices, const Camera& camera, float parameter )
+inline void BakeNearClippingPlaneMessage(EventThreadServices& eventThreadServices, const Camera& camera, float parameter)
 {
-  typedef MessageValue1< Camera, float > LocalType;
+  using LocalType = MessageDoubleBuffered1<Camera, float>;
 
   // Reserve some memory inside the message queue
-  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType));
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
-  new (slot) LocalType( &camera, &Camera::SetTopClippingPlane, parameter );
+  new(slot) LocalType(&camera, &Camera::BakeNearClippingPlane, parameter);
 }
 
-inline void SetBottomClippingPlaneMessage( EventThreadServices& eventThreadServices, const Camera& camera, float parameter )
+inline void BakeFarClippingPlaneMessage(EventThreadServices& eventThreadServices, const Camera& camera, float parameter)
 {
-  typedef MessageValue1< Camera, float > LocalType;
+  using LocalType = MessageDoubleBuffered1<Camera, float>;
 
   // Reserve some memory inside the message queue
-  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType));
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
-  new (slot) LocalType( &camera, &Camera::SetBottomClippingPlane, parameter );
+  new(slot) LocalType(&camera, &Camera::BakeFarClippingPlane, parameter);
 }
 
-inline void SetNearClippingPlaneMessage( EventThreadServices& eventThreadServices, const Camera& camera, float parameter )
+inline void SetReflectByPlaneMessage(EventThreadServices& eventThreadServices, const Camera& camera, const Vector4& plane)
 {
-  typedef MessageValue1< Camera, float > LocalType;
+  using LocalType = MessageValue1<Camera, Vector4>;
 
   // Reserve some memory inside the message queue
-  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType));
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
-  new (slot) LocalType( &camera, &Camera::SetNearClippingPlane, parameter );
+  new(slot) LocalType(&camera, &Camera::SetReflectByPlane, plane);
 }
 
-inline void SetFarClippingPlaneMessage( EventThreadServices& eventThreadServices, const Camera& camera, float parameter )
+inline void SetTargetPositionMessage(EventThreadServices& eventThreadServices, const Camera& camera, const Vector3& parameter)
 {
-  typedef MessageValue1< Camera, float > LocalType;
+  using LocalType = MessageValue1<Camera, Vector3>;
 
   // Reserve some memory inside the message queue
-  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType));
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
-  new (slot) LocalType( &camera, &Camera::SetFarClippingPlane, parameter );
+  new(slot) LocalType(&camera, &Camera::SetTargetPosition, parameter);
 }
 
-inline void SetTargetPositionMessage( EventThreadServices& eventThreadServices, const Camera& camera, const Vector3& parameter )
+inline void SetInvertYAxisMessage(EventThreadServices& eventThreadServices, const Camera& camera, bool parameter)
 {
-  typedef MessageValue1< Camera, Vector3 > LocalType;
+  using LocalType = MessageValue1<Camera, bool>;
 
   // Reserve some memory inside the message queue
-  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType));
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
-  new (slot) LocalType( &camera, &Camera::SetTargetPosition, parameter );
+  new(slot) LocalType(&camera, &Camera::SetInvertYAxis, parameter);
 }
 
-inline void SetInvertYAxisMessage( EventThreadServices& eventThreadServices, const Camera& camera, bool parameter )
+inline void RotateProjectionMessage(EventThreadServices& eventThreadServices, const Camera& camera, int parameter)
 {
-  typedef MessageValue1< Camera, bool > LocalType;
+  typedef MessageValue1<Camera, int> LocalType;
 
   // Reserve some memory inside the message queue
-  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  unsigned int* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType));
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
-  new (slot) LocalType( &camera, &Camera::SetInvertYAxis, parameter );
+  new(slot) LocalType(&camera, &Camera::RotateProjection, parameter);
 }
 
 } // namespace SceneGraph