cz.cuni.amis.pogamut.udk.communication.messages.gbinfomessages
Class AutoTraceRay

Package class diagram package AutoTraceRay
java.lang.Object
  extended by cz.cuni.amis.pogamut.base.communication.messages.InfoMessage
      extended by cz.cuni.amis.pogamut.udk.communication.messages.GBObjectUpdate
          extended by cz.cuni.amis.pogamut.udk.communication.messages.gbinfomessages.AutoTraceRay
All Implemented Interfaces:
IWorldChangeEvent, IWorldObjectUpdatedEvent, IWorldObject, IGBWorldObjectEvent, cz.cuni.amis.utils.listener.Event

public class AutoTraceRay
extends GBObjectUpdate
implements IGBWorldObjectEvent, IWorldObject

Synchronous message. Contains the results of automatically casted rays. One ATR message is for one casted ray. New automatically casted rays can be defined by ADDRAY command and removed by REMOVERAY command. Corresponding GameBots message is ATR.


Nested Class Summary
 
Nested classes/interfaces inherited from interface cz.cuni.amis.pogamut.base.communication.translator.event.IWorldObjectUpdatedEvent
IWorldObjectUpdatedEvent.DestroyWorldObject
 
Field Summary
protected  boolean FastTrace
          True if it is a fast trace, false if not (fast trace is a bit faster version of UDK ray trace - but provides us with less information - just true/false if we hit something on the way or not).
protected  boolean FloorCorrection
          If we should correct ray directions accoring floor normal.
protected  Location From
          Location from which the ray is emitted.
protected  UnrealId HitId
          Id of the actor we have hit.
protected  Location HitLocation
          Vector with location of the collision (not sent if FastTrace is True).
protected  javax.vecmath.Vector3d HitNormal
          Vector with normal of the plane we have hit (not sent if FastTrace is True).
protected  UnrealId Id
          An Id for this ray (should be unique), assigned by the user when adding ray.
static String PROTOTYPE
          Example how the message looks like - used during parser tests.
protected  boolean Result
          True if it hit something, false if not.
protected  double Time
           
protected  Location To
          Location to which the ray is sent.
protected  boolean TraceActors
          If we traced also actors with this ray (actors – moving things in a game – bots, players, monsters, pickup …) (only if NOT using FastTrace)
 
Constructor Summary
AutoTraceRay()
          Used by Yylex to create empty message then to fill it's protected fields (Yylex is in the same package).
AutoTraceRay(AutoTraceRay original)
          Cloning constructor.
AutoTraceRay(UnrealId Id, Location From, Location To, boolean FastTrace, boolean FloorCorrection, boolean Result, javax.vecmath.Vector3d HitNormal, Location HitLocation, boolean TraceActors, UnrealId HitId)
          Creates new instance of command AutoTraceRay.
 
Method Summary
 boolean equals(Object obj)
           
 Location getFrom()
          Location from which the ray is emitted.
 UnrealId getHitId()
          Id of the actor we have hit.
 Location getHitLocation()
          Vector with location of the collision (not sent if FastTrace is True).
 javax.vecmath.Vector3d getHitNormal()
          Vector with normal of the plane we have hit (not sent if FastTrace is True).
 UnrealId getId()
          An Id for this ray (should be unique), assigned by the user when adding ray.
 double getLastSeenTime()
           
 ILocalWorldObject getLocal()
           
 IWorldObject getObject()
          Returns original object (if method update() has already been called, for bot-programmer that is always true as the original object is updated and then the event is propagated).
 ISharedWorldObject getShared()
           
 long getSimTime()
           
 IStaticWorldObject getStatic()
           
protected  double getTime()
           
 Location getTo()
          Location to which the ray is sent.
 int hashCode()
           
 boolean isFastTrace()
          True if it is a fast trace, false if not (fast trace is a bit faster version of UDK ray trace - but provides us with less information - just true/false if we hit something on the way or not).
 boolean isFloorCorrection()
          If we should correct ray directions accoring floor normal.
 boolean isResult()
          True if it hit something, false if not.
 boolean isTraceActors()
          If we traced also actors with this ray (actors – moving things in a game – bots, players, monsters, pickup …) (only if NOT using FastTrace)
protected  void setTime(double time)
           
 String toHtmlString()
           
 String toString()
           
 IWorldObjectUpdateResult update(IWorldObject obj)
           
 
Methods inherited from class cz.cuni.amis.pogamut.base.communication.messages.InfoMessage
toJsonLiteral
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

PROTOTYPE

public static final String PROTOTYPE
Example how the message looks like - used during parser tests.

See Also:
Constant Field Values

Id

protected UnrealId Id
An Id for this ray (should be unique), assigned by the user when adding ray.


From

protected Location From
Location from which the ray is emitted.


To

protected Location To
Location to which the ray is sent.


FastTrace

