resonance 1.0.1
Loading...
Searching...
No Matches
tnlcamerarig.h
Go to the documentation of this file.
1#pragma once
2
3#include <vector>
4
5#include "app/linearanim.h"
6#include "math/vector3.h"
7#include "rnd/cam.h"
8
9namespace Rnd {
10class View;
11} // namespace Rnd
12
30public:
45 TnlCameraRig(int nPlayerCount, int nSkipIntro);
46
53 void ZoomIn();
54
64 void ZoomOut();
65
77 void SetFrame(float flTime);
78
79private:
80 // Phase after the ramp settles. Zoomed in follows ZoomIn(), zooming out follows ZoomOut(),
81 // and settled follows the next SetFrame() in which the ramp does not move.
82 enum State { kStateZoomedIn = 0, kStateZoomingOut = 1, kStateSettled = 2 };
83
84 // Index into mMainCams.
85 enum MainCam { kMainCamNormal = 0, kMainCamZoom = 1, kMainCamCount = 2 };
86
87 Rnd::Cam *mMainCams[kMainCamCount]; // "tnl cam1" and "tnl cam1z".
88 std::vector<Rnd::Cam *> mOuterCams; // "outer cam<n>", four slots.
89 std::vector<Rnd::View *> mLocalViews; // "tnl local<n>.view", four slots.
90 int mPlayerCount;
91 State mState;
92 LinearAnim mRamp; // 0 at the intro pose and 1 at the playing pose.
93 float mIntroPitch;
94 float mPlayPitch;
95 Vector3 mIntroPos;
96 Vector3 mPlayPos;
97 Rnd::Cam::Rect mIntroRect;
98 Rnd::Cam::Rect mPlayRect;
99 float mIntroFov;
100 float mPlayFov;
101};
Root of a loadable scene.
Definition view.h:47
void ZoomOut()
Run the ramp back towards the intro pose.
TnlCameraRig(int nPlayerCount, int nSkipIntro)
Resolve the cameras and views and record the two poses.
void ZoomIn()
Run the ramp towards the playing pose and hide the outer cameras and views of players 2 to 4.
void SetFrame(float flTime)
Advance the ramp and apply the blended pose.
The rendering engine.
Definition animhelper.h:3