open-dis-cpp
CollisionPdu.h
1 #pragma once
2 
3 #include <dis6/EntityID.h>
4 #include <dis6/EntityID.h>
5 #include <dis6/EventID.h>
6 #include <dis6/Vector3Float.h>
7 #include <dis6/Vector3Float.h>
8 #include <dis6/EntityInformationFamilyPdu.h>
9 #include <dis6/utils/DataStream.h>
10 #include <dis6/opendis6_export.h>
11 
12 
13 namespace DIS
14 {
15 // Section 5.3.3.2. Information about a collision. COMPLETE
16 
17 // Copyright (c) 2007-2009, MOVES Institute, Naval Postgraduate School. All rights reserved.
18 //
19 // @author DMcG, jkg
20 
21 class OPENDIS6_EXPORT CollisionPdu : public EntityInformationFamilyPdu
22 {
23 protected:
26 
29 
32 
34  unsigned char _collisionType;
35 
37  char _pad;
38 
41 
43  float _mass;
44 
47 
48 
49  public:
50  CollisionPdu();
51  virtual ~CollisionPdu();
52 
53  virtual void marshal(DataStream& dataStream) const;
54  virtual void unmarshal(DataStream& dataStream);
55 
56  EntityID& getIssuingEntityID();
57  const EntityID& getIssuingEntityID() const;
58  void setIssuingEntityID(const EntityID &pX);
59 
60  EntityID& getCollidingEntityID();
61  const EntityID& getCollidingEntityID() const;
62  void setCollidingEntityID(const EntityID &pX);
63 
64  EventID& getEventID();
65  const EventID& getEventID() const;
66  void setEventID(const EventID &pX);
67 
68  unsigned char getCollisionType() const;
69  void setCollisionType(unsigned char pX);
70 
71  char getPad() const;
72  void setPad(char pX);
73 
74  Vector3Float& getVelocity();
75  const Vector3Float& getVelocity() const;
76  void setVelocity(const Vector3Float &pX);
77 
78  float getMass() const;
79  void setMass(float pX);
80 
81  Vector3Float& getLocation();
82  const Vector3Float& getLocation() const;
83  void setLocation(const Vector3Float &pX);
84 
85 
86 virtual int getMarshalledSize() const;
87 
88  bool operator ==(const CollisionPdu& rhs) const;
89 };
90 }
91 
92 // Copyright (c) 1995-2009 held by the author(s). All rights reserved.
93 // Redistribution and use in source and binary forms, with or without
94 // modification, are permitted provided that the following conditions
95 // are met:
96 //
97 // * Redistributions of source code must retain the above copyright
98 // notice, this list of conditions and the following disclaimer.
99 // * Redistributions in binary form must reproduce the above copyright
100 // notice, this list of conditions and the following disclaimer
101 // in the documentation and/or other materials provided with the
102 // distribution.
103 // * Neither the names of the Naval Postgraduate School (NPS)
104 // Modeling Virtual Environments and Simulation (MOVES) Institute
105 // (http://www.nps.edu and http://www.MovesInstitute.org)
106 // nor the names of its contributors may be used to endorse or
107 // promote products derived from this software without specific
108 // prior written permission.
109 //
110 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
111 // AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
112 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
113 // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
114 // COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
115 // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
116 // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
117 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
118 // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
119 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
120 // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
121 // POSSIBILITY OF SUCH DAMAGE.
Symbolic names as defined in 5.1.4.
Definition: AcknowledgePdu.h:8
char _pad
some padding
Definition: CollisionPdu.h:37
EntityID _issuingEntityID
ID of the entity that issued the collision PDU.
Definition: CollisionPdu.h:25
Definition: EntityInformationFamilyPdu.h:16
a class to support managing a network buffer.
Definition: DataStream.h:28
Definition: CollisionPdu.h:21
float _mass
mass of issuing entity
Definition: CollisionPdu.h:43
Definition: EventID.h:15
Definition: Vector3Float.h:15
Definition: EntityID.h:15
Vector3Float _velocity
velocity at collision
Definition: CollisionPdu.h:40
EntityID _collidingEntityID
ID of entity that has collided with the issuing entity ID.
Definition: CollisionPdu.h:28
unsigned char _collisionType
ID of event.
Definition: CollisionPdu.h:34
EventID _eventID
ID of event.
Definition: CollisionPdu.h:31
Vector3Float _location
Location with respect to entity the issuing entity collided with.
Definition: CollisionPdu.h:46