cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages
Class AutoTraceRayCompositeImpl

java.lang.Object
  extended by cz.cuni.amis.pogamut.base.communication.messages.InfoMessage
      extended by cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.AutoTraceRay
          extended by cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.AutoTraceRayCompositeImpl
All Implemented Interfaces:
IWorldChangeEvent, IWorldEvent, IWorldObject, ICompositeWorldObject, Event

public class AutoTraceRayCompositeImpl
extends AutoTraceRay

Composite implementation of the ATR abstract message. It wraps Local/Shared/Static parts in single object allowing to presenting a nice facade for users.

Complete message documentation: 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.


Nested Class Summary
 
Nested classes/interfaces inherited from class cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.AutoTraceRay
AutoTraceRay.AutoTraceRayUpdate
 
Field Summary
protected  AutoTraceRayLocalImpl partLocal
           
protected  AutoTraceRayStaticImpl partStatic
           
 
Fields inherited from class cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.AutoTraceRay
PROTOTYPE, SimTime
 
Constructor Summary
AutoTraceRayCompositeImpl()
          Parameter-less contructor for the message.
AutoTraceRayCompositeImpl(AutoTraceRayCompositeImpl original)
          Cloning constructor.
AutoTraceRayCompositeImpl(AutoTraceRayLocalImpl partLocal, AutoTraceRaySharedImpl partShared, AutoTraceRayStaticImpl partStatic)
          Composite-impl constructor.
 
Method Summary
 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).
 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.
 AutoTraceRayLocal getLocal()
           
 AutoTraceRayShared getShared()
           
 AutoTraceRayStatic getStatic()
           
 Location getTo()
          Location to which the ray is sent.
 boolean isFastTrace()
          True if it is a fast trace, false if not (fast trace is a bit faster version of UT2004 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)
 void setSimTime(long SimTime)
          Used by Yylex to slip correct time of the object or programmatically.
 java.lang.String toHtmlString()
           
 java.lang.String toString()
           
 
Methods inherited from class cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.AutoTraceRay
getSimTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

partStatic

protected AutoTraceRayStaticImpl partStatic

partLocal

protected AutoTraceRayLocalImpl partLocal
Constructor Detail

AutoTraceRayCompositeImpl

public AutoTraceRayCompositeImpl()
Parameter-less contructor for the message.


AutoTraceRayCompositeImpl

public AutoTraceRayCompositeImpl(AutoTraceRayLocalImpl partLocal,
                                 AutoTraceRaySharedImpl partShared,
                                 AutoTraceRayStaticImpl partStatic)
Composite-impl constructor. It assembles the message from its three fragments - local/shared/static.

Parameters:
partLocal - local-part of the message
partShared - shared-part of the message
partStatic - static-part of the message

AutoTraceRayCompositeImpl

public AutoTraceRayCompositeImpl(AutoTraceRayCompositeImpl original)
Cloning constructor.

Parameters:
original -
Method Detail

setSimTime

public void setSimTime(long SimTime)
Description copied from class: AutoTraceRay
Used by Yylex to slip correct time of the object or programmatically.

Overrides:
setSimTime in class AutoTraceRay

getStatic

public AutoTraceRayStatic getStatic()

getLocal

public AutoTraceRayLocal getLocal()

getShared

public AutoTraceRayShared getShared()

getId

public UnrealId getId()
Description copied from class: AutoTraceRay
An Id for this ray (should be unique), assigned by the user when adding ray.

Specified by:
getId in interface IWorldObject
Specified by:
getId in class AutoTraceRay
Returns:

getFrom

public Location getFrom()
Description copied from class: AutoTraceRay
Location from which the ray is emitted.

Specified by:
getFrom in class AutoTraceRay

getTo

public Location getTo()
Description copied from class: AutoTraceRay
Location to which the ray is sent.

Specified by:
getTo in class AutoTraceRay

isFastTrace

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

Specified by:
isFastTrace in class AutoTraceRay

isFloorCorrection

public boolean isFloorCorrection()
Description copied from class: AutoTraceRay
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.

Specified by:
isFloorCorrection in class AutoTraceRay

isResult

public boolean isResult()
Description copied from class: AutoTraceRay
True if it hit something, false if not.

Specified by:
isResult in class AutoTraceRay

getHitNormal

public Vector3d getHitNormal()
Description copied from class: AutoTraceRay
Vector with normal of the plane we have hit (not sent if FastTrace is True).

Specified by:
getHitNormal in class AutoTraceRay

getHitLocation

public Location getHitLocation()
Description copied from class: AutoTraceRay
Vector with location of the collision (not sent if FastTrace is True).

Specified by:
getHitLocation in class AutoTraceRay

isTraceActors

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

Specified by:
isTraceActors in class AutoTraceRay

getHitId

public UnrealId getHitId()
Description copied from class: AutoTraceRay
Id of the actor we have hit. (Sent if FastTrace is False and TraceActors is True).

Specified by:
getHitId in class AutoTraceRay

toString

public java.lang.String toString()
Overrides:
toString in class AutoTraceRay

toHtmlString

public java.lang.String toHtmlString()
Overrides:
toHtmlString in class AutoTraceRay