瀏覽代碼

Changed some methods in Camera to be const qualified.

Darryl Gough 13 年之前
父節點
當前提交
4ae7fa3a9c
共有 2 個文件被更改,包括 6 次插入6 次删除
  1. 3 3
      gameplay/src/Camera.cpp
  2. 3 3
      gameplay/src/Camera.h

+ 3 - 3
gameplay/src/Camera.cpp

@@ -243,7 +243,7 @@ const Frustum& Camera::getFrustum() const
     return _bounds;
     return _bounds;
 }
 }
 
 
-void Camera::project(const Rectangle& viewport, const Vector3& position, float* x, float* y, float* depth)
+void Camera::project(const Rectangle& viewport, const Vector3& position, float* x, float* y, float* depth) const
 {
 {
     GP_ASSERT(x);
     GP_ASSERT(x);
     GP_ASSERT(y);
     GP_ASSERT(y);
@@ -267,7 +267,7 @@ void Camera::project(const Rectangle& viewport, const Vector3& position, float*
     }
     }
 }
 }
 
 
-void Camera::unproject(const Rectangle& viewport, float x, float y, float depth, Vector3* dst)
+void Camera::unproject(const Rectangle& viewport, float x, float y, float depth, Vector3* dst) const
 {
 {
     GP_ASSERT(dst);
     GP_ASSERT(dst);
     
     
@@ -294,7 +294,7 @@ void Camera::unproject(const Rectangle& viewport, float x, float y, float depth,
     dst->set(screen.x, screen.y, screen.z);
     dst->set(screen.x, screen.y, screen.z);
 }
 }
 
 
-void Camera::pickRay(const Rectangle& viewport, float x, float y, Ray* dst)
+void Camera::pickRay(const Rectangle& viewport, float x, float y, Ray* dst) const
 {
 {
     GP_ASSERT(dst);
     GP_ASSERT(dst);
 
 

+ 3 - 3
gameplay/src/Camera.h

@@ -203,7 +203,7 @@ public:
      * @param y The returned viewport y coordinate.
      * @param y The returned viewport y coordinate.
      * @param depth The returned pixel depth (can be NULL).
      * @param depth The returned pixel depth (can be NULL).
      */
      */
-    void project(const Rectangle& viewport, const Vector3& position, float* x, float* y, float* depth = NULL);
+    void project(const Rectangle& viewport, const Vector3& position, float* x, float* y, float* depth = NULL) const;
 
 
     /**
     /**
      * Converts a viewport-space coordinate to a world-space position for the given depth value.
      * Converts a viewport-space coordinate to a world-space position for the given depth value.
@@ -217,7 +217,7 @@ public:
      * @param depth The depth range.
      * @param depth The depth range.
      * @param dst The world space position.
      * @param dst The world space position.
      */
      */
-    void unproject(const Rectangle& viewport, float x, float y, float depth, Vector3* dst);
+    void unproject(const Rectangle& viewport, float x, float y, float depth, Vector3* dst) const;
 
 
     /**
     /**
      * Picks a ray that can be used for picking given the specified viewport-space coordinates.
      * Picks a ray that can be used for picking given the specified viewport-space coordinates.
@@ -227,7 +227,7 @@ public:
      * @param y The viewport y-coordinate.
      * @param y The viewport y-coordinate.
      * @param dst The computed pick ray.
      * @param dst The computed pick ray.
      */
      */
-    void pickRay(const Rectangle& viewport, float x, float y, Ray* dst);
+    void pickRay(const Rectangle& viewport, float x, float y, Ray* dst) const;
 
 
 private:
 private: