com.threerings.tudey.client
Class TudeySceneView

java.lang.Object
  extended by com.threerings.expr.DynamicScope
      extended by com.threerings.tudey.client.TudeySceneView
All Implemented Interfaces:
ChatDisplay, OccupantObserver, PlaceView, Scope, ScopeUpdateListener, Compositable, GlView, Tickable, InvocationCodes, TudeyCodes, TudeySceneModel.Observer, ActorAdvancer.Environment
Direct Known Subclasses:
ToolSceneView

public class TudeySceneView
extends DynamicScope
implements GlView, PlaceView, TudeySceneModel.Observer, OccupantObserver, ChatDisplay, ActorAdvancer.Environment, TudeyCodes

Displays a view of a Tudey scene.


Nested Class Summary
protected static class TudeySceneView.FloorMaskFilter
          Used to select sprites according to their floor flags.
static interface TudeySceneView.TickParticipant
          An interface for objects (such as sprites and observers) that require per-tick updates.
protected static class TudeySceneView.UpdateRecord
          Contains the state at a single update.
 
Field Summary
protected  HashSpace _actorSpace
          The actor space (used for client-side collision detection).
protected  HashIntMap<ActorSprite> _actorSprites
          Sprites corresponding to the actors in the scene.
protected  TimeSmoother _advancedSmoother
          Smooths the advanced time.
protected  int _advancedTime
          The advanced time.
protected  CameraConfig _camcfg
          The current camera config.
protected  List<CameraConfig> _camcfgs
          The priority-ordered list of active camera configs.
protected  OrbitCameraHandler _camhand
          The view's camera handler.
protected  Tickable _camtrans
          The active camera transition, if any.
protected  ActorSprite _controlledSprite
          The sprite that the user is controlling.
protected  TudeySceneController _ctrl
          The controller that created this view.
protected  TudeyContext _ctx
          The application context.
protected  TimeSmoother _delayedSmoother
          Smooths the delayed time.
protected  int _delayedTime
          The delayed time.
protected  boolean _disposed
          Set when we've been disposed.
protected  TruncatedAverage _elapsedAverage
          The trailing average of the elapsed times.
protected  List<SpaceElement> _elements
          Holds collected elements during queries.
protected  HashMap<Object,EntrySprite> _entrySprites
          Sprites corresponding to the scene entries.
protected  TudeySceneView.FloorMaskFilter _floorMaskFilter
          Used to find the floor.
protected  Window _inputWindow
          A window used to gather input events.
protected  Vector3f _isect
          Used to find the floor.
protected  List<Actor> _loadingActors
          The remaining actors to add during loading.
protected  List<TudeySceneModel.Entry> _loadingEntries
          The remaining entries to add during loading.
protected  List<Sprite> _loadingMerged
          The remaining merged sprites to be initialized during loading.
protected  Window _loadingWindow
          The loading window, if any.
protected  Map<Coord,Sprite> _mergedSprites
          Sprites for merged static models mapped by coordinates.
protected  Vector2f _penetration
          Stores penetration vector during queries.
protected  int _ping
          The last estimated ping time.
protected  TruncatedAverage _pingAverage
          The trailing average of the ping times.
protected  TudeySceneConfig _placeConfig
          The place configuration.
protected  PreloadableSet _preloads
          The set of resources to preload.
protected  Ray3D _ray
          Used to find the floor.
protected  List<TudeySceneView.UpdateRecord> _records
          Records of each update received from the server.
protected  HashScene _scene
          The OpenGL scene.
protected  TudeySceneModel _sceneModel
          The scene model.
protected  int _smoothedTime
          The smoothed time.
protected  TimeSmoother _smoother
          Smoother used to provide a smoothed time estimate.
protected  boolean _suppressMergeUpdates
          When set, indicates that we should hold off on updating merged sprites.
protected  ActorSprite _targetSprite
          The sprite that the camera is tracking.
protected  List<TudeySceneView.TickParticipant> _tickParticipants
          The list of participants in the tick.
protected  TudeySceneObject _tsobj
          A casted reference to the scene object.
protected static float ACTOR_LOAD_PERCENT
          The percentage of load progress devoted to loading actors.
protected static long BATCH_LOAD_DURATION
          The amount of time to spend on each batch when loading.
protected static float ENTRY_LOAD_PERCENT
          The percentage of load progress devoted to loading entries.
