|
Player12
An open source football management simulator
|
#include "gui/render/match_renderer_3d.h"#include <fmt/printf.h>#include <imgui.h>#include <algorithm>#include <array>#include <cfloat>#include <cmath>#include <cstddef>#include <cstdint>#include <format>#include <numbers>#include <span>#include <string>#include <utility>#include <vector>#include "global/language_manager.h"#include "gui/render/match_camera_3d.h"#include "gui/render/match_kit_colors.h"#include "gui/render/match_player_rig.h"#include "gui/render/match_render_3d_tuning.h"#include "gui/render/match_render_math.h"#include "gui/render/match_renderer_2d.h"#include "gui/render/match_shirt_numbers.h"#include "gui/render/match_stadium_3d.h"#include "gui/view_models/match_clock.h"#include "gui/widgets/theme.h"#include "model/player.h"#include "model/role_utils.h"Classes | |
| struct | MatchRenderer3D::State |
| struct | CrowdFaceLayout |
| struct | GaitFrame |
| struct | PlayerTorsoFrame |
Functions | |
| ImVec2 | crowdPoint (const CrowdFaceLayout &layout, float x, float y, float across, float up, float dx, float dy) |
| template<class RendererState > | |
| void | drawCrowdDot (RendererState &state, const CrowdFaceLayout &layout, const Stadium3D::CrowdClump &clump, const Stadium3D::CrowdDot &dot, std::uint32_t detail) |
| template<class RendererState > | |
| void | drawPitchCell (RendererState &state, const Stadium3D::PitchGrid &grid, std::size_t cell, std::size_t rows, std::size_t cellsPerStripe) |
| template<class RendererState > | |
| void | initializeAnimationSlot (RendererState &state, const MatchRenderPlayer &player, AnimationSlot &slot, Vec3 root, float yaw) |
| template<class RendererState > | |
| float | jumpTargetFor (const RendererState &state, const MatchRenderPlayer &player, Vec3 root, float scale) |
| float | attackDirectionFor (std::span< const MatchRenderPlayer > players, const MatchRenderPlayer &carrier) |
| void | setCelebrationFocus (MatchCameraFocus &focus, std::span< const MatchRenderPlayer > players, std::uint32_t scorer, float alpha) |
| template<class RendererState > | |
| void | drawPlayerMarker (RendererState &state, const MatchRenderPlayer &player, Vec3 root, float pixelHeight) |
| template<class RendererState > | |
| void | drawDayPlayerShadow (RendererState &state, Vec3 root, float standing, Vec3 sunAway, float sunLength) |
| template<class RendererState > | |
| void | drawFloodlightPlayerShadows (RendererState &state, Vec3 root, float pixelHeight, float standing, std::span< const Vec3 > lights) |
| template<class RendererState > | |
| void | drawPossessionRing (RendererState &state, Vec3 root) |
| template<class RendererState > | |
| void | drawPlayerShadow (RendererState &state, const MatchRenderPlayer &player, Vec3 root, float pixelHeight, float standing, Vec3 sunAway, float sunLength, std::span< const Vec3 > lights) |
| template<class RendererState > | |
| void | drawDistantCrowdClump (RendererState &state, const Stadium3D::CrowdClump &clump, const CrowdFaceLayout &layout, Vec4 clumpClip, float inverseDepth) |
| template<class RendererState > | |
| void | drawNearCrowdClump (RendererState &state, const Stadium3D::CrowdClump &clump, const CrowdFaceLayout &layout, Vec4 clumpClip, float seatPixels) |
| template<class RendererState > | |
| void | drawCrowdClump (RendererState &state, const Stadium3D::CrowdClump &clump, const CrowdFaceLayout &layout, float seatFocal) |
| template<class RendererState > | |
| void | drawStadiumFace (RendererState &state, const Stadium3D::Face &face) |
| GaitFrame | advanceGait (AnimationSlot &slot, const MatchRenderPlayer &player, Vec3 root, float scale, float deltaSeconds) |
| void | updateMotionRates (AnimationSlot &slot, float groundSpeed, float yaw, float simSeconds) |
| template<class RendererState > | |
| void | updateKeeperPose (RendererState &state, const MatchRenderPlayer &player, AnimationSlot &slot, Vec3 root, float yaw, float blend) |
| void | updateFootPlanting (AnimationSlot &slot, Vec3 root, float yaw, float scale, float cycleMetres, float groundSpeed, float simSeconds) |
| Pose | poseForTimedEvent (Pose pose, PlayerRig::Event event, float eventTime, float eventWeight, std::size_t eventLeg) |
| Pose | poseForKeeper (Pose pose, bool keeper, float setBlend, float diveBlend, float diveSide, float stride) |
| Pose | poseForCelebration (Pose pose, GoalMood mood, bool reducedMotion, float elapsedSeconds, std::uint32_t seed, float stride, float celebrationWeight) |
| void | applyEventFootTargets (std::array< Vec3, 2 > &ankleTargets, std::array< bool, 2 > &planted, const AnimationSlot &slot, Vec3 pelvis, float ankleHeight, float scale, float eventTime, float eventWeight) |
| template<class RendererState > | |
| void | drawPlayerLeg (RendererState &state, const AnimationSlot &slot, std::size_t index, const std::array< Vec3, 2 > &hipJoint, const std::array< Vec3, 2 > &knee, const std::array< Vec3, 2 > &ankle, const std::array< float, 2 > &heel, const std::array< bool, 2 > &planted, Vec3 bodySide, float scale, float bulk, float objectDepth, PlayerLod lod, const KitColors &kit, const PlayerLook &look, ImU32 skin) |
| template<class RendererState > | |
| void | drawPlayerLegs (RendererState &state, const AnimationSlot &slot, const std::array< Vec3, 2 > &hipJoint, const std::array< Vec3, 2 > &knee, const std::array< Vec3, 2 > &ankle, const std::array< float, 2 > &heel, const std::array< bool, 2 > &planted, Vec3 bodySide, float scale, float bulk, float objectDepth, PlayerLod lod, const KitColors &kit, const PlayerLook &look, ImU32 skin) |
| float | fitPelvisToPlantedFeet (float pelvisHeight, const AnimationSlot &slot, Vec3 root, Vec3 flatSide, Vec3 forward, float scale, float poseLift) |
| void | buildPlayerAnkleTargets (const AnimationSlot &slot, const Pose &pose, Vec3 root, Vec3 pelvis, Vec3 bodyUp, Vec3 bodySide, Vec3 forward, float scale, float ankleHeight, std::array< Vec3, 2 > &hipJoint, std::array< Vec3, 2 > &ankleTarget, std::array< bool, 2 > &planted) |
| void | solvePlayerLegJoints (const AnimationSlot &slot, const std::array< Vec3, 2 > &hipJoint, const std::array< Vec3, 2 > &ankleTarget, const std::array< bool, 2 > &planted, Vec3 forward, Vec3 bodyUp, float scale, std::array< Vec3, 2 > &knee, std::array< Vec3, 2 > &ankle, std::array< float, 2 > &heel) |
| template<class RendererState > | |
| PlayerTorsoFrame | drawPlayerTorso (RendererState &state, const AnimationSlot &slot, const Pose &pose, Vec3 pelvis, Vec3 bodyUp, Vec3 bodySide, Vec3 forward, float scale, float bulk, float objectDepth, PlayerLod lod, bool detailed, std::size_t kitIndex, const KitColors &kit) |
| template<class RendererState > | |
| void | detectTackleActions (RendererState &state, const MatchRenderSnapshot &snapshot, float alpha) |
| template<class RendererState > | |
| void | detectKickAction (RendererState &state, const MatchRenderSnapshot &snapshot, float alpha) |
| template<class RendererState > | |
| void | captureGoalEvent (RendererState &state, const MatchRenderSnapshot &snapshot) |
| template<class RendererState > | |
| void | addGoalNetPanel (RendererState &state, const Stadium3D::NetPanel &net, bool rippling, float age, Vec3 mouth) |
| template<class RendererState > | |
| void | addGoalFrame (RendererState &state, const Stadium3D::Goal &frame, std::size_t goalIndex) |
| template<class RendererState > | |
| void | updateBallRotation (RendererState &state, Vec3 world, Vec3 moved, float distance, const ScreenPoint &screen) |
| template<class RendererState > | |
| void | updateMatchSimulation (RendererState &state, const MatchRenderSnapshot &snapshot, float deltaSeconds, float alpha) |
| template<class RendererState > | |
| void | updateRenderCamera (RendererState &state, const MatchRenderSnapshot &snapshot, const MatchRenderOptions &options, const MatchViewport &viewport, float deltaSeconds, float alpha) |
| template<class RendererState > | |
| void | drawWorldLayers (RendererState &state, const MatchRenderSnapshot &snapshot, const MatchRenderOptions &options, float alpha) |
| template<class RendererState > | |
| void | drawSortedLayers (RendererState &state, const MatchRenderSnapshot &snapshot, const MatchRenderOptions &options, float alpha) |
| void addGoalFrame | ( | RendererState & | state, |
| const Stadium3D::Goal & | frame, | ||
| std::size_t | goalIndex | ||
| ) |
| void addGoalNetPanel | ( | RendererState & | state, |
| const Stadium3D::NetPanel & | net, | ||
| bool | rippling, | ||
| float | age, | ||
| Vec3 | mouth | ||
| ) |
| GaitFrame advanceGait | ( | AnimationSlot & | slot, |
| const MatchRenderPlayer & | player, | ||
| Vec3 | root, | ||
| float | scale, | ||
| float | deltaSeconds | ||
| ) |
| void applyEventFootTargets | ( | std::array< Vec3, 2 > & | ankleTargets, |
| std::array< bool, 2 > & | planted, | ||
| const AnimationSlot & | slot, | ||
| Vec3 | pelvis, | ||
| float | ankleHeight, | ||
| float | scale, | ||
| float | eventTime, | ||
| float | eventWeight | ||
| ) |
| float attackDirectionFor | ( | std::span< const MatchRenderPlayer > | players, |
| const MatchRenderPlayer & | carrier | ||
| ) |
| void buildPlayerAnkleTargets | ( | const AnimationSlot & | slot, |
| const Pose & | pose, | ||
| Vec3 | root, | ||
| Vec3 | pelvis, | ||
| Vec3 | bodyUp, | ||
| Vec3 | bodySide, | ||
| Vec3 | forward, | ||
| float | scale, | ||
| float | ankleHeight, | ||
| std::array< Vec3, 2 > & | hipJoint, | ||
| std::array< Vec3, 2 > & | ankleTarget, | ||
| std::array< bool, 2 > & | planted | ||
| ) |
| void captureGoalEvent | ( | RendererState & | state, |
| const MatchRenderSnapshot & | snapshot | ||
| ) |
| ImVec2 crowdPoint | ( | const CrowdFaceLayout & | layout, |
| float | x, | ||
| float | y, | ||
| float | across, | ||
| float | up, | ||
| float | dx, | ||
| float | dy | ||
| ) |
| void detectKickAction | ( | RendererState & | state, |
| const MatchRenderSnapshot & | snapshot, | ||
| float | alpha | ||
| ) |
| void detectTackleActions | ( | RendererState & | state, |
| const MatchRenderSnapshot & | snapshot, | ||
| float | alpha | ||
| ) |
| void drawCrowdClump | ( | RendererState & | state, |
| const Stadium3D::CrowdClump & | clump, | ||
| const CrowdFaceLayout & | layout, | ||
| float | seatFocal | ||
| ) |
| void drawCrowdDot | ( | RendererState & | state, |
| const CrowdFaceLayout & | layout, | ||
| const Stadium3D::CrowdClump & | clump, | ||
| const Stadium3D::CrowdDot & | dot, | ||
| std::uint32_t | detail | ||
| ) |
| void drawDayPlayerShadow | ( | RendererState & | state, |
| Vec3 | root, | ||
| float | standing, | ||
| Vec3 | sunAway, | ||
| float | sunLength | ||
| ) |
| void drawDistantCrowdClump | ( | RendererState & | state, |
| const Stadium3D::CrowdClump & | clump, | ||
| const CrowdFaceLayout & | layout, | ||
| Vec4 | clumpClip, | ||
| float | inverseDepth | ||
| ) |
| void drawFloodlightPlayerShadows | ( | RendererState & | state, |
| Vec3 | root, | ||
| float | pixelHeight, | ||
| float | standing, | ||
| std::span< const Vec3 > | lights | ||
| ) |
| void drawNearCrowdClump | ( | RendererState & | state, |
| const Stadium3D::CrowdClump & | clump, | ||
| const CrowdFaceLayout & | layout, | ||
| Vec4 | clumpClip, | ||
| float | seatPixels | ||
| ) |
| void drawPitchCell | ( | RendererState & | state, |
| const Stadium3D::PitchGrid & | grid, | ||
| std::size_t | cell, | ||
| std::size_t | rows, | ||
| std::size_t | cellsPerStripe | ||
| ) |
| void drawPlayerLeg | ( | RendererState & | state, |
| const AnimationSlot & | slot, | ||
| std::size_t | index, | ||
| const std::array< Vec3, 2 > & | hipJoint, | ||
| const std::array< Vec3, 2 > & | knee, | ||
| const std::array< Vec3, 2 > & | ankle, | ||
| const std::array< float, 2 > & | heel, | ||
| const std::array< bool, 2 > & | planted, | ||
| Vec3 | bodySide, | ||
| float | scale, | ||
| float | bulk, | ||
| float | objectDepth, | ||
| PlayerLod | lod, | ||
| const KitColors & | kit, | ||
| const PlayerLook & | look, | ||
| ImU32 | skin | ||
| ) |
| void drawPlayerLegs | ( | RendererState & | state, |
| const AnimationSlot & | slot, | ||
| const std::array< Vec3, 2 > & | hipJoint, | ||
| const std::array< Vec3, 2 > & | knee, | ||
| const std::array< Vec3, 2 > & | ankle, | ||
| const std::array< float, 2 > & | heel, | ||
| const std::array< bool, 2 > & | planted, | ||
| Vec3 | bodySide, | ||
| float | scale, | ||
| float | bulk, | ||
| float | objectDepth, | ||
| PlayerLod | lod, | ||
| const KitColors & | kit, | ||
| const PlayerLook & | look, | ||
| ImU32 | skin | ||
| ) |
| void drawPlayerMarker | ( | RendererState & | state, |
| const MatchRenderPlayer & | player, | ||
| Vec3 | root, | ||
| float | pixelHeight | ||
| ) |
| void drawPlayerShadow | ( | RendererState & | state, |
| const MatchRenderPlayer & | player, | ||
| Vec3 | root, | ||
| float | pixelHeight, | ||
| float | standing, | ||
| Vec3 | sunAway, | ||
| float | sunLength, | ||
| std::span< const Vec3 > | lights | ||
| ) |
| PlayerTorsoFrame drawPlayerTorso | ( | RendererState & | state, |
| const AnimationSlot & | slot, | ||
| const Pose & | pose, | ||
| Vec3 | pelvis, | ||
| Vec3 | bodyUp, | ||
| Vec3 | bodySide, | ||
| Vec3 | forward, | ||
| float | scale, | ||
| float | bulk, | ||
| float | objectDepth, | ||
| PlayerLod | lod, | ||
| bool | detailed, | ||
| std::size_t | kitIndex, | ||
| const KitColors & | kit | ||
| ) |
| void drawPossessionRing | ( | RendererState & | state, |
| Vec3 | root | ||
| ) |
| void drawSortedLayers | ( | RendererState & | state, |
| const MatchRenderSnapshot & | snapshot, | ||
| const MatchRenderOptions & | options, | ||
| float | alpha | ||
| ) |
| void drawStadiumFace | ( | RendererState & | state, |
| const Stadium3D::Face & | face | ||
| ) |
| void drawWorldLayers | ( | RendererState & | state, |
| const MatchRenderSnapshot & | snapshot, | ||
| const MatchRenderOptions & | options, | ||
| float | alpha | ||
| ) |
| float fitPelvisToPlantedFeet | ( | float | pelvisHeight, |
| const AnimationSlot & | slot, | ||
| Vec3 | root, | ||
| Vec3 | flatSide, | ||
| Vec3 | forward, | ||
| float | scale, | ||
| float | poseLift | ||
| ) |
| void initializeAnimationSlot | ( | RendererState & | state, |
| const MatchRenderPlayer & | player, | ||
| AnimationSlot & | slot, | ||
| Vec3 | root, | ||
| float | yaw | ||
| ) |
| float jumpTargetFor | ( | const RendererState & | state, |
| const MatchRenderPlayer & | player, | ||
| Vec3 | root, | ||
| float | scale | ||
| ) |
| Pose poseForCelebration | ( | Pose | pose, |
| GoalMood | mood, | ||
| bool | reducedMotion, | ||
| float | elapsedSeconds, | ||
| std::uint32_t | seed, | ||
| float | stride, | ||
| float | celebrationWeight | ||
| ) |
| Pose poseForKeeper | ( | Pose | pose, |
| bool | keeper, | ||
| float | setBlend, | ||
| float | diveBlend, | ||
| float | diveSide, | ||
| float | stride | ||
| ) |
| Pose poseForTimedEvent | ( | Pose | pose, |
| PlayerRig::Event | event, | ||
| float | eventTime, | ||
| float | eventWeight, | ||
| std::size_t | eventLeg | ||
| ) |
| void setCelebrationFocus | ( | MatchCameraFocus & | focus, |
| std::span< const MatchRenderPlayer > | players, | ||
| std::uint32_t | scorer, | ||
| float | alpha | ||
| ) |
| void solvePlayerLegJoints | ( | const AnimationSlot & | slot, |
| const std::array< Vec3, 2 > & | hipJoint, | ||
| const std::array< Vec3, 2 > & | ankleTarget, | ||
| const std::array< bool, 2 > & | planted, | ||
| Vec3 | forward, | ||
| Vec3 | bodyUp, | ||
| float | scale, | ||
| std::array< Vec3, 2 > & | knee, | ||
| std::array< Vec3, 2 > & | ankle, | ||
| std::array< float, 2 > & | heel | ||
| ) |
| void updateBallRotation | ( | RendererState & | state, |
| Vec3 | world, | ||
| Vec3 | moved, | ||
| float | distance, | ||
| const ScreenPoint & | screen | ||
| ) |
| void updateFootPlanting | ( | AnimationSlot & | slot, |
| Vec3 | root, | ||
| float | yaw, | ||
| float | scale, | ||
| float | cycleMetres, | ||
| float | groundSpeed, | ||
| float | simSeconds | ||
| ) |
| void updateKeeperPose | ( | RendererState & | state, |
| const MatchRenderPlayer & | player, | ||
| AnimationSlot & | slot, | ||
| Vec3 | root, | ||
| float | yaw, | ||
| float | blend | ||
| ) |
| void updateMatchSimulation | ( | RendererState & | state, |
| const MatchRenderSnapshot & | snapshot, | ||
| float | deltaSeconds, | ||
| float | alpha | ||
| ) |
| void updateMotionRates | ( | AnimationSlot & | slot, |
| float | groundSpeed, | ||
| float | yaw, | ||
| float | simSeconds | ||
| ) |
| void updateRenderCamera | ( | RendererState & | state, |
| const MatchRenderSnapshot & | snapshot, | ||
| const MatchRenderOptions & | options, | ||
| const MatchViewport & | viewport, | ||
| float | deltaSeconds, | ||
| float | alpha | ||
| ) |