[Pogamut-list] RayCasting Bot II
michal.bida
pogamut-forum at artemis.ms.mff.cuni.cz
Wed Mar 18 01:05:05 CET 2009
Re: RayCasting Bot II
Author: michal.bida
It should return true if it hits someting (ray is red) and false if the ray did not hit anything (ray is green).
michal
> Hi!
>
> Im trying to work RayCasting out. I took the RayCasting bot and its class RayTraces, so, I define the ray:
>
> FRONT_HOLE(5, new Triple(1, 0, -1), 100) //I want to detect holes
>
> I create the class RayCasting traces = new RayCasting();
>
> In postPrepareAgent() I call traces.botInit();
>
> Back in the doLogic():
> Map rays = traces.getTraceSnapshot();
> if (rays.get(Ray.FRONT_HOLE.getId()).result) { this.log.log(Level.INFO,"Watch out!! hole!");
> }
>
> But the if condition always give me false...:S
>
> How it is suppose to work? If the ray is green returns true?, and if it touches something and comming red, returns false? or is the other way around? is the .result suppose to return that boolean?
>
> Thanks a lot!
>
> Dani.
More information about the Pogamut-list
mailing list