aboutsummaryrefslogtreecommitdiff
path: root/src/client/shadows/dynamicshadows.h
diff options
context:
space:
mode:
authorElias Fleckenstein <eliasfleckenstein@web.de>2022-05-17 22:12:00 +0200
committerElias Fleckenstein <eliasfleckenstein@web.de>2022-05-17 22:12:00 +0200
commit21df26984da91143c15587f5a03c98d68c3adc4e (patch)
treeaaa707a628ad331f67890023dffe1b4f60dd01d3 /src/client/shadows/dynamicshadows.h
parentb09fc5de5cdb021f43ad32b7e3f50dc75c0bc622 (diff)
parenteabf05758e3ba5f6f4bb1b8d1d1f02179b84e410 (diff)
downloaddragonfireclient-21df26984da91143c15587f5a03c98d68c3adc4e.tar.xz
Merge branch 'master' of https://github.com/minetest/minetest
Diffstat (limited to 'src/client/shadows/dynamicshadows.h')
-rw-r--r--src/client/shadows/dynamicshadows.h21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/client/shadows/dynamicshadows.h b/src/client/shadows/dynamicshadows.h
index d8be66be8..6e9d96b15 100644
--- a/src/client/shadows/dynamicshadows.h
+++ b/src/client/shadows/dynamicshadows.h
@@ -22,18 +22,21 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "irrlichttypes_bloated.h"
#include <matrix4.h>
#include "util/basic_macros.h"
+#include "constants.h"
class Camera;
class Client;
struct shadowFrustum
{
- float zNear{0.0f};
- float zFar{0.0f};
- float length{0.0f};
+ f32 zNear{0.0f};
+ f32 zFar{0.0f};
+ f32 length{0.0f};
+ f32 radius{0.0f};
core::matrix4 ProjOrthMat;
core::matrix4 ViewMat;
v3f position;
+ v3f player;
v3s16 camera_offset;
};
@@ -56,6 +59,8 @@ public:
return direction;
};
v3f getPosition() const;
+ v3f getPlayerPos() const;
+ v3f getFuturePlayerPos() const;
/// Gets the light's matrices.
const core::matrix4 &getViewMatrix() const;
@@ -64,10 +69,16 @@ public:
const core::matrix4 &getFutureProjectionMatrix() const;
core::matrix4 getViewProjMatrix();
- /// Gets the light's far value.
+ /// Gets the light's maximum far value, i.e. the shadow boundary
f32 getMaxFarValue() const
{
- return farPlane;
+ return farPlane * BS;
+ }
+
+ /// Gets the current far value of the light
+ f32 getFarValue() const
+ {
+ return shadow_frustum.zFar;
}