multiverse.server.engine
Class InterpolatedWorldNode

java.lang.Object
  extended by multiverse.server.engine.InterpolatedWorldNode
All Implemented Interfaces:
Serializable, BasicInterpolatable, Interpolatable, Locatable, WorldNode
Direct Known Subclasses:
WMWorldNode, WorldManagerPlugin.CaptureInterpWorldNode

public class InterpolatedWorldNode
extends Object
implements WorldNode, BasicInterpolatable

See Also:
Serialized Form

Nested Class Summary
 class InterpolatedWorldNode.InterpolatedDirLocOrientTime
          A utility class provided solely to return these values atomically
 
Field Summary
protected  Set<WorldNode> children
           
protected  MVVector dir
           
protected  Boolean followsTerrain
           
protected  long instanceOid
           
protected  Point interpLoc
           
protected  long lastInterp
           
protected  long lastUpdate
           
 Lock lock
           
protected  EntityHandle objHandle
           
protected  Quaternion orient
           
protected  WorldNode parent
           
protected  PathInterpolator pathInterpolator
           
protected  Point rawLoc
           
private static long serialVersionUID
           
protected  boolean spawned
           
 Lock treeLock
           
 
Constructor Summary
InterpolatedWorldNode()
           
InterpolatedWorldNode(BasicWorldNode bnode)
           
InterpolatedWorldNode(WorldManagerClient.ObjectInfo info)
           
 
Method Summary
 void addChild(WorldNode child)
           
protected  void changeDir(MVVector dir, boolean performDirInterpolation)
           
 Set<WorldNode> getChildren()
           
 Point getCurrentLoc()
           
 MVVector getDir()
           
 InterpolatedWorldNode.InterpolatedDirLocOrientTime getDirLocOrientTime()
           
 Boolean getFollowsTerrain()
           
 long getInstanceOid()
           
 Point getInterpLoc()
           
 long getLastInterp()
           
 long getLastUpdate()
           
 Point getLoc()
           
 MVObject getObject()
           
 Long getObjectOID()
           
 Quaternion getOrientation()
           
 WorldNode getParent()
           
 PathInterpolator getPathInterpolator()
           
 Point getRawLoc()
           
 PathLocAndDir interpolate(float t)
           
 boolean isSpawned()
           
 void isSpawned(boolean spawned)
           
private  void readObject(ObjectInputStream in)
           
 void removeChild(WorldNode child)
           
 void setChildren(Set<WorldNode> children)
           
 void setDir(MVVector dir)
           
 void setDirLocOrient(BasicWorldNode bnode)
           
 void setFollowsTerrain(Boolean flag)
           
 void setInstanceOid(long oid)
           
 void setInterpLoc(Point p)
           
 void setLastInterp(long time)
           
 void setLastUpdate(long time)
           
 void setLoc(Point p)
           
 void setObject(MVObject obj)
           
 void setObjectOID(Long oid)
           
 void setOrientation(Quaternion orient)
           
 void setParent(WorldNode node)
           
 void setPathInterpolator(PathInterpolator pathInterpolator)
           
 void setPathInterpolatorValues(long time, MVVector newDir, Point newLoc, Quaternion orientation)
           
 void setRawLoc(Point p)
           
(package private)  void setupTransient()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

objHandle

protected EntityHandle objHandle

followsTerrain

protected Boolean followsTerrain

spawned

protected boolean spawned

instanceOid

protected long instanceOid

rawLoc

protected Point rawLoc

interpLoc

protected Point interpLoc

dir

protected MVVector dir

orient

protected Quaternion orient

pathInterpolator

protected transient PathInterpolator pathInterpolator

lastUpdate

protected long lastUpdate

lastInterp

protected long lastInterp

parent

protected WorldNode parent

children

protected Set<WorldNode> children

lock

public transient Lock lock

treeLock

public transient Lock treeLock

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values
Constructor Detail

InterpolatedWorldNode

public InterpolatedWorldNode()

InterpolatedWorldNode

public InterpolatedWorldNode(BasicWorldNode bnode)

InterpolatedWorldNode

public InterpolatedWorldNode(WorldManagerClient.ObjectInfo info)
Method Detail

setupTransient

void setupTransient()

toString

public String toString()
Overrides:
toString in class Object

getInstanceOid

public long getInstanceOid()
Specified by:
getInstanceOid in interface Locatable

setInstanceOid

public void setInstanceOid(long oid)

getLoc

public Point getLoc()
Specified by:
getLoc in interface Locatable

setLoc

public void setLoc(Point p)
Specified by:
setLoc in interface Locatable

getLastUpdate

public long getLastUpdate()
Specified by:
getLastUpdate in interface Locatable

setLastUpdate

public void setLastUpdate(long time)
Specified by:
setLastUpdate in interface Locatable

getObject

public MVObject getObject()
Specified by:
getObject in interface WorldNode

setObject

public void setObject(MVObject obj)
Specified by:
setObject in interface WorldNode

setObjectOID

public void setObjectOID(Long oid)

getObjectOID

public Long getObjectOID()

getParent

public WorldNode getParent()
Specified by:
getParent in interface WorldNode

setParent

public void setParent(WorldNode node)
Specified by:
setParent in interface WorldNode

getOrientation

public Quaternion getOrientation()
Specified by:
getOrientation in interface BasicInterpolatable
Specified by:
getOrientation in interface WorldNode

setOrientation

public void setOrientation(Quaternion orient)
Specified by:
setOrientation in interface BasicInterpolatable
Specified by:
setOrientation in interface WorldNode

setDirLocOrient

public void setDirLocOrient(BasicWorldNode bnode)

getDirLocOrientTime

public InterpolatedWorldNode.InterpolatedDirLocOrientTime getDirLocOrientTime()

getChildren

public Set<WorldNode> getChildren()
Specified by:
getChildren in interface WorldNode

setChildren

public void setChildren(Set<WorldNode> children)
Specified by:
setChildren in interface WorldNode

addChild

public void addChild(WorldNode child)
Specified by:
addChild in interface WorldNode

removeChild

public void removeChild(WorldNode child)
Specified by:
removeChild in interface WorldNode

isSpawned

public boolean isSpawned()
Specified by:
isSpawned in interface WorldNode

isSpawned

public void isSpawned(boolean spawned)

getPathInterpolator

public PathInterpolator getPathInterpolator()
Specified by:
getPathInterpolator in interface BasicInterpolatable

setPathInterpolator

public void setPathInterpolator(PathInterpolator pathInterpolator)

interpolate

public PathLocAndDir interpolate(float t)

getDir

public MVVector getDir()
Specified by:
getDir in interface BasicInterpolatable

setDir

public void setDir(MVVector dir)
Specified by:
setDir in interface BasicInterpolatable

changeDir

protected void changeDir(MVVector dir,
                         boolean performDirInterpolation)

getRawLoc

public Point getRawLoc()
Specified by:
getRawLoc in interface BasicInterpolatable

setRawLoc

public void setRawLoc(Point p)
Specified by:
setRawLoc in interface BasicInterpolatable

getLastInterp

public long getLastInterp()
Specified by:
getLastInterp in interface BasicInterpolatable

setLastInterp

public void setLastInterp(long time)
Specified by:
setLastInterp in interface BasicInterpolatable

getInterpLoc

public Point getInterpLoc()
Specified by:
getInterpLoc in interface BasicInterpolatable

getCurrentLoc

public Point getCurrentLoc()
Specified by:
getCurrentLoc in interface Locatable

setInterpLoc

public void setInterpLoc(Point p)
Specified by:
setInterpLoc in interface BasicInterpolatable

setPathInterpolatorValues

public void setPathInterpolatorValues(long time,
                                      MVVector newDir,
                                      Point newLoc,
                                      Quaternion orientation)
Specified by:
setPathInterpolatorValues in interface BasicInterpolatable

getFollowsTerrain

public Boolean getFollowsTerrain()

setFollowsTerrain

public void setFollowsTerrain(Boolean flag)

readObject

private void readObject(ObjectInputStream in)
                 throws IOException,
                        ClassNotFoundException
Throws:
IOException
ClassNotFoundException