Actin®  Version 5.2.0
Software for Robotics Simulation and Control
ecShapeProximityData.h
Go to the documentation of this file.
1 #ifndef ecShapeProximityData_H_
2 #define ecShapeProximityData_H_
3 //------------------------------------------------------------------------------
4 // Copyright (c) 2004-2013 Energid Technologies. All rights reserved.
5 //
8 //
9 //------------------------------------------------------------------------------
10 #include <actinCore/actinCore_config.h> // Required to be first header.
12 #include "ecPlane.h"
14 #include <xml/ecXmlCompType.h>
15 
16 // XXX FIXME: selfTest requires access to protected methods.
17 namespace Ec { namespace test { class EcShapeProximityDataTester; } }
18 
21 {
22 public:
24  typedef enum
25  {
26  POINT,
27  LINE,
28  FACET,
29  CLOSEST_NONE
30  } EcClosestType;
31 
33  typedef enum
34  {
35  STATIC_FRICTION_MODE,
36  KINETIC_FRICTION_MODE,
37  UNDEFINED_FRICTION_MODE
39 
42  (
43  );
44 
46  virtual ~EcShapeProximityData
47  (
48  );
49 
52  (
53  const EcShapeProximityData& orig
54  );
55 
57  EcShapeProximityData& operator=
58  (
59  const EcShapeProximityData& orig
60  );
61 
63  EcBoolean operator==
64  (
65  const EcShapeProximityData& orig
66  ) const;
67 
69  virtual EcBoolean xmlInit
70  (
71  ) EC_OVERRIDE;
72 
74  virtual void registerComponents
75  (
76  ) EC_OVERRIDE;
77 
79  virtual const EcToken& token
80  (
81  ) const EC_OVERRIDE;
82 
84  virtual EcXmlObject* clone
85  (
86  ) const EC_OVERRIDE;
87 
89  virtual EcBoolean equality
90  (
91  const EcXmlObject* other
92  ) const EC_OVERRIDE;
93 
95  virtual EcXmlObject* newObject
96  (
97  ) const EC_OVERRIDE;
98 
100  virtual const EcReal& distance
101  (
102  ) const;
103 
105  virtual void setDistance
106  (
107  const EcReal& dist
108  );
109 
111  virtual void setCollisionOccurred
112  (
113  EcBoolean col
114  );
115 
117  virtual EcBoolean collisionOccurred
118  (
119  ) const;
120 
122  virtual void setProximityVector
123  (
124  const EcVector& vec
125  );
126 
128  virtual const EcVector& proximityVector
129  (
130  ) const;
131 
133  virtual void setUpdateTime
134  (
135  const EcU64& uTime
136  );
137 
139  virtual const EcU64& updateTime
140  (
141  ) const;
142 
144  virtual void setDistanceUpdateTime
145  (
146  const EcU64& uTime
147  );
148 
150  virtual const EcU64& distanceUpdateTime
151  (
152  ) const;
153 
155  virtual void setLineOfAction
156  (
157  const EcVector& loa
158  );
159 
161  virtual const EcVector& lineOfAction
162  (
163  ) const;
164 
166  virtual void setCollisionPointPrimaryObject1
167  (
168  const EcVector& colPoint
169  );
170 
172  virtual const EcVector& collisionPointPrimaryObject1
173  (
174  )const;
175 
177  virtual void setCollisionPointPrimaryObject2
178  (
179  const EcVector& colPoint
180  );
181 
183  virtual const EcVector& collisionPointPrimaryObject2
184  (
185  )const;
186 
191  virtual void setStaticStartCollisionPointInPrimary1
192  (
193  const EcVector& colPoint
194  );
195 
200  virtual const EcVector& staticStartCollisionPointInPrimary1
201  (
202  )const;
203 
208  virtual void setStaticStartCollisionPointInPrimary2
209  (
210  const EcVector& colPoint
211  );
212 
217  virtual const EcVector& staticStartCollisionPointInPrimary2
218  (
219  )const;
220 
223  virtual const EcCoordinateSystemTransformation& relXformObject1
224  (
225  )const;
226 
229  virtual void setRelXformObject1
230  (
232  );
233 
235  virtual void setLastVelocityPrimaryObject1
236  (
237  const EcGeneralVelocity& vel
238  );
239 
241  virtual const EcGeneralVelocity& lastVelocityPrimaryObject1
242  (
243  )const;
244 
246  virtual void setLastVelocityPrimaryObject2
247  (
248  const EcGeneralVelocity& vel
249  );
250 
252  virtual const EcGeneralVelocity& lastVelocityPrimaryObject2
253  (
254  )const;
255 
257  virtual void setVelocityPrimaryObject1
258  (
259  const EcGeneralVelocity& vel
260  );
261 
263  virtual const EcGeneralVelocity& velocityPrimaryObject1
264  (
265  )const;
266 
268  virtual void setVelocityPrimaryObject2
269  (
270  const EcGeneralVelocity& vel
271  );
272 
274  virtual const EcGeneralVelocity& velocityPrimaryObject2
275  (
276  )const;
277 
279  virtual void setProximitySense
280  (
281  const EcBoolean& sense
282  )const;
283 
285  virtual const EcBoolean& proximitySense
286  (
287  )const;
288 
290  virtual void setFrictionMode
291  (
292  const EcFrictionMode& insmode
293  );
294 
296  virtual const EcFrictionMode& frictionMode
297  (
298  )const;
299 
301  virtual const EcCoordinateSystemTransformation& staticStartPrimaryFrame1InSystem
302  (
303  )const;
304 
306  virtual void setStaticStartPrimaryFrame1InSystem
307  (
308  const EcCoordinateSystemTransformation& staticStartPrimaryFrame1InSystem
309  );
310 
312  virtual const EcCoordinateSystemTransformation& staticStartPrimaryFrame2InSystem
313  (
314  )const;
315 
317  virtual void setStaticStartPrimaryFrame2InSystem
318  (
319  const EcCoordinateSystemTransformation& primaryFrame2InSystem
320  );
321 
323  virtual void setDynamicSimulationDataFromLast
324  (
325  const EcShapeProximityData& data
326  );
327 
329  virtual void setAndInvertDynamicSimulationDataFromLast
330  (
331  const EcShapeProximityData& data
332  );
333 
335  void setAndInvertDirectionalData
336  (
337  const EcShapeProximityData& other
338  );
339 
341  virtual void insertPenetrationPointShape1Primary
342  (
343  const EcVector& point
344  );
345 
347  virtual void insertPenetrationPointShape2Primary
348  (
349  const EcVector& point
350  );
351 
353  virtual const EcVector* getPenetrationPointShape1Primary
354  (
355  const EcU32& nthElement
356  ) const;
357 
359  virtual const EcVector* getPenetrationPointShape2Primary
360  (
361  const EcU32& nthElement
362  ) const;
363 
367  virtual const EcVector& penetrationPointPrimary
368  (
369  EcU32 shapeIndex,
370  EcU32 pointIndex
371  ) const;
372 
375  virtual const EcU32 numPenetrationPoints
376  (
377  )const;
378 
381  virtual void resetPenetrationPointBuffers
382  (
383  );
384 
388  virtual void copyDataWithDirectionalInversion
389  (
390  const EcShapeProximityData& other
391  );
392 
394  virtual const EcClosestType& closestPoint1
395  (
396  )const;
397 
399  virtual void setClosestPoint1
400  (
401  const EcClosestType& val
402  );
403 
405  virtual const EcClosestType& closestPoint2
406  (
407  )const;
408 
410  virtual void setClosestPoint2
411  (
412  const EcClosestType& val
413  );
414 
416  virtual const EcBoolean& firstCollisionOccurred
417  (
418  )const;
419 
421  virtual void setFirstCollisionOccurred
422  (
423  EcBoolean col
424  );
425 
427  virtual void getWitnessPoints
428  (
429  EcVector& witnessPoint1,
430  EcVector& witnessPoint2
431  ) const;
432 
434  virtual void setWitnessPoints
435  (
436  const EcVector& witnessPoint1,
437  const EcVector& witnessPoint2
438  );
439 
441  virtual EcU64 witnessPointsUpdateTime
442  (
443  ) const;
444 
446  virtual void setWitnessPointsUpdateTime
447  (
448  EcU64 updateTime
449  );
450 
451 protected:
453  friend class Ec::test::EcShapeProximityDataTester;
454 
456  virtual void insertPenetrationPoint
457  (
458  const EcVector& point,
459  EcVectorVector& points,
460  EcInt32& index
461  );
462 
464  virtual const EcVector* penetrationPoint
465  (
466  const EcU32& numElements,
467  const EcVectorVector& circularBuffer,
468  const EcInt32& circularBufferHeadIndex
469  ) const;
470 
473 
476 
479 
482 
486 
490 
497 
504 
508 
511 
514 
517 
520 
523  EcFrictionMode m_FrictionMode;
524 
532 
535 
538 
541 
544 
549 
554 
557 
560 
563 
564  //-------used internally----------
565 
568 
572 
575 
578 
580  EcClosestType m_ClosestType1;
581 
583  EcClosestType m_ClosestType2;
584 
587 
589 
592 };
593 
594 #endif // ecShapeProximityData_H_
Holds a class to describe a shape proximity related data.
EcVector m_ProximityVector
the vector of the closest points between the shapes
EcCoordinateSystemTransformation m_StaticStartPrimaryFrame1InSystem
the body 1 static start primary frame in system coordinates
A rotation and a translation to describe a new frame.
EcGeneralVelocity m_LastVelocityPrimaryObject1
last-time-step velocity of the first object in its primary frame
EcGeneralVelocity m_VelocityPrimaryObject1
current velocity of the first object in its primary frame
#define EC_OVERRIDE
Add wrapper around c++11 override keyword.
Definition: ecMacros.h:36
EcReal m_Distance
distance to shape
boost::uint32_t EcU32
32-bit unsigned integer
Definition: ecTypes.h:53
std::vector< EcVector > EcVectorVector
a vector of Euclidean vectors
Definition: ecVector.h:375
EcBoolean m_CollisionOccurred
boolean describing whether or not a collision resulted from the query
EcU64 m_LastWitnessPointsUpdateTime
the time of the last witness points update. witness points can be updated without an update of additi...
EcVector m_StaticStartCollisionPointInPrimary1
A general motion class – to be applied to general velocity and general acceleration.
EcInt32 m_PenetrationPointBuffer1HeadIndex
index pointing to the most recent data in the queue
EcCoordinateSystemTransformation m_StaticStartPrimaryFrame2InSystem
the body 2 static start primary frame in system coordinates
An EcString-like class that holds a tag and a namespace.
Definition: ecToken.h:41
EcClosestType
type of closest
EcCoordinateSystemTransformation m_RelativeTransformPrimaryFrame1
A base class for xml objects.
Definition: ecXmlObject.h:23
boost::uint64_t EcU64
64-bit unsigned integer
Definition: ecTypes.h:59
EcVector m_StaticStartCollisionPointInPrimary2
EcPlane m_ContactPlaneShape2PrimarySystem
the contact plane for shape 2 in primary coordinates
EcU64 m_LastUpdateTime
the time of the last data update
EcVectorVector m_PenetrationPointsPrimaryObject1
Configuration header for the foundation hierarchy.
EcVector m_WitnessPoint1
the witness point on shape 1
An XML object that holds a compound set of XML data.
Definition: ecXmlCompType.h:23
Energid common namespace.
static const EcU32 m_thePenetrationPointBufferSize
const data
bool EcBoolean
Boolean (0 or 1)
Definition: ecTypes.h:21
EcGeneralVelocity m_LastVelocityPrimaryObject2
last-time-step velocity of the second object in its primary frame
EcGeneralVelocity m_VelocityPrimaryObject2
current velocity of the second object in its primary frame
boost::int32_t EcInt32
32-bit signed integer
Definition: ecTypes.h:56
EcF64 EcReal
Alias for 64-bit float.
Definition: ecTypes.h:30
EcVectorVector m_PenetrationPointsPrimaryObject2
EcVector m_LineOfAction
line of action. The direction of the collision
EcBoolean m_FirstCollisionOccurred
boolean describing whether or not a first collision occurred before
EcClosestType m_ClosestType2
The closest type for the other object.
EcPlane m_ContactPlaneShape1PrimarySystem
the contact plane for shape 1 in primary coordinates
EcClosestType m_ClosestType1
The closest type for this object.
Holds a description of a plane.
Definition: ecPlane.h:28
EcVector m_WitnessPoint2
the witness point on shape 2
#define EC_ACTINCORE_GEOMETRY_DECL
geometry directory
EcInt32 m_PenetrationPointBuffer2HeadIndex
index pointing to the most recent data in the queue
A three-element vector.
Definition: ecVector.h:20
Created by Energid Technologies www.energid.com
Copyright © 2016 Energid. All trademarks mentioned in this document are property of their respective owners.