|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.threerings.util.DeepObject
com.threerings.tudey.data.actor.Actor
public class Actor
Represents an active, stateful element of the scene.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.threerings.io.Streamable |
|---|
com.threerings.io.Streamable.Closure |
| Field Summary | |
|---|---|
static int |
LAST_FLAG
The value of the last flag defined in this class. |
static int |
WARP
A flag indicating that the actor has changed its position in a discontinuous fashion. |
| Constructor Summary | |
|---|---|
Actor()
No-arg constructor for deserialization. |
|
Actor(ConfigReference<ActorConfig> config,
int id,
int created,
Vector2f translation,
float rotation)
Creates a new actor. |
|
| Method Summary | |
|---|---|
boolean |
canCollide(Actor oactor)
Determines whether this actor should be checked for collisions with the specified other actor. |
boolean |
canCollide(int flags)
Determines whether this actor should be checked for collisions with scene elements with the specified flags. |
void |
clear(int flag)
Clears a flag. |
Object |
copy(Object dest)
Creates a copy of this object, (re)populating the supplied destination object if possible. |
ActorAdvancer |
createAdvancer(ActorAdvancer.Environment environment,
int timestamp)
Creates an advancer for the actor. |
boolean |
equals(Object other)
|
Actor |
extrapolate(float elapsed,
int timestamp,
Actor result)
Extrapolates the state of this actor after the specified time interval, in seconds (which may be negative). |
int |
getCollisionFlags()
Returns the actor's collision flags. |
int |
getCollisionMask()
Returns the actor's collision mask. |
ConfigReference<ActorConfig> |
getConfig()
Returns the actor's config reference. |
int |
getCreated()
Returns the timestamp at which the actor was created. |
int |
getDestroyed()
Returns the timestamp at which the actor was destroyed, or Integer.MAX_VALUE if
not yet destroyed. |
int |
getFlags()
Returns the actor's flags. |
int |
getId()
Returns the actor's unique identifier. |
ActorConfig.Original |
getOriginal()
Returns a reference to the cached config implementation. |
void |
getPreloads(ConfigManager cfgmgr,
PreloadableSet preloads)
Adds the resources to preload for this actor into the provided set. |
float |
getRotation()
Returns the actor's rotation angle. |
Vector2f |
getTranslation()
Returns a reference to the actor's translation vector. |
int |
hashCode()
|
void |
init(ConfigManager cfgmgr)
Gives the actor a chance to resolve and cache configuration data after being created or deserialized. |
Actor |
interpolate(Actor other,
int start,
int end,
int timestamp,
Actor result)
Interpolates between the state of this actor and that of the specified other, placing the result in the provided object. |
boolean |
isClientControlled(TudeyContext ctx,
TudeySceneView view)
Checks whether this actor is client controlled. |
boolean |
isDirty()
Returns the state of the actor's dirty flag. |
boolean |
isSet(int flag)
Determines whether a flag is set. |
ActorAdvancer |
maybeCreateAdvancer(TudeyContext ctx,
TudeySceneView view,
int timestamp)
Determines whether this actor is controlled by the client and, if so, creates and returns an ActorAdvancer instance to perform client-side prediction. |
void |
set(int flag)
Sets a flag. |
void |
set(int flag,
boolean value)
Sets or clears a flag. |
void |
setConfig(ConfigReference<ActorConfig> config)
Sets the actor's config reference. |
void |
setDestroyed(int destroyed)
Sets the timestamp at which the actor was destroyed. |
void |
setDirty(boolean dirty)
Sets the state of the actor's dirty flag. |
void |
setFlags(int flags)
Sets the actor's flags. |
void |
setRotation(float rotation)
Sets the actor's rotation angle. |
void |
setTranslation(float x,
float y)
Sets the actor's translation and its dirty flag. |
String |
toString()
|
| Methods inherited from class com.threerings.util.DeepObject |
|---|
clone, copy |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int WARP
public static final int LAST_FLAG
| Constructor Detail |
|---|
public Actor(ConfigReference<ActorConfig> config,
int id,
int created,
Vector2f translation,
float rotation)
public Actor()
| Method Detail |
|---|
public void init(ConfigManager cfgmgr)
public void getPreloads(ConfigManager cfgmgr,
PreloadableSet preloads)
public void setConfig(ConfigReference<ActorConfig> config)
public ConfigReference<ActorConfig> getConfig()
public ActorConfig.Original getOriginal()
public int getId()
public int getCreated()
public void setDestroyed(int destroyed)
public int getDestroyed()
Integer.MAX_VALUE if
not yet destroyed.
public void setTranslation(float x,
float y)
public Vector2f getTranslation()
public void setRotation(float rotation)
public float getRotation()
public void setFlags(int flags)
public int getFlags()
public void set(int flag,
boolean value)
public void set(int flag)
public void clear(int flag)
public boolean isSet(int flag)
public Actor interpolate(Actor other,
int start,
int end,
int timestamp,
Actor result)
start - the start time (the timestamp of this actor).end - the end time (the timestamp of the other actor).timestamp - the desired time (the timestamp of the result).
public Actor extrapolate(float elapsed,
int timestamp,
Actor result)
public ActorAdvancer maybeCreateAdvancer(TudeyContext ctx,
TudeySceneView view,
int timestamp)
ActorAdvancer instance to perform client-side prediction. Returns null
if not controlled by the client.
public boolean isClientControlled(TudeyContext ctx,
TudeySceneView view)
public ActorAdvancer createAdvancer(ActorAdvancer.Environment environment,
int timestamp)
public boolean canCollide(Actor oactor)
public boolean canCollide(int flags)
public int getCollisionFlags()
public int getCollisionMask()
public void setDirty(boolean dirty)
public boolean isDirty()
public Object copy(Object dest)
Copyable
copy in interface Copyablecopy in class DeepObjectpublic boolean equals(Object other)
equals in class DeepObjectpublic int hashCode()
hashCode in class DeepObjectpublic String toString()
toString in class DeepObject
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||