#ifndef SCENE_H #define SCENE_H #include "Object3D.h" class Light { public: Light(); Light(real redIntensity, real greenIntensity, real blueIntensity); Light(Vector3DW position, real redIntensity, real greenIntensity, real blueIntensity); Vector3DW getPosition(); void setPosition(Vector3DW position); real getRedIntensity(); real getGreenIntensity(); real getBlueIntensity(); void setRedIntensity(real redIntensity); void setGreenIntensity(real greenIntensity); void setBlueIntensity(real blueIntensity); void setIntensity(real redIntensity, real greenIntensity, real blueIntensity); protected: Vector3DW position_; real redIntensity_; real greenIntensity_; real blueIntensity_; }; class Scene { public: Scene(Color backColor, Light ambientLight); Color getBackColor(); void setBackColor(Color backColor); Light getAmbientLight(); void setAmbientLight(Light ambientLight); void clear(); void addObject(Object3D* obj); void addLight(Light* light); Color rayTrace(Vector3DW rOrigin, Vector3DW rDirection, bool& hitObject, int maxReflections); void drawOpenGL(); protected: vector objects_; vector lights_; Color backColor_; Light ambientLight_; }; class Camera { public: Camera(Scene* scene, Vector3DW eye, Vector3DW at, Vector3DW up, real fovy, real nearp, real farp); Vector3DW getEye(); Vector3DW getAt(); Vector3DW getUp(); void setEye(Vector3DW eye); void setAt(Vector3DW at); void setUp(Vector3DW up); void rayTrace(unsigned char* data, int width, int height); void zBuffer(unsigned char* data, int width, int height); protected: Scene* scene_; Vector3DW eye_; Vector3DW at_; Vector3DW up_; real fovy_; real nearp_; real farp_; }; class StereoscopicCamera { public: StereoscopicCamera(Scene* scene, Vector3DW midEye, real distEyes, Vector3DW at, Vector3DW up, real fovy, real nearp, real farp); ~StereoscopicCamera(); Vector3DW getMidEye(); real getDistEyes(); Vector3DW getAt(); Vector3DW getUp(); void setMidEye(Vector3DW eye); void setDistEyes(real distEyes); void setAt(Vector3DW at); void setUp(Vector3DW up); void setColorFactors(real redFactor, real greenFactor, real blueFactor); void rayTrace(unsigned char* data, int width, int height); protected: Scene* scene_; Vector3DW midEye_; real distEyes_; Vector3DW at_; Vector3DW up_; real fovy_; real nearp_; real farp_; real redFactor_; real greenFactor_; real blueFactor_; Camera* leftCamera_; Camera* rightCamera_; private: void deleteCameras(); void setCameras(); }; #endif