Contents | Package | Class | Tree | Deprecated | Index | Help
PREV | NEXT SHOW LISTS | HIDE LISTS

Class mil.navy.nps.dis.CollisionPdu

java.lang.Object
    |
    +----mil.navy.nps.dis.PduElement
            |
            +----mil.navy.nps.dis.ProtocolDataUnit
                    |
                    +----mil.navy.nps.dis.CollisionPdu

public class CollisionPdu
extends ProtocolDataUnit
Version:
1.0
Author:
Don McGregor (http://www.stl.nps.navy.mil/~mcgredo)
Location:
http://www.stl.nps.navy.mil/dis-java-vrml/mil/navy/nps/dis/CollisionPdu.java
Hierarchy Diagram:
Summary:
Collisions between entities shall be communicated by issuing a Collision PDU.
Explanation:
The collision pdu denotes the collision between two entities. It inherits the header information from ProtocolDataUnit, an abstract class that contains assorted protocol information. It implements the IDs of the issuing entity, the colliding entity, the event, and where the impact occurred with respect to the issuing entity.

As with other PDUs, it knows how to serialize and deserialize itself from the wire. It also knows how to clone itself, and knows how to calculate its size when sent to the wire.

Note:
Here we don't have any padding field, because it isn't used in DIS. However, it is serialized and deSerialized when written to the wire. Also note that we have not created accessor methods for the nested fields.
History:
10Sep97 /JPL /New
8Dec97 /Ronan Fauglas /changes for documentation templates + complements in documentation
11Dec97 /Ronan Fauglas /changed access methods: thisVariable() --> getThisVariable()
References:
DIS-Java-VRML Working Group: http://www.stl.nps.navy.mil/dis-java-vrml/
DIS Data Dictionary : Collision PDU
DIS specification : IEEE 1278.1, Section 4.4.2.2, 5.4.3.2
See Also:
ProtocolDataUnit, PduElement, mil.navy.nps.util.SerializationInterface, EntityStatePdu

Field Summary
EntityID  collidingEntityID
Colliding Entity ID - This field shall identify the entity that has collided with the issuing entity.
mil.navy.nps.util.UnsignedByte  collisionType
Collision Type - This field shall identify the type of collision.
EventID  eventID
Event ID - this field shall contain an identification generated by the issuing simulation application to associate related collision events.
EntityID  issuingEntityID
Issuing Entity ID - This field shall identify the entity that is issueing the Pdu
EntityCoordinate  location
Location - This field shall specify the location of the collision with respect to the entity with which the issuing entity collided.
float  mass
Mass -this field shall contain the mass of the issuing entity.
static int  sizeOf
Constant value--size of an collision PDU without headder.
LinearVelocity  velocity
Velocity - This field shall contain the velocity of the issuing entity (at the time the collision is detected).
 
Fields inherited from class mil.navy.nps.dis.ProtocolDataUnit
 DEBUG, exerciseID, pduType, protocolFamily, protocolVersion, sizeOf, timestamp
 

Constructor Summary
 CollisionPdu()
Default constructor--fills with zeros for all values.
 

Method Summary
java.lang.Object  clone()
 
void  deSerialize(java.io.DataInputStream inputStream)
 
EntityID  getCollidingEntityID()
 
mil.navy.nps.util.UnsignedByte  getCollisionType()
 
EventID  getEventID()
 
EntityID  getIssuingEntityID()
 
LinearVelocity  getLinearVelocity()
 
EntityCoordinate  getLocation()
 
float  getMass()
 
int  length()
 
java.lang.String  PDUName()
 
void  printValues(int indentLevel, java.io.PrintStream printStream)
 
void  serialize(java.io.DataOutputStream outputStream)
 
void  setCollidingEntityID(EntityID pCollidingEntityID)
 
void  setCollisionType(mil.navy.nps.util.UnsignedByte pCollisionType)
 
void  setEventID(EventID pEventID)
 
void  setIssuingEntityID(EntityID pIssuingEntityID)
 
void  setLinearVelocity(LinearVelocity pLinearVelocity)
 
void  setLinearVelocity(float x, float y, float z)
 
void  setLocation(EntityCoordinate pLocation)
 
void  setLocation(float x, float y, float z)
 
void  setMass(float pMass)
 
 
Methods inherited from class mil.navy.nps.dis.ProtocolDataUnit
 , clone, datagramToPdu, deSerialize, getExerciseID, getPduType, getProtocolFamily, getProtocolVersion, getTimestamp, getVRMLTimestamp, length, makeTimestampCurrent, PDUName, printValues, serialize, setExerciseID, setExerciseID, setPduType, setPduType, setProtocolFamily, setProtocolFamily, setProtocolVersion, setProtocolVersion, setSimulationStartTime, setTimestamp, setTimestamp
 
Methods inherited from class mil.navy.nps.dis.PduElement
 clone, deSerialize, length, printValues, serialize
 
Methods inherited from class java.lang.Object
 clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

issuingEntityID

protected EntityID issuingEntityID
Issuing Entity ID - This field shall identify the entity that is issueing the Pdu

collidingEntityID

protected EntityID collidingEntityID
Colliding Entity ID - This field shall identify the entity that has collided with the issuing entity.
Value:
If the entity ID is unknown or the collision is with a terrain object, this field shall contain ENTITY_ID_UNKNOWN.

eventID

protected EventID eventID
Event ID - this field shall contain an identification generated by the issuing simulation application to associate related collision events.

collisionType

protected mil.navy.nps.util.UnsignedByte collisionType
Collision Type - This field shall identify the type of collision.
Value:
Enumeration, see references below for semantics.
References:
see Section 10 in the EBV-doc

velocity

protected LinearVelocity velocity
Velocity - This field shall contain the velocity of the issuing entity (at the time the collision is detected).
Value:
The velocity shall be represented in world Coordinates.

mass

protected float mass
Mass -this field shall contain the mass of the issuing entity.
Value:
In kilograms.

location

protected EntityCoordinate location
Location - This field shall specify the location of the collision with respect to the entity with which the issuing entity collided.

sizeOf

public static final int sizeOf
Constant value--size of an collision PDU without headder. sizeOf = 60 bytes
Constructor Detail

CollisionPdu

public CollisionPdu()
Default constructor--fills with zeros for all values.
Method Detail

clone

public java.lang.Object clone()
Overrides:
clone in class ProtocolDataUnit

serialize

public void serialize(java.io.DataOutputStream outputStream)
Throws:
java.lang.RuntimeException - when IO error occurs.
Overrides:
serialize in class ProtocolDataUnit

deSerialize

public void deSerialize(java.io.DataInputStream inputStream)
Throws:
java.lang.RuntimeException - when IO error occurs.
Overrides:
deSerialize in class ProtocolDataUnit

length

public int length()
Overrides:
length in class ProtocolDataUnit

PDUName

public java.lang.String PDUName()
Overrides:
PDUName in class ProtocolDataUnit

printValues

public void printValues(int indentLevel,
                        java.io.PrintStream printStream)
Overrides:
printValues in class ProtocolDataUnit

getIssuingEntityID

public EntityID getIssuingEntityID()

setIssuingEntityID

public void setIssuingEntityID(EntityID pIssuingEntityID)

getCollidingEntityID

public EntityID getCollidingEntityID()

setCollidingEntityID

public void setCollidingEntityID(EntityID pCollidingEntityID)

getEventID

public EventID getEventID()

setEventID

public void setEventID(EventID pEventID)

getCollisionType

public mil.navy.nps.util.UnsignedByte getCollisionType()

setCollisionType

public void setCollisionType(mil.navy.nps.util.UnsignedByte pCollisionType)

getLinearVelocity

public LinearVelocity getLinearVelocity()

setLinearVelocity

public void setLinearVelocity(LinearVelocity pLinearVelocity)

setLinearVelocity

public void setLinearVelocity(float x,
                              float y,
                              float z)

getMass

public float getMass()

setMass

public void setMass(float pMass)

getLocation

public EntityCoordinate getLocation()

setLocation

public void setLocation(EntityCoordinate pLocation)

setLocation

public void setLocation(float x,
                        float y,
                        float z)

Contents | Package | Class | Tree | Deprecated | Index | Help
PREV | NEXT SHOW LISTS | HIDE LISTS