Added the beginnings of a new osgforest example.
Added support into osg::TriangleFunctor for specifying whether the vertices being generates are temporary or not.
This commit is contained in:
@@ -369,7 +369,7 @@ struct TriangleIntersect
|
||||
}
|
||||
|
||||
// bool intersect(const Vec3& v1,const Vec3& v2,const Vec3& v3,float& r)
|
||||
inline void operator () (const Vec3& v1,const Vec3& v2,const Vec3& v3)
|
||||
inline void operator () (const Vec3& v1,const Vec3& v2,const Vec3& v3, bool treatVertexDataAsTemporary)
|
||||
{
|
||||
++_index;
|
||||
|
||||
@@ -465,8 +465,15 @@ struct TriangleIntersect
|
||||
osg::notify(WARN)<<" ("<<r1<<",\t"<<r2<<",\t"<<r3<<")"<<std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
_thl.insert(std::pair<const float,TriangleHit>(r,TriangleHit(_index-1,normal,r1,&v1,r2,&v2,r3,&v3)));
|
||||
|
||||
if (treatVertexDataAsTemporary)
|
||||
{
|
||||
_thl.insert(std::pair<const float,TriangleHit>(r,TriangleHit(_index-1,normal,r1,0,r2,0,r3,0)));
|
||||
}
|
||||
else
|
||||
{
|
||||
_thl.insert(std::pair<const float,TriangleHit>(r,TriangleHit(_index-1,normal,r1,&v1,r2,&v2,r3,&v3)));
|
||||
}
|
||||
_hit = true;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user