[Pogamut-list] RayCasting Bot

cazub pogamut-forum at artemis.ms.mff.cuni.cz
Fri Oct 3 22:33:24 CEST 2008


Re: RayCasting Bot
yay! 1 problem down 1 to go! 
      Ok so adding the rays to the auto trace in an init function instead of postprepareAgent works! On top of that though the bot only functions if i put ONE command out per doLogicCycle() , for instance if i change:

if( rayDistance < 100){
     body.turnHorizontal(90);
     body.moveContinuous();
} 

TO:
if( rayDistance < 100){
   body.turnHorizontal(90);
}
else{
   body.moveContinuous();
}

---Now it the bot works with the seperate commands.
BUT i still can't get a ray to cast out with a changed elevation/pitch. when i declare a ray  with the direction triple of  (0,0,1) or (1,0,1) or (1,0,-1) i get nothing but horizontal rays, its as if the x,y parts are the only ones read, kinda makes it tough to havea bot navigate up ramps and hills :( 
body.addRayToAutoTrace(RAY_STRAIGHT_UP45, new Triple( 1, 0, 1), 100.0D, false, true); gives a ray 100 in length directly in front of me, no pitch.

----

Reply Link: <https://artemis.ms.mff.cuni.cz/pogamut/tiki-view_forum_thread.php?forumId=6&comments_reply_threadId=258&comments_parentId=243&post_reply=1#form>





More information about the Pogamut-list mailing list