24 lines
483 B
C++
24 lines
483 B
C++
// Copyright 2024 SquareBlock Inc. All Rights Reserved.
|
|
// Author: tianlei.richard@qq.com (tianlei.richard)
|
|
|
|
#include "common.h"
|
|
|
|
class Camera {
|
|
public:
|
|
explicit Camera(const Vector3d &up);
|
|
|
|
public:
|
|
TransformMatrix get_view_transform() const;
|
|
|
|
public:
|
|
void set_position(const Point3d &position) {
|
|
position_ = position.normalized();
|
|
}
|
|
void set_gaze(const Vector3d &gaze) { gaze_ = gaze.normalized(); }
|
|
|
|
private:
|
|
Point3d position_;
|
|
Vector3d gaze_;
|
|
Vector3d up_;
|
|
};
|