erebus

diff liberebus/src/camera.h @ 46:c4d48a21bc4a

in the middle of the vmath->gph-math port
author John Tsiombikas <nuclear@member.fsf.org>
date Wed, 24 Feb 2016 00:26:50 +0200
parents bab25c0ce337
children
line diff
     1.1 --- a/liberebus/src/camera.h	Tue Dec 29 12:19:53 2015 +0200
     1.2 +++ b/liberebus/src/camera.h	Wed Feb 24 00:26:50 2016 +0200
     1.3 @@ -5,50 +5,50 @@
     1.4  
     1.5  class Camera {
     1.6  protected:
     1.7 -	Vector3 pos;
     1.8 +	Vec3 pos;
     1.9  	float vfov;	// vertical field of view in radians
    1.10  
    1.11 -	mutable Matrix4x4 cached_matrix;
    1.12 +	mutable Mat4x4 cached_matrix;
    1.13  	mutable bool cached_matrix_valid;
    1.14  
    1.15 -	virtual void calc_matrix(Matrix4x4 *mat) const = 0;
    1.16 +	virtual void calc_matrix(Mat4x4 *mat) const = 0;
    1.17  
    1.18 -	Vector2 calc_sample_pos(int x, int y, int xsz, int ysz, int sample) const;
    1.19 +	Vec2 calc_sample_pos(int x, int y, int xsz, int ysz, int sample) const;
    1.20  
    1.21  public:
    1.22  	Camera();
    1.23 -	Camera(const Vector3 &pos);
    1.24 +	Camera(const Vec3 &pos);
    1.25  	virtual ~Camera();
    1.26  
    1.27  	virtual void set_fov(float vfov);
    1.28  	virtual float get_fov() const;
    1.29  
    1.30 -	virtual void set_position(const Vector3 &pos);
    1.31 -	virtual const Vector3 &get_position() const;
    1.32 -	virtual const Matrix4x4 &get_matrix() const;
    1.33 +	virtual void set_position(const Vec3 &pos);
    1.34 +	virtual const Vec3 &get_position() const;
    1.35 +	virtual const Mat4x4 &get_matrix() const;
    1.36  
    1.37  	virtual Ray get_primary_ray(int x, int y, int xsz, int ysz, int sample = 0) const;
    1.38  };
    1.39  
    1.40  class TargetCamera : public Camera {
    1.41  protected:
    1.42 -	Vector3 target;
    1.43 +	Vec3 target;
    1.44  
    1.45 -	void calc_matrix(Matrix4x4 *mat) const;
    1.46 +	void calc_matrix(Mat4x4 *mat) const;
    1.47  
    1.48  public:
    1.49  	TargetCamera();
    1.50 -	TargetCamera(const Vector3 &pos, const Vector3 &targ);
    1.51 +	TargetCamera(const Vec3 &pos, const Vec3 &targ);
    1.52  
    1.53 -	virtual void set_target(const Vector3 &targ);
    1.54 -	virtual const Vector3 &get_target() const;
    1.55 +	virtual void set_target(const Vec3 &targ);
    1.56 +	virtual const Vec3 &get_target() const;
    1.57  };
    1.58  
    1.59  class FlyCamera : public Camera {
    1.60  protected:
    1.61 -	Quaternion rot;
    1.62 +	Quat rot;
    1.63  
    1.64 -	void calc_matrix(Matrix4x4 *mat) const;
    1.65 +	void calc_matrix(Mat4x4 *mat) const;
    1.66  
    1.67  public:
    1.68  	void input_move(float x, float y, float z);