|
Player12
An open source football management simulator
|
#include <match_camera_3d.h>
Classes | |
| struct | Rig |
Public Member Functions | |
| void | update (const MatchCameraFocus &focus, MatchCameraMode mode, const MatchCameraControl &control, float deltaSeconds) |
| void | snap (const MatchCameraFocus &focus, MatchCameraMode mode) |
| RenderMath::Vec3 | eye () const |
| RenderMath::Vec3 | target () const |
| float | verticalFov () const |
| float | zoom () const |
| float | yaw () const |
| float | pitch () const |
| float | distance () const |
| RenderMath::Vec3 | freeTarget () const |
| float | freePitch () const |
| float | freeDistance () const |
| MatchDirectorShot | directorShot () const |
| int | directorCuts () const |
Private Member Functions | |
| Rig | desiredRig (const MatchCameraFocus &focus, MatchCameraMode mode) const |
| Rig | directorRig (const MatchCameraFocus &focus) const |
| bool | direct (const MatchCameraFocus &focus, float deltaSeconds) |
| void | steerFree (const MatchCameraFocus &focus, const MatchCameraControl &control) |
Private Attributes | |
| Rig | current |
| Rig | freeRig |
| float | zoomFactor = 1.0f |
| float | chaseYaw = 0.0f |
| bool | initialized = false |
| bool | freeActive = false |
| MatchDirectorShot | shot = MatchDirectorShot::BROADCAST |
| int | cuts = 0 |
| float | shotSeconds = 0.0f |
| float | sinceReverse = 1e6f |
| float | sinceGoalLine = 1e6f |
| float | attackSeconds = 0.0f |
| float | goalLineX = 0.0f |
Smoothly damped orbit camera with broadcast, tactical, end and chase presets, a user-driven free orbit camera and a TV director.
The camera is described by a look-at target plus yaw, pitch, distance and vertical field of view. Each preset produces a desired rig from the focus and every parameter is damped exponentially with real frame time, so the motion is identical at any frame rate and mode switches glide instead of cutting. The free camera starts from whatever pose was on screen when it was selected, so a drag in any preset takes over seamlessly; its pitch, distance and target are clamped so it never dips under the pitch, leaves the stadium bowl or loses the pitch.
The director stays on the broadcast camera and cuts (never glides) to a reverse angle while an attack builds in the final third, to a goal-line view for shots and to a close-up of a goal celebration, each with a minimum hold and a cooldown. With reduced motion it keeps the broadcast camera throughout.
|
private |
|
private |
Picks the director's shot; true when it cut to a new one.
|
inline |
|
private |
|
inline |
The director's current shot and how many cuts it has made.
|
inline |
| Vec3 MatchCamera3D::eye | ( | ) | const |
|
inline |
|
inline |
|
inline |
Where the free camera is heading (after clamps), for tests.
|
inline |
| void MatchCamera3D::snap | ( | const MatchCameraFocus & | focus, |
| MatchCameraMode | mode | ||
| ) |
Jumps straight to the desired framing (first frame, tests).
|
private |
Applies one frame of user control to the free rig and clamps it.
|
inline |
| void MatchCamera3D::update | ( | const MatchCameraFocus & | focus, |
| MatchCameraMode | mode, | ||
| const MatchCameraControl & | control, | ||
| float | deltaSeconds | ||
| ) |
Advances the camera towards the preset's desired framing.
|
inline |
|
inline |
Current orbit parameters (radians, metres).
|
inline |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
Desired pose of the free camera (the user's, before bowl clamping).
|
private |
Goal line (x) the goal-line camera watches.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |