MCPcopy Index your code
hub / github.com/HandmadeMath/HandmadeMath / HMM_Orthographic_RH_NO

Function HMM_Orthographic_RH_NO

HandmadeMath.h:1708–1724  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1706// Left, Right, Bottom, and Top specify the coordinates of their respective clipping planes.
1707// Near and Far specify the distances to the near and far clipping planes.
1708static inline HMM_Mat4 HMM_Orthographic_RH_NO(float Left, float Right, float Bottom, float Top, float Near, float Far)
1709{
1710 ASSERT_COVERED(HMM_Orthographic_RH_NO);
1711
1712 HMM_Mat4 Result = {0};
1713
1714 Result.Elements[0][0] = 2.0f / (Right - Left);
1715 Result.Elements[1][1] = 2.0f / (Top - Bottom);
1716 Result.Elements[2][2] = 2.0f / (Near - Far);
1717 Result.Elements[3][3] = 1.0f;
1718
1719 Result.Elements[3][0] = (Left + Right) / (Left - Right);
1720 Result.Elements[3][1] = (Bottom + Top) / (Bottom - Top);
1721 Result.Elements[3][2] = (Near + Far) / (Near - Far);
1722
1723 return Result;
1724}
1725
1726COVERAGE(HMM_Orthographic_RH_ZO, 1)
1727// Produces a right-handed orthographic projection matrix with Z ranging from 0 to 1 (the DirectX convention).

Callers 3

HMM_Orthographic_LH_NOFunction · 0.85
TESTFunction · 0.85
TESTFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected