Updated demos to use DALi clang-format
[platform/core/uifw/dali-demo.git] / examples / fpp-game / game-camera.h
index f1d6306..fd908a3 100644 (file)
@@ -2,7 +2,7 @@
 #define GAME_CAMERA_H
 
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
@@ -30,7 +30,7 @@
  * Additionally it handles simple user input by attaching fullscreen
  * sized 'interceptor' Actor to the front of the CameraActor ( to be always
  * parallel to the view ). It is necessary, as with changing camera orientation
- * the the stage cannot be used as a touch signal receiver ( it will simply
+ * the the window cannot be used as a touch signal receiver ( it will simply
  * go offscreen with camera rotation ).
  *
  * DALi camera uses left-handed coordinate system.
@@ -41,7 +41,6 @@
 class GameCamera : public Dali::ConnectionTracker
 {
 public:
-
   /**
    * Creates an instance of GameCamera
    */
@@ -54,20 +53,15 @@ public:
 
   /**
    * Initialise with given fovY, near, far
+   * @param[in] defaultCamera The default camera used by the scene
    * @param[in] fovY Field of view in degrees
    * @param[in] near Near plane
    * @param[in] far Far Plane
+   * @param[in] sceneSize The size of the scene this is looking at
    */
-  void Initialise( float fov, float near, float far );
-
-  /**
-   * Retrieves actor associated with camera object
-   * @return Returns camera actor
-   */
-  Dali::CameraActor GetCameraActor();
+  void Initialise(Dali::CameraActor defaultCamera, float fov, float near, float far, const Dali::Vector2& sceneSize);
 
 private:
-
   /**
    * Sets up a perspective camera using Dali default camera
    */
@@ -85,7 +79,7 @@ private:
    * @param[in] actor Actor receiving signal
    * @param[in] touch Touch data
    */
-  bool OnTouch( Dali::Actor actor, const Dali::TouchData& touch );
+  bool OnTouch(Dali::Actor actor, const Dali::TouchEvent& touch);
 
   /**
    * Handles camera tick() update
@@ -94,14 +88,13 @@ private:
   bool OnTick();
 
 private:
-
-  Dali::CameraActor mCameraActor; /// Camera actor
-  Dali::Actor mInterceptorActor; /// Actor intercepting user input
+  Dali::CameraActor mCameraActor;      /// Camera actor
+  Dali::Actor       mInterceptorActor; /// Actor intercepting user input
 
   Dali::Timer mTimer; /// Per-frame timer
 
-  Dali::Vector2 mScreenLookDelta; /// Look delta vector in screen space
-  Dali::Vector2 mScreenWalkDelta; /// Walk delta vector in screen space
+  Dali::Vector2 mScreenLookDelta;      /// Look delta vector in screen space
+  Dali::Vector2 mScreenWalkDelta;      /// Walk delta vector in screen space
   Dali::Vector2 mOldTouchLookPosition; /// Previous look vector in screen space
   Dali::Vector2 mOldTouchWalkPosition; /// Previuus walk vector in screen space
 
@@ -109,14 +102,15 @@ private:
 
   float mFovY; /// Camera field-of-view
   float mNear; /// Near plane
-  float mFar; /// Far plane
+  float mFar;  /// Far plane
 
   int mWalkingTouchId; /// Touch device id bound to the walking action
   int mLookingTouchId; /// Touch device id bound to the looking action
 
   Dali::Vector3 mCameraPosition; /// Current camera position ( shadowing the actor position )
+  Dali::Vector2 mSceneSize;      /// The size of the scene we are looking at
 
-  bool mPortraitMode; /// flag if window is in portrait mode ( physically stage width < height )
+  bool mPortraitMode; /// flag if window is in portrait mode ( physically window width < height )
 };
 
 #endif