[Pogamut-list] RayCasting Bot II

Daniel pogamut-forum at artemis.ms.mff.cuni.cz
Tue Mar 17 00:14:00 CET 2009


RayCasting Bot II

Author: Daniel

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