|
Player12
An open source football management simulator
|
#include <match_render_math.h>
Public Member Functions | |
| Vec4 | toClip (Vec3 point) const |
| ScreenPoint | clipToScreen (Vec4 clip) const |
| bool | project (Vec3 point, ScreenPoint &out) const |
| float | depth (Vec3 point) const |
| Vec3 | rayThrough (float pixelX, float pixelY) const |
| bool | groundPointAt (float pixelX, float pixelY, Vec3 &out, float planeHeight=0.0f) const |
Static Public Member Functions | |
| static Projection | make (Vec3 eye, Vec3 target, float verticalFovRadians, float nearPlane, float farPlane, ScreenRect rect) |
Public Attributes | |
| Mat4 | viewProjection = Mat4::identity() |
| Vec3 | eye |
| Vec3 | forward {0.0f, 1.0f, 0.0f} |
| Vec3 | side {1.0f, 0.0f, 0.0f} |
| Vec3 | up {0.0f, 0.0f, 1.0f} |
| ScreenRect | rect |
| float | nearPlane = 0.5f |
| float | focalPixels = 1.0f |
Everything needed to project world points for one frame.
|
inline |
Converts a clip-space point with w >= nearPlane to pixels.
|
inline |
|
inline |
Intersects the ray through a pixel with the horizontal plane at planeHeight; false when the ray points away from it (sky pixels).
|
inlinestatic |
|
inline |
Projects a point; returns false when it lies behind the near plane.
|
inline |
World-space direction (not normalised) of the ray through a pixel.
| Vec3 RenderMath::Projection::eye |
| float RenderMath::Projection::focalPixels = 1.0f |
Pixels per metre at one metre depth (for sizing billboards).
| Vec3 RenderMath::Projection::forward {0.0f, 1.0f, 0.0f} |
| float RenderMath::Projection::nearPlane = 0.5f |
| ScreenRect RenderMath::Projection::rect |
| Vec3 RenderMath::Projection::side {1.0f, 0.0f, 0.0f} |
Camera right and up axes in world space (for un-projecting).
| Vec3 RenderMath::Projection::up {0.0f, 0.0f, 1.0f} |
| Mat4 RenderMath::Projection::viewProjection = Mat4::identity() |