protected static float ENTRY_MERGE_PERCENT
          The percentage of load progress devoted to merging entries.
protected static float PRELOAD_PERCENT
          The percentage of load progress devoted to preloading.
 
Fields inherited from class com.threerings.expr.DynamicScope
_compoundDepth, _listeners, _owner, _parentScope, _scopeName, _symbols, INVALID_SCOPE
 
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
 
Fields inherited from interface com.threerings.expr.Scope
EPOCH, NOW
 
Constructor Summary
TudeySceneView(TudeyContext ctx)
          Creates a new scene view for use in the editor.
TudeySceneView(TudeyContext ctx, TudeySceneController ctrl)
          Creates a new scene view.
 
Method Summary
protected  void addActorSprite(Actor actor)
          Adds a sprite for the specified actor.
 void addCameraConfig(CameraConfig camcfg)
          Adds a camera config to the stack with no transition.
 void addCameraConfig(CameraConfig camcfg, float transition, Easing easing)
          Adds a camera config to the stack with an option transition.
protected  void addEntrySprite(TudeySceneModel.Entry entry)
          Adds a sprite for the specified entry.
protected  void addExtraPreloads()
          Gives the view a chance to add any required additional preloads to the set.
protected  void addPreloads(Actor actor)
          Adds the specified actor's preloads to the set if appropriate.
protected  void addPreloads(Effect effect)
          Adds the specified effect's preloads to the set if appropriate.
protected  void addPreloads(TudeySceneModel.Entry entry)
          Adds the specified entry's preloads to the set if appropriate.
 void addTickParticipant(TudeySceneView.TickParticipant participant)
          Adds a participant to tick at each frame.
 void addTickParticipant(TudeySceneView.TickParticipant participant, boolean prepend)
          Adds a participant to tick at each frame.
 boolean canMerge()
          Checks whether we should attempt to merge static models.
 void clear()
           
 boolean collides(Actor actor, Shape shape)
          Checks whether the actor is colliding with anything.
 boolean collides(int mask, Shape shape)
          Checks for collision against a mask.
 void composite()
          Adds this object's Dependencys and Enqueueables to the compositor in preparation for rendering.
protected  float createActorSpriteBatch()
          Creates a batch of actor sprites as part of the loading process.
protected  OrbitCameraHandler createCameraHandler()
          Creates the camera handler for the view.
protected  float createEntrySpriteBatch()
          Creates a batch of entry sprites as part of the loading process.
 void didLeavePlace(PlaceObject plobj)
           
 boolean displayMessage(ChatMessage msg, boolean alreadyDisplayed)
           
protected  boolean doLoading()
          Returns true if we should perform loading operations.
 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.
 HashSpace getActorSpace()
          Returns a reference to the actor space.
 ActorSprite getActorSprite(int id)
          Returns a reference to the actor sprite with the supplied id, or null if it doesn't exist.
 int getAdvancedTime()
          Returns the advanced time, which is the smoothed time plus an interval that compensates for buffering and latency.
 int getBufferDelay()
          Returns the delay with which to display information received from the server in order to compensate for network jitter and dropped packets.
 OrbitCameraHandler getCameraHandler()
          Returns a reference to the camera handler.
protected  String getChatType()
          Returns the valid chat type for this view.
 int getControlDelta()
          Returns the client control delta (the difference between the advanced and delayed times).
 ActorSprite getControlledSprite()
          Returns a reference to the controlled sprite.
 TudeySceneController getController()
          Returns a reference to the scene controller.
 int getDelayedTime()
          Returns the delayed client time, which is the smoothed time minus a delay that compensates for network jitter and dropped packets.
 int getElapsed()
          Returns the average of the elapsed times.
 EntrySprite getEntrySprite(Object key)
          Returns the sprite corresponding to the entry with the given key.
 Transform3D getFloorTransform(float x, float y, float rotation, int mask)
          Gets the transform of an object on the floor with the provided coordinates.
 Transform3D getFloorTransform(float x, float y, float rotation, int mask, Transform3D result)
          Gets the transform of an object on the floor with the provided coordinates.
 Transform3D getFloorTransform(float x, float y, float rotation, com.google.common.base.Predicate<? super SceneElement> filter)
          Gets the transform of an object on the floor with the provided coordinates.
 Transform3D getFloorTransform(float x, float y, float rotation, com.google.common.base.Predicate<? super SceneElement> filter, Transform3D result)
          Gets the transform of an object on the floor with the provided coordinates.
 float getFloorZ(float x, float y, int mask, float defvalue)
          Returns the z coordinate of the floor at the provided coordinates, or the provided default if no floor is found.
 float getFloorZ(float x, float y, com.google.common.base.Predicate<? super SceneElement> filter, float defvalue)
          Returns the z coordinate of the floor at the provided coordinates, or the provided default if no floor is found.
 int getInputAdvance()
          Returns the interval ahead of the smoothed server time (which estimates the server time minus one-way latency) at which we schedule input events.
 Window getInputWindow()
          Returns a reference to the window used to gather input events.
 Sprite getIntersection(Ray3D ray, Vector3f location)
          Checks for an intersection between the provided ray and the sprites in the scene.
 Sprite getIntersection(Ray3D ray, Vector3f location, com.google.common.base.Predicate<? super Sprite> filter)
          Checks for an intersection between the provided ray and the sprites in the scene.
