|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.cmu.emulator.world.MovableObject
public class MovableObject
Represents the general MovableObject. It tracks the object's position, velocity, etc in the emulated world.
Position and navigation attributes should not be set directly. Instead, navigation methods should be invoked to set these attributes. This allows for proper handling of listener code and termination of ongoing navigation.
EmuNode and Antenna extend this class.
See the world documentation for more information.
Field Summary | |
---|---|
protected RelVector |
accelerationMPS2
|
protected HashMap |
attributeMap
|
protected ArrayList |
children
|
private static boolean |
debugListeners
|
private static boolean |
debugSegment
|
protected DirRelOrientationMatrix |
dirOrientation
relative orientation computed from the velocityMPS |
protected GroupWorker |
groupWorker
|
static int |
ID_ACCELERATION_MPS2
|
static int |
ID_ORIENTATION
|
static int |
ID_POSITION
|
static int |
ID_ROTATION
|
static int |
ID_VELOCITY_MPS
|
protected String |
name
|
protected Navigator |
navigator
|
static int |
OM_PARENT
|
static int |
OM_VELOCITY
|
protected RelOrientationMatrix |
orientation
relative orientation in parent's reference frame |
protected int |
orientationMode
The value is OM_PARENT or OM_VELOCITY. |
protected MovableObject |
parent
|
protected RelPositionVector |
position
relative position in parent's reference frame |
protected RelVector |
rotation
|
protected long |
segmentEndMillis
|
protected double[] |
segmentEndPos
|
protected ListenerManager |
segmentListenerManager
|
protected long |
segmentStartMillis
|
protected double[] |
segmentStartPos
|
protected String |
uName
|
protected RelVector |
velocityMPS
|
Constructor Summary | |
---|---|
MovableObject()
Construct a MovableObject with the world as parent |
|
MovableObject(MovableObject parent)
Construct a MovableObject with the given parent |
Method Summary | |
---|---|
void |
addChild(MovableObject child)
|
void |
addSegmentListener(SegmentListener listener,
int threadMode)
|
void |
addWaypointListener(WaypointListener wpl)
|
void |
addWaypointListener(WaypointListener wpl,
int threadMode)
|
(package private) void |
endSegment()
Called by system code |
void |
fixOrientation(double[][] newOrientation)
Set to a fixed orientation. |
double[] |
getAbsAcceleration()
|
void |
getAbsAcceleration(double[] accel)
|
double[][] |
getAbsOrientation()
Get the absolute orientation . |
void |
getAbsOrientation(double[][] oMatrix)
|
double[] |
getAbsPosition()
|
void |
getAbsPosition(double[] pos)
|
double[] |
getAbsRotation()
|
void |
getAbsRotation(double[] vel)
|
double[] |
getAbsVelocity()
|
void |
getAbsVelocity(double[] vel)
|
RelVector |
getAcceleration()
|
Object |
getAttribute(String name)
|
MovableObject |
getChild(int index)
|
double |
getDistance(MovableObject other)
Calculates the distance between this object and another MovableObject. |
String |
getName()
|
int |
getNumChildren()
|
RelOrientationMatrix |
getOrientation()
|
void |
getOrientation(double[][] oMatrix)
|
int |
getOrientationMode()
Get the orientation mode |
MovableObject |
getParent()
|
RelPositionVector |
getPosition()
|
RelVector |
getRotation()
|
String |
getUName()
|
RelVector |
getVelocity()
|
boolean |
isMoving()
Checks if the node is in motion in the world.. |
void |
moveToOverTime(double[] rPos,
double timeSecs)
Move to a given position over a given time interval. |
void |
moveToOverTime(double[] rPos,
double timeSecs,
long startTimeSecs)
Move to a given position over a given time interval starting at the specified time. |
void |
moveToOverTime(double[] rPos,
long timeMillis)
Move to a given position over a given time interval. |
void |
moveToOverTime(double[] rPos,
long timeMillis,
long startTimeMillis)
Move to a given position over a given time interval starting at the specified time. |
void |
moveToWithSpeed(double[] rPos,
double speedMPS)
Move to a given position at a given speed. |
void |
moveToWithSpeed(double[] rPos,
double speedMPS,
double startTimeSecs)
Move to a given position at a given speed at a given start time. |
void |
moveToWithSpeed(double[] rPos,
double speedMPS,
long startTimeMillis)
Move to a given position at a given speed at a given start time. |
protected void |
notifySegmentListeners(long timeMillis,
boolean atStart)
|
void |
removeSegmentListener(SegmentListener listener)
|
void |
removeWaypointListener(WaypointListener wpl)
|
void |
setAttribute(String name,
Object value)
|
void |
setName(String name)
|
void |
setOrientationMode(int orientationMode)
Set the orientation mode. |
void |
setStationaryAtPos(double[] rPos)
Set the node to a specific position, and make it stationary. |
void |
setUName(String name)
|
void |
startRoute(Route newRoute)
Start navigation of a route. |
(package private) void |
startSegment(long startTimeMillis,
long navTimeMillis,
double[] segmentStartPos,
double[] segmentEndPos)
Called by system code |
(package private) void |
stopInPlace(long timeMillis)
Called by system code |
void |
update(long timeMillis)
Called by system code |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected String name
protected String uName
protected RelPositionVector position
protected RelVector velocityMPS
protected RelVector accelerationMPS2
protected RelOrientationMatrix orientation
protected DirRelOrientationMatrix dirOrientation
protected int orientationMode
protected RelVector rotation
public static final int ID_POSITION
public static final int ID_VELOCITY_MPS
public static final int ID_ACCELERATION_MPS2
public static final int ID_ORIENTATION
public static final int ID_ROTATION
public static final int OM_PARENT
public static final int OM_VELOCITY
protected MovableObject parent
protected ArrayList children
protected ListenerManager segmentListenerManager
protected GroupWorker groupWorker
protected HashMap attributeMap
protected long segmentStartMillis
protected long segmentEndMillis
protected double[] segmentStartPos
protected double[] segmentEndPos
protected Navigator navigator
private static final boolean debugListeners
private static final boolean debugSegment
Constructor Detail |
---|
public MovableObject(MovableObject parent)
public MovableObject()
Method Detail |
---|
public void setOrientationMode(int orientationMode)
orientationMode
public int getOrientationMode()
public MovableObject getParent()
public void setName(String name)
public String getName()
public void setUName(String name)
public String getUName()
public int getNumChildren()
public MovableObject getChild(int index)
public void addChild(MovableObject child)
public RelPositionVector getPosition()
public double[] getAbsPosition()
public void getAbsPosition(double[] pos)
public RelVector getVelocity()
public double[] getAbsVelocity()
public void getAbsVelocity(double[] vel)
public RelVector getAcceleration()
public double[] getAbsAcceleration()
public void getAbsAcceleration(double[] accel)
public RelOrientationMatrix getOrientation()
public double[][] getAbsOrientation()
public void getAbsOrientation(double[][] oMatrix)
public void getOrientation(double[][] oMatrix)
public RelVector getRotation()
public double[] getAbsRotation()
public void getAbsRotation(double[] vel)
public void startRoute(Route newRoute)
public boolean isMoving()
true
of the node is moving towards its
destination, false
otherwise.public double getDistance(MovableObject other)
other
- distance of object to measure to
public void addSegmentListener(SegmentListener listener, int threadMode)
public void removeSegmentListener(SegmentListener listener)
protected void notifySegmentListeners(long timeMillis, boolean atStart)
public void addWaypointListener(WaypointListener wpl, int threadMode)
public void addWaypointListener(WaypointListener wpl)
public void removeWaypointListener(WaypointListener wpl)
public Object getAttribute(String name)
public void setAttribute(String name, Object value)
public void setStationaryAtPos(double[] rPos)
public void moveToWithSpeed(double[] rPos, double speedMPS)
public void moveToWithSpeed(double[] rPos, double speedMPS, double startTimeSecs)
public void moveToWithSpeed(double[] rPos, double speedMPS, long startTimeMillis)
public void moveToOverTime(double[] rPos, double timeSecs)
public void moveToOverTime(double[] rPos, double timeSecs, long startTimeSecs)
public void moveToOverTime(double[] rPos, long timeMillis)
public void moveToOverTime(double[] rPos, long timeMillis, long startTimeMillis)
public void fixOrientation(double[][] newOrientation)
newOrientation
- double[][]void startSegment(long startTimeMillis, long navTimeMillis, double[] segmentStartPos, double[] segmentEndPos)
void endSegment()
void stopInPlace(long timeMillis)
public void update(long timeMillis)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |