AGXDynamics  2.35.0.3
Contacts.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2022. Algoryx Simulation AB.
3 
4 All AGX source code, intellectual property, documentation, sample code,
5 tutorials, scene files and technical white papers, are copyrighted, proprietary
6 and confidential material of Algoryx Simulation AB. You may not download, read,
7 store, distribute, publish, copy or otherwise disseminate, use or expose this
8 material unless having a written signed agreement with Algoryx Simulation AB, or having been
9 advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10 valid commercial license from Algoryx Simulation AB.
11 
12 Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13 from using this software, unless otherwise stated in written agreements with
14 Algoryx Simulation AB.
15 */
16 
17 #pragma once
18 
19 #ifdef _MSC_VER
20 # pragma warning(push)
21 # pragma warning( disable : 4275 ) // warning C4275: non dll-interface class
22 #endif
23 
24 #include <agx/agxPhysics_export.h>
25 
26 #include <agxCollide/agxCollide.h>
27 #include <agx/agx.h>
28 #include <agx/Referenced.h>
29 #include <agx/RigidBody.h>
30 #include <agx/Vec3.h>
32 
33 #include <agx/Material.h>
34 #include <agx/Vector.h>
40 
41 
42 namespace agxSDK
43 {
44  class MaterialManager;
45 }
46 
47 namespace agxCollide
48 {
49  class Geometry;
50 
51 
56  {
57  public:
59  {
62  TANGENTIAL_FORCE_V
63  };
64 
66  {
67  IMPACTING = 1 << 0,
73  NONHOLONOMIC = 1 << 1
79  };
80 
81  public:
85  ContactPoint();
86 
93 
100  ContactPoint(agx::Vec3 thePoint, agx::Vec3f theNormal, agx::Real theDepth);
101 
103  void clear();
104 
106 
112  agx::Real& localForce( size_t idx );
113 
119  agx::Real localForce( size_t idx ) const;
120 
125  agx::Vec3 getForce() const;
126 
130  agx::Real getForceMagnitude() const;
131 
135  agx::Vec3 getNormalForce() const;
136 
140  agx::Real getNormalForceMagnitude() const;
141 
145  agx::Real getTangentialForceUMagnitude() const;
146 
150  agx::Real getTangentialForceVMagnitude() const;
151 
155  agx::Real getTangentialForceMagnitude() const;
156 
160  agx::Vec3 getTangentialForce() const;
161 
166  agx::UInt32& faceIndex(size_t ith);
167 
172  agx::UInt32 const& faceIndex(size_t ith) const;
173 
178  agx::UInt8& faceFeature(size_t ith);
179 
184  agx::UInt8 const& faceFeature(size_t ith) const;
185 
190  agx::Physics::Geometry::ShapePtr& shape(size_t ith);
191 
196  agx::Physics::Geometry::ShapePtr const& shape(size_t ith) const;
197 
206  agx::Vec3 getWitnessPoint(size_t ith) const;
207 
211  agx::Bool hasState( ContactPointState contactPointState ) const;
212 
219  void setIsHolonomic( agx::Bool isHolonomic );
220 
225  agx::Bool isHolonomic() const;
226  };
227 
228 
234  template<typename T1, typename T2>
235  void copyContactPoint(const T1& from, T2& to)
236  {
237  to.point() = from.point();
238  to.normal() = from.normal();
239  to.depth() = from.depth();
240  to.area() = from.area();
241 
242  to.velocity() = from.velocity();
243  to.enabled() = from.enabled();
244 
245  to.shape1() = from.shape1();
246  to.shape2() = from.shape2();
247 
248  to.faceIndex1() = from.faceIndex1();
249  to.faceIndex2() = from.faceIndex2();
250  to.faceFeature1() = from.faceFeature1();
251  to.faceFeature2() = from.faceFeature2();
252  to.state() = from.state();
253  }
254 
255 #ifndef SWIG
256  template void copyContactPoint(const ContactPoint&, LocalContactPoint&);
257  template void copyContactPoint(const LocalContactPoint&, ContactPoint&);
258  template void copyContactPoint(const LocalContactPoint&, agx::Physics::ContactPointPtr&);
259  template void copyContactPoint(const agx::Physics::ContactPointPtr&, LocalContactPoint&);
260 
261 
262  AGX_STATIC_ASSERT(sizeof(ContactPoint) == sizeof(agx::Physics::ContactPointPtr));
263 #endif
265 
270  {
271  public:
273 
274  public:
277  NO_CONTACT = 0,
278  IMPACT_STATE = 1,
279  CONTACT_STATE = 2,
280  SEPARATION_STATE = 3
281  };
282 
283  public:
287  GeometryContact();
288 
294 
298  void clear();
299 
307  agx::Vec3f calculateRelativeVelocity( size_t pointIndex = 0 ) const;
308 
316  static bool calculateSurfaceVelocity( const agxCollide::Geometry* geometry1, const agxCollide::Geometry* geometry2, LocalContactPoint& p );
317 
325  static bool calculateSurfaceVelocity( const agxCollide::Geometry* geometry1, const agxCollide::Geometry* geometry2, ContactPoint& p );
326 
331  agxCollide::Geometry* geometry( size_t ith );
332 
337  const agxCollide::Geometry* geometry( size_t ith ) const;
338 
344  agx::RigidBody* rigidBody( size_t ith );
345 
351  const agx::RigidBody* rigidBody( size_t ith ) const;
352 
354  ContactPointVector& points();
355 
357  const ContactPointVector& points() const;
358 
360  void* getCustomData();
361 
363  const void* getCustomData() const;
364 
369  void setCustomData( void* customData );
370 
377  agx::ContactMaterial* getMaterial();
378 
385  const agx::ContactMaterial* getMaterial() const;
386 
392  const agx::ContactMaterial* getMaterial( bool ) const;
393 
395  agx::UInt8 state() const;
396 
398  void removeContactPoint( ContactPoint& point );
399 
403  void setEnable(bool flag);
404 
413  int contains(agx::RigidBody * body) const;
414 
423  int contains(agxCollide::Geometry * geometry) const;
424 
428  bool isEnabled() const;
429 
436  agx::Bool hasImpactingPoints() const;
437 
438 
440 
441 
442 
447  void setGeometry( size_t ith, Geometry* geom );
448 
449  /***
450  When called, this contact should be removed before entering the solver
451  NOTE: Contacts are never removed, only marked as disabled
452  \param immediately - Should the contact be removed immediately
453  */
454  void markForRemoval( bool immediately );
455 
461  bool shouldBeCalled() const;
462 
466  void setMaterial( agx::ContactMaterial* material );
467 
468  void setHasSurfaceVelocity( bool flag );
469 
470  GeometryPair getGeometryPair();
471 
472  void setHasInternalMaterial( bool flag );
473  bool getHasInternalMaterial( ) const;
474 
475  void setState( agx::UInt8 state );
477  };
478 
479 
480 
481  inline int GeometryContact::contains(agx::RigidBody * body) const
482  {
483  if (this->rigidBody(0) == body) return 0;
484  if (this->rigidBody(1) == body) return 1;
485  return -1;
486  }
487 
488  inline int GeometryContact::contains(agxCollide::Geometry * geometry) const
489  {
490  if (this->geometry(0) == geometry) return 0;
491  if (this->geometry(1) == geometry) return 1;
492  return -1;
493  }
494 
495 
496 
497 #ifndef SWIG
498  //AGX_STATIC_ASSERT(sizeof(GeometryContact) == sizeof(agx::Physics::GeometryContactPtr));
499 #endif
500 
501  /* Implementation */
502  inline ContactPoint::ContactPoint() : agx::Physics::ContactPointPtr( agx::Physics::ContactPointModel::createInstance() )
503  {
504  }
505 
506  inline ContactPoint::ContactPoint(agx::Physics::ContactPointPtr contact) : agx::Physics::ContactPointPtr(contact)
507  {
508  }
509 
510 
512  {
513  depth() = agx::Real( 0 );
514  enabled() = true;
515  point().set(0, 0, 0);
516  normal().set(0, 0, 0);
517  state() = agx::UInt8( 0 );
518  tangentU().set(0, 0, 0);
519  tangentV().set(0, 0, 0);
520  localForce().set( 0, 0, 0 );
521  velocity().set(0, 0, 0);
522  faceIndex1() = 0;
523  faceIndex2() = 0;
524  faceFeature1() = 0;
525  faceFeature2() = 0;
526  area() = agx::Real( 0 );
529  }
530 
531 
533  {
534  agxAssert(idx < 3);
535  return localForce()[idx];
536  }
537 
538 
540  {
541  agxAssert(idx < 3);
542  return localForce()[idx];
543  }
544 
545 
546 
548  {
549  return getNormalForce() + getTangentialForce();
550  }
551 
552 
554  {
555  agx::Real sqr =
559  return sqr > 0 ? std::sqrt( sqr ) : 0;
560  }
561 
562 
564  {
565  return agx::Vec3(normal()) * localForce()[ NORMAL_FORCE ];
566  }
567 
568 
570  {
571  return std::abs(localForce()[ NORMAL_FORCE ]);
572  }
573 
574 
576  {
577  const agx::Vec3 forceU = agx::Vec3(tangentU()) * localForce()[ TANGENTIAL_FORCE_U ];
578  const agx::Vec3 forceV = agx::Vec3(tangentV()) * localForce()[ TANGENTIAL_FORCE_V ];
579  return forceU + forceV;
580  }
581 
582 
584  {
585  return std::abs(localForce()[ TANGENTIAL_FORCE_U ]);
586  }
587 
588 
590  {
591  return std::abs(localForce()[ TANGENTIAL_FORCE_V ]);
592  }
593 
594 
596  {
598  return sqr > 0 ? std::sqrt( sqr ) : 0;
599  }
600 
602  {
603  return ( state() & contactPointState ) != 0;
604  }
605 
607  {
608  return !hasState( NONHOLONOMIC );
609  }
610 
612  {
613  if ( isHolonomic )
614  {
615  // remove non-holonomic bit
616  state() = (agx::UInt8)( state() & ~NONHOLONOMIC );
617  }
618  else
619  {
620  // add non-holonomic bit
621  state() |= ( agx::UInt8 )( NONHOLONOMIC );
622  }
623  }
624 
626  {
627 
628  }
629 
631  agx::Physics::GeometryContactPtr(contact)
632 
633  {
634  }
635 
637  {
638  agxAssert(ith < 2);
639  if(ith == 0)
640  return geometry1().model();
641  else
642  return geometry2().model();
643  }
644 
646  {
647  agxAssert(ith < 2);
648  if(ith == 0)
649  return geometry1().model();
650  else
651  return geometry2().model();
652  }
653 
654  AGX_FORCE_INLINE GeometryPair GeometryContact::getGeometryPair()
655  {
656  return GeometryPair(geometry(0), geometry(1));
657  }
658 
659  AGX_FORCE_INLINE void GeometryContact::setGeometry( size_t ith, Geometry* geom )
660  {
661  agxAssert(ith < 2 );
662  if(ith == 0)
663  geometry1() = geom->getEntity();
664  else
665  geometry2() = geom->getEntity();
666  }
667 
669  {
670  agx::Vec3 v1, v2;
671  if (pointIndex > points().size() - 1)
672  return agx::Vec3f();
673 
674  const agx::RigidBody* rb1 = geometry(0)->getRigidBody();
675  const agx::RigidBody* rb2 = geometry(1)->getRigidBody();
676 
677  if (rb1)
678  v1 = rb1->getVelocity() + (rb1->getAngularVelocity() ^ (points()[pointIndex].point() - rb1->getCmPosition()));
679  if (rb2)
680  v2 = rb2->getVelocity() + (rb2->getAngularVelocity() ^ (points()[pointIndex].point() - rb2->getCmPosition()));
681 
682  return static_cast<agx::Vec3f>(v1 - v2);
683  }
684 
685 
687  {
688  LocalContactPoint lcp;
689  lcp.point() = p.point();
691  p.velocity() = lcp.velocity();
692  return hasSurfaceVelocity;
693  }
694 
695 
697  {
698  agxAssert(ith < 2 );
699  return geometry(ith)->getRigidBody();
700  }
701 
703  {
704  agxAssert(ith < 2 );
705  return geometry(ith)->getRigidBody();
706  }
707 
708 
710  {
712  }
713 
715  {
716  return reinterpret_cast<const ContactPointVector&>(agx::Physics::GeometryContactPtr::points());
717  }
718 
720  {
721  return customData();
722  }
723 
725  {
726  return customData();
727  }
728 
729  inline void GeometryContact::setCustomData( void* customData )
730  {
731  this->customData() = customData;
732  }
733 
734 
735  AGX_FORCE_INLINE void GeometryContact::markForRemoval( bool immediately )
736  {
737  this->immediately() = immediately;
738  this->enabled() = false;
739  }
740 
742  {
743  this->enabled() = flag;
744  }
745 
747  {
748  return this->enabled();
749  }
750 
751 
752  AGX_FORCE_INLINE bool GeometryContact::shouldBeCalled() const
753  {
754  return !immediately();
755  }
756 
758  {
759  if ( material() && material().isExplicit() )
760  return material().model();
761  return nullptr;
762  }
763 
765  {
766  if ( material() && material().isExplicit() )
767  return material().model();
768  return nullptr;
769  }
770 
772  {
773  return material() ? material().model() : nullptr;
774  }
775 
776  AGX_FORCE_INLINE void GeometryContact::setMaterial( agx::ContactMaterial* material )
777  {
778  agxAssert( material != nullptr );
779  if (material)
780  this->material() = material->getEntity();
781  }
782 
783  AGX_FORCE_INLINE void GeometryContact::setHasSurfaceVelocity( bool flag )
784  {
785  hasSurfaceVelocity() = flag;
786  }
787 
788 
789  AGX_FORCE_INLINE void GeometryContact::setHasInternalMaterial( bool flag )
790  {
791  hasInternalMaterial() = flag;
792  }
793 
794  AGX_FORCE_INLINE bool GeometryContact::getHasInternalMaterial( ) const
795  {
796  return hasInternalMaterial();
797  }
798 
800  {
801  if ( broadPhasePair() )
802  return broadPhasePair().state();
803 
805  }
806 
807  AGX_FORCE_INLINE void GeometryContact::setState( agx::UInt8 state )
808  {
810  broadPhasePair().state() = state;
811  }
812 
814  {
815  if (ith == 0) return faceIndex1(); else return faceIndex2();
816  }
817 
818 
820  {
821  if (ith == 0) return faceIndex1(); else return faceIndex2();
822  }
823 
824 
826  {
827  if (ith == 0) return faceFeature1(); else return faceFeature2();
828  }
829 
830 
832  {
833  if (ith == 0) return faceFeature1(); else return faceFeature2();
834  }
835 
836 
838  {
839  if (ith == 0) return shape1(); else return shape2();
840  }
841 
842 
844  {
845  if (ith == 0) return shape1(); else return shape2();
846  }
847 
848 
850  {
851  if (ith == 0)
852  return point() - agx::Vec3(normal()) * (depth() * agx::Real(0.5));
853  else
854  return point() + agx::Vec3(normal()) * (depth() * agx::Real(0.5));
855  }
856 }
857 
858 #ifdef _MSC_VER
859 # pragma warning(pop)
860 #endif
861 
agxPhysics_export.h
Referenced.h
agxCollide::GeometryContact::PointType
ContactPoint PointType
Definition: Contacts.h:272
agxCollide::ContactPoint::getTangentialForceUMagnitude
agx::Real getTangentialForceUMagnitude() const
Definition: Contacts.h:583
agx::Physics::GeometryContactPtr::customData
AGXPHYSICS_EXPORT void *& customData()
agx::Real
double Real
Definition: Real.h:42
Vector.h
agx::Physics::ContactPointPtr::enabled
AGXPHYSICS_EXPORT agx::Bool & enabled()
agx::Physics::ContactPointPtr::shape2
AGXPHYSICS_EXPORT agx::Physics::Geometry::ShapePtr & shape2()
Shape number 2 in contact.
agxCollide::ContactPoint::isHolonomic
agx::Bool isHolonomic() const
Definition: Contacts.h:606
agxData::GeometryPair
agx::SymmetricPair< agx::Physics::GeometryPtr > GeometryPair
Definition: Geometry.h:66
agxCollide::ContactPoint::getTangentialForceVMagnitude
agx::Real getTangentialForceVMagnitude() const
Definition: Contacts.h:589
agxCollide::ContactPoint::TANGENTIAL_FORCE_V
@ TANGENTIAL_FORCE_V
Tangential force V, orthogonal to the normal force and U.
Definition: Contacts.h:62
GeometryContactEntity.h
agx::RigidBody
The rigid body class, combining a geometric model and a frame of reference.
Definition: RigidBody.h:54
agxCollide::GeometryContact::NO_CONTACT
@ NO_CONTACT
! No contact yet
Definition: Contacts.h:277
agxCollide::LocalContactPoint
Definition: LocalContactPoint.h:40
agxCollide::ContactPoint::getForceMagnitude
agx::Real getForceMagnitude() const
Definition: Contacts.h:553
agx::Physics::ContactPointPtr::normal
AGXPHYSICS_EXPORT agx::Vec3f & normal()
DOXYGEN_END_INTERNAL_BLOCK
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: macros.h:97
agx::Physics::ContactPointPtr
Pointer to a entity instance of type Physics.ContactPoint.
Definition: ContactPointEntity.h:258
agx::Physics::ContactPointPtr::shape1
AGXPHYSICS_EXPORT agx::Physics::Geometry::ShapePtr & shape1()
Shape number 1 in contact.
DOXYGEN_START_INTERNAL_BLOCK
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: macros.h:96
agxAssert
#define agxAssert(expr)
Definition: debug.h:143
agxCollide::ContactPoint
A contact point in a contact data.
Definition: Contacts.h:55
agx::Physics::ContactPointPtr::point
AGXPHYSICS_EXPORT agx::Vec3 & point()
agxCollide::GeometryContact::setCustomData
void setCustomData(void *customData)
Store custom data for this Contact.
Definition: Contacts.h:729
agxCollide::ContactPoint::getTangentialForceMagnitude
agx::Real getTangentialForceMagnitude() const
Definition: Contacts.h:595
agx::Physics::GeometryContactPtr::immediately
AGXPHYSICS_EXPORT agx::Bool & immediately()
agxCollide::ContactPoint::TANGENTIAL_FORCE_U
@ TANGENTIAL_FORCE_U
Tangential force U, orthogonal to the normal force and V.
Definition: Contacts.h:61
agxCollide::GeometryContact::GeometryContact
GeometryContact()
Default constructor.
Definition: Contacts.h:625
agxCollide::ContactPoint::setIsHolonomic
void setIsHolonomic(agx::Bool isHolonomic)
Set if contact point should be treated as a holonomic constraint ( regular contact constraint with de...
Definition: Contacts.h:611
agx
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
Definition: AddedMassInteraction.h:22
agxCollide::ContactPoint::getNormalForce
agx::Vec3 getNormalForce() const
Definition: Contacts.h:563
AGXPHYSICS_EXPORT
#define AGXPHYSICS_EXPORT
agxCollide::GeometryContact::isEnabled
bool isEnabled() const
Definition: Contacts.h:746
agx::Physics::GeometryContactPtr::hasInternalMaterial
AGXPHYSICS_EXPORT agx::Bool & hasInternalMaterial()
agxData::Array
Type-specific Array used for fast access into the data held by a Buffer.
Definition: agxData.h:30
agxCollide::ContactPoint::faceIndex
agx::UInt32 & faceIndex(size_t ith)
Definition: Contacts.h:813
agx::Physics::GeometryContactPtr::enabled
AGXPHYSICS_EXPORT agx::Bool & enabled()
agxCollide::GeometryContact::ContactState
ContactState
Specify the state of the contact.
Definition: Contacts.h:276
agx::RigidBody::getCmPosition
agx::Vec3 getCmPosition() const
Definition: RigidBody.h:1524
BroadPhasePairEntity.h
agx::Physics::ContactPointPtr::localForce
AGXPHYSICS_EXPORT agx::Vec3 & localForce()
agx::RigidBody::getAngularVelocity
agx::Vec3 getAngularVelocity() const
Angular velocity in world coordinate frame.
Definition: RigidBody.h:1514
Vec3.h
agxCollide::AGX_STATIC_ASSERT
AGX_STATIC_ASSERT(sizeof(ContactPoint)==sizeof(agx::Physics::ContactPointPtr))
agxCollide::ContactPoint::getNormalForceMagnitude
agx::Real getNormalForceMagnitude() const
Definition: Contacts.h:569
agx::Physics::ContactPointPtr::faceIndex1
AGXPHYSICS_EXPORT agx::UInt32 & faceIndex1()
The face index of shape 1 in contact (e.g. index of triangle for trimesh).
agx::Physics::GeometryContactPtr
A geometry contact hold contact information between two geometries.
Definition: GeometryContactEntity.h:224
agx::UInt8
uint8_t UInt8
Definition: Integer.h:38
agx::Vec3
Vec3T< Real > Vec3
The object holding 3 dimensional vectors and providing basic arithmetic.
Definition: Vec3.h:36
agxCollide::ContactPoint::clear
void clear()
Clear all values in this contact.
Definition: Contacts.h:511
agx::Physics::ContactPointPtr::area
AGXPHYSICS_EXPORT agx::Real & area()
LocalContactPoint.h
agxCollide::GeometryContact::state
agx::UInt8 state() const
Definition: Contacts.h:799
agxCollide::GeometryContact::rigidBody
agx::RigidBody * rigidBody(size_t ith)
Returns access to rigid body data.
Definition: Contacts.h:696
agxCollide::LocalContactPoint::velocity
agx::Vec3f & velocity()
Definition: LocalContactPoint.h:120
GeometryEntity.h
agx::Physics::ContactPointPtr::state
AGXPHYSICS_EXPORT agx::UInt8 & state()
Contact point state, such as impacting, resting etc.
agx::Physics::GeometryContactPtr::geometry2
AGXPHYSICS_EXPORT agx::Physics::GeometryPtr & geometry2()
agxCollide::GeometryContact::calculateSurfaceVelocity
static bool calculateSurfaceVelocity(const agxCollide::Geometry *geometry1, const agxCollide::Geometry *geometry2, LocalContactPoint &p)
Calculate the relative velocity in a contact point between geometry1 and geometry2 Put result in p.
agxCollide::GeometryContact::getMaterial
agx::ContactMaterial * getMaterial()
If the contact material for this geometry contact is explicit it can be accessed here.
Definition: Contacts.h:757
agxCollide::Geometry
The geometry representation used by the collision detection engine.
Definition: Geometry.h:92
agx::Physics::GeometryContactPtr::broadPhasePair
AGXPHYSICS_EXPORT agx::Physics::BroadPhasePairPtr & broadPhasePair()
agx::Vec3T::set
void set(T x, T y, T z)
Definition: Vec3Template.h:465
agxCollide::ContactPoint::ContactForceComponents
ContactForceComponents
Definition: Contacts.h:58
agx::ContactMaterial
This class store the combine material properties between two agx::Material's.
Definition: Material.h:527
agx::Physics::ContactPointPtr::faceFeature2
AGXPHYSICS_EXPORT agx::UInt8 & faceFeature2()
The face feature of shape 2 in contact (e.g. voronoi region on triangle for trimesh).
agxCollide::ContactPoint::getTangentialForce
agx::Vec3 getTangentialForce() const
Definition: Contacts.h:575
agxCollide::ContactPoint::hasState
agx::Bool hasState(ContactPointState contactPointState) const
Definition: Contacts.h:601
agxCable::DamageStateTypes::NORMAL_FORCE
@ NORMAL_FORCE
Definition: CableDamageStateTypes.h:34
agxCollide::ContactPoint::ContactPoint
ContactPoint()
Default constructor.
Definition: Contacts.h:502
agxCollide::ContactPoint::getForce
agx::Vec3 getForce() const
Definition: Contacts.h:547
GeometryPair.h
agxCollide::GeometryContact::geometry
agxCollide::Geometry * geometry(size_t ith)
Definition: Contacts.h:636
agxCollide.h
agxCollide::ContactPoint::getWitnessPoint
agx::Vec3 getWitnessPoint(size_t ith) const
Get witness point for ith geometry.
Definition: Contacts.h:849
agx.h
agx::Physics::GeometryContactPtr::geometry1
AGXPHYSICS_EXPORT agx::Physics::GeometryPtr & geometry1()
RigidBody.h
agxCollide::LocalContactPoint::point
agx::Vec3 & point()
Definition: LocalContactPoint.h:118
ContactPointEntity.h
agxCollide::GeometryContact::setEnable
void setEnable(bool flag)
Set to false to disable the contact.
Definition: Contacts.h:741
agxCollide::ContactPoint::NORMAL_FORCE
@ NORMAL_FORCE
Normal force.
Definition: Contacts.h:60
agxCollide::ContactPoint::NONHOLONOMIC
@ NONHOLONOMIC
This contact point is treated as a non-holonomic constraint in the normal direction - i....
Definition: Contacts.h:73
agxCollide::ContactPoint::shape
agx::Physics::Geometry::ShapePtr & shape(size_t ith)
Definition: Contacts.h:837
agx::Physics::GeometryPtr::model
AGXPHYSICS_EXPORT agxCollide::Geometry *& model()
agx::Physics::ContactPointPtr::velocity
AGXPHYSICS_EXPORT agx::Vec3f & velocity()
agx::Physics::GeometryContactPtr::hasSurfaceVelocity
AGXPHYSICS_EXPORT agx::Bool & hasSurfaceVelocity()
agx::Physics::Geometry::ShapePtr
Pointer to a entity instance of type Physics.Geometry.Shape.
Definition: ShapeEntity.h:195
agxCollide
This namespace consists of a set of classes for handling geometric intersection tests including boole...
Definition: ContactForceFilterParticipant.h:22
agx::Bool
bool Bool
Definition: Integer.h:48
agxCollide::GeometryContact
A contact between two geometries.
Definition: Contacts.h:269
agx::Physics::ContactPointPtr::tangentU
AGXPHYSICS_EXPORT agx::Vec3f & tangentU()
agxCollide::ContactPoint::faceFeature
agx::UInt8 & faceFeature(size_t ith)
Definition: Contacts.h:825
agxCollide::ContactPoint::ContactPointState
ContactPointState
Definition: Contacts.h:65
agxCollide::Geometry::getRigidBody
agx::RigidBody * getRigidBody()
Definition: Geometry.h:850
agxSDK
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
Definition: Constraint.h:30
agx::Physics::ContactPtr::material
AGXPHYSICS_EXPORT agx::Physics::ContactMaterialPtr & material()
agx::Physics::ContactPointPtr::faceIndex2
AGXPHYSICS_EXPORT agx::UInt32 & faceIndex2()
The face index of shape 2 in contact (e.g. index of triangle for trimesh).
agx::Vec3T< Real >
agxCollide::GeometryContact::calculateRelativeVelocity
agx::Vec3f calculateRelativeVelocity(size_t pointIndex=0) const
Calculate the relative velocity in a contact point.
Definition: Contacts.h:668
agx::Physics::BroadPhasePairPtr::state
AGXPHYSICS_EXPORT agx::UInt8 & state()
agx::Physics::GeometryContactPtr::points
AGXPHYSICS_EXPORT agxData::Array< agx::Physics::ContactPointPtr > & points()
The list of contact points.
agx::Physics::ContactMaterialPtr::model
AGXPHYSICS_EXPORT agx::ContactMaterial *& model()
agxTerrain::Profiler::clear
AGXTERRAIN_EXPORT void clear()
agxCollide::GeometryContact::contains
int contains(agx::RigidBody *body) const
Will return -1 if body does not exist in this GeometryContact, 0 if it is the first (index 0) and 1 i...
Definition: Contacts.h:481
agx::Vec3f
Vec3T< Real32 > Vec3f
Definition: Vec3.h:39
agxCollide::GeometryContact::points
ContactPointVector & points()
Definition: Contacts.h:709
agx::UInt32
uint32_t UInt32
Definition: Integer.h:40
agx::Physics::ContactPointPtr::depth
AGXPHYSICS_EXPORT agx::Real & depth()
agx::RigidBody::getVelocity
agx::Vec3 getVelocity() const
Velocity of center of mass frame origin, in world coordinate frame.
Definition: RigidBody.h:1509
agx::Physics::ContactPointPtr::tangentV
AGXPHYSICS_EXPORT agx::Vec3f & tangentV()
agxCollide::GeometryContact::getCustomData
void * getCustomData()
Definition: Contacts.h:719
AGX_FORCE_INLINE
#define AGX_FORCE_INLINE
Definition: macros.h:58
agxCollide::ContactPointVector
agxData::Array< ContactPoint > ContactPointVector
Definition: Contacts.h:264
Material.h
agxCollide::copyContactPoint
void copyContactPoint(const T1 &from, T2 &to)
Copy between the different kinds of contact points.
Definition: Contacts.h:235
agx::Physics::ContactPointPtr::faceFeature1
AGXPHYSICS_EXPORT agx::UInt8 & faceFeature1()
The face feature of shape 1 in contact (e.g. voronoi region on triangle for trimesh).