protected  int getMergeGranularity()
          Returns the merge granularity to use for static tile models.
 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 getPing()
          Returns the average of the ping times.
 HashScene getScene()
          Returns a reference to the view scene.
 TudeySceneModel getSceneModel()
          Returns a reference to the scene model.
 int getSmoothedTime()
          Returns the smoothed estimate of the server time (plus network latency) calculated at the start of each tick.
 Sprite getSprite(EntityKey key)
          Returns the sprite corresponding to the entity with the given key.
 ActorSprite getTargetSprite()
          Returns a reference to the target sprite.
protected  float initMergedSpriteBatch()
          Initializes a batch of merged sprites as part of the loading process.
protected  Window maybeCreateLoadingWindow(TudeySceneModel model)
          Creates the loading window, or returns null to skip preloading.
 Model maybeMerge(int x, int y, ConfigReference<ModelConfig> ref, Transform3D transform, int floorFlags)
          Attempts to merge a static model.
protected  void noteJitter(int value)
          Notes a jitter value (difference between elapsed time on server and elapsed time on client between two successive updates).
 void occupantEntered(OccupantInfo info)
           
 void occupantLeft(OccupantInfo info)
           
 void occupantUpdated(OccupantInfo oinfo, OccupantInfo ninfo)
           
 EffectSprite prefireEffect(int timestamp, EntityKey target, Vector2f translation, float rotation, ConfigReference<EffectConfig> ref)
          Requests to prefire an effect.
 ActorSprite prespawnActor(int timestamp, ActorSprite source, Vector2f translation, float rotation, ConfigReference<ActorConfig> ref)
          Requests to prespawn an actor.
 boolean processSceneDelta(SceneDeltaEvent event)
          Processes a scene delta received from the server.
protected  boolean pruneRecords(int reference)
          Prunes all records before the supplied reference time, if found.
 void removeCameraConfig(CameraConfig camcfg)
          Removes a camera config from the stack with no transition.
 void removeCameraConfig(CameraConfig camcfg, float transition, Easing easing)
          Removes a camera config from the stack with an optional transition.
 void removeTickParticipant(TudeySceneView.TickParticipant participant)
          Removes a participant from the tick list.
protected  void setCameraConfig(CameraConfig camcfg, float transition, Easing easing)
          Sets the camera configuration (optionally transitioning to it over time).
 void setSceneModel(TudeySceneModel model)
          Sets the scene model for this view.
 void tick(float elapsed)
          Updates the state of this object based on the elapsed time in seconds.
 boolean unmerge(int x, int y, ConfigReference<ModelConfig> ref, Transform3D transform)
          Unmerges a model.
 void updateControlledSprite()
          Updates the controlled sprite base on the controlled id.
protected  void updateLoadingWindow(float pct)
          Updates the loading window with the current percentage of resources loaded.
 void updateTargetSprite()
          Updates the target sprite based on the target id.
 void wasAdded()
          Notifies the view that it is going to be rendered.
 void wasRemoved()
          Notifies the view that it will no longer be rendered.
 void willEnterPlace(PlaceObject plobj)
           
 
Methods inherited from class com.threerings.expr.DynamicScope
addListener, dispose, endCompoundUpdate, get, getParentScope, getScopeName, put, remove, removeListener, scopeUpdated, setParentScope, startCompoundUpdate, wasUpdated
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_ctx

