Player12
An open source football management simulator
Loading...
Searching...
No Matches
MatchRenderer3D::State Struct Reference

Public Member Functions

 State ()
 
void prepareMatch (const MatchRenderSnapshot &snapshot)
 
MatchCameraFocus computeFocus (const MatchRenderSnapshot &snapshot, float deltaSeconds)
 
MatchCameraControl cameraControl (const MatchCameraInput &input) const
 
void drawSky ()
 
void emitRaw (std::span< const ImVec2 > screen, std::span< const ImU32 > colors)
 
void drawWorldPolygon (std::span< const Vec3 > world, std::span< const ImU32 > colors, bool antiAliased)
 
void drawGroundEllipse (Vec3 centre, Vec3 axisA, Vec3 axisB, ImU32 color)
 
void drawSoftEllipse (Vec3 centre, Vec3 axisA, Vec3 axisB, ImU32 color)
 
void drawPitch ()
 
void drawShadows (const MatchRenderSnapshot &snapshot, float alpha)
 
void drawStadium ()
 
void reserveBatch (int vertices, int indices)
 
void releaseBatch ()
 
void batchFan (std::span< const ImVec2 > screen, std::span< const ImU32 > colors)
 
void batchQuad (ImVec2 bottomLeft, ImVec2 bottomRight, ImVec2 topRight, ImVec2 topLeft, ImU32 bottom, ImU32 top)
 
void updateCrowdMotion ()
 
void drawCrowd (const Stadium3D::Face &face)
 
void drawCrowdFlags (const Stadium3D::Face &face, float upX, float upY)
 
void drawVignette ()
 
void addPolygon (std::span< const ScreenPoint > screen, ImU32 color, float objectDepth, float localDepth)
 
void addLine (Vec3 from, Vec3 to, ImU32 color, float thickness, float objectDepth)
 
void addBox (const std::array< Vec3, 8 > &corners, ImU32 color, float objectDepth)
 
void addPrism (std::span< const Vec3 > bottom, std::span< const Vec3 > top, ImU32 color, float objectDepth, bool capBottom, bool capTop)
 
void orientedBox (Vec3 centre, Vec3 axisA, Vec3 axisB, Vec3 axisC, ImU32 color, float objectDepth)
 
void addSegment (Vec3 from, Vec3 to, float fromHalf, float toHalf, ImU32 color, SegmentStyle style)
 
void updateMotion (const MatchRenderPlayer &player, AnimationSlot &slot, float alpha, float deltaSeconds)
 
void findBallHolder (const MatchRenderSnapshot &snapshot, float alpha)
 
int shirtNumberFor (const MatchRenderPlayer &player)
 
GoalMood goalMoodFor (const MatchRenderPlayer &player) const
 
void addPlayer (const MatchRenderPlayer &player, AnimationSlot &slot, float alpha)
 
void addBackPrint (const AnimationSlot &slot, std::size_t kitIndex, Vec3 waist, const BodyFrame &frame, float scale, float objectDepth)
 
void drawBackText (const Primitive &primitive)
 
void detectTouches (const MatchRenderSnapshot &snapshot)
 
void updateGoalMoment (const MatchRenderSnapshot &snapshot)
 
void addGoals ()
 
void addCornerFlags ()
 
void addBoards ()
 
void addBall (const MatchRenderSnapshot &snapshot, float alpha)
 
void flushSorted ()
 
void drawHead (const Primitive &primitive)
 
void drawBoard (const Primitive &primitive)
 
void drawBoardLogo (const Stadium3D::AdBoard &board, const Stadium3D::SponsorStyle &style, Vec3 origin, float width, float height)
 
void drawLabelsAndHover (const MatchRenderOptions &options)
 
void drawScoreBug (const MatchRenderSnapshot &snapshot, const MatchRenderOptions &options)
 
void drawGoalSting (const MatchRenderSnapshot &snapshot)
 

Public Attributes

Stadium3D::Geometry geometry
 
bool geometryBuilt = false
 
TeamID homeTeam = 0
 
TeamID awayTeam = 0
 
MatchKits kits
 
