|
Player12
An open source football management simulator
|
#include <match_render_snapshot.h>
Public Attributes | |
| const Player * | player = nullptr |
| bool | isHomeTeam = false |
| Vector2F | previousPosition |
| Vector2F | currentPosition |
| Vector2F | movementTarget |
| PlayerIntent | intent = PlayerIntent::HOLD_SHAPE |
| float | previousFacingAngle = 0.0f |
| float | currentFacingAngle = 0.0f |
| float | stamina = 1.0f |
| bool | possessesBall = false |
| bool | onPitch = true |
| bool | isGoalkeeper = false |
| bool | isDiving = false |
| bool | isInjured = false |
| int | yellowCards = 0 |
| float | heightMetres = MatchTuning::Units::DEFAULT_PLAYER_HEIGHT_METRES |
| float | speedMetresPerSecond = 0.0f |
| float | tackleCooldown = 0.0f |
Read-only normalized world state consumed by renderers.
The snapshot is rebuilt every frame from a MatchEngine and carries the previous and current fixed-step positions plus the interpolation fraction, so 2D and 3D renderers can interpolate without touching the simulation. Renderers must never mutate this data or the engine.
Positions are copied, but Player pointers and the event/statistics pointers in MatchRenderSnapshot remain borrowed. Consume the snapshot while its source engine and players are alive and stable; it is not an owned replay record or a cross-thread publication format. See docs/development/match-engine.md.
Units: positions are normalised pitch coordinates (x along the 105 m length, home attacking +x; y across the 68 m width). Ball currentZ and previousZ are in length units (metres = z * 105); the *HeightMetres fields carry the same value already converted to metres.
| float MatchRenderPlayer::currentFacingAngle = 0.0f |
| Vector2F MatchRenderPlayer::currentPosition |
| float MatchRenderPlayer::heightMetres = MatchTuning::Units::DEFAULT_PLAYER_HEIGHT_METRES |
| PlayerIntent MatchRenderPlayer::intent = PlayerIntent::HOLD_SHAPE |
| bool MatchRenderPlayer::isDiving = false |
| bool MatchRenderPlayer::isGoalkeeper = false |
| bool MatchRenderPlayer::isHomeTeam = false |
| bool MatchRenderPlayer::isInjured = false |
| Vector2F MatchRenderPlayer::movementTarget |
| bool MatchRenderPlayer::onPitch = true |
False once sent off or forced off; such players wait by the bench.
| const Player* MatchRenderPlayer::player = nullptr |
| bool MatchRenderPlayer::possessesBall = false |
| float MatchRenderPlayer::previousFacingAngle = 0.0f |
| Vector2F MatchRenderPlayer::previousPosition |
| float MatchRenderPlayer::speedMetresPerSecond = 0.0f |
Running speed in metres per simulated second (drives the stride).
| float MatchRenderPlayer::stamina = 1.0f |
| float MatchRenderPlayer::tackleCooldown = 0.0f |
Seconds before this player may challenge again; it jumps up when he goes into a tackle (renderers start the tackle pose on the rise).
| int MatchRenderPlayer::yellowCards = 0 |