protected TudeyContext _ctx
The application context.


_ctrl

protected TudeySceneController _ctrl
The controller that created this view.


_placeConfig

protected TudeySceneConfig _placeConfig
The place configuration.


_tsobj

protected TudeySceneObject _tsobj
A casted reference to the scene object.


_camhand

protected OrbitCameraHandler _camhand
The view's camera handler.


_inputWindow

protected Window _inputWindow
A window used to gather input events.


_loadingWindow

protected Window _loadingWindow
The loading window, if any.


_preloads

protected PreloadableSet _preloads
The set of resources to preload.


_loadingEntries

protected List<TudeySceneModel.Entry> _loadingEntries
The remaining entries to add during loading.


_loadingMerged

protected List<Sprite> _loadingMerged
The remaining merged sprites to be initialized during loading.


_loadingActors

protected List<Actor> _loadingActors
The remaining actors to add during loading.


_scene

@Scoped
protected HashScene _scene
The OpenGL scene.


_sceneModel

protected TudeySceneModel _sceneModel
The scene model.


_smoother

protected TimeSmoother _smoother
Smoother used to provide a smoothed time estimate.


_smoothedTime

protected int _smoothedTime
The smoothed time.


_delayedSmoother

protected TimeSmoother _delayedSmoother
Smooths the delayed time.


_delayedTime

protected int _delayedTime
The delayed time.


_advancedSmoother

protected TimeSmoother _advancedSmoother
Smooths the advanced time.


_advancedTime

protected int _advancedTime
The advanced time.


_ping

protected int _ping
The last estimated ping time.


_pingAverage

protected TruncatedAverage _pingAverage
The trailing average of the ping times.


_elapsedAverage

protected TruncatedAverage _elapsedAverage
The trailing average of the elapsed times.


_records

protected List<TudeySceneView.UpdateRecord> _records
Records of each update received from the server.


_entrySprites

protected HashMap<Object,EntrySprite> _entrySprites
Sprites corresponding to the scene entries.


_actorSprites

protected HashIntMap<ActorSprite> _actorSprites
Sprites corresponding to the actors in the scene.


_actorSpace

protected HashSpace _actorSpace
The actor space (used for client-side collision detection).


_tickParticipants

protected List<TudeySceneView.TickParticipant> _tickParticipants
The list of participants in the tick.


_mergedSprites

protected Map<Coord,Sprite> _mergedSprites
Sprites for merged static models mapped by coordinates.


_suppressMergeUpdates

protected boolean _suppressMergeUpdates
When set, indicates that we should hold off on updating merged sprites.


_targetSprite

protected ActorSprite _targetSprite
The sprite that the camera is tracking.


_controlledSprite

protected ActorSprite _controlledSprite
The sprite that the user is controlling.


_camcfgs

protected List<CameraConfig> _camcfgs
The priority-ordered list of active camera configs.


_camcfg

protected CameraConfig _camcfg
The current camera config.


_camtrans

protected Tickable _camtrans
The active camera transition, if any.


_disposed

protected boolean _disposed
Set when we've been disposed.


_ray

protected Ray3D _ray
Used to find the floor.


_isect

protected Vector3f _isect
Used to find the floor.


_floorMaskFilter

protected TudeySceneView.FloorMaskFilter _floorMaskFilter
Used to find the floor.


_elements

protected List<SpaceElement> _elements
Holds collected elements during queries.


_penetration

protected Vector2f _penetration
Stores penetration vector during queries.


BATCH_LOAD_DURATION

protected static final long BATCH_LOAD_DURATION
The amount of time to spend on each batch when loading.

See Also:
Constant Field Values

PRELOAD_PERCENT

protected static final float PRELOAD_PERCENT
The percentage of load progress devoted to preloading.

See Also:
Constant Field Values

ENTRY_LOAD_PERCENT

protected static final float ENTRY_LOAD_PERCENT
The percentage of load progress devoted to loading entries.

See Also:
Constant Field Values

ENTRY_MERGE_PERCENT

protected static final float ENTRY_MERGE_PERCENT
The percentage of load progress devoted to merging entries.

See Also:
Constant Field Values

ACTOR_LOAD_PERCENT

protected static final float ACTOR_LOAD_PERCENT
The percentage of load progress devoted to loading actors.