MatchCamera3D camera
 
RenderMath::Projection projection
 
bool hasProjection = false
 
ImDrawList * drawList = nullptr
 
ImVec2 whitePixel
 
float elapsedSeconds = 0.0f
 
float frameSeconds = 0.0f
 
float attackDirection = 1.0f
 
float directionChangeSeconds = 0.0f
 
bool jumped = false
 
bool day = false
 
LightRig light = nightLight()
 
float ballSpin = 0.0f
 
Vec3 lastBallWorld
 
ImVec2 ballRoll {1.0f, 0.0f}
 
std::array< KitColors, 4 > kitList {}
 
std::array< ImU32, 4 > numberColors {}
 
std::array< ImU32, 4 > gloveColors {}
 
MatchShirtNumbers numbers
 
float simSeconds = 0.0f
 
float lastMatchMinutes = -1.0f
 
bool reducedMotion = false
 
bool livePlay = false
 
Vec3 ballWorld
 
GoalkeeperState homeKeeperState = GoalkeeperState::SET_POSITION
 
GoalkeeperState awayKeeperState = GoalkeeperState::SET_POSITION
 
const std::vector< PlayerMatchStats > * playerStats = nullptr
 
float lastKickerLockout = 0.0f
 
const MatchRenderPlayer * heldBy = nullptr
 
Vec3 heldBallWorld
 
bool heldBallPlaced = false
 
GoalMomentState goal
 
float celebrationWeight = 0.0f
 
float crowdCelebration = 0.0f
 
std::array< float, Stadium3D::CROWD_PHASES > crowdSway {}
 
std::array< float, Stadium3D::CROWD_PHASES > crowdHop {}
 
float crowdTension = 0.0f
 
std::array< float, Stadium3D::CROWD_PHASES > crowdRise {}
 
std::byte cheeringMask {}
 
int batchVertices = 0
 
int batchIndices = 0
 
std::vector< Vec4 > pitchClip
 
std::vector< ImVec2 > pitchScreen
 
std::vector< ImU32 > pitchColors
 
float pitchSwing = 0.0f
 
bool pitchDay = false
 
std::vector< AnimationSlot > slots
 
std::vector< ImVec2 > points
 
std::vector< Primitive > primitives
 
std::vector< SortKey > keys
 
std::vector< const char * > texts
 
std::vector< std::pair< float, std::uint32_t > > sectionOrder
 
std::vector< PlayerOnScreen > playersOnScreen
 

Constructor & Destructor Documentation

◆ State()

MatchRenderer3D::State::State ( )
inline

Member Function Documentation

◆ addBackPrint()

void MatchRenderer3D::State::addBackPrint ( const AnimationSlot &  slot,
std::size_t  kitIndex,
Vec3  waist,
const BodyFrame &  frame,
float  scale,
float  objectDepth 
)

◆ addBall()

void MatchRenderer3D::State::addBall ( const MatchRenderSnapshot &  snapshot,
float  alpha 
)

◆ addBoards()

void MatchRenderer3D::State::addBoards ( )

◆ addBox()

void MatchRenderer3D::State::addBox ( const std::array< Vec3, 8 > &  corners,
ImU32  color,
float  objectDepth 
)

◆ addCornerFlags()

void MatchRenderer3D::State::addCornerFlags ( )

◆ addGoals()

void MatchRenderer3D::State::addGoals ( )

◆ addLine()

void MatchRenderer3D::State::addLine ( Vec3  from,
Vec3  to,
ImU32  color,
float  thickness,
float  objectDepth 
)

◆ addPlayer()

void MatchRenderer3D::State::addPlayer ( const MatchRenderPlayer &  player,
AnimationSlot &  slot,
float  alpha 
)

◆ addPolygon()

void MatchRenderer3D::State::addPolygon ( std::span< const ScreenPoint >  screen,
ImU32  color,
float  objectDepth,
float  localDepth 
)

◆ addPrism()

void MatchRenderer3D::State::addPrism ( std::span< const Vec3 >  bottom,
std::span< const Vec3 >  top,
ImU32  color,
float  objectDepth,
bool  capBottom,
bool  capTop 
)

