xref: /haiku/src/apps/haiku3d/Camera.h (revision 7749d0bb0c358a3279b1b9cc76d8376e900130a5)
1 /*
2  * Copyright 2009, Haiku Inc. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  * 		Alexandre Deckner <alex@zappotek.com>
7  */
8 #ifndef _CAMERA_H
9 #define _CAMERA_H
10 
11 #include "Vector3.h"
12 #include "Quaternion.h"
13 
14 
15 class Camera {
16 public:
17 					Camera(const Vector3& position,
18 						const Quaternion& orientation, float fov = 50.0f, float near = 1.0f,
19 						float far = 100.0f);
20 	virtual			~Camera();
21 
22 	const Vector3&		Position() const;
23 	const Quaternion&	Orientation() const;
24 	float				FieldOfView() const;
25 	float				Near() const;
26 	float				Far() const;
27 
28 protected:
29 	Vector3			fPosition;
30 	Quaternion		fOrientation;
31 	float			fFieldOfView;
32 	float			fNear;
33 	float			fFar;
34 	bool			fOrtho;
35 };
36 
37 
38 inline const Vector3&
39 Camera::Position() const
40 {
41 	return fPosition;
42 }
43 
44 
45 inline const Quaternion&
46 Camera::Orientation() const
47 {
48 	return fOrientation;
49 }
50 
51 
52 inline float
53 Camera::FieldOfView() const
54 {
55 	return fFieldOfView;
56 }
57 
58 
59 inline float
60 Camera::Near() const
61 {
62 	return fNear;
63 }
64 
65 
66 inline float
67 Camera::Far() const
68 {
69 	return fFar;
70 }
71 
72 #endif /* _CAMERA_H */
73