|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.threerings.expr.DynamicScope
com.threerings.tudey.client.TudeySceneView
public class TudeySceneView
Displays a view of a Tudey scene.
| Nested Class Summary | |
|---|---|
static interface |
TudeySceneView.TickParticipant
An interface for objects (such as sprites and observers) that require per-tick updates. |
| Field Summary |
|---|
| 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 | |
|---|---|
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. |
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. |
void |
composite()
Adds this object's Dependencys and Enqueueables to the compositor in
preparation for rendering. |
void |
didLeavePlace(com.threerings.crowd.data.PlaceObject plobj)
|
boolean |
displayMessage(com.threerings.crowd.chat.data.ChatMessage msg,
boolean alreadyDisplayed)
|
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. |
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,
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,
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,
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,
Predicate<? super Sprite> filter)
Checks for an intersection between the provided ray and the sprites in the scene. |
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). |
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. |
Model |
maybeMerge(int x,
int y,
ConfigReference<ModelConfig> ref,
Transform3D transform,
int floorFlags)
Attempts to merge a static model. |
void |
occupantEntered(com.threerings.crowd.data.OccupantInfo info)
|
void |
occupantLeft(com.threerings.crowd.data.OccupantInfo info)
|
void |
occupantUpdated(com.threerings.crowd.data.OccupantInfo oinfo,
com.threerings.crowd.data.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. |
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. |
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. |
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(com.threerings.crowd.data.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 |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TudeySceneView(TudeyContext ctx)
public TudeySceneView(TudeyContext ctx,
TudeySceneController ctrl)
| Method Detail |
|---|
public TudeySceneController getController()
public OrbitCameraHandler getCameraHandler()
public Window getInputWindow()
public HashScene getScene()
public HashSpace getActorSpace()
public int getControlDelta()
public int getDelayedTime()
public int getBufferDelay()
public int getElapsed()
public int getAdvancedTime()
public int getInputAdvance()
public int getSmoothedTime()
public void setSceneModel(TudeySceneModel model)
public Sprite getSprite(EntityKey key)
public EntrySprite getEntrySprite(Object key)
public ActorSprite getActorSprite(int id)
null if it
doesn't exist.
public ActorSprite getTargetSprite()
public ActorSprite getControlledSprite()
public boolean canMerge()
public Model maybeMerge(int x,
int y,
ConfigReference<ModelConfig> ref,
Transform3D transform,
int floorFlags)
null if the model cannot be merged.
public boolean unmerge(int x,
int y,
ConfigReference<ModelConfig> ref,
Transform3D transform)
public Sprite getIntersection(Ray3D ray,
Vector3f location)
location - a vector to populate with the location of the intersection, if any.
null for
none.
public Sprite getIntersection(Ray3D ray,
Vector3f location,
Predicate<? super Sprite> filter)
location - a vector to populate with the location of the intersection, if any.
null for
none.
public Transform3D getFloorTransform(float x,
float y,
float rotation,
int mask)
mask - the floor mask to use for the query.
public Transform3D getFloorTransform(float x,
float y,
float rotation,
Predicate<? super SceneElement> filter)
filter - the floor filter to use for the query.
public Transform3D getFloorTransform(float x,
float y,
float rotation,
int mask,
Transform3D result)
mask - the floor mask to use for the query.
public Transform3D getFloorTransform(float x,
float y,
float rotation,
Predicate<? super SceneElement> filter,
Transform3D result)
filter - the floor filter to use for the query.
public float getFloorZ(float x,
float y,
int mask,
float defvalue)
mask - the floor mask to use for the query.
public float getFloorZ(float x,
float y,
Predicate<? super SceneElement> filter,
float defvalue)
filter - the floor filter to use for the query.
public ActorSprite prespawnActor(int timestamp,
ActorSprite source,
Vector2f translation,
float rotation,
ConfigReference<ActorConfig> ref)
public EffectSprite prefireEffect(int timestamp,
EntityKey target,
Vector2f translation,
float rotation,
ConfigReference<EffectConfig> ref)
public boolean processSceneDelta(SceneDeltaEvent event)
public void addTickParticipant(TudeySceneView.TickParticipant participant)
public void addTickParticipant(TudeySceneView.TickParticipant participant,
boolean prepend)
prepend - if true, prepend the participant so that it is ticked last (participants
are usually ticked in reverse order of addition).public void removeTickParticipant(TudeySceneView.TickParticipant participant)
public void updateTargetSprite()
public void updateControlledSprite()
public void addCameraConfig(CameraConfig camcfg)
public void addCameraConfig(CameraConfig camcfg,
float transition,
Easing easing)
public void removeCameraConfig(CameraConfig camcfg)
public void removeCameraConfig(CameraConfig camcfg,
float transition,
Easing easing)
public void wasAdded()
GlView
wasAdded in interface GlViewpublic void wasRemoved()
GlView
wasRemoved in interface GlViewpublic void tick(float elapsed)
Tickable
tick in interface Tickablepublic void composite()
CompositableDependencys and Enqueueables to the compositor in
preparation for rendering.
composite in interface Compositablepublic void willEnterPlace(com.threerings.crowd.data.PlaceObject plobj)
willEnterPlace in interface com.threerings.crowd.client.PlaceViewpublic void didLeavePlace(com.threerings.crowd.data.PlaceObject plobj)
didLeavePlace in interface com.threerings.crowd.client.PlaceViewpublic 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 occupantEntered(com.threerings.crowd.data.OccupantInfo info)
occupantEntered in interface com.threerings.crowd.client.OccupantObserverpublic void occupantLeft(com.threerings.crowd.data.OccupantInfo info)
occupantLeft in interface com.threerings.crowd.client.OccupantObserver
public void occupantUpdated(com.threerings.crowd.data.OccupantInfo oinfo,
com.threerings.crowd.data.OccupantInfo ninfo)
occupantUpdated in interface com.threerings.crowd.client.OccupantObserver
public boolean displayMessage(com.threerings.crowd.chat.data.ChatMessage msg,
boolean alreadyDisplayed)
displayMessage in interface com.threerings.crowd.chat.client.ChatDisplaypublic void clear()
clear in interface com.threerings.crowd.chat.client.ChatDisplaypublic 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.Environment
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||