CView (camera class)
The culling systems for the forest, grass, shadow, and notional terrain systems all use the CView class to communicate information about a camera.
Read time 2 minutesLast updated 2 hours ago
CViewCViewCView::Set()st_bool CView::Set(const Vec3& vCameraPos, const Mat4x4& mProjection, const Mat4x4& mModelview, st_float32 fNearClip, st_float32 fFarClip);
CView::Set()In addition to the user-supplied values, the derived values that can be queried include:
- Camera direction
- Composite matrix (modelview * projection matrices)
- Composite matrix with no translation element
- Camera azimuth and pitch
- Eight points defining the view frustum's geometry
- Six planes defining the frustum
- Axis-aligned bounding box of the frustum's geometry
Level of detail (LOD) reference point
The LOD reference point is the point used for all LOD calculations in the forest culling system. It defaults to the camera's position, but in the case of shadow rendering, it is helpful for these to be separate values. Specifically, during shadow map rendering, the light's position is camera position and the main camera is used as the LOD reference point to ensure that the tree's shadows cast with the same LOD that they were rendered with in the main view.
The LOD reference point must be specifically given through , otherwise will simply return the camera's position.
CView::SetLodRefPoint()CView::GetLodRefPoint()