1 | /*
|
---|
2 | * ----------------------------------------------------------------------
|
---|
3 | * Camera.h : Camera class
|
---|
4 | *
|
---|
5 | * ======================================================================
|
---|
6 | * AUTHOR: Wei Qiao <qiaow@purdue.edu>
|
---|
7 | * Purdue Rendering and Perceptualization Lab (PURPL)
|
---|
8 | *
|
---|
9 | * Copyright (c) 2004-2006 Purdue Research Foundation
|
---|
10 | *
|
---|
11 | * See the file "license.terms" for information on usage and
|
---|
12 | * redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
---|
13 | * ======================================================================
|
---|
14 | */
|
---|
15 |
|
---|
16 | #ifndef _CAMERA_H_
|
---|
17 | #define _CAMERA_H_
|
---|
18 |
|
---|
19 |
|
---|
20 | #include <GL/glu.h>
|
---|
21 | #include "Vector3.h"
|
---|
22 |
|
---|
23 | class Camera{
|
---|
24 |
|
---|
25 | public:
|
---|
26 | Vector3 location; //Location of the camera in the scene
|
---|
27 | Vector3 target; //Location the camera is looking at.
|
---|
28 | //location and target: two points define the line-of-sight
|
---|
29 | Vector3 angle; //rotation angles of camera along x, y, z
|
---|
30 | int width; //screen size
|
---|
31 | int height; //screen size
|
---|
32 |
|
---|
33 | ~Camera();
|
---|
34 | Camera(int w, int h,
|
---|
35 | double loc_x, double loc_y, double loc_z,
|
---|
36 | double target_x, double target_y, double target_z,
|
---|
37 | int angle_x, int angle_y, int angle_z);
|
---|
38 | void move(double loc_x, double loc_y, double loc_z); //move location of camera
|
---|
39 | void aim(double target_x, double target_y, double target_z); //change target point
|
---|
40 | void rotate(double angle_x, double angle_y, double angle_z); //change target point
|
---|
41 | void activate();//make the camera setting active, this has to be called before drawing things.
|
---|
42 | };
|
---|
43 |
|
---|
44 | #endif
|
---|