Lit prism between two rings of the same size (up to 8 sides).

◆ addSegment()

void MatchRenderer3D::State::addSegment ( Vec3  from,
Vec3  to,
float  fromHalf,
float  toHalf,
ImU32  color,
SegmentStyle  style 
)

Limb segment between two joints, tapering from fromHalf to toHalf (a prism up close, a box further out, a stroke far away).

◆ batchFan()

void MatchRenderer3D::State::batchFan ( std::span< const ImVec2 >  screen,
std::span< const ImU32 >  colors 
)

◆ batchQuad()

void MatchRenderer3D::State::batchQuad ( ImVec2  bottomLeft,
ImVec2  bottomRight,
ImVec2  topRight,
ImVec2  topLeft,
ImU32  bottom,
ImU32  top 
)

◆ cameraControl()

MatchCameraControl MatchRenderer3D::State::cameraControl ( const MatchCameraInput &  input) const

Turns the view's mouse input into world-space camera control.

◆ computeFocus()

MatchCameraFocus MatchRenderer3D::State::computeFocus ( const MatchRenderSnapshot &  snapshot,
float  deltaSeconds 
)

◆ detectTouches()

void MatchRenderer3D::State::detectTouches ( const MatchRenderSnapshot &  snapshot)

Starts kick, header and tackle poses from the engine's touches.

◆ drawBackText()

void MatchRenderer3D::State::drawBackText ( const Primitive &  primitive)

◆ drawBoard()

void MatchRenderer3D::State::drawBoard ( const Primitive &  primitive)

◆ drawBoardLogo()

void MatchRenderer3D::State::drawBoardLogo ( const Stadium3D::AdBoard &  board,
const Stadium3D::SponsorStyle &  style,
Vec3  origin,
float  width,
float  height 
)

◆ drawCrowd()

void MatchRenderer3D::State::drawCrowd ( const Stadium3D::Face &  face)

◆ drawCrowdFlags()

void MatchRenderer3D::State::drawCrowdFlags ( const Stadium3D::Face &  face,
float  upX,
float  upY 
)

◆ drawGoalSting()

void MatchRenderer3D::State::drawGoalSting ( const MatchRenderSnapshot &  snapshot)

◆ drawGroundEllipse()

void MatchRenderer3D::State::drawGroundEllipse ( Vec3  centre,
Vec3  axisA,
Vec3  axisB,
ImU32  color 
)

◆ drawHead()

void MatchRenderer3D::State::drawHead ( const Primitive &  primitive)

◆ drawLabelsAndHover()

void MatchRenderer3D::State::drawLabelsAndHover ( const MatchRenderOptions &  options)

◆ drawPitch()

void MatchRenderer3D::State::drawPitch ( )

The mown playing surface (vertex grid, per-frame stripe tint).

◆ drawScoreBug()

void MatchRenderer3D::State::drawScoreBug ( const MatchRenderSnapshot &  snapshot,
const MatchRenderOptions &  options 
)

◆ drawShadows()

void MatchRenderer3D::State::drawShadows ( const MatchRenderSnapshot &  snapshot,
float  alpha 
)

◆ drawSky()

void MatchRenderer3D::State::drawSky ( )

◆ drawSoftEllipse()

void MatchRenderer3D::State::drawSoftEllipse ( Vec3  centre,
Vec3  axisA,
Vec3  axisB,
ImU32  color 
)

Radial-gradient ellipse (dark centre, clear rim) for soft shadows.

◆ drawStadium()

void MatchRenderer3D::State::drawStadium ( )

◆ drawVignette()

void MatchRenderer3D::State::drawVignette ( )

◆ drawWorldPolygon()

void MatchRenderer3D::State::drawWorldPolygon ( std::span< const Vec3 >  world,
std::span< const ImU32 >  colors,
bool  antiAliased 
)

◆ emitRaw()

void MatchRenderer3D::State::emitRaw ( std::span< const ImVec2 >  screen,
std::span< const ImU32 >  colors 
)

◆ findBallHolder()

