|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.threerings.crowd.server.PlaceManager
com.threerings.whirled.server.SceneManager
com.threerings.tudey.server.TudeySceneManager
public class TudeySceneManager
Manager for Tudey scenes.
| Nested Class Summary | |
|---|---|
static interface |
TudeySceneManager.ActorObserver
An interface for objects to notify when actors are added or removed. |
static interface |
TudeySceneManager.IntersectionSensor
An interface for objects that should be notified when actors intersect them. |
static interface |
TudeySceneManager.Sensor
Base interface for sensors. |
static interface |
TudeySceneManager.ShutdownObserver
An interface for objects to notify when we shutdown. |
static interface |
TudeySceneManager.TickParticipant
An interface for objects that take part in the server tick. |
| Nested classes/interfaces inherited from class com.threerings.crowd.server.PlaceManager |
|---|
com.threerings.crowd.server.PlaceManager.DelegateOp, com.threerings.crowd.server.PlaceManager.MessageHandler |
| Nested classes/interfaces inherited from interface com.samskivert.util.RunQueue |
|---|
RunQueue.AsExecutor |
| Field Summary |
|---|
| Fields inherited from interface com.samskivert.util.RunQueue |
|---|
AWT |
| Fields inherited from interface com.threerings.tudey.data.TudeyCodes |
|---|
DEFAULT_BUFFER_DELAY, DEFAULT_TICK_INTERVAL |
| Fields inherited from interface com.threerings.presents.data.InvocationCodes |
|---|
ACCESS_DENIED, E_ACCESS_DENIED, E_INTERNAL_ERROR, GLOBAL_GROUP, INTERNAL_ERROR |
| Constructor Summary | |
|---|---|
TudeySceneManager()
|
|
| Method Summary | |
|---|---|
void |
addActorObserver(TudeySceneManager.ActorObserver observer)
Adds an observer for actor events. |
void |
addMappings(Logic logic)
Registers the specified logic object unders its mappings. |
void |
addShutdownObserver(TudeySceneManager.ShutdownObserver observer)
Adds a shutdown observer. |
void |
addTickParticipant(TudeySceneManager.TickParticipant participant)
Adds a participant to notify at each tick. |
void |
bodyWillEnter(com.threerings.crowd.data.BodyObject body)
|
void |
bodyWillLeave(com.threerings.crowd.data.BodyObject body)
|
void |
clearEnteringBody(com.threerings.crowd.data.BodyObject body)
Clears out the mapping for an entering body. |
static void |
clearTickProfiles()
Clears the current set of tick profiles. |
boolean |
collides(ActorLogic logic)
Determines whether the specified actor collides with anything in the environment. |
boolean |
collides(ActorLogic logic,
Shape shape)
Determines whether the specified actor collides with anything in the environment. |
boolean |
collides(ActorLogic logic,
Shape shape,
int timestamp)
Determines whether the specified actor collides with anything in the environment. |
boolean |
collides(Actor actor,
Shape shape)
Checks whether the actor is colliding with anything. |
boolean |
collides(Actor actor,
Shape shape,
int timestamp)
Determines whether the specified actor collides with anything in the environment. |
boolean |
collides(int mask,
Shape shape)
Determines whether the specified shape collides with anything in the environment. |
boolean |
collides(int mask,
Shape shape,
int timestamp)
Determines whether the specified shape collides with anything in the environment. |
Logic |
createLogic(String cname)
Creates an instance of the logic object with the specified class name using the injector, logging a warning and returning null on error. |
static void |
dumpTickProfiles()
Dumps the current set of tick profiles to the log. |
void |
enqueueInputReliable(com.threerings.presents.data.ClientObject caller,
int acknowledge,
int smoothedTime,
InputFrame[] frames)
Handles a TudeySceneService.enqueueInputReliable(int, int, com.threerings.tudey.data.InputFrame[]) request. |
void |
enqueueInputUnreliable(com.threerings.presents.data.ClientObject caller,
int acknowledge,
int smoothedTime,
InputFrame[] frames)
Handles a TudeySceneService.enqueueInputUnreliable(int, int, com.threerings.tudey.data.InputFrame[]) request. |
void |
enteredPlace(com.threerings.presents.data.ClientObject caller)
Handles a TudeySceneService.enteredPlace() request. |
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. |
EffectLogic |
fireEffect(int timestamp,
Logic target,
Vector2f translation,
float rotation,
ConfigReference<EffectConfig> ref)
Fires off an effect with the referenced configuration. |
EffectLogic |
fireEffect(int timestamp,
Logic target,
Vector2f translation,
float rotation,
String name)
Fires off an effect at the with the named configuration. |
EffectLogic |
fireEffect(int timestamp,
Logic target,
Vector2f translation,
float rotation,
String name,
String firstKey,
Object firstValue,
Object... otherArgs)
Fires off an effect with the supplied name and arguments. |
ActorLogic |
getActorLogic(int id)
Returns the logic object for the actor with the provided id, if any. |
HashSpace |
getActorSpace()
Returns a reference to the actor space. |
int |
getBufferDelay()
Returns the delay with which the clients display information received from the server in order to compensate for network jitter and dropped packets. |
ConfigManager |
getConfigManager()
Returns a reference to the configuration manager for the scene. |
boolean |
getDebugRegions()
Checks whether we should show region debug effects. |
Rect |
getDefaultLocalInterest()
Returns the default untransformed area of interest region for clients. |
Effect[] |
getEffectsFired(PawnLogic target,
Rect bounds)
Returns an array containing all effects fired on the current tick whose influence regions intersect the provided bounds. |
EntryLogic |
getEntryLogic(Object key)
Returns the logic object for the entry with the provided key, if any. |
ArrayList<Logic> |
getInstances(Class<? extends Logic> clazz)
Returns the list of logic objects that are instances of the supplied class, or null for none. |
Logic |
getLogic(EntityKey key)
Returns the logic object for the entity with the provided key, if any. |
int |
getNextTimestamp()
Returns the approximate timestamp of the next tick. |
Pathfinder |
getPathfinder()
Returns a reference to the pathfinder object. |
boolean |
getPenetration(Actor actor,
Shape shape,
Vector2f result)
Checks whether the actor is colliding with anything and, if it is, populates the provided object with the penetration vector (the minimum translation required to cancel the penetration). |
int |
getPreviousTimestamp()
Returns the timestamp of the last tick. |
TudeySceneModel |
getSceneModel()
Returns a reference to the scene model. |
HashSpace |
getSensorSpace()
Returns a reference to the sensor space. |
Set<ActorLogic> |
getStaticActors()
Returns a reference to the set of static actors. |
Set<ActorLogic> |
getStaticActorsAdded()
Returns a reference to the set of static actors added on the current tick. |
Set<ActorLogic> |
getStaticActorsRemoved()
Returns a reference to the set of static actors removed on the current tick. |
Set<ActorLogic> |
getStaticActorsUpdated()
Returns a reference to the set of static actors updated on the current tick. |
ArrayList<Logic> |
getTagged(String tag)
Returns the list of logic objects with the supplied tag, or null for none. |
PawnLogic |
getTarget(com.threerings.presents.data.ClientObject clobj)
Returns a reference to the target of the specified client, if any. |
long |
getTickDuration()
Returns the amount of time spent processing the last tick. |
int |
getTickInterval()
Returns the interval at which we call the tick() method. |
static int |
getTickProfInterval()
Returns the tick profile interval. |
int |
getTicksPerSecond()
Returns the number of ticks per second. |
int |
getTimestamp()
Returns the timestamp of the current tick. |
int |
getTransmitInterval()
Returns the interval at which clients transmit their input frames. |
void |
getVisibleActors(PawnLogic target,
Rect bounds,
Collection<ActorLogic> results)
Populates the supplied collection with references to all non-static actors visible to the specified target whose influence regions intersect the provided bounds. |
boolean |
isDispatchThread()
|
boolean |
isRunning()
|
static boolean |
isTickProfEnabled()
Checks whether tick profiling is enabled. |
void |
mapEnteringBody(com.threerings.crowd.data.BodyObject body,
Object portalKey)
Notes that a body will be entering via the identified portal. |
void |
postRunnable(Runnable runnable)
|
void |
removeActorLogic(int id)
Removes the logic mapping for the actor with the given id. |
void |
removeActorObserver(TudeySceneManager.ActorObserver observer)
Removes an actor observer. |
void |
removeMappings(Logic logic)
Remove the specified logic object from the mappings. |
void |
removeShutdownObserver(TudeySceneManager.ShutdownObserver observer)
Removes a shutdown observer. |
void |
removeTickParticipant(TudeySceneManager.TickParticipant participant)
Removes a participant from the tick list. |
void |
setCameraParams(com.threerings.presents.data.ClientObject caller,
CameraConfig config,
float aspect)
Handles a TudeySceneService.setCameraParams(com.threerings.tudey.config.CameraConfig, float) request. |
void |
setDefaultLocalInterest(Rect interest)
Sets the default untransformed area of interest region for clients. |
void |
setTarget(com.threerings.presents.data.ClientObject caller,
int pawnId)
Handles a TudeySceneService.setTarget(int) request. |
static void |
setTickProfEnabled(boolean enabled)
Enables or disables tick participant profiling. |
static void |
setTickProfInterval(int interval)
Sets the frequency at which we sample tick participants. |
ActorLogic |
spawnActor(int timestamp,
Vector2f translation,
float rotation,
ConfigReference<ActorConfig> ref)
Spawns an actor with the referenced configuration. |
ActorLogic |
spawnActor(int timestamp,
Vector2f translation,
float rotation,
ConfigReference<ActorConfig> ref,
Actor actor)
Spawns an actor with the referenced configuration. |
ActorLogic |
spawnActor(int timestamp,
Vector2f translation,
float rotation,
String name)
Spawns an actor with the named configuration. |
ActorLogic |
spawnActor(int timestamp,
Vector2f translation,
float rotation,
String name,
String firstKey,
Object firstValue,
Object... otherArgs)
Spawns an actor with the supplied name and arguments. |
void |
staticActorUpdated(ActorLogic logic)
Notes that a static actor's state has changed. |
void |
submitActorRequest(com.threerings.presents.data.ClientObject caller,
int actorId,
String name)
Handles a TudeySceneService.submitActorRequest(int, java.lang.String) request. |
void |
submitEntryRequest(com.threerings.presents.data.ClientObject caller,
Object key,
String name)
Handles a TudeySceneService.submitEntryRequest(java.lang.Object, java.lang.String) request. |
void |
tick()
Updates the scene. |
int |
triggerIntersectionSensors(int timestamp,
ActorLogic actor)
Triggers any intersection sensors intersecting the specified shape. |
int |
triggerSensors(Class<? extends TudeySceneManager.Sensor> type,
int timestamp,
Collection<Shape> shapes,
int flags,
ActorLogic actor)
Triggers any sensors of the specified type intersecting the specified shape. |
int |
triggerSensors(Class<? extends TudeySceneManager.Sensor> type,
int timestamp,
Shape shape,
int flags,
ActorLogic actor)
Triggers any sensors of the specified type intersecting the specified shape. |
| Methods inherited from class com.threerings.whirled.server.SceneManager |
|---|
getLocation, getScene, getUpdates, isPersistent, where |
| Methods inherited from class com.threerings.crowd.server.PlaceManager |
|---|
addDelegate, applyToDelegates, applyToOccupants, checkPermissions, getConfig, getPlaceObject, init, isValidSpeaker, messageReceived, ratifyBodyEntry, registerMessageHandler, shutdown, startup, toString, updateOccupantInfo |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public TudeySceneManager()
| Method Detail |
|---|
public static void setTickProfEnabled(boolean enabled)
public static boolean isTickProfEnabled()
public static void setTickProfInterval(int interval)
public static int getTickProfInterval()
public static void dumpTickProfiles()
public static void clearTickProfiles()
public int getBufferDelay()
public int getTicksPerSecond()
public int getTickInterval()
tick() method.
public int getTransmitInterval()
public ConfigManager getConfigManager()
public void addTickParticipant(TudeySceneManager.TickParticipant participant)
public void removeTickParticipant(TudeySceneManager.TickParticipant participant)
public void addActorObserver(TudeySceneManager.ActorObserver observer)
public void removeActorObserver(TudeySceneManager.ActorObserver observer)
public void addShutdownObserver(TudeySceneManager.ShutdownObserver observer)
public void removeShutdownObserver(TudeySceneManager.ShutdownObserver observer)
public int getTimestamp()
public int getPreviousTimestamp()
public int getNextTimestamp()
public long getTickDuration()
public ArrayList<Logic> getTagged(String tag)
null for none.
public ArrayList<Logic> getInstances(Class<? extends Logic> clazz)
null for none.
public HashSpace getActorSpace()
public HashSpace getSensorSpace()
public Pathfinder getPathfinder()
public void setDefaultLocalInterest(Rect interest)
public Rect getDefaultLocalInterest()
public boolean getDebugRegions()
public ActorLogic spawnActor(int timestamp,
Vector2f translation,
float rotation,
String name)
public ActorLogic spawnActor(int timestamp,
Vector2f translation,
float rotation,
String name,
String firstKey,
Object firstValue,
Object... otherArgs)
public ActorLogic spawnActor(int timestamp,
Vector2f translation,
float rotation,
ConfigReference<ActorConfig> ref)
public ActorLogic spawnActor(int timestamp,
Vector2f translation,
float rotation,
ConfigReference<ActorConfig> ref,
Actor actor)
actor - if non-null, the already-created actor object.
public EffectLogic fireEffect(int timestamp,
Logic target,
Vector2f translation,
float rotation,
String name)
public EffectLogic fireEffect(int timestamp,
Logic target,
Vector2f translation,
float rotation,
String name,
String firstKey,
Object firstValue,
Object... otherArgs)
public EffectLogic fireEffect(int timestamp,
Logic target,
Vector2f translation,
float rotation,
ConfigReference<EffectConfig> ref)
public Logic createLogic(String cname)
null on error.
public Logic getLogic(EntityKey key)
public EntryLogic getEntryLogic(Object key)
public ActorLogic getActorLogic(int id)
public void getVisibleActors(PawnLogic target,
Rect bounds,
Collection<ActorLogic> results)
public Set<ActorLogic> getStaticActors()
public Set<ActorLogic> getStaticActorsAdded()
public Set<ActorLogic> getStaticActorsUpdated()
public Set<ActorLogic> getStaticActorsRemoved()
public Effect[] getEffectsFired(PawnLogic target,
Rect bounds)
public PawnLogic getTarget(com.threerings.presents.data.ClientObject clobj)
public void removeActorLogic(int id)
public int triggerIntersectionSensors(int timestamp,
ActorLogic actor)
public int triggerSensors(Class<? extends TudeySceneManager.Sensor> type,
int timestamp,
Shape shape,
int flags,
ActorLogic actor)
public int triggerSensors(Class<? extends TudeySceneManager.Sensor> type,
int timestamp,
Collection<Shape> shapes,
int flags,
ActorLogic actor)
public boolean collides(ActorLogic logic)
public boolean collides(ActorLogic logic,
Shape shape)
public boolean collides(ActorLogic logic,
Shape shape,
int timestamp)
public boolean collides(Actor actor,
Shape shape,
int timestamp)
public boolean collides(int mask,
Shape shape)
public boolean collides(int mask,
Shape shape,
int timestamp)
public void staticActorUpdated(ActorLogic logic)
public void mapEnteringBody(com.threerings.crowd.data.BodyObject body,
Object portalKey)
public void clearEnteringBody(com.threerings.crowd.data.BodyObject body)
public void bodyWillEnter(com.threerings.crowd.data.BodyObject body)
bodyWillEnter in class com.threerings.crowd.server.PlaceManagerpublic void bodyWillLeave(com.threerings.crowd.data.BodyObject body)
bodyWillLeave in class com.threerings.crowd.server.PlaceManagerpublic void enteredPlace(com.threerings.presents.data.ClientObject caller)
TudeySceneProviderTudeySceneService.enteredPlace() request.
enteredPlace in interface TudeySceneProvider
public void enqueueInputReliable(com.threerings.presents.data.ClientObject caller,
int acknowledge,
int smoothedTime,
InputFrame[] frames)
TudeySceneProviderTudeySceneService.enqueueInputReliable(int, int, com.threerings.tudey.data.InputFrame[]) request.
enqueueInputReliable in interface TudeySceneProvider
public void enqueueInputUnreliable(com.threerings.presents.data.ClientObject caller,
int acknowledge,
int smoothedTime,
InputFrame[] frames)
TudeySceneProviderTudeySceneService.enqueueInputUnreliable(int, int, com.threerings.tudey.data.InputFrame[]) request.
enqueueInputUnreliable in interface TudeySceneProvider
public void setTarget(com.threerings.presents.data.ClientObject caller,
int pawnId)
TudeySceneProviderTudeySceneService.setTarget(int) request.
setTarget in interface TudeySceneProvider
public void setCameraParams(com.threerings.presents.data.ClientObject caller,
CameraConfig config,
float aspect)
TudeySceneProviderTudeySceneService.setCameraParams(com.threerings.tudey.config.CameraConfig, float) request.
setCameraParams in interface TudeySceneProvider
public void submitActorRequest(com.threerings.presents.data.ClientObject caller,
int actorId,
String name)
TudeySceneProviderTudeySceneService.submitActorRequest(int, java.lang.String) request.
submitActorRequest in interface TudeySceneProvider
public void submitEntryRequest(com.threerings.presents.data.ClientObject caller,
Object key,
String name)
TudeySceneProviderTudeySceneService.submitEntryRequest(java.lang.Object, java.lang.String) request.
submitEntryRequest in interface TudeySceneProviderpublic 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 TudeySceneModel getSceneModel()
ActorAdvancer.Environment
getSceneModel in interface ActorAdvancer.Environment
public boolean getPenetration(Actor actor,
Shape shape,
Vector2f result)
ActorAdvancer.Environment
getPenetration in interface ActorAdvancer.Environment
public boolean collides(Actor actor,
Shape shape)
ActorAdvancer.Environment
collides in interface ActorAdvancer.Environmentpublic void postRunnable(Runnable runnable)
postRunnable in interface RunQueuepublic boolean isDispatchThread()
isDispatchThread in interface RunQueuepublic boolean isRunning()
isRunning in interface RunQueuepublic void addMappings(Logic logic)
public void removeMappings(Logic logic)
public void tick()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||