diff options
author | Juan Linietsky <reduzio@gmail.com> | 2016-12-04 12:45:30 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2016-12-04 12:45:30 -0300 |
commit | a299c3ebf1ceb3ce108526b3e134e82e5bf4413b (patch) | |
tree | f62ea61a7245d83caadc8c6c84d82e129ef240cf /core/math/camera_matrix.cpp | |
parent | 27a46d78ec43b69a70a1d84c540353e3cb3b04c0 (diff) | |
download | redot-engine-a299c3ebf1ceb3ce108526b3e134e82e5bf4413b.tar.gz |
Support for SSAO
Diffstat (limited to 'core/math/camera_matrix.cpp')
-rw-r--r-- | core/math/camera_matrix.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/core/math/camera_matrix.cpp b/core/math/camera_matrix.cpp index 3e3cd1af4f..fc35908fa3 100644 --- a/core/math/camera_matrix.cpp +++ b/core/math/camera_matrix.cpp @@ -534,6 +534,15 @@ float CameraMatrix::get_aspect() const { return w/h; } +int CameraMatrix::get_pixels_per_meter(int p_for_pixel_width) const { + + + Vector3 result = xform(Vector3(1,0,-1)); + + return int((result.x * 0.5 + 0.5) * p_for_pixel_width); + +} + float CameraMatrix::get_fov() const { const float * matrix = (const float*)this->matrix; |