[Pogamut-list] Raycasting problem

fireball787b pogamut-forum at diana.ms.mff.cuni.cz
Sun Dec 2 14:38:40 CET 2012


Re: Raycasting problem

Author: fireball787b

hi! sorry for not answering before! i've been really busy to take a look at the raycasting problem.
i've checked what you said and here's the results:

1) ok
2) yes, i see the rays in the environment and they change their colour when they collide with a wall
3) this is what i can see in the log:
(SmartBot)  [WARNING] 14:28:45.100                        State MSG_ATR unprocessed: .
(SmartBot)  [WARNING] 14:28:45.100                        State MSG_ATR unprocessed: }
Ray: InfoMessage[AutoTraceRayMessage][Id = WorldObjectId[down45Ray] | From = [1249.86; 485.18; -78.15] | To = [1426.62; 487.83; -254.93] | FastTrace = false | FloorCorrection = false | Result = false | HitNormal = (0.0, 0.0, 1.0) | HitLocation = [1299.35; 485.92; -127.65] | TraceActors = false | HitId = WorldObjectId[DM-TrainingDay.LevelInfo0] | ][Id = WorldObjectId[down45Ray] | From = [1249.86; 485.18; -78.15] | To = [1426.62; 487.83; -254.93] | FastTrace = false | FloorCorrection = false | Result = false | HitNormal = (0.0, 0.0, 1.0) | HitLocation = [1299.35; 485.92; -127.65] | TraceActors = false | HitId = WorldObjectId[DM-TrainingDay.LevelInfo0] | ]
Ray: InfoMessage[AutoTraceRayMessage][Id = WorldObjectId[up45Ray] | From = [1249.86; 485.18; -78.15] | To = [1426.69; 487.83; 98.56] | FastTrace = false | FloorCorrection = false | Result = false | HitNormal = (0.0, 0.0, 0.0) | HitLocation = [0.00; 0.00; 0.00] | TraceActors = false | HitId = WorldObjectId[None] | ][Id = WorldObjectId[up45Ray] | From = [1249.86; 485.18; -78.15] | To = [1426.69; 487.83; 98.56] | FastTrace = false | FloorCorrection = false | Result = false | HitNormal = (0.0, 0.0, 0.0) | HitLocation = [0.00; 0.00; 0.00] | TraceActors = false | HitId = WorldObjectId[None] | ]
Ray: InfoMessage[AutoTraceRayMessage][Id = WorldObjectId[right90Ray] | From = [1249.86; 485.18; -78.15] | To = [1246.12; 735.15; -78.15] | FastTrace = false | FloorCorrection = false | Result = false | HitNormal = (0.0, -1.0, 0.0) | HitLocation = [1246.60; 703.50; -78.15] | TraceActors = false | HitId = WorldObjectId[DM-TrainingDay.LevelInfo0] | ][Id = WorldObjectId[right90Ray] | From = [1249.86; 485.18; -78.15] | To = [1246.12; 735.15; -78.15] | FastTrace = false | FloorCorrection = false | Result = false | HitNormal = (0.0, -1.0, 0.0) | HitLocation = [1246.60; 703.50; -78.15] | TraceActors = false | HitId = WorldObjectId[DM-TrainingDay.LevelInfo0] | ]
Ray: InfoMessage[AutoTraceRayMessage][Id = WorldObjectId[left90Ray] | From = [1249.86; 485.18; -78.15] | To = [1253.70; 235.21; -78.15] | FastTrace = false | FloorCorrection = false | Result = false | HitNormal = (0.0, 0.0, 0.0) | HitLocation = [0.00; 0.00; 0.00] | TraceActors = false | HitId = WorldObjectId[None] | ][Id = WorldObjectId[left90Ray] | From = [1249.86; 485.18; -78.15] | To = [1253.70; 235.21; -78.15] | FastTrace = false | FloorCorrection = false | Result = false | HitNormal = (0.0, 0.0, 0.0) | HitLocation = [0.00; 0.00; 0.00] | TraceActors = false | HitId = WorldObjectId[None] | ]
Ray: InfoMessage[AutoTraceRayMessage][Id = WorldObjectId[right45Ray] | From = [1249.86; 485.18; -78.15] | To = [1423.98; 664.58; -78.15] | FastTrace = false | FloorCorrection = false | Result = false | HitNormal = (0.0, 0.0, 0.0) | HitLocation = [0.00; 0.00; 0.00] | TraceActors = false | HitId = WorldObjectId[None] | ][Id = WorldObjectId[right45Ray] | From = [1249.86; 485.18; -78.15] | To = [1423.98; 664.58; -78.15] | FastTrace = false | FloorCorrection = false | Result = false | HitNormal = (0.0, 0.0, 0.0) | HitLocation = [0.00; 0.00; 0.00] | TraceActors = false | HitId = WorldObjectId[None] | ]
Ray: InfoMessage[AutoTraceRayMessage][Id = WorldObjectId[left45Ray] | From = [1249.86; 485.18; -78.15] | To = [1429.33; 311.14; -78.15] | FastTrace = false | FloorCorrection = false | Result = false | HitNormal = (0.0, 0.0, 0.0) | HitLocation = [0.00; 0.00; 0.00] | TraceActors = false | HitId = WorldObjectId[None] | ][Id = WorldObjectId[left45Ray] | From = [1249.86; 485.18; -78.15] | To = [1429.33; 311.14; -78.15] | FastTrace = false | FloorCorrection = false | Result = false | HitNormal = (0.0, 0.0, 0.0) | HitLocation = [0.00; 0.00; 0.00] | TraceActors = false | HitId = WorldObjectId[None] | ]
Ray: InfoMessage[AutoTraceRayMessage][Id = WorldObjectId[frontRay] | From = [1249.86; 485.18; -78.15] | To = [1499.83; 488.92; -78.15] | FastTrace = false | FloorCorrection = false | Result = false | HitNormal = (0.0, 0.0, 0.0) | HitLocation = [0.00; 0.00; 0.00] | TraceActors = false | HitId = WorldObjectId[None] | ][Id = WorldObjectId[frontRay] | From = [1249.86; 485.18; -78.15] | To = [1499.83; 488.92; -78.15] | FastTrace = false | FloorCorrection = false | Result = false | HitNormal = (0.0, 0.0, 0.0) | HitLocation = [0.00; 0.00; 0.00] | TraceActors = false | HitId = WorldObjectId[None] | ]
(SmartBot)  [WARNING] 14:28:45.105                        State MSG_NAV unprocessed: {
(SmartBot)  [WARNING] 14:28:45.105                        State MSG_NAV unprocessed: I
(SmartBot)  [WARNING] 14:28:45.105                        State MSG_NAV unprocessed: t
(SmartBot)  [WARNING] 14:28:45.105                        State MSG_NAV unprocessed: e
(SmartBot)  [WARNING] 14:28:45.106                        State MSG_NAV unprocessed: m

4) i've this in the botInitialized

