Changeset View
Changeset View
Standalone View
Standalone View
source/graphics/tests/test_Camera.h
Show First 20 Lines • Show All 158 Lines • ▼ Show 20 Lines | void test_persepctive_plane_points() | ||||
// Zero distance point is the origin of all camera rays, | // Zero distance point is the origin of all camera rays, | ||||
// so all plane points should be stay there. | // so all plane points should be stay there. | ||||
camera.GetViewQuad(0.0f, quad); | camera.GetViewQuad(0.0f, quad); | ||||
for (const CVector3D& point : quad) | for (const CVector3D& point : quad) | ||||
TS_ASSERT_EQUALS(point, CVector3D(0.0f, 0.0f, 0.0f)); | TS_ASSERT_EQUALS(point, CVector3D(0.0f, 0.0f, 0.0f)); | ||||
// Points lying on the far plane. | // Points lying on the far plane. | ||||
CCamera::Quad expectedFarQuad = { | CCamera::Quad expectedFarQuad = { { | ||||
CVector3D(-101.0f, -101.0f, 101.0f), | CVector3D(-101.0f, -101.0f, 101.0f), | ||||
CVector3D(101.0f, -101.0f, 101.0f), | CVector3D(101.0f, -101.0f, 101.0f), | ||||
CVector3D(101.0f, 101.0f, 101.0f), | CVector3D(101.0f, 101.0f, 101.0f), | ||||
CVector3D(-101.0f, 101.0f, 101.0f) | CVector3D(-101.0f, 101.0f, 101.0f) | ||||
}; | } }; | ||||
camera.GetViewQuad(camera.GetFarPlane(), quad); | camera.GetViewQuad(camera.GetFarPlane(), quad); | ||||
CompareQuads(quad, expectedFarQuad); | CompareQuads(quad, expectedFarQuad); | ||||
} | } | ||||
}; | }; |
Wildfire Games · Phabricator