History

use radians instead of degrees (almost) everywhere

Andrew Meadows committed 12 years ago

Commit aa8c2fc1 parent de8165c51 files · +302 −306Browse files

Showing the changes to interface/src/Stars.cpp (1 of 51 files). Show all

Unified · Split

interface/src/Stars.cpp+1−2
@@ -30,9 +30,8 @@ bool Stars::setResolution(unsigned k) { · 29 unmodified lines
30}30}
31 31
32void Stars::render(float fovY, float aspect, float nearZ, float alpha) {32void Stars::render(float fovY, float aspect, float nearZ, float alpha) {
33
34 // determine length of screen diagonal from quadrant height and aspect ratio33 // determine length of screen diagonal from quadrant height and aspect ratio
35 float quadrantHeight = nearZ * tan(angleConvert<Degrees,Radians>(fovY) * 0.5f);34 float quadrantHeight = nearZ * tan(RADIANS_PER_DEGREE * fovY * 0.5f);
36 float halfDiagonal = sqrt(quadrantHeight * quadrantHeight * (1.0f + aspect * aspect));35 float halfDiagonal = sqrt(quadrantHeight * quadrantHeight * (1.0f + aspect * aspect));
37 36
38 // determine fov angle in respect to the diagonal37 // determine fov angle in respect to the diagonal

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t