void MatchRenderer3D::State::findBallHolder ( const MatchRenderSnapshot &  snapshot,
float  alpha 
)

Who holds the ball in his hands this frame (keeper, throw-in).

◆ flushSorted()

void MatchRenderer3D::State::flushSorted ( )

◆ goalMoodFor()

GoalMood MatchRenderer3D::State::goalMoodFor ( const MatchRenderPlayer &  player) const

◆ orientedBox()

void MatchRenderer3D::State::orientedBox ( Vec3  centre,
Vec3  axisA,
Vec3  axisB,
Vec3  axisC,
ImU32  color,
float  objectDepth 
)

Oriented box from its centre and three half axes.

◆ prepareMatch()

void MatchRenderer3D::State::prepareMatch ( const MatchRenderSnapshot &  snapshot)

◆ releaseBatch()

void MatchRenderer3D::State::releaseBatch ( )

◆ reserveBatch()

void MatchRenderer3D::State::reserveBatch ( int  vertices,
int  indices 
)

Crowd and pitch geometry go through chunked reservations (16-bit indices); release before any other draw-list call.

◆ shirtNumberFor()

int MatchRenderer3D::State::shirtNumberFor ( const MatchRenderPlayer &  player)

◆ updateCrowdMotion()

void MatchRenderer3D::State::updateCrowdMotion ( )

Fills the idle-sway and goal-hop tables for this frame.

◆ updateGoalMoment()

void MatchRenderer3D::State::updateGoalMoment ( const MatchRenderSnapshot &  snapshot)

Tracks the goal being celebrated (sting, net ripple, reactions).

◆ updateMotion()

void MatchRenderer3D::State::updateMotion ( const MatchRenderPlayer &  player,
AnimationSlot &  slot,
float  alpha,
float  deltaSeconds 
)

Advances a player's gait, planted feet, actions and keeper stances.

Member Data Documentation

◆ attackDirection

float MatchRenderer3D::State::attackDirection = 1.0f

◆ awayKeeperState

GoalkeeperState MatchRenderer3D::State::awayKeeperState = GoalkeeperState::SET_POSITION

◆ awayTeam

TeamID MatchRenderer3D::State::awayTeam = 0

◆ ballRoll

ImVec2 MatchRenderer3D::State::ballRoll {1.0f, 0.0f}

◆ ballSpin

float MatchRenderer3D::State::ballSpin = 0.0f

Ball panel rotation and its on-screen roll direction.

◆ ballWorld

Vec3 MatchRenderer3D::State::ballWorld

◆ batchIndices

int MatchRenderer3D::State::batchIndices = 0

◆ batchVertices

int MatchRenderer3D::State::batchVertices = 0

◆ camera

MatchCamera3D MatchRenderer3D::State::camera

◆ celebrationWeight

float MatchRenderer3D::State::celebrationWeight = 0.0f

0..1 weight of the players' goal reactions this frame.

◆ cheeringMask

std::byte MatchRenderer3D::State::cheeringMask {}

CHEERS_* bit of the celebrating supporters (0: nobody).

◆ crowdCelebration

float MatchRenderer3D::State::crowdCelebration = 0.0f

0..1 weight of the crowd's goal celebration this frame.

◆ crowdHop

std::array<float, Stadium3D::CROWD_PHASES> MatchRenderer3D::State::crowdHop {}

◆ crowdRise

std::array<float, Stadium3D::CROWD_PHASES> MatchRenderer3D::State::crowdRise {}

◆ crowdSway

std::array<float, Stadium3D::CROWD_PHASES> MatchRenderer3D::State::crowdSway {}

Idle sway and celebration hop offsets per crowd phase (metres).

◆ crowdTension

float MatchRenderer3D::State::crowdTension = 0.0f

0..1 build-up of the crowd rising for a shot or a chance.

◆ day

bool MatchRenderer3D::State::day = false

Daylight preset this frame (kick-off time or the view toggle).

◆ directionChangeSeconds

float MatchRenderer3D::State::directionChangeSeconds = 0.0f

◆ drawList

ImDrawList* MatchRenderer3D::State::drawList = nullptr