//listener para cuando los rayos son inicializados en el UT

final int rayLength = (int) (UnrealUtils.CHARACTER_COLLISION_RADIUS * radio);
        
         // configuracion de los rayos
        boolean fastTrace = false;        // NI IDEA
        boolean floorCorrection = false; // devuelve el angulo en caso de estar en un piso desigual
        boolean traceActor = false;      // si el rayo colisiona con otros bots/jugadores
        
        //1. eliminamos todos los rayos
         getAct().act(new RemoveRay("All"));
       
         
         
         //2. cremos los rayos
        raycasting.createRay(FRONT,   new Vector3d(1, 0, 0), rayLength, fastTrace, floorCorrection, traceActor);
        raycasting.createRay(LEFT45,  new Vector3d(1, -1, 0), rayLength, fastTrace, floorCorrection, traceActor);
        raycasting.createRay(RIGHT45, new Vector3d(1, 1, 0), rayLength, fastTrace, floorCorrection, traceActor);
        raycasting.createRay(LEFT90,  new Vector3d(0, -1, 0), rayLength, fastTrace, floorCorrection, traceActor);
        raycasting.createRay(RIGHT90, new Vector3d(0, 1, 0), rayLength, fastTrace, floorCorrection, traceActor);
        raycasting.createRay(UP45, new Vector3d(1, 0, 1), rayLength, fastTrace, floorCorrection, traceActor);
        raycasting.createRay(DOWN45, new Vector3d(1, 0, -1), rayLength, fastTrace, floorCorrection, traceActor);
        raycasting.getAllRaysInitialized().addListener(new FlagListener() {

            
            @Override
            public void flagChanged(Boolean changedValue) {
                // once all rays were initialized store the AutoTraceRay objects
                // that will come in response in local variables, it is just
                // for convenience
                //NI IDEA
                
                left = raycasting.getRay(LEFT90);
                left45 = raycasting.getRay(LEFT90);
                right = raycasting.getRay(RIGHT45);
                right45 = raycasting.getRay(RIGHT45);
                down45 = raycasting.getRay(DOWN45);
                up45 = raycasting.getRay(UP45);
                front = raycasting.getRay(FRONT);
            }
        });
        
        //3. si no añadimos mas rayos:
        raycasting.endRayInitSequence();
 getAct().act(new Configuration().setDrawTraceLines(true).setAutoTrace(true));

