summaryrefslogtreecommitdiffstats
path: root/src/ShadowVolume.cpp
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2009-12-24 23:17:51 +0100
committerMatthias Schiffer <matthias@gamezock.de>2009-12-24 23:17:51 +0100
commitd1c909ca57b1685d8c4303d1ff9018fdb152f889 (patch)
tree3cca2c7ac48f23bcc12f334c8367a3ab38dd5e3a /src/ShadowVolume.cpp
parentc883f50f90d6f0fcfa3bee94e974ede149c35ca6 (diff)
downloadzoom++-d1c909ca57b1685d8c4303d1ff9018fdb152f889.tar
zoom++-d1c909ca57b1685d8c4303d1ff9018fdb152f889.zip
Refactored Ray
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);
}
}