◆ elapsedSeconds

float MatchRenderer3D::State::elapsedSeconds = 0.0f

◆ frameSeconds

float MatchRenderer3D::State::frameSeconds = 0.0f

Real seconds of the current frame.

◆ geometry

Stadium3D::Geometry MatchRenderer3D::State::geometry

◆ geometryBuilt

bool MatchRenderer3D::State::geometryBuilt = false

◆ gloveColors

std::array<ImU32, 4> MatchRenderer3D::State::gloveColors {}

◆ goal

GoalMomentState MatchRenderer3D::State::goal

◆ hasProjection

bool MatchRenderer3D::State::hasProjection = false

False until a frame was projected (input maps through it).

◆ heldBallPlaced

bool MatchRenderer3D::State::heldBallPlaced = false

◆ heldBallWorld

Vec3 MatchRenderer3D::State::heldBallWorld

◆ heldBy

const MatchRenderPlayer* MatchRenderer3D::State::heldBy = nullptr

Holding the ball in his hands (keeper, throw-in taker), and where the hands put it this frame.

◆ homeKeeperState

GoalkeeperState MatchRenderer3D::State::homeKeeperState = GoalkeeperState::SET_POSITION

◆ homeTeam

TeamID MatchRenderer3D::State::homeTeam = 0

◆ jumped

bool MatchRenderer3D::State::jumped = false

The play jumped this frame (playback skip): cameras cut, not ease.

◆ keys

std::vector<SortKey> MatchRenderer3D::State::keys

◆ kitList

std::array<KitColors, 4> MatchRenderer3D::State::kitList {}

Kits indexed home, home keeper, away, away keeper.

◆ kits

MatchKits MatchRenderer3D::State::kits

◆ lastBallWorld

Vec3 MatchRenderer3D::State::lastBallWorld

◆ lastKickerLockout

float MatchRenderer3D::State::lastKickerLockout = 0.0f

The kicker's lockout last frame (a rise marks a strike).

◆ lastMatchMinutes

float MatchRenderer3D::State::lastMatchMinutes = -1.0f

◆ light

LightRig MatchRenderer3D::State::light = nightLight()

◆ livePlay

bool MatchRenderer3D::State::livePlay = false

◆ numberColors

std::array<ImU32, 4> MatchRenderer3D::State::numberColors {}

◆ numbers

MatchShirtNumbers MatchRenderer3D::State::numbers

◆ pitchClip

std::vector<Vec4> MatchRenderer3D::State::pitchClip

Clip-space pitch grid vertices of this frame.

◆ pitchColors

std::vector<ImU32> MatchRenderer3D::State::pitchColors

Grid colours with the current stripe tint (rebuilt on change).

◆ pitchDay

bool MatchRenderer3D::State::pitchDay = false

◆ pitchScreen

std::vector<ImVec2> MatchRenderer3D::State::pitchScreen

◆ pitchSwing

float MatchRenderer3D::State::pitchSwing = 0.0f

◆ playersOnScreen

std::vector<PlayerOnScreen> MatchRenderer3D::State::playersOnScreen

◆ playerStats

const std::vector<PlayerMatchStats>* MatchRenderer3D::State::playerStats = nullptr

◆ points

std::vector<ImVec2> MatchRenderer3D::State::points

◆ primitives

std::vector<Primitive> MatchRenderer3D::State::primitives

◆ projection

RenderMath::Projection MatchRenderer3D::State::projection

◆ reducedMotion

bool MatchRenderer3D::State::reducedMotion = false

◆ sectionOrder

std::vector<std::pair<float, std::uint32_t> > MatchRenderer3D::State::sectionOrder

◆ simSeconds

float MatchRenderer3D::State::simSeconds = 0.0f

Simulated seconds since the previous frame (0 while paused).

◆ slots

std::vector<AnimationSlot> MatchRenderer3D::State::slots

◆ texts

std::vector<const char*> MatchRenderer3D::State::texts

◆ whitePixel

ImVec2 MatchRenderer3D::State::whitePixel

The documentation for this struct was generated from the following file: