|
| constexpr float | dot (Vec3 a, Vec3 b) |
| |
| constexpr Vec3 | cross (Vec3 a, Vec3 b) |
| |
| float | length (Vec3 a) |
| |
| Vec3 | normalize (Vec3 a) |
| |
| constexpr Vec3 | lerp (Vec3 a, Vec3 b, float t) |
| |
| Mat4 | lookAt (Vec3 eye, Vec3 target, Vec3 up) |
| |
| Mat4 | perspective (float verticalFovRadians, float aspect, float nearPlane, float farPlane) |
| |
| template<typename Vertex , typename WOf , typename Interpolate > |
| std::size_t | clipConvexToNearPlane (std::span< const Vertex > input, std::span< Vertex > output, float nearPlane, WOf wOf, Interpolate interpolate) |
| |
| constexpr Vec4 | lerp (Vec4 a, Vec4 b, float t) |
| |
| std::size_t | clipPolygonToNearPlane (std::span< const Vec4 > input, std::span< Vec4 > output, float nearPlane) |
| |
| float | wrapAngle (float angle) |
| |
| float | lerpAngle (float from, float to, float t) |
| |
| float | dampingFactor (float ratePerSecond, float deltaSeconds) |
| |
| constexpr Vec3 | worldFromPitch (Vector2F normalized, float heightMetres=0.0f) |
| |
| float | worldYawFromFacing (float facingAngle) |
| |
Minimal 3D math used by the software-projected match renderer.
World space is metric and right-handed: x runs along the pitch length (0..105 m, home attacks +x), y across its width (0..68 m, y = 0 is the near touchline of the broadcast camera) and z points up. Nothing here depends on ImGui, so the projection and clipping rules are unit-testable headless.
template<typename Vertex , typename WOf , typename Interpolate >
| std::size_t RenderMath::clipConvexToNearPlane |
( |
std::span< const Vertex > |
input, |
|
|
std::span< Vertex > |
output, |
|
|
float |
nearPlane, |
|
|
WOf |
wOf, |
|
|
Interpolate |
interpolate |
|
) |
| |
Clips a convex polygon against the near plane (w >= nearPlane) using Sutherland-Hodgman in homogeneous clip space. wOf(vertex) returns the clip-space w and interpolate(a, b, t) blends two vertices (including any attributes). output needs room for input.size() + 1 vertices. Returns the number of vertices written (0 when entirely behind the camera).