|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cz.cuni.amis.pogamut.base.agent.module.AgentModule<AGENT> cz.cuni.amis.pogamut.base.agent.module.SensomotoricModule<UDKBot> cz.cuni.amis.pogamut.udk.agent.module.sensomotoric.Raycasting
public class Raycasting
Support for creating rays used for raycasting (see AutoTraceRay
that is being utilized).
It is designed to be initialized inside IUDKBotController.initializeController(UDKBot)
method call
and may be used since IUDKBotController.botInitialized(cz.cuni.amis.pogamut.udk.communication.messages.gbinfomessages.GameInfo, cz.cuni.amis.pogamut.udk.communication.messages.gbinfomessages.ConfigChange, cz.cuni.amis.pogamut.udk.communication.messages.gbinfomessages.InitedMessage)
is called.
Field Summary |
---|
Fields inherited from class cz.cuni.amis.pogamut.base.agent.module.SensomotoricModule |
---|
act, worldView |
Fields inherited from class cz.cuni.amis.pogamut.base.agent.module.AgentModule |
---|
agent, controller, eventBus, log |
Constructor Summary | |
---|---|
Raycasting(UDKBot bot)
|
|
Raycasting(UDKBot bot,
Logger log)
|
Method Summary | |
---|---|
void |
clear()
Deletes all previous rays and makes this instance ready for setting up new rays. |
Future<AutoTraceRay> |
createRay(String Id,
javax.vecmath.Vector3d Direction,
int Length,
boolean FastTrace,
boolean FloorCorrection,
boolean TraceActors)
Initializes ray usind AddRay command and returns future that waits for the first AutoTraceRay message corresponding to this ray. |
Future<AutoTraceRay> |
createRay(javax.vecmath.Vector3d Direction,
int Length,
boolean FastTrace,
boolean FloorCorrection,
boolean TraceActors)
Creates ray with system generated id. |
void |
endRayInitSequence()
Once all rays were initialized using createRay(...) methods, call this method to start listening for response from UT. |
cz.cuni.amis.utils.flag.Flag<Boolean> |
getAllRaysInitialized()
|
AutoTraceRay |
getRay(String rayID)
Returns a ray of specified id. |
protected void |
checkIfAllInited()
Sets allRaysInitialized flag to true if all rays has been initialized. |
protected void |
start(boolean startPaused)
Provides initialization of the module (clearing internal data structures). |
Methods inherited from class cz.cuni.amis.pogamut.base.agent.module.AgentModule |
---|
cleanUp, getComponentId, getLog, getState, initComponentId, isRunning, kill, pause, reset, resume, stop, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Raycasting(UDKBot bot)
public Raycasting(UDKBot bot, Logger log)
Method Detail |
---|
public cz.cuni.amis.utils.flag.Flag<Boolean> getAllRaysInitialized()
protected void start(boolean startPaused)
start
in class AgentModule<UDKBot>
public void clear() throws CommunicationException
CommunicationException
public void endRayInitSequence()
public Future<AutoTraceRay> createRay(String Id, javax.vecmath.Vector3d Direction, int Length, boolean FastTrace, boolean FloorCorrection, boolean TraceActors) throws CommunicationException
Id
- User set Id of the ray, so the ray can be identified.Direction
- Vector direction of the ray (it will be relative - added to
the vector, where the bot is looking, also takes into
account angle of the floor the bot is standing on).Length
- Specifies the length of the ray (in UT units).FastTrace
- True if we want to use FastTrace function instead of Trace
function (a bit faster but less information provided - just
information if we hit something 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.TraceActors
- If we want to trace also actors – bots, monsters, players,
items. False if we want to trace just level geometry.
CommunicationException
public Future<AutoTraceRay> createRay(javax.vecmath.Vector3d Direction, int Length, boolean FastTrace, boolean FloorCorrection, boolean TraceActors) throws CommunicationException
AutoTraceRay
but its Future
.
Use method Future.isDone()
to check whether the ray was initialized and method Future.get()
to obtain the ray instance.
Direction
- Vector direction of the ray (it will be relative - added to
the vector, where the bot is looking, also takes into
account angle of the floor the bot is standing on).Length
- Specifies the length of the ray (in UT units).FastTrace
- True if we want to use FastTrace function instead of Trace
function (a bit faster but less information provided - just
information if we hit something or not).FloorCorrection
- If we should correct ray directions according floor normal. Note: Has issue - we can't set set rays up or down when correction is active.TraceActors
- If we want to trace also actors, bots, monsters, players,
items. False if we want to trace just level geometry.
Future.isDone()
to check whether the ray was initialized and method Future.get()
to obtain the ray instance
cz.cuni.amis.pogamut.base.communication.exceptions.CommunicationException
CommunicationException
public AutoTraceRay getRay(String rayID)
Note that the AutoTraceRay
instance is self updating - once obtained you may use it every
logic cycle to obtain current readings from the ray.
rayID
-
protected void checkIfAllInited()
allRaysInitialized
flag to true if all rays has been initialized.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |