|
|||||||||
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<UT2004Bot> cz.cuni.amis.pogamut.ut2004.bot.command.BotCommands cz.cuni.amis.pogamut.ut2004.bot.command.SimpleRayCasting
public class SimpleRayCasting
This command module provides basic ray tracing control. Note that you will need to register listeners in your code in order to receive answers to commands issued by this module. For fastTrace register listener for FastTraceResponse() class. For trace register listener for TraceResponse() class. For autoTracing rays register listener for AutoTraceRay() class.
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 | |
---|---|
SimpleRayCasting(UT2004Bot agent,
java.util.logging.Logger log)
Constructor. |
Method Summary | |
---|---|
void |
addAutoTraceRay(java.lang.String id,
Vector3d direction,
int length,
boolean bFastTrace,
boolean bFloorCorrection,
boolean bTraceActors)
Adds a new ray to auto ray tracing rays set. |
void |
addDefaultAutoTraceRays()
This command removes all existing auto trace rays and adds a default auto trace rays set. |
void |
changeAutoTraceRay(java.lang.String id,
Vector3d direction,
int length,
boolean bFastTrace,
boolean bFloorCorrection,
boolean bTraceActors)
To change the ray it is sufficient to call addAutoTraceRay function with proper Id. |
void |
disableAutoTracing()
Disables auto trace rays. |
void |
enableAutoTracing()
Enables auto trace rays. |
void |
fastTrace(java.lang.String id,
ILocated to)
Sends a ray from actual bot location to desired location. |
void |
fastTrace(java.lang.String id,
ILocated from,
ILocated to)
Sends a ray from desired location to desired location. |
void |
removeAllAutoTraceRays()
Removes all autoTraceRays. |
void |
removeAutoTraceRay(java.lang.String id)
Remove one autoTraceRay with desired id from the list. |
void |
trace(java.lang.String id,
ILocated to,
boolean bTraceActors)
Sends a ray from actual bot location to desired location. |
void |
trace(java.lang.String id,
ILocated from,
ILocated to,
boolean bTraceActors)
Sends a ray from desired location to desired location. |
Methods inherited from class cz.cuni.amis.pogamut.base.agent.module.AgentModule |
---|
cleanUp, getComponentId, getLog, getState, initComponentId, isRunning, kill, pause, reset, resume, start, stop, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SimpleRayCasting(UT2004Bot agent, java.util.logging.Logger log)
agent
- AbstractUT2004Bot we will send commands forlog
- Logger to be used for logging runtime/debug info.Method Detail |
---|
public void fastTrace(java.lang.String id, ILocated to)
id
- user determined id of the ray (use to match response)to
- end location of this raypublic void fastTrace(java.lang.String id, ILocated from, ILocated to)
id
- user determined id of the ray (use to match response)from
- start location of this rayto
- end location of this raypublic void trace(java.lang.String id, ILocated to, boolean bTraceActors)
id
- user determined id of the ray (use to match response)to
- end location of this raypublic void trace(java.lang.String id, ILocated from, ILocated to, boolean bTraceActors)
id
- user determined id of the ray (use to match response)from
- start location of this rayto
- end location of this raypublic void addAutoTraceRay(java.lang.String id, Vector3d direction, int length, boolean bFastTrace, boolean bFloorCorrection, boolean bTraceActors)
id
- String id of this ray, used to change its parameters or delete
itdirection
- vector direction of this ray (1,0,0) for straight ahead,
(0,1,0) for 90 degrees right, etc. The vector does not have to
be normalized.length
- length of the ray in UT units. One character in UT is
approximately 200 UT units long.bFastTrace
- true if we want to use FastTrace function for this ray cast
(faster, but only world geometry can be traced)bFloorCorrection
- if true the rays direction will be adjusted according to floor
normal. So if we will climb a hill, the rays will adjust to
the steepnes of the hill.bTraceActors
- if true and bFastTrace set to true, also dynamic items in the
map will be traced (other players and items)public void changeAutoTraceRay(java.lang.String id, Vector3d direction, int length, boolean bFastTrace, boolean bFloorCorrection, boolean bTraceActors)
id
- String id of this ray, used to change its parameters or delete
itdirection
- vector direction of this ray (1,0,0) for straight ahead,
(0,1,0) for 90 degrees right, etc. The vector does not have to
be normalized.length
- length of the ray in UT units. One character in UT is
approximately 200 UT units long.bFastTrace
- true if we want to use FastTrace function for this ray cast
(faster, but only world geometry can be traced)bFloorCorrection
- if true the rays direction will be adjusted according to floor
normal. So if we will climb a hill, the rays will adjust to
the steepnes of the hill.bTraceActors
- if true and bFastTrace set to true, also dynamic items in the
map will be traced (other players and items)public void addDefaultAutoTraceRays()
public void removeAutoTraceRay(java.lang.String id)
id
- id of the ray we want to deletepublic void removeAllAutoTraceRays()
public void enableAutoTracing()
public void disableAutoTracing()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |