Source: raytracer/cameraperspective.h


Annotated List
Files
Globals
Hierarchy
Index
/* *************************************************************************
                          cameraperspective.h  -  description
                             -------------------
    begin                : Wed Oct 16 2002       
    copyright            : (C) 2002 by Micha Riser
    email                : mriser@gmx.net
 ************************************************************************* */

/* *************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ************************************************************************* */

#ifndef CAMERAPERSPECTIVE_H
#define CAMERAPERSPECTIVE_H

#include "pigment3d.h"
#include "vector.h"
#include "colour.h"
#include "insidelist.h"

class Scene;

/**Perspective Camera.
  *@author Micha Riser
  */
class CameraPerspective : public Pigment3D  {

public: // Constructors and destructor

    /**Constructs a perspective camera with default parameters.
      */
    CameraPerspective(Scene* s): location(0,0,0), direction(0,0,1), right(4.0/3,0,0),
      up(0,1,0), scene(s), insides(0) {};

    /**Constructs a camera for given parameters.
      */
    CameraPerspective(Scene* s, const Vector3& loc, const Vector3& dir,
      const Vector3& r, const Vector3& u): location(loc), direction(dir), right(r),
      up(u), scene(s), insides(0) {};

    ~CameraPerspective() {delete(insides);};

private:
    CameraPerspective& operator=(const CameraPerspective&);

public: // Public methods

    // Inherited from Pigment3D
    Colour5 evaluateAt(const Vector3& p) const;
    Pigment3D* copy() const {return new CameraPerspective(*this);}
    
private: // Private attributes
    Vector3 location;
    Vector3 direction;
    Vector3 right;
    Vector3 up;

    /**Pointer to the scene attached to the camera.
      */
    Scene* scene;

    /**Lists the object which the camera's origin is inside.
      */
    mutable InsideList* insides;
        
private:
    // Copy constructor
    CameraPerspective(const CameraPerspective& c): Pigment3D(c), location(c.location), direction(c.direction),
      right(c.right), up(c.up), scene(c.scene), insides(0) {};  

};

#endif

Generated by: micha@laptop on Thu Oct 24 20:25:24 2002, using kdoc 2.0a53.