Browse Source

Making the padding for orthogonal view frustums relative, to prevent integer overflows during extreme zooming.

David Piuva 2 years ago
parent
commit
2375e1abe6
1 changed files with 4 additions and 4 deletions
  1. 4 4
      Source/DFPSR/render/Camera.h

+ 4 - 4
Source/DFPSR/render/Camera.h

@@ -46,10 +46,10 @@ public:
 	// Orthogonal view frustum in camera space
 	ViewFrustum(float halfWidth, float halfHeight) : planeCount(4) {
 		// Sides
-		planes[0] = FPlane3D(FVector3D(1.0f, 0.0f, 0.0f), halfWidth + 0.1f);
-		planes[1] = FPlane3D(FVector3D(-1.0f, 0.0f, 0.0f), halfWidth + 0.1f);
-		planes[2] = FPlane3D(FVector3D(0.0f, 1.0f, 0.0f), halfHeight + 0.1f);
-		planes[3] = FPlane3D(FVector3D(0.0f, -1.0f, 0.0f), halfHeight + 0.1f);
+		planes[0] = FPlane3D(FVector3D(1.0f, 0.0f, 0.0f), halfWidth * 1.01);
+		planes[1] = FPlane3D(FVector3D(-1.0f, 0.0f, 0.0f), halfWidth * 1.01);
+		planes[2] = FPlane3D(FVector3D(0.0f, 1.0f, 0.0f), halfHeight * 1.01);
+		planes[3] = FPlane3D(FVector3D(0.0f, -1.0f, 0.0f), halfHeight * 1.01);
 	}
 	// Perspective view frustum in camera space
 	ViewFrustum(float nearClip, float farClip, float widthSlope, float heightSlope) : planeCount(6) {