edu.nps.moves.disutil
Class DisMarshaller
java.lang.Object
edu.nps.moves.disutil.DisMarshaller
public class DisMarshaller
- extends java.lang.Object
Marhsalls a Java object PDU to IEEE DIS, optionally changing coordinate systems
of some PDUs to conform to the desired coordinate system.
DIS has a standard coordiante system; its origin is a the center of the
earth and it is cartesian. It's very difficult for casual programmers to work
with, though. Often simulators want to specify object locations in (lat, lon, altitude)
or (x,y) offset from some position on the surface of the earth. Also, the timestamp
updates are not always easy to work with. In short, there are some fields in the
PDUs whose values are not easily set, but that nonetheless need to be correctly
specified. This class accoplishes that.
The class can rewrite the coordinates used for position in PDUs to conform to
the DIS standard, or someother agreed-upon standard. Fields such as the
timestamp or exercise ID can also be set--in short, it can look over the
shoulder of the programmer and set the fields correctly even if the programmer
doesn't. As with any effort of this type, the line betwen being helpful and
being annoying is a fine one.
- Author:
- DMcG
Nested Class Summary |
static class |
DisMarshaller.TimestampStyle
The various formats we can use for the timestamp format in the PDU header when marshalled |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DisMarshaller
public DisMarshaller()
marshalPdu
public byte[] marshalPdu(Pdu aPdu)