5) I put you just a few lines of my ylex warnings but it's always the same, warnings about unprocessed keys:
(SmartBot)  [WARNING] 14:28:45.136                        State MSG_ATR unprocessed: V
(SmartBot)  [WARNING] 14:28:45.136                        State MSG_ATR unprocessed: e
(SmartBot)  [WARNING] 14:28:45.136                        State MSG_ATR unprocessed: r
(SmartBot)  [WARNING] 14:28:45.136                        State MSG_ATR unprocessed: .
(SmartBot)  [WARNING] 14:28:45.136                        State MSG_ATR unprocessed: }
(SmartBot)  [WARNING] 14:28:45.137                        State MSG_ATR unprocessed: {
(SmartBot)  [WARNING] 14:28:45.137                        State MSG_ATR unprocessed: R
(SmartBot)  [WARNING] 14:28:45.137                        State MSG_ATR unprocessed: e
(SmartBot)  [WARNING] 14:28:45.137                        State MSG_ATR unprocessed: s
(SmartBot)  [WARNING] 14:28:45.137                        State MSG_ATR unprocessed: u
(SmartBot)  [WARNING] 14:28:45.137                        State MSG_ATR unprocessed: l
(SmartBot)  [WARNING] 14:28:45.137                        State MSG_ATR unprocessed: t
(SmartBot)  [WARNING] 14:28:45.137                        State MSG_ATR unprocessed: V
(SmartBot)  [WARNING] 14:28:45.137                        State MSG_ATR unprocessed: e
(SmartBot)  [WARNING] 14:28:45.137                        State MSG_ATR unprocessed: r
(SmartBot)  [WARNING] 14:28:45.137                        State MSG_ATR unprocessed: .
(SmartBot)  [WARNING] 14:28:45.137                        State MSG_ATR unprocessed: }

6) also i add you some pics about my raycasting just to check that they are green and red:

http://i47.tinypic.com/644c5d.png

http://i46.tinypic.com/28lxnbr.png

thanks for your help and your patience with my case.

Bests, Joan Marc

-- 
Reply Link: <http://diana.ms.mff.cuni.cz/main/tiki-view_forum_thread.php?forumId=6&comments_reply_threadId=6&comments_parentId=1067&post_reply=1#form>




More information about the Pogamut-list mailing list