MCPcopy Create free account
hub / github.com/PlotJuggler/PlotJuggler / projMatrix

Method projMatrix

pj_scene3D/core/src/camera/camera.cpp:105–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103}
104
105glm::mat4 OrbitCamera::projMatrix(float aspect) const {
106 // Decoupled adaptive near/far: near tracks the working distance (so close
107 // inspection never clips), far reaches the whole scene, ratio-capped for depth
108 // precision. OrbitCamera is always perspective, so the working distance is the
109 // orbit radius.
110 const float d = state_.radius;
111 float near_plane = 0.0f;
112 float far_plane = 0.0f;
113 adaptiveNearFar(d, sceneReach(scene_bounds_, state_.focal), near_plane, far_plane);
114 return glm::perspective(state_.fov_y, aspect, near_plane, far_plane);
115}
116
117glm::vec3 OrbitCamera::position() const {
118 return state_.focal + state_.radius * sphericalDir(state_.azimuth, state_.elevation);

Callers 5

TESTFunction · 0.80
TESTFunction · 0.80
groundPointUnderPixelFunction · 0.80
TESTFunction · 0.80
paintGLMethod · 0.80

Calls 2

adaptiveNearFarFunction · 0.85
sceneReachFunction · 0.85

Tested by 4

TESTFunction · 0.64
TESTFunction · 0.64
groundPointUnderPixelFunction · 0.64
TESTFunction · 0.64