Hi Vince,
On Thu, 2004-11-11 at 11:58, Ace Bluedust wrote:
> Hi all,
>
> Is it possible to change the value of "maxdist" in the setline fonction of an
> IntersectAction when I do a ray
> intersection? When I changed it, it doesnt seem to change the distance and I
> still hit objects that are far away.
> Seems that the value stays at "Infinite" the default value... I want to only
> get the objects that are within a
> distance from the start of my ray.
>
> void IntersectAction::setLine
> (
> const Line &
> line,
> const Real32
> maxdist = Inf)
>
> Any advice on this? thanks
Yup. Thanks for the bugreport. ;)
The fix is trivial:
diff -u -3 -p -r1.3 OSGIntersectAction.cpp
--- OSGIntersectAction.cpp 11 Nov 2002 13:55:40 -0000 1.3
+++ OSGIntersectAction.cpp 13 Nov 2004 18:36:38 -0000
@@ -249,7 +249,7 @@ Action::ResultE IntersectAction::setEnt
void IntersectAction::setHit( Real32 t, NodePtr obj, Int32 triIndex,
Vec3f &normal )
{
- if ( t < 0 || t > _hitT )
+ if ( t < 0 || t > _hitT || t > _maxdist)
return;
_hitT = t;
Thanks
Dirk
-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE
FREE OODBMS DOWNLOAD - A multidimensional database that combines
robust object and relational technologies, making it a perfect match
for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users