open-dis-cpp
CollisionElasticPdu.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/Vector3Float.h>
9 #include <dis6/EntityInformationFamilyPdu.h>
10 #include <dis6/utils/DataStream.h>
11 #include <dis6/opendis6_export.h>
12 
13 
14 namespace DIS
15 {
16 // 5.3.3.3. Information about elastic collisions in a DIS exercise shall be communicated using a Collision-Elastic PDU. COMPLETE
17 
18 // Copyright (c) 2007-2009, MOVES Institute, Naval Postgraduate School. All rights reserved.
19 //
20 // @author DMcG, jkg
21 
22 class OPENDIS6_EXPORT CollisionElasticPdu : public EntityInformationFamilyPdu
23 {
24 protected:
27 
30 
33 
35  short _pad;
36 
39 
41  float _mass;
42 
45 
48 
51 
54 
57 
60 
63 
66 
69 
70 
71  public:
73  virtual ~CollisionElasticPdu();
74 
75  virtual void marshal(DataStream& dataStream) const;
76  virtual void unmarshal(DataStream& dataStream);
77 
78  EntityID& getIssuingEntityID();
79  const EntityID& getIssuingEntityID() const;
80  void setIssuingEntityID(const EntityID &pX);
81 
82  EntityID& getCollidingEntityID();
83  const EntityID& getCollidingEntityID() const;
84  void setCollidingEntityID(const EntityID &pX);
85 
86  EventID& getCollisionEventID();
87  const EventID& getCollisionEventID() const;
88  void setCollisionEventID(const EventID &pX);
89 
90  short getPad() const;
91  void setPad(short pX);
92 
93  Vector3Float& getContactVelocity();
94  const Vector3Float& getContactVelocity() const;
95  void setContactVelocity(const Vector3Float &pX);
96 
97  float getMass() const;
98  void setMass(float pX);
99 
100  Vector3Float& getLocation();
101  const Vector3Float& getLocation() const;
102  void setLocation(const Vector3Float &pX);
103 
104  float getCollisionResultXX() const;
105  void setCollisionResultXX(float pX);
106 
107  float getCollisionResultXY() const;
108  void setCollisionResultXY(float pX);
109 
110  float getCollisionResultXZ() const;
111  void setCollisionResultXZ(float pX);
112 
113  float getCollisionResultYY() const;
114  void setCollisionResultYY(float pX);
115 
116  float getCollisionResultYZ() const;
117  void setCollisionResultYZ(float pX);
118 
119  float getCollisionResultZZ() const;
120  void setCollisionResultZZ(float pX);
121 
122  Vector3Float& getUnitSurfaceNormal();
123  const Vector3Float& getUnitSurfaceNormal() const;
124  void setUnitSurfaceNormal(const Vector3Float &pX);
125 
126  float getCoefficientOfRestitution() const;
127  void setCoefficientOfRestitution(float pX);
128 
129 
130 virtual int getMarshalledSize() const;
131 
132  bool operator ==(const CollisionElasticPdu& rhs) const;
133 };
134 }
135 
136 // Copyright (c) 1995-2009 held by the author(s). All rights reserved.
137 // Redistribution and use in source and binary forms, with or without
138 // modification, are permitted provided that the following conditions
139 // are met:
140 //
141 // * Redistributions of source code must retain the above copyright
142 // notice, this list of conditions and the following disclaimer.
143 // * Redistributions in binary form must reproduce the above copyright
144 // notice, this list of conditions and the following disclaimer
145 // in the documentation and/or other materials provided with the
146 // distribution.
147 // * Neither the names of the Naval Postgraduate School (NPS)
148 // Modeling Virtual Environments and Simulation (MOVES) Institute
149 // (http://www.nps.edu and http://www.MovesInstitute.org)
150 // nor the names of its contributors may be used to endorse or
151 // promote products derived from this software without specific
152 // prior written permission.
153 //
154 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
155 // AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
156 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
157 // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
158 // COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
159 // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
160 // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
161 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
162 // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
163 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
164 // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
165 // POSSIBILITY OF SUCH DAMAGE.
Vector3Float _location
Location with respect to entity the issuing entity collided with.
Definition: CollisionElasticPdu.h:44
float _collisionResultXY
tensor values
Definition: CollisionElasticPdu.h:50
Symbolic names as defined in 5.1.4.
Definition: AcknowledgePdu.h:8
float _collisionResultYZ
tensor values
Definition: CollisionElasticPdu.h:59
float _coefficientOfRestitution
This field shall represent the degree to which energy is conserved in a collision.
Definition: CollisionElasticPdu.h:68
Definition: EntityInformationFamilyPdu.h:16
a class to support managing a network buffer.
Definition: DataStream.h:28
float _collisionResultZZ
tensor values
Definition: CollisionElasticPdu.h:62
float _collisionResultXZ
tensor values
Definition: CollisionElasticPdu.h:53
float _mass
mass of issuing entity
Definition: CollisionElasticPdu.h:41
EventID _collisionEventID
ID of event.
Definition: CollisionElasticPdu.h:32
Vector3Float _unitSurfaceNormal
This record shall represent the normal vector to the surface at the point of collision detection...
Definition: CollisionElasticPdu.h:65
Definition: EventID.h:15
EntityID _collidingEntityID
ID of entity that has collided with the issuing entity ID.
Definition: CollisionElasticPdu.h:29
EntityID _issuingEntityID
ID of the entity that issued the collision PDU.
Definition: CollisionElasticPdu.h:26
float _collisionResultXX
tensor values
Definition: CollisionElasticPdu.h:47
Definition: Vector3Float.h:15
Definition: EntityID.h:15
Vector3Float _contactVelocity
velocity at collision
Definition: CollisionElasticPdu.h:38
float _collisionResultYY
tensor values
Definition: CollisionElasticPdu.h:56
Definition: CollisionElasticPdu.h:22
short _pad
some padding
Definition: CollisionElasticPdu.h:35