fix annoying win32 template static member linkage errors
parent
f2f4f94bdf
commit
e394456621
|
@ -41,7 +41,7 @@ class InstanceManager;
|
|||
class InterpolatedSpectrum;
|
||||
class LocalWorker;
|
||||
class Logger;
|
||||
class Matrix4x4;
|
||||
struct Matrix4x4;
|
||||
class MemoryStream;
|
||||
class Mutex;
|
||||
class NetworkedObject;
|
||||
|
|
|
@ -61,6 +61,7 @@ MTS_NAMESPACE_BEGIN
|
|||
*
|
||||
* \sa GenericKDTree
|
||||
*/
|
||||
|
||||
class MTS_EXPORT_RENDER KDTree : public GenericKDTree<AABB, KDTree> {
|
||||
friend class GenericKDTree<AABB, KDTree>;
|
||||
friend class Instance;
|
||||
|
@ -353,6 +354,37 @@ protected:
|
|||
}
|
||||
}
|
||||
|
||||
/// Plain shadow ray query (used by the 'instance' plugin)
|
||||
inline bool rayIntersect(const Ray &ray, Float _mint, Float _maxt) const {
|
||||
Float mint, maxt, tempT = std::numeric_limits<Float>::infinity();
|
||||
if (m_aabb.rayIntersect(ray, mint, maxt)) {
|
||||
if (_mint > mint) mint = _mint;
|
||||
if (_maxt < maxt) maxt = _maxt;
|
||||
|
||||
if (EXPECT_TAKEN(maxt > mint)) {
|
||||
if (rayIntersectHavran<true>(ray, mint, maxt, tempT, NULL))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// Plain intersection query (used by the 'instance' plugin)
|
||||
inline bool rayIntersect(const Ray &ray, Float _mint, Float _maxt, Float &t, void *temp) const {
|
||||
Float mint, maxt, tempT = std::numeric_limits<Float>::infinity();
|
||||
if (m_aabb.rayIntersect(ray, mint, maxt)) {
|
||||
if (_mint > mint) mint = _mint;
|
||||
if (_maxt < maxt) maxt = _maxt;
|
||||
|
||||
if (EXPECT_TAKEN(maxt > mint)) {
|
||||
if (rayIntersectHavran<false>(ray, mint, maxt, tempT, temp)) {
|
||||
t = tempT;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// Virtual destructor
|
||||
virtual ~KDTree();
|
||||
|
|
|
@ -68,43 +68,19 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
bool rayIntersect(const Ray &_ray, Float _mint,
|
||||
Float _maxt, Float &t, void *temp) const {
|
||||
bool rayIntersect(const Ray &_ray, Float mint,
|
||||
Float maxt, Float &t, void *temp) const {
|
||||
const KDTree *kdtree = m_shapeGroup->getKDTree();
|
||||
Ray ray;
|
||||
m_worldToObject(_ray, ray);
|
||||
Float mint, maxt, tempT = std::numeric_limits<Float>::infinity();
|
||||
|
||||
if (kdtree->m_aabb.rayIntersect(ray, mint, maxt)) {
|
||||
if (_mint > mint) mint = _mint;
|
||||
if (_maxt < maxt) maxt = _maxt;
|
||||
|
||||
if (EXPECT_TAKEN(maxt > mint)) {
|
||||
if (kdtree->rayIntersectHavran<false>(ray, mint, maxt, tempT, temp)) {
|
||||
t = tempT;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return kdtree->rayIntersect(ray, mint, maxt, t, temp);
|
||||
}
|
||||
|
||||
bool rayIntersect(const Ray &_ray, Float _mint, Float _maxt) const {
|
||||
bool rayIntersect(const Ray &_ray, Float mint, Float maxt) const {
|
||||
const KDTree *kdtree = m_shapeGroup->getKDTree();
|
||||
Ray ray;
|
||||
m_worldToObject(_ray, ray);
|
||||
Float mint, maxt, tempT = std::numeric_limits<Float>::infinity();
|
||||
|
||||
if (kdtree->m_aabb.rayIntersect(ray, mint, maxt)) {
|
||||
if (_mint > mint) mint = _mint;
|
||||
if (_maxt < maxt) maxt = _maxt;
|
||||
|
||||
if (EXPECT_TAKEN(maxt > mint)) {
|
||||
if (kdtree->rayIntersectHavran<true>(ray, mint, maxt, tempT, NULL))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return kdtree->rayIntersect(ray, mint, maxt);
|
||||
}
|
||||
|
||||
void fillIntersectionRecord(const Ray &ray,
|
||||
|
|
Loading…
Reference in New Issue