Skip to content
Snippets Groups Projects
Commit e18e7572 authored by UnityGrunt03's avatar UnityGrunt03
Browse files

Created a more elements to the firePDU.

parent 1a278171
No related branches found
No related tags found
No related merge requests found
......@@ -73,7 +73,22 @@ public class Yurk_EspduReceiver
{
System.out.println(receiptMessage);
Vector3Double position = ((FirePdu)aPdu).getLocationInWorldCoordinates();
System.out.println(" FirePdu locationInWorldCoordinates: [" + position.getX() + ", " + position.getY() + ", " + position.getZ() + "]");
//Yurkovich Updated:
EntityID firingEntity = ((FirePdu)aPdu).getFiringEntityID();
Float range = ((FirePdu)aPdu).getRange();
int missionIndedx = ((FirePdu)aPdu).getFireMissionIndex();
Vector3Float pVelocity = new Vector3Float();
pVelocity.setX(1.0f);
pVelocity.setY(2.0f);
pVelocity.setZ(0.0f);
System.out.println(" FirePdu was shot by: " + firingEntity.toString()+
" from locationInWorldCoordinates: [" + position.getX() + ", " + position.getY() + ", " + position.getZ() + "]");
System.out.println("The munition has a range of: "+range+" and a velocity of: [" +pVelocity.getX()+
","+pVelocity.getY()+","+pVelocity.getZ()+"].");
//End Yurkovich Update:
}
else
......
......@@ -143,7 +143,7 @@ public class Yurk_EspduSender
entityID.setSiteID ((short)1); // TODO utility method to allow int values
entityID.setApplicationID((short)2);
entityID.setEntityID ((short)3);
espdu.setEntityID(entityID);
espdu.setEntityID(entityID);
// Set the entity type. SISO has a big list of enumerations, so that by
// specifying various numbers we can say this is an M1A2 American tank,
......@@ -152,8 +152,8 @@ public class Yurk_EspduSender
// enumerations in C++ and Java, but to keep things simple we just use
// numbers here.
// New way using entity jar(s)
espdu.setEntityType(new edu.nps.moves.dis7.entities.usa.platform.land.M1A2());
// New way using entity jar(s)
espdu.setEntityType(new edu.nps.moves.dis7.entities.usa.platform.land.M1A2());
// Manual way:
/*
......@@ -256,7 +256,17 @@ public class Yurk_EspduSender
byte[] espduArray = baos.toByteArray();
FirePdu firePdu = new FirePdu();
firePdu.setLocationInWorldCoordinates(espdu.getEntityLocation());
firePdu.setLocationInWorldCoordinates(espdu.getEntityLocation());
firePdu.setFiringEntityID(espdu.getEntityID());
firePdu.setRange((float) 200.00);
firePdu.setFireMissionIndex(1);
Vector3Float pVelocity = new Vector3Float();
pVelocity.setX(1.0f);
pVelocity.setY(2.0f);
pVelocity.setZ(0.0f);
firePdu.setVelocity(pVelocity);
byte[] fireArray = firePdu.marshal();
broadcastAddresses = getBroadcastAddresses();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment