MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / worldToScreen

Method worldToScreen

Source/Graphics/camera.cpp:318–330  ·  view source on GitHub ↗

Transform from world coordinates to screen coordinates

Source from the content-addressed store, hash-verified

316
317// Transform from world coordinates to screen coordinates
318vec3 Camera::worldToScreen(const vec3 point) const {
319 glm::vec3 window_pos = glm::project(glm::vec3(point.x(), point.y(), point.z()),
320 glm::make_mat4(modelview_matrix),
321 glm::make_mat4(projection_matrix),
322 glm::make_vec4(viewport));
323
324 vec3 window;
325 window.x() = window_pos.x;
326 window.y() = window_pos.y;
327 window.z() = window_pos.z;
328
329 return window;
330}
331
332float GetAspectRatio() {
333 Graphics* gi = Graphics::Instance();

Callers 2

DrawMethod · 0.80
DrawWeaponConnectionUIFunction · 0.80

Calls 5

projectFunction · 0.85
vec3Class · 0.50
xMethod · 0.45
yMethod · 0.45
zMethod · 0.45

Tested by

no test coverage detected