Thanks for all your answers.
Hitting a little bit of a problem in my understanding of the source code. If I
change TriangleIntersection to use Vec3d and not Vec3:
Code:
TriangleIntersection(unsigned int index, const osg::Vec3d& normal,
double r1, const osg::Vec3d* v1, double r2, const osg::Vec3d* v2, double r3,
const osg::Vec3d* v3):
_index(index),
_normal(normal),
_r1(r1),
_v1(v1),
_r2(r2),
_v2(v2),
_r3(r3),
_v3(v3) {}
I get a compilation error in LineSegmentIntersector::intersect:
Code:
osg::Vec3Array* vertices =
dynamic_cast<osg::Vec3Array*>(geometry->getVertexArray());
osg::Vec3* first = &(vertices->front());
if (triHit._v1)
{
hit.indexList.push_back(triHit._v1-first);
hit.ratioList.push_back(triHit._r1);
}
triHit._v1 is a Vec3d*, first is a Vec3*, I'm lost here as to whether
subtracting two pointers (of different type) makes sense here.
The trouble is the original vertices I get are from the vertex array of the
geometry. There's no point turning these into Vec3d's is there?
Would somebody mind shedding some light on this, while I keep looking at the
source and try to figure it out.
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=20900#20900
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org