projects
/
MicroTrace.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
InVoxel() for all Primitives, including fix for Triangle::CalcBounds()
[MicroTrace.git]
/
Ray.cxx
diff --git
a/Ray.cxx
b/Ray.cxx
index
b7e5457
..
84617d1
100644
(file)
--- a/
Ray.cxx
+++ b/
Ray.cxx
@@
-5,15
+5,20
@@
Ray::Ray()
: m_org(Vec3f()),
m_dir(Vec3f()),
Ray::Ray()
: m_org(Vec3f()),
m_dir(Vec3f()),
+ m_level(0),
+ m_density(1.0),
m_hit(0)
{
m_t = std::numeric_limits<float>::max();
}
Ray::Ray(const Vec3f& org,
m_hit(0)
{
m_t = std::numeric_limits<float>::max();
}
Ray::Ray(const Vec3f& org,
- const Vec3f& dir)
+ const Vec3f& dir,
+ unsigned int recursion_level)
: m_org(org),
m_dir(dir),
: m_org(org),
m_dir(dir),
+ m_level(recursion_level),
+ m_density(1.0),
m_hit(0)
{
m_t = std::numeric_limits<float>::max();
m_hit(0)
{
m_t = std::numeric_limits<float>::max();
@@
-29,6
+34,8
@@
Ray::Ray(const Ray& r)
m_dir = r.m_dir;
m_t = r.m_t;
m_hit = r.m_hit;
m_dir = r.m_dir;
m_t = r.m_t;
m_hit = r.m_hit;
+ m_level = r.m_level;
+ m_density = r.m_density;
}
Ray&
}
Ray&
@@
-40,6
+47,8
@@
Ray::operator=(const Ray& r)
m_dir = r.m_dir;
m_t = r.m_t;
m_hit = r.m_hit;
m_dir = r.m_dir;
m_t = r.m_t;
m_hit = r.m_hit;
+ m_level = r.m_level;
+ m_density = r.m_density;
}
return *this;
}
}
return *this;
}
@@
-86,6
+95,12
@@
Ray::hit()
return m_hit;
}
return m_hit;
}
+void
+Ray::setHit(Primitive* p)
+{
+ m_hit = p;
+}
+
unsigned int
Ray::recursionDepth() const
{
unsigned int
Ray::recursionDepth() const
{
@@
-97,3
+112,15
@@
Ray::setRecursionDepth(unsigned int i)
{
m_level = i;
}
{
m_level = i;
}
+
+float
+Ray::indexOfRefraction() const
+{
+ return m_density;
+}
+
+void
+Ray::setIndexOfRefraction(float d)
+{
+ m_density = d;
+}
This page took
0.024846 seconds
and
4
git commands to generate.