2024-03-22 20:12:09 +08:00
|
|
|
// Copyright 2024 SquareBlock Inc. All Rights Reserved.
|
2024-03-07 14:29:24 +08:00
|
|
|
// Author: tianlei.richard@qq.com (tianlei.richard)
|
|
|
|
|
|
|
|
#include "common.h"
|
|
|
|
|
|
|
|
class Camera {
|
|
|
|
public:
|
|
|
|
explicit Camera(const Vector3d &up);
|
2024-03-29 21:34:07 +08:00
|
|
|
explicit Camera(const Vector3d &up, const float camera_speed);
|
2024-03-07 14:29:24 +08:00
|
|
|
|
|
|
|
public:
|
|
|
|
TransformMatrix get_view_transform() const;
|
|
|
|
|
|
|
|
public:
|
2024-03-29 21:34:07 +08:00
|
|
|
void move(const Point3d &offset);
|
|
|
|
void set_gaze(const Vector3d &gaze);
|
2024-03-07 14:29:24 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
Point3d position_;
|
|
|
|
Vector3d gaze_;
|
|
|
|
Vector3d up_;
|
2024-03-29 21:34:07 +08:00
|
|
|
|
|
|
|
float camera_speed_;
|
2024-03-07 14:29:24 +08:00
|
|
|
};
|