summaryrefslogtreecommitdiffstats
path: root/src/ShadowVolume.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ShadowVolume.cpp')
-rw-r--r--src/ShadowVolume.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/ShadowVolume.cpp b/src/ShadowVolume.cpp
index 27aba6e..ed0cd76 100644
--- a/src/ShadowVolume.cpp
+++ b/src/ShadowVolume.cpp
@@ -27,10 +27,6 @@ namespace Zoom {
ShadowVolume::ShadowVolume(const Triangle &t, const vmml::vec3f &lightPos) : visible(true) {
MathUtil::Plane trianglePlane(t);
- for(int i = 0; i < 3; ++i) {
- rays[i].p = t.getVertex(i);
- }
-
if(!trianglePlane.isBehind(lightPos)) {
visible = false;
@@ -38,7 +34,7 @@ ShadowVolume::ShadowVolume(const Triangle &t, const vmml::vec3f &lightPos) : vis
}
for(int i = 0; i < 3; ++i) {
- rays[i].dir = rays[i].p - lightPos;
+ rays[i] = MathUtil::Ray(t.getVertex(i), t.getVertex(i) - lightPos);
}
}