protected boolean FastTrace
True if it is a fast trace, false if not (fast trace is a bit faster version of UDK ray trace - but provides us with less information - just true/false if we hit something on the way or not).


FloorCorrection

protected boolean FloorCorrection
If we should correct ray directions accoring floor normal. Note: Has issue - we can't set set rays up or down when correction is active.


Result

protected boolean Result
True if it hit something, false if not.


HitNormal

protected javax.vecmath.Vector3d HitNormal
Vector with normal of the plane we have hit (not sent if FastTrace is True).


HitLocation

protected Location HitLocation
Vector with location of the collision (not sent if FastTrace is True).


TraceActors

protected boolean TraceActors
If we traced also actors with this ray (actors – moving things in a game – bots, players, monsters, pickup …) (only if NOT using FastTrace)


HitId

protected UnrealId HitId
Id of the actor we have hit. (Sent if FastTrace is False and TraceActors is True).


Time

protected double Time
Constructor Detail

AutoTraceRay

public AutoTraceRay(UnrealId Id,
                    Location From,
                    Location To,
                    boolean FastTrace,
                    boolean FloorCorrection,
                    boolean Result,
                    javax.vecmath.Vector3d HitNormal,
                    Location HitLocation,
                    boolean TraceActors,
                    UnrealId HitId)
Creates new instance of command AutoTraceRay. Synchronous message. Contains the results of automatically casted rays. One ATR message is for one casted ray. New automatically casted rays can be defined by ADDRAY command and removed by REMOVERAY command. Corresponding GameBots message for this command is .

Parameters:
Id - An Id for this ray (should be unique), assigned by the user when adding ray.
From - Location from which the ray is emitted.
To - Location to which the ray is sent.
FastTrace - True if it is a fast trace, false if not (fast trace is a bit faster version of UDK ray trace - but provides us with less information - just true/false if we hit something on the way or not).
FloorCorrection - If we should correct ray directions accoring floor normal. Note: Has issue - we can't set set rays up or down when correction is active.
Result - True if it hit something, false if not.
HitNormal - Vector with normal of the plane we have hit (not sent if FastTrace is True).
HitLocation - Vector with location of the collision (not sent if FastTrace is True).
TraceActors - If we traced also actors with this ray (actors – moving things in a game – bots, players, monsters, pickup …) (only if NOT using FastTrace)
HitId - Id of the actor we have hit. (Sent if FastTrace is False and TraceActors is True).

AutoTraceRay

public AutoTraceRay(AutoTraceRay original)
Cloning constructor.


AutoTraceRay

public AutoTraceRay()
Used by Yylex to create empty message then to fill it's protected fields (Yylex is in the same package).

Method Detail

getId

public UnrealId getId()
An Id for this ray (should be unique), assigned by the user when adding ray.

Specified by:
getId in interface IWorldObjectUpdatedEvent
Specified by:
getId in interface IWorldObject

getFrom

public Location getFrom()
Location from which the ray is emitted.


getTo

public Location getTo()
Location to which the ray is sent.


isFastTrace

public boolean isFastTrace()
True if it is a fast trace, false if not (fast trace is a bit faster version of UDK ray trace - but provides us with less information - just true/false if we hit something on the way or not).


isFloorCorrection

public boolean isFloorCorrection()
If we should correct ray directions accoring floor normal. Note: Has issue - we can't set set rays up or down when correction is active.


isResult

public boolean isResult()
True if it hit something, false if not.


getHitNormal

public javax.vecmath.Vector3d getHitNormal()
Vector with normal of the plane we have hit (not sent if FastTrace is True).


getHitLocation

public Location getHitLocation()
Vector with location of the collision (not sent if FastTrace is True).


isTraceActors

public boolean isTraceActors()
If we traced also actors with this ray (actors – moving things in a game – bots, players, monsters, pickup …) (only if NOT using FastTrace)


getHitId

public UnrealId getHitId()
Id of the actor we have hit. (Sent if FastTrace is False and TraceActors is True).


getTime

protected double getTime()

setTime

protected void setTime(double time)

getLastSeenTime

public double getLastSeenTime()

getLocal

public ILocalWorldObject getLocal()

getShared

public ISharedWorldObject getShared()

getStatic

public IStaticWorldObject getStatic()

getSimTime

public long getSimTime()
Specified by:
getSimTime in interface IWorldChangeEvent
Specified by:
getSimTime in interface IWorldObject

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

update

public IWorldObjectUpdateResult update(IWorldObject obj)
Specified by:
update in interface IWorldObjectUpdatedEvent

getObject

public IWorldObject getObject()
Returns original object (if method update() has already been called, for bot-programmer that is always true as the original object is updated and then the event is propagated).


toString

public String toString()
Overrides:
toString in class InfoMessage

toHtmlString

public String toHtmlString()


Copyright © 2014 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.