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 );
*/
void SetAspectRatio( float aspectRatio );
- /**
- * @copydoc Dali::Internal::CameraActor::SetStereoBias
- */
- void SetStereoBias(const Vector2& stereoBias);
-
/**
* @copydoc Dali::Internal::CameraActor::SetLeftClippingPlane
*/
void SetFarClippingPlane( float farClippingPlane );
/**
+ * @copydoc Dali::Internal::CameraActor::RotateProjection
+ */
+ void RotateProjection(int rotationAngle);
+
+ /**
* @copydoc Dali::Internal::CameraActor::SetTarget
*/
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.
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-matrix property querying interface.
* @pre The camera is on-stage.
* @return The projection-matrix property querying interface.
*/
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
const Node* mNode; ///< The node this scene graph camera belongs to
public: // PROPERTIES
float mBottomClippingPlane;
float mNearClippingPlane;
float mFarClippingPlane;
- Vector2 mStereoBias;
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.
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
};
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 ) );
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 ) );
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 ) );
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 ) );
new (slot) LocalType( &camera, &Camera::SetAspectRatio, parameter );
}
-inline void SetStereoBiasMessage( EventThreadServices& eventThreadServices, const Camera& camera, const Vector2& parameter )
-{
- typedef MessageValue1< Camera, Vector2 > LocalType;
-
- // Reserve some memory inside the message queue
- 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::SetStereoBias, parameter );
-}
-
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 ) );
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 ) );
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 ) );
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 ) );
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 ) );
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 ) );
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 ) );
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 ) );
new (slot) LocalType( &camera, &Camera::SetInvertYAxis, parameter );
}
+inline void RotateProjectionMessage( EventThreadServices& eventThreadServices, const Camera& camera, int parameter )
+{
+ typedef MessageValue1< Camera, int > LocalType;
+
+ // Reserve some memory inside the message queue
+ 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::RotateProjection, parameter );
+}
+
} // namespace SceneGraph
} // namespace Internal