See Also:
Constant Field Values
Constructor Detail

TudeySceneView

public TudeySceneView(TudeyContext ctx)
Creates a new scene view for use in the editor.


TudeySceneView

public TudeySceneView(TudeyContext ctx,
                      TudeySceneController ctrl)
Creates a new scene view.

Method Detail

getController

public TudeySceneController getController()
Returns a reference to the scene controller.


getCameraHandler

public OrbitCameraHandler getCameraHandler()
Returns a reference to the camera handler.


getInputWindow

public Window getInputWindow()
Returns a reference to the window used to gather input events.


getScene

public HashScene getScene()
Returns a reference to the view scene.


getActorSpace

public HashSpace getActorSpace()
Returns a reference to the actor space.


getControlDelta

public int getControlDelta()
Returns the client control delta (the difference between the advanced and delayed times).


getDelayedTime

public int getDelayedTime()
Returns the delayed client time, which is the smoothed time minus a delay that compensates for network jitter and dropped packets.


getBufferDelay

public int getBufferDelay()
Returns the delay with which to display information received from the server in order to compensate for network jitter and dropped packets.


getPing

public int getPing()
Returns the average of the ping times.


getElapsed

public int getElapsed()
Returns the average of the elapsed times.


getAdvancedTime

public int getAdvancedTime()
Returns the advanced time, which is the smoothed time plus an interval that compensates for buffering and latency.


getInputAdvance

public int getInputAdvance()
Returns the interval ahead of the smoothed server time (which estimates the server time minus one-way latency) at which we schedule input events. This should be at least the transmit interval (which represents the maximum amount of time that events may be delayed) plus the two-way latency.


getSmoothedTime

public int getSmoothedTime()
Returns the smoothed estimate of the server time (plus network latency) calculated at the start of each tick.


setSceneModel

public void setSceneModel(TudeySceneModel model)
Sets the scene model for this view.


getSprite

public Sprite getSprite(EntityKey key)
Returns the sprite corresponding to the entity with the given key.


getEntrySprite

public EntrySprite getEntrySprite(Object key)
Returns the sprite corresponding to the entry with the given key.


getActorSprite

public ActorSprite getActorSprite(int id)
Returns a reference to the actor sprite with the supplied id, or null if it doesn't exist.


getTargetSprite

public ActorSprite getTargetSprite()
Returns a reference to the target sprite.


getControlledSprite

public ActorSprite getControlledSprite()
Returns a reference to the controlled sprite.


canMerge

public boolean canMerge()
Checks whether we should attempt to merge static models.


maybeMerge

public Model maybeMerge(int x,
                        int y,
                        ConfigReference<ModelConfig> ref,
                        Transform3D transform,
                        int floorFlags)
Attempts to merge a static model.

Returns:
a reference to the merged model, or null if the model cannot be merged.

unmerge

public boolean unmerge(int x,
                       int y,
                       ConfigReference<ModelConfig> ref,
                       Transform3D transform)
Unmerges a model.

Returns:
whether or not the model was found and unmerged.

getIntersection

public Sprite getIntersection(Ray3D ray,
                              Vector3f location)
Checks for an intersection between the provided ray and the sprites in the scene.

Parameters:
location - a vector to populate with the location of the intersection, if any.
Returns:
a reference to the first sprite intersected by the ray, or null for none.

getIntersection

public Sprite getIntersection(Ray3D ray,
                              Vector3f location,
                              com.google.common.base.Predicate<? super Sprite> filter)
Checks for an intersection between the provided ray and the sprites in the scene.

Parameters:
location - a vector to populate with the location of the intersection, if any.
Returns:
a reference to the first sprite intersected by the ray, or null for none.

getFloorTransform

public Transform3D getFloorTransform(float x,
                                     float y,
                                     float rotation,
                                     int mask)
Gets the transform of an object on the floor with the provided coordinates.

Parameters:
mask - the floor mask to use for the query.

getFloorTransform

public Transform3D getFloorTransform(float x,
                                     float y,
                                     float rotation,
                                     com.google.common.base.Predicate<? super SceneElement> filter)
Gets the transform of an object on the floor with the provided coordinates.

Parameters:
filter - the floor filter to use for the query.

getFloorTransform

public Transform3D getFloorTransform(float x,
                                     float y,
                                     float rotation,
                                     int mask,
                                     Transform3D result)
Gets the transform of an object on the floor with the provided coordinates.

Parameters:
mask - the floor mask to use for the query.

getFloorTransform

public Transform3D getFloorTransform(float x,
                                     float y,
                                     float rotation,
                                     com.google.common.base.Predicate<? super SceneElement> filter,
                                     Transform3D result)
Gets the transform of an object on the floor with the provided coordinates.

Parameters:
filter - the floor filter to use for the query.

getFloorZ

public float getFloorZ(float x,
                       float y,
                       int mask,
                       float defvalue)
Returns the z coordinate of the floor at the provided coordinates, or the provided default if no floor is found.

Parameters:
mask - the floor mask to use for the query.

getFloorZ

public float getFloorZ(float x,
                       float y,
                       com.google.common.base.Predicate<? super SceneElement> filter,
                       float defvalue)
Returns the z coordinate of the floor at the provided coordinates, or the provided default if no floor is found.

Parameters:
filter - the floor filter to use for the query.

prespawnActor

public ActorSprite prespawnActor(int timestamp,
                                 ActorSprite source,
                                 Vector2f translation,
                                 float rotation,
                                 ConfigReference<ActorConfig> ref)
Requests to prespawn an actor. Only one actor may be prespawned at any given timestamp; if one already exists for the specified timestamp, this method will return null.


prefireEffect

public EffectSprite prefireEffect(int timestamp,
                                  EntityKey target,
                                  Vector2f translation,
                                  float rotation,
                                  ConfigReference<EffectConfig> ref)
Requests to prefire an effect.


processSceneDelta

public boolean processSceneDelta(SceneDeltaEvent event)
Processes a scene delta received from the server.

Returns:
true if the scene delta was processed, false if we have not yet received the reference delta.

addTickParticipant

public void addTickParticipant(TudeySceneView.TickParticipant participant)
Adds a participant to tick at each frame.


addTickParticipant

public void addTickParticipant(TudeySceneView.TickParticipant participant,
                               boolean prepend)
Adds a participant to tick at each frame.

Parameters:
prepend - if true, prepend the participant so that it is ticked last (participants are usually ticked in reverse order of addition).

removeTickParticipant

public void removeTickParticipant(TudeySceneView.TickParticipant participant)
Removes a participant from the tick list.


updateTargetSprite

public void updateTargetSprite()
Updates the target sprite based on the target id.


updateControlledSprite

public void updateControlledSprite()
Updates the controlled sprite base on the controlled id.


addCameraConfig

public void addCameraConfig(CameraConfig camcfg)
Adds a camera config to the stack with no transition.


addCameraConfig

public void addCameraConfig(CameraConfig camcfg,
                            float transition,
                            Easing easing)
Adds a camera config to the stack with an option transition.


removeCameraConfig

public void removeCameraConfig(CameraConfig camcfg)
Removes a camera config from the stack with no transition.


removeCameraConfig

public void removeCameraConfig(CameraConfig camcfg,
                               float transition,
                               Easing easing)
Removes a camera config from the stack with an optional transition.


wasAdded

public void wasAdded()
Description copied from interface: GlView
Notifies the view that it is going to be rendered.

Specified by:
wasAdded in interface GlView

wasRemoved

public void wasRemoved()
Description copied from interface: GlView
Notifies the view that it will no longer be rendered.

Specified by:
wasRemoved in interface GlView

tick

public void tick(float elapsed)
Description copied from interface: Tickable
Updates the state of this object based on the elapsed time in seconds.

Specified by:
tick in interface Tickable

composite

public void composite()
Description copied from interface: Compositable
Adds this object's Dependencys and Enqueueables to the compositor in preparation for rendering.

Specified by:
composite in interface Compositable

willEnterPlace

public void willEnterPlace(PlaceObject plobj)
Specified by:
willEnterPlace in interface PlaceView

didLeavePlace

public void didLeavePlace(PlaceObject plobj)
Specified by:
didLeavePlace in interface PlaceView

entryAdded

public void entryAdded(TudeySceneModel.Entry entry)
Description copied from interface: TudeySceneModel.Observer
Notes that an entry has been added to the scene.

Specified by:
entryAdded in interface TudeySceneModel.Observer

entryUpdated

public void entryUpdated(TudeySceneModel.Entry oentry,
                         TudeySceneModel.Entry nentry)
Description copied from interface: TudeySceneModel.Observer
Notes that an entry has been updated within the scene.

Specified by:
entryUpdated in interface TudeySceneModel.Observer

entryRemoved

public void entryRemoved(TudeySceneModel.Entry oentry)
Description copied from interface: TudeySceneModel.Observer
Notes that an entry has been removed from the scene.

Specified by:
entryRemoved in interface TudeySceneModel.Observer

occupantEntered

public void occupantEntered(OccupantInfo info)
Specified by:
occupantEntered in interface OccupantObserver

occupantLeft

public void occupantLeft(OccupantInfo info)
Specified by:
occupantLeft in interface OccupantObserver

occupantUpdated

public void occupantUpdated(OccupantInfo oinfo,
                            OccupantInfo ninfo)
Specified by:
occupantUpdated in interface OccupantObserver

displayMessage

public boolean displayMessage(ChatMessage msg,
                              boolean alreadyDisplayed)
Specified by:
displayMessage in interface ChatDisplay

clear

public void clear()
Specified by:
clear in interface ChatDisplay

getSceneModel

public TudeySceneModel getSceneModel()
Description copied from interface: ActorAdvancer.Environment
Returns a reference to the scene model.

Specified by:
getSceneModel in interface ActorAdvancer.Environment

getPenetration

public boolean getPenetration(Actor actor,
                              Shape shape,
                              Vector2f result)
Description copied from interface: ActorAdvancer.Environment
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).

Specified by:
getPenetration in interface ActorAdvancer.Environment
Returns:
true if a collision was detected (in which case the result vector will be populated), false otherwise.

collides

public boolean collides(Actor actor,
                        Shape shape)
Description copied from interface: ActorAdvancer.Environment
Checks whether the actor is colliding with anything.

Specified by:
collides in interface ActorAdvancer.Environment

collides

public boolean collides(int mask,
                        Shape shape)
Checks for collision against a mask.


createCameraHandler

protected OrbitCameraHandler createCameraHandler()
Creates the camera handler for the view.


setCameraConfig

protected void setCameraConfig(CameraConfig camcfg,
                               float transition,
                               Easing easing)
Sets the camera configuration (optionally transitioning to it over time).


maybeCreateLoadingWindow

protected Window maybeCreateLoadingWindow(TudeySceneModel model)
Creates the loading window, or returns null to skip preloading.


createEntrySpriteBatch

protected float createEntrySpriteBatch()
Creates a batch of entry sprites as part of the loading process.

Returns:
the completion percentage.

initMergedSpriteBatch

protected float initMergedSpriteBatch()
Initializes a batch of merged sprites as part of the loading process.

Returns:
the completion percentage.

createActorSpriteBatch

protected float createActorSpriteBatch()
Creates a batch of actor sprites as part of the loading process.

Returns:
the completion percentage.

updateLoadingWindow

protected void updateLoadingWindow(float pct)
Updates the loading window with the current percentage of resources loaded. If pct is equal to 1.0, this method should remove the loading window (or start fading it out).


addEntrySprite

protected void addEntrySprite(TudeySceneModel.Entry entry)
Adds a sprite for the specified entry.


addActorSprite

protected void addActorSprite(Actor actor)
Adds a sprite for the specified actor.


addPreloads

protected void addPreloads(TudeySceneModel.Entry entry)
Adds the specified entry's preloads to the set if appropriate.


addPreloads

protected void addPreloads(Actor actor)
Adds the specified actor's preloads to the set if appropriate.


addPreloads

protected void addPreloads(Effect effect)
Adds the specified effect's preloads to the set if appropriate.


addExtraPreloads

protected void addExtraPreloads()
Gives the view a chance to add any required additional preloads to the set.


getMergeGranularity

protected int getMergeGranularity()
Returns the merge granularity to use for static tile models. This is expressed as a power of two: tiles with coordinates in the same 2^granularity square block will be merged together if possible. A value of zero allows no merging.


noteJitter

protected void noteJitter(int value)
Notes a jitter value (difference between elapsed time on server and elapsed time on client between two successive updates).


pruneRecords

protected boolean pruneRecords(int reference)
Prunes all records before the supplied reference time, if found.

Returns:
true if the reference time was found, false if not.

getChatType

protected String getChatType()
Returns the valid chat type for this view.


doLoading

protected boolean doLoading()
Returns true if we should perform loading operations.