Hello Garry,

Carsten Neumann wrote:
Garry Hoberg wrote:
Am Mittwoch, 12. November 2008 00:18:54 schrieb Carsten Neumann:
        Hello Garry,

Garry Hoberg wrote:
I have the same problem as Telmo. The WalkNavigator "walks" me into a
wall and then gets stuck (it can still turn but not "walk" any more; I
only noticed actually being inside the wall after setting the near
clipping plane to 0.0001 and turning 90 degrees). In my case the
collision model and the drawn one are the same nodes.

Large values didn't change anything. To me it seems like either the
_wallDistance, _fatness and _width properites are collectively ignored or
the IntersectAction's _hitT property value is set or returned falsely.
well, not quite, but the ray shot into the scene was aimed in the wrong
direction and as it turns out from the old position not the one the user
tries to move to (which made it impossible to just go backwards to get
away from a wall) -- why did I never see this when looking at the code
earlier, arghh

I'm confused. mv is still calculated the same, isn't it?.

right, the calculation of mv is unchanged.

Before, the ray was shot from the old position towards the new one in mv direction.

the Line constructor in use here takes a point and a vector, i.e. a starting point and a direction ...

Now the ray is shot from the new position towards the old one in -mv direction.

... and since that direction is now -mv, the ray points in the opposite direction, which is the one the user actually wants to move in ;)

alright, the above was only true if the user moved forward (step > 0), for backwards movement the ray was still/again in the wrong direction, which should be fixed by the attached patch.
Hope I got it finally right this time ;)

        regards,
                Carsten

Index: Source/System/Window/OSGWalkNavigator.cpp
===================================================================
RCS file: /cvsroot/opensg/OpenSG/Source/System/Window/OSGWalkNavigator.cpp,v
retrieving revision 1.8
diff -u -r1.8 OSGWalkNavigator.cpp
--- Source/System/Window/OSGWalkNavigator.cpp	11 Nov 2008 23:15:46 -0000	1.8
+++ Source/System/Window/OSGWalkNavigator.cpp	12 Nov 2008 17:54:35 -0000
@@ -168,7 +168,7 @@
 
     //finally check if the move is correct or not
 
-    line.setValue(rFrom, -mv);
+    line.setValue(rFrom, (rFrom - _rFrom));
     _act->setLine(line  );
     _act->apply  (_world);
 
@@ -234,7 +234,7 @@
 
     //finally check if the move is correct or not
 
-    line.setValue(rFrom, sv);
+    line.setValue(rFrom, (rFrom - _rFrom));
     _act->setLine(line  );
     _act->apply  (_world);
 
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to