|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.threerings.tudey.server.util.Pathfinder
public class Pathfinder
A helper class for pathfinding. Currently the pathfinding strategy is to divide the world up into unit cells and track the collision flags of all scene entries and actors whose shapes intersect those cells. An alternate method that may be worth exploring would be to have the traversal predicate perform a full intersection query (it seems likely that this would be more expensive than maintaining the collision map for all actors, but it's not entirely clear).
| Constructor Summary | |
|---|---|
Pathfinder(TudeySceneManager scenemgr)
Creates a new pathfinder. |
|
| Method Summary | |
|---|---|
void |
actorAdded(ActorLogic logic)
Notes that an actor has been added. |
void |
actorRemoved(ActorLogic logic)
Notes that an actor has been removed. |
void |
collisionFlagsChanged(ActorLogic logic,
int oflags)
Notes that the actor's collision flags have changed. |
void |
entryAdded(TudeySceneModel.Entry entry)
Notes that an entry has been added to the scene. |
void |
entryRemoved(TudeySceneModel.Entry oentry)
Notes that an entry has been removed from the scene. |
void |
entryUpdated(TudeySceneModel.Entry oentry,
TudeySceneModel.Entry nentry)
Notes that an entry has been updated within the scene. |
Vector2f[] |
getEntryPath(ActorLogic actor,
float longest,
float bx,
float by,
boolean partial,
boolean shortcut)
Computes a path for the specified actor from its current location, considering only the scene entries (not the actors). |
Vector2f[] |
getEntryPath(ActorLogic actor,
float longest,
float ax,
float ay,
float bx,
float by,
boolean partial,
boolean shortcut)
Computes a path for the specified actor, considering only the scene entries (not the actors). |
Vector2f[] |
getPath(ActorLogic actor,
float longest,
float bx,
float by,
boolean partial,
boolean shortcut)
Computes a path for the specified actor from its current location. |
Vector2f[] |
getPath(ActorLogic actor,
float longest,
float ax,
float ay,
float bx,
float by,
boolean partial,
boolean shortcut)
Computes a path for the specified actor. |
void |
shapeDidChange(Logic logic)
Notes that the logic's shape has changed. |
void |
shapeWillChange(Logic logic)
Notes that the logic's shape is about to change. |
void |
shutdown()
Shuts down the pathfinder. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Pathfinder(TudeySceneManager scenemgr)
| Method Detail |
|---|
public void shutdown()
public Vector2f[] getEntryPath(ActorLogic actor,
float longest,
float bx,
float by,
boolean partial,
boolean shortcut)
longest - the maximum path length.partial - if true, return a partial path even if the destination is unreachable.shortcut - if true, use swept shapes to find path shortcuts.
public Vector2f[] getEntryPath(ActorLogic actor,
float longest,
float ax,
float ay,
float bx,
float by,
boolean partial,
boolean shortcut)
longest - the maximum path length.partial - if true, return a partial path even if the destination is unreachable.shortcut - if true, use swept shapes to find path shortcuts.
public Vector2f[] getPath(ActorLogic actor,
float longest,
float bx,
float by,
boolean partial,
boolean shortcut)
longest - the maximum path length.partial - if true, return a partial path even if the destination is unreachable.shortcut - if true, use swept shapes to find path shortcuts.
public Vector2f[] getPath(ActorLogic actor,
float longest,
float ax,
float ay,
float bx,
float by,
boolean partial,
boolean shortcut)
longest - the maximum path length.partial - if true, return a partial path even if the destination is unreachable.shortcut - if true, use swept shapes to find path shortcuts.
public void entryAdded(TudeySceneModel.Entry entry)
TudeySceneModel.Observer
entryAdded in interface TudeySceneModel.Observer
public void entryUpdated(TudeySceneModel.Entry oentry,
TudeySceneModel.Entry nentry)
TudeySceneModel.Observer
entryUpdated in interface TudeySceneModel.Observerpublic void entryRemoved(TudeySceneModel.Entry oentry)
TudeySceneModel.Observer
entryRemoved in interface TudeySceneModel.Observerpublic void actorAdded(ActorLogic logic)
TudeySceneManager.ActorObserver
actorAdded in interface TudeySceneManager.ActorObserverpublic void actorRemoved(ActorLogic logic)
TudeySceneManager.ActorObserver
actorRemoved in interface TudeySceneManager.ActorObserverpublic void shapeWillChange(Logic logic)
Logic.ShapeObserver
shapeWillChange in interface Logic.ShapeObserverpublic void shapeDidChange(Logic logic)
Logic.ShapeObserver
shapeDidChange in interface Logic.ShapeObserver
public void collisionFlagsChanged(ActorLogic logic,
int oflags)
ActorLogic.CollisionFlagObserver
collisionFlagsChanged in interface ActorLogic.CollisionFlagObserver
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||