|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.expr.SimpleScope
com.threerings.tudey.client.sprite.Sprite
com.threerings.tudey.client.sprite.ActorSprite
public class ActorSprite
Represents an active element of the scene.
| Nested Class Summary | |
|---|---|
static class |
ActorSprite.Acting
Depicts an active actor with activity animations. |
static class |
ActorSprite.Implementation
The actual sprite implementation. |
static class |
ActorSprite.Moving
Depicts a mobile actor with optional movement animations. |
static class |
ActorSprite.Original
Superclass of the original implementations. |
static class |
ActorSprite.StatefulEntry
Executes animations on the corresponding entry sprite. |
static class |
ActorSprite.StatefulModelEntry
Changes model configurations on the corresponding entry sprite. |
| Field Summary | |
|---|---|
protected Actor |
_actor
The "play head" actor with interpolated or advanced state. |
protected ActorAdvancer |
_advancer
The advancer, if this is a controlled actor. |
protected List<Model> |
_attachedModels
Models attached to this sprite (including the primary model). |
protected boolean |
_attachedVisible
If attached models are visible. |
protected ActorConfig |
_config
The actor configuration. |
protected boolean |
_disposed
Set when the sprite has been disposed. |
protected ActorHistory |
_history
The history that we use to find interpolated actor state. |
protected ActorSprite.Implementation |
_impl
The actor implementation ( null until actually created). |
protected Model |
_model
The actor model. |
protected int |
_removed
The timestamp at which the actor was removed, if any. |
protected ShapeElement |
_shape
The actor's shape element. |
protected static ActorSprite.Implementation |
NULL_IMPLEMENTATION
An implementation that does nothing. |
| Fields inherited from class com.threerings.tudey.client.sprite.Sprite |
|---|
_ctx, _view |
| Fields inherited from class com.threerings.expr.SimpleScope |
|---|
_parentScope |
| Fields inherited from interface com.threerings.expr.Scope |
|---|
EPOCH, NOW |
| Constructor Summary | |
|---|---|
ActorSprite(TudeyContext ctx,
TudeySceneView view,
int timestamp,
Actor actor)
Creates a new actor sprite. |
|
| Method Summary | |
|---|---|
void |
attachModel(Model model)
Attaches a model to this sprite. |
void |
attachScaledModel(Model model)
Attaches a model to this sprite, setting its scale to the product of its current scale and an attachment scale specified by the implementation. |
void |
attachScaledModel(Model model,
float baseScale)
Attaches a model to this sprite, setting its scale to the product of the provided base scale and an attachment scale specified by the implementation. |
void |
clearMessages()
Requests that the sprite clear any chat messages being displayed. |
void |
configUpdated(ConfigEvent<ActorConfig> event)
Called when a configuration has been updated. |
Component |
createTooltipComponent(String tiptext)
Creates a tooltip component for the sprite (will only be called if Sprite.getTooltipText()
returns true). |
void |
detachModel(Model model)
Detaches a model from this sprite. |
boolean |
dispatchEvent(Event event)
Dispatches an event on the sprite. |
boolean |
displayMessage(UserMessage msg,
boolean alreadyDisplayed)
Gives the sprite a chance to display a message sent by the occupant controlling the actor. |
void |
dispose()
Releases the resources associated with this scope. |
Actor |
getActor()
Returns a reference to the actor object. |
protected int |
getActorTime()
Returns the time value for the actor. |
ActorAdvancer |
getAdvancer()
Returns a reference to the advancer used to advance the state, if this is actor is controlled by the client. |
protected float |
getAttachedScale()
Returns the scale to use for attachments. |
int |
getFloorFlags()
Returns the sprite's floor flags. |
int |
getFloorMask()
Returns the sprite's floor mask. |
ActorSprite.Implementation |
getImplementation()
Returns a reference to the sprite implementation. |
Model |
getModel()
Returns the model associated with the sprite (if any). |
List<Model> |
getModels()
Returns a reference to all the sprites models. |
String |
getTooltipText()
Returns the sprite's tooltip text, or null for none. |
float |
getTooltipTimeout()
Returns the sprite's tooltip timeout, or -1 to use the default. |
String |
getTooltipWindowStyle()
Returns the sprite's tooltip window style. |
boolean |
isClickable()
Determines whether the sprite is clickable. |
protected boolean |
isCreated()
Determines whether the actor has been created. |
protected boolean |
isDestroyed()
Determines whether the actor has been destroyed. |
boolean |
isHoverable()
Determines whether the sprite is hoverable (for purposes of in-game user interaction). |
protected boolean |
isRemoved()
Determines whether the actor has been removed. |
void |
occupantEntered(TudeyOccupantInfo info)
Notes that the occupant controlling this actor has entered. |
void |
occupantLeft(TudeyOccupantInfo info)
Notes that the occupant controlling this actor has left. |
void |
occupantUpdated(TudeyOccupantInfo oinfo,
TudeyOccupantInfo ninfo)
Notes that the occupant controlling this actor has been updated. |
void |
reinit(int timestamp,
Actor actor)
Reinitializes the sprite. |
void |
remove(int timestamp)
Notes that the actor has been removed. |
void |
setAttachedVisibility(boolean visible)
Updates the visibility of attached models. |
protected void |
setConfig(ActorConfig config)
Sets the configuration of this sprite. |
protected void |
setConfig(ConfigReference<ActorConfig> ref)
Sets the configuration of this sprite. |
void |
spawnAttachedTransientModel(ConfigReference<ModelConfig> ref)
Gets and attaches a transient model to this sprite. |
Model |
spawnOffsetTransientModel(ConfigReference<ModelConfig> ref,
boolean rotate)
Spawns a transient model at a z-offset of the location of this sprite. |
Model |
spawnOffsetTransientModel(ConfigReference<ModelConfig> ref,
boolean rotate,
float offset)
Spawns a transient model at a z-offset of the location of this sprite. |
Model |
spawnTransientModel(ConfigReference<ModelConfig> ref)
Spawns a transient model at the location (translation and rotation) of this sprite. |
Model |
spawnTransientModel(ConfigReference<ModelConfig> ref,
boolean rotate)
Spawns a transient model at the location of this sprite. |
boolean |
tick(int delayedTime)
Ticks the participant. |
protected void |
update()
Updates the configuration and implementation of the sprite. |
void |
update(int timestamp,
Actor actor)
Updates this sprite with new state. |
protected void |
updateActor()
Brings the state of the actor up-to-date with the current time. |
protected static void |
updateAttachedTransform(Model attached,
Transform3D mtrans)
Updates the transform of an attached model based on that of the primary. |
protected void |
updateFromConfig()
Updates the sprite to match its new or modified configuration. |
protected void |
updateShape()
Updates the shape according to the state of the actor. |
| Methods inherited from class com.threerings.tudey.client.sprite.Sprite |
|---|
getScopeName, setVisible |
| Methods inherited from class com.threerings.expr.SimpleScope |
|---|
addListener, get, getParentScope, removeListener, scopeUpdated |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected ActorHistory _history
protected ActorAdvancer _advancer
@Scoped protected Actor _actor
protected ActorConfig _config
protected int _removed
@Scoped protected Model _model
@Scoped protected List<Model> _attachedModels
protected boolean _attachedVisible
protected ShapeElement _shape
protected ActorSprite.Implementation _impl
null until actually created).
protected boolean _disposed
protected static final ActorSprite.Implementation NULL_IMPLEMENTATION
| Constructor Detail |
|---|
public ActorSprite(TudeyContext ctx,
TudeySceneView view,
int timestamp,
Actor actor)
| Method Detail |
|---|
public void reinit(int timestamp,
Actor actor)
public ActorAdvancer getAdvancer()
public List<Model> getModels()
public ActorSprite.Implementation getImplementation()
public void attachScaledModel(Model model)
public void attachScaledModel(Model model,
float baseScale)
public void attachModel(Model model)
public void detachModel(Model model)
public void setAttachedVisibility(boolean visible)
public void spawnAttachedTransientModel(ConfigReference<ModelConfig> ref)
public Model spawnTransientModel(ConfigReference<ModelConfig> ref)
public Model spawnTransientModel(ConfigReference<ModelConfig> ref,
boolean rotate)
rotate - if true, match the rotation as well as the translation of the sprite.
public Model spawnOffsetTransientModel(ConfigReference<ModelConfig> ref,
boolean rotate)
rotate - if true, match the rotation as well as the translation of the sprite.
public void update(int timestamp,
Actor actor)
public void remove(int timestamp)
public void occupantEntered(TudeyOccupantInfo info)
public void occupantLeft(TudeyOccupantInfo info)
public void occupantUpdated(TudeyOccupantInfo oinfo,
TudeyOccupantInfo ninfo)
public boolean displayMessage(UserMessage msg,
boolean alreadyDisplayed)
public void clearMessages()
public boolean tick(int delayedTime)
TudeySceneView.TickParticipant
tick in interface TudeySceneView.TickParticipantdelayedTime - the current delayed client time.
public void configUpdated(ConfigEvent<ActorConfig> event)
ConfigUpdateListener
configUpdated in interface ConfigUpdateListener<ActorConfig>public Actor getActor()
HasActor
getActor in interface HasActorpublic Model getModel()
Sprite
getModel in class Spritepublic int getFloorFlags()
Sprite
getFloorFlags in class Spritepublic int getFloorMask()
Sprite
getFloorMask in class Spritepublic boolean isHoverable()
Sprite
isHoverable in class Spritepublic boolean isClickable()
Sprite
isClickable in class Spritepublic String getTooltipText()
Spritenull for none.
getTooltipText in class Spritepublic float getTooltipTimeout()
Sprite
getTooltipTimeout in class Spritepublic String getTooltipWindowStyle()
Sprite
getTooltipWindowStyle in class Spritepublic Component createTooltipComponent(String tiptext)
SpriteSprite.getTooltipText()
returns true).
createTooltipComponent in class Spritepublic boolean dispatchEvent(Event event)
Sprite
dispatchEvent in class Spritepublic void dispose()
SimpleScope
dispose in class SimpleScopeprotected void updateActor()
protected boolean isCreated()
protected boolean isDestroyed()
protected boolean isRemoved()
protected int getActorTime()
protected void update()
protected void setConfig(ConfigReference<ActorConfig> ref)
protected void setConfig(ActorConfig config)
protected void updateFromConfig()
protected void updateShape()
protected float getAttachedScale()
public Model spawnOffsetTransientModel(ConfigReference<ModelConfig> ref,
boolean rotate,
float offset)
rotate - if true, match the rotation as well as the translation of the sprite.
protected static void updateAttachedTransform(Model attached,
Transform3D mtrans)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||