[Pogamut-list] RayCasting Bot II

Daniel pogamut-forum at artemis.ms.mff.cuni.cz
Thu May 7 23:31:53 CEST 2009


Re: Re: RayCasting Bot II

Author: Daniel

Upss, I just found out this behaves very bad, better use what follows:

public void receiveMessage(RcvMsgEvent e) {


if (e.getMessage().type == MessageType?.AUTO_TRACE_RAY){
AutoTraceRay? autoTraceRay = (AutoTraceRay)e.getMessage();

if(autoTraceRay.getUnrealID().equalsIgnoreCase("1")){
 if( autoTraceRay.hitLocation.zero() ) sensorLeft = false;
 else sensorLeft = true;
}

if(autoTraceRay.getUnrealID().equalsIgnoreCase("2")){
 if( autoTraceRay.hitLocation.zero() ) sensorFront = false;
 else sensorFront = true;
}

if(autoTraceRay.getUnrealID().equalsIgnoreCase("3")){
 if( autoTraceRay.hitLocation.zero() ) sensorRight = false;
 else sensorRight = true;
}


}
}
 


> 
> public void receiveMessage(RcvMsgEvent e) {
> 
>         //We are looking for ray trace messages only
>         if (e.getMessage().type == MessageType.AUTO_TRACE_RAY){
>             AutoTraceRay autoTraceRay = (AutoTraceRay)e.getMessage();
> 
>             if(autoTraceRay.getUnrealID().equalsIgnoreCase("1") && !autoTraceRay.hitLocation.zero()){                
>                 sensorLeft = true;
>             }else sensorLeft = false;
>             
>             if(autoTraceRay.getUnrealID().equalsIgnoreCase("2") && !autoTraceRay.hitLocation.zero()){                
>                 sensorFront = true;
>             }else sensorFront = false;
>             
>             if(autoTraceRay.getUnrealID().equalsIgnoreCase("3") && !autoTraceRay.hitLocation.zero()){                
>                 sensorRight = true;
>             }else sensorRight = false;
> 
> 
>         }
>  }
>





More information about the Pogamut-list mailing list