wavelength 1.0.0
Loading...
Searching...
No Matches
playercamfx.h
Go to the documentation of this file.
1#pragma once
2
3#include <map>
4
5#include "gfx/gfxtunnel.h"
6#include "math/interpolator.h"
7#include "math/transform.h"
8#include "math/vector3.h"
9#include "os/string.h"
10#include "rnd/rndanimatable.h"
11#include "rnd/rndcam.h"
12#include "rnd/rndtransanim.h"
14#include "script/dataarray.h"
15
26public:
33 typedef void (PlayerCamFX::*Algorithm)(GfxTunnel *, Transform &, Transform &, int, bool);
34
44 PlayerCamFX(int nPlayer, int nNumTracks, bool bBoss);
45
53
64 void Poll(GfxTunnel *pTunnel, GfxArena *pArena, float flTick, float flTime);
65
74 void SetSlide(const Transform *pXfm, float flBlend);
75
87 static void
88 LoadConfig(DataArray *pConfig, DataArray *pDefaults, GfxTunnel *pTunnel, int nOption);
89
97 void SetZoomedOut(int nZoomedOut);
98
106 void SetZoom(float flZoom);
107
117 void Reset(bool bNearPullBack);
118
128 void Kick(float flAmount);
129
138 void SetBlendAlgorithm(const char *pszName, float flBlend);
139
147 void SetBlend(float flBlend);
148
150 const Transform &GetCamera() const {
151 return mCamera;
152 }
153
155 const Transform &GetView() const {
156 return mView;
157 }
158
160 float GetPullBackLevel() const {
161 return mPullBackLevel;
162 }
163
165 int GetZoomedOut() const {
166 return mZoomedOut;
167 }
168
170 const Vector3 *GetScreenJiggle() const {
171 return &mScreenJiggle;
172 }
173
174private:
175 int mPlayer;
176 int mSkipIntro;
177 RndTransformable *mFx;
178 RndTransformable *mSlide;
179 RndCam *mCam;
180 RndTransAnim *mIntro;
181 float mIntroTilt;
182 Transform mCamera;
183 Transform mView;
184 ATanInterpolator mPullBackCurve;
185 float mPullBackLevel;
186 int mPullingBack;
187 float mZoom;
188 int mZoomedOut;
189 ATanInterpolator mTrackCurve;
190 char mFocusPlayer;
191 float mFromTrack;
192 float mTrack;
193 float mCenterTrack;
194 Vector3 mJiggleAxis;
195 Vector3 mScreenJiggleAxis;
197 Vector3 mScreenJiggle;
198 int mSliding;
199 float mSlideBlend;
200 Transform mSlideXfm;
201 std::map<String, Algorithm>::iterator mAlgorithm;
202 Algorithm mBlendAlgorithm;
203 float mBlend;
204
212 void PlayIntro(float flTick);
213
229 void LookAlong(GfxTunnel *pTunnel,
230 Transform &track,
231 Transform &camera,
232 int nPlayer,
233 bool bLocal,
234 float flTrack);
235
247 void
248 Trailing(GfxTunnel *pTunnel, Transform &track, Transform &camera, int nPlayer, bool bLocal);
249
261 void TrailingFixed(
262 GfxTunnel *pTunnel, Transform &track, Transform &camera, int nPlayer, bool bLocal);
263
275 void Solo(GfxTunnel *pTunnel, Transform &track, Transform &camera, int nPlayer, bool bLocal);
276
288 void Multi(GfxTunnel *pTunnel, Transform &track, Transform &camera, int nPlayer, bool bLocal);
289
297 void UpdateZoom(bool bImmediate);
298};
Interpolator that follows an arctangent, which eases in and out of the range.
Definition interpolator.h:287
Reference-counted array of script data nodes.
Definition dataarray.h:20
Arena the play field flies through, with its camera path, its triggers, and the movies and the freque...
Definition gfxarena.h:28
Tunnel of tracks the players fly down, with the gems, the cameras of the players, and the effects dra...
Definition gfxtunnel.h:58
void SetZoom(float flZoom)
Set a pull back as a multiple of the far one, and start the pull back to it.
const Transform & GetCamera() const
Definition playercamfx.h:150
void Kick(float flAmount)
Kick the jiggle of the camera.
static void LoadConfig(DataArray *pConfig, DataArray *pDefaults, GfxTunnel *pTunnel, int nOption)
Load the shared settings, and register the algorithms.
const Vector3 * GetScreenJiggle() const
Definition playercamfx.h:170
int GetZoomedOut() const
Definition playercamfx.h:165
void SetZoomedOut(int nZoomedOut)
Select the far pull back, and start the pull back to it.
void(PlayerCamFX::* Algorithm)(GfxTunnel *, Transform &, Transform &, int, bool)
An algorithm that places the camera for a player.
Definition playercamfx.h:33
PlayerCamFX(int nPlayer, int nNumTracks, bool bBoss)
Find the camera objects and the intro animation.
void Reset(bool bNearPullBack)
Return the camera to its start.
void SetBlendAlgorithm(const char *pszName, float flBlend)
Blend in a second algorithm by its name.
float GetPullBackLevel() const
Definition playercamfx.h:160
const Transform & GetView() const
Definition playercamfx.h:155
void Poll(GfxTunnel *pTunnel, GfxArena *pArena, float flTick, float flTime)
Place the camera objects for a frame.
~PlayerCamFX()
Release the camera.
void SetSlide(const Transform *pXfm, float flBlend)
Slide the view towards a transform, or stop sliding.
void SetBlend(float flBlend)
Set the blend towards the second algorithm.
Stage that follows the frame like a damped spring.
Definition rndanimatable.h:469
Camera.
Definition rndcam.h:23
Animation of a transformable's local transform by rotation, translation, and scale keys.
Definition rndtransanim.h:20
Mix-in for an object with a local transform and a world transform derived from its parent's.
Definition rndtransformable.h:17
Affine transform stored as three basis rows and a translation row.
Definition transform.h:18
Three-component vector, padded to a PlayStation 2 quadword.
Definition vector3.h:14