VisPro  1.0
Project of Visualisierung 2
ViewFrustum.h
1 #pragma once
2 #include "glm.hpp"
3 #include "BoundingBox.h"
4 #include <iostream>
5 
6 
7 class ViewFrustum{
8 public:
9  ViewFrustum();
10  ~ViewFrustum();
11  void defineCamera(float& nearDist, float& farDist, float& fieldOfView, float& ratio);
12  void calcFrustum(glm::mat4& modelViewMat);
13  bool ViewFrustum::isCullable(BoundingBox* b);
14 
16  public:
19  void init(glm::vec3 a, glm::vec3 b, glm::vec3 c);
20  bool isOutside(glm::vec3 point);
21  private:
22  glm::vec3 normalvector;
23  float d; // ax+by+cz+d = 0
24  };
25 
26 private:
27  float fov;
28  float rat;
29  glm::vec3 camPos;
30  glm::vec3 camViewRayNormalized;
31  float near_Dist;
32  float far_Dist;
33  float near_Height;
34  float near_Width;
35  float far_Height;
36  float far_Width;
37  glm::vec3 up;
38  glm::vec3 right;
39 
40  //0:near, 1:right, 2:far, 3:left, 4:top, 5:bottom
41  ViewFrustumPlane clipping_planes[6];
42 
43  void ViewFrustum::createPlanes();
44 
45 
46 
47 };
Definition: ViewFrustum.h:7
Definition: BoundingBox.h:4
Definition: ViewFrustum.h:15