#include "rtsLinearAlgebra.h" #ifndef _RTSMATH_H #define _RTSMATH_H #define CAMERA_UP -1 #define CAMERA_DOWN 1 #define CAMERA_LEFT -1 #define CAMERA_RIGHT 1 struct rtsCameraState { point3D position; point3D lookat; vector3D up; float pers_view_angle; float ortho_width; float ortho_height; float near_plane; float far_plane; }; class rtsCamera { //members point3D position; vector3D view_vector; vector3D up_vector; point3D lookat_point; float pers_view_angle; float ortho_width; float ortho_height; float near_plane; float far_plane; public: //constructors rtsCamera(); ~rtsCamera(){}; //methods void LookAt(point3D pos, point3D lookat, vector3D up); /* void RotateUpDown(double degrees); void RotateLeftRight(double degrees); void Pan(double x, double y); void Yaw(double degrees); void Pitch(double degrees); void Forward(double distance); void ScaleForward(double factor, double min = 0, double max = 999999); void DollyLeftRight(double distance); void DollyUpDown(double distance); void Zoom(double angle); void LookAt(point3D point); void Position(point3D point); void Up(vector3D up); void DollyPosition(point3D point); //moves the camera but keeps the current orientation */ //get methods rtsCameraState getState(); vector3D getView(){return view_vector;} vector3D getUp(){return up_vector;} point3D getPosition(){return position;} point3D getLookAt(){return lookat_point;} double getViewAngle(){return pers_view_angle;} double getNearPlane(){return near_plane;} double getFarPlane(){return far_plane;} double getOrthoWidth(){return ortho_width;} double getOrthoHeight(){return ortho_height;} }; #endif