Tiny refactoring for simplify code

pull/3/head
Hleb Valoshka 2019-11-08 00:56:26 +03:00
parent 0d5e867219
commit 08907c5883
1 changed files with 2 additions and 5 deletions

View File

@ -2500,16 +2500,13 @@ void Renderer::draw(const Observer& observer,
m_cameraOrientation = observer.getOrientationf(); m_cameraOrientation = observer.getOrientationf();
// Get the view frustum used for culling in camera space. // Get the view frustum used for culling in camera space.
float viewAspectRatio = (float) windowWidth / (float) windowHeight;
Frustum frustum(degToRad(fov), Frustum frustum(degToRad(fov),
viewAspectRatio, getAspectRatio(),
MinNearPlaneDistance); MinNearPlaneDistance);
// Get the transformed frustum, used for culling in the astrocentric coordinate // Get the transformed frustum, used for culling in the astrocentric coordinate
// system. // system.
Frustum xfrustum(degToRad(fov), Frustum xfrustum(frustum);
viewAspectRatio,
MinNearPlaneDistance);
xfrustum.transform(observer.getOrientationf().conjugate().toRotationMatrix()); xfrustum.transform(observer.getOrientationf().conjugate().toRotationMatrix());
// Set up the camera for star rendering; the units of this phase // Set up the camera for star rendering; the units of this phase