15 #ifndef GAME_CAMERA_H_
16 #define GAME_CAMERA_H_
19 #include "mathfu/glsl_mappings.h"
20 #include "motive/init.h"
21 #include "motive/motivator.h"
27 mathfu::vec3 position;
30 GameCameraState() : position(mathfu::kZeros3f), target(mathfu::kZeros3f) {}
31 GameCameraState(
const mathfu::vec3& position,
const mathfu::vec3& target)
32 : position(position), target(target) {}
35 return position[0] == rhs.position[0] && position[1] == rhs.position[1] &&
36 position[2] == rhs.position[2] && target[0] == rhs.target[0] &&
37 target[1] == rhs.target[1] && target[2] == rhs.target[2];
39 bool operator!=(
const GameCameraState& rhs)
const {
return !operator==(rhs); }
47 motive::SplineInit init;
54 void Initialize(
const GameCameraState& state, motive::MotiveEngine* engine);
57 void AdvanceFrame(WorldTime delta_time);
62 movements_.push(movement);
66 void TerminateMovements();
71 void OverridePosition(
const mathfu::vec3& position);
74 void OverrideTarget(
const mathfu::vec3& target);
82 mathfu::vec3 Position()
const;
85 mathfu::vec3 Target()
const;
88 mathfu::vec3 Forward()
const {
return forward_; }
91 mathfu::vec3 Side()
const {
return side_; }
95 mathfu::vec3 Up()
const {
96 return mathfu::vec3::CrossProduct(side_, forward_);
100 float Dist()
const {
return (Target() - Position()).Length(); }
106 motive::MotiveEngine* engine_;
110 motive::Motivator1f percent_;
119 mathfu::vec3 forward_;
124 std::queue<GameCameraMovement> movements_;
130 #endif // GAME_CAMERA_H_
Definition: game_camera.h:26
Definition: game_camera.h:43
Definition: game_camera.h:51