12 #ifndef hifi_workload_View_h
13 #define hifi_workload_View_h
17 #include <glm/glm.hpp>
18 #include <glm/gtc/constants.hpp>
26 using Sphere = glm::vec4;
31 View(
const View& view) =
default;
36 glm::vec3 direction{ 0.0f, 0.0f, -1.0f };
39 float maxRadius{ FLT_MAX };
42 glm::vec4 fov_halfAngle_tan_cos_sin { glm::quarter_pi<float>(), 1.0f, glm::root_two<float>() * 0.5f, glm::root_two<float>() * 0.5f};
45 glm::vec3 origin{ 0.0f };
48 float originRadius{ 0.5f };
51 glm::vec2 regionBackFronts[Region::NUM_TRACKED_REGIONS];
54 Sphere regions[Region::NUM_TRACKED_REGIONS];
57 void setFov(
float angleRad);
60 void makeHorizontal();
62 static View evalFromFrustum(
const ViewFrustum& frustum,
const glm::vec3& offset = glm::vec3());
63 static Sphere evalRegionSphere(
const View& view,
float originRadius,
float maxDistance);
65 static void updateRegionsDefault(View& view);
66 static void updateRegionsFromBackFronts(View& view);
67 static void updateRegionsFromBackFrontDistances(View& view,
const float* configDistances);
70 using Views = std::vector<View>;