Camera doesn't inherit from Object; defines its own origin.
This commit is contained in:
parent
709453adcb
commit
c564791d1a
3 changed files with 36 additions and 9 deletions
18
src/camera.h
18
src/camera.h
|
@ -11,23 +11,23 @@
|
|||
#define __CAMERA_H__
|
||||
|
||||
#include "basics.h"
|
||||
#include "object.h"
|
||||
|
||||
|
||||
struct Camera
|
||||
: public Object
|
||||
{
|
||||
public:
|
||||
Camera();
|
||||
Camera(const Camera& other);
|
||||
virtual ~Camera();
|
||||
|
||||
const Vector3 &get_direction() const;
|
||||
void set_direction(const Vector3 &d);
|
||||
float get_angle() const;
|
||||
const Vector3& GetOrigin() const;
|
||||
void SetOrigin(const Vector3& origin);
|
||||
|
||||
const Vector3& get_direction() const;
|
||||
void set_direction(const Vector3& direction);
|
||||
|
||||
const Vector3& GetRight() const;
|
||||
void SetRight(const Vector3& right);
|
||||
|
||||
const Vector3& GetUp() const;
|
||||
void SetUp(const Vector3& up);
|
||||
|
||||
|
@ -35,6 +35,12 @@ public:
|
|||
const int y, const int height) const = 0;
|
||||
|
||||
private:
|
||||
/**
|
||||
* The location of the camera in the scene. Depending on the type of camera,
|
||||
* this is the point from which rays will be emitted.
|
||||
*/
|
||||
Vector3 mOrigin;
|
||||
|
||||
/** A normalized vector defining where the camera is pointed. */
|
||||
Vector3 mDirection;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue