AGX Dynamics 2.42.0.2
Loading...
Searching...
No Matches
Contacts.h
Go to the documentation of this file.
1/*
2Copyright 2007-2025. Algoryx Simulation AB.
3
4All AGX source code, intellectual property, documentation, sample code,
5tutorials, scene files and technical white papers, are copyrighted, proprietary
6and confidential material of Algoryx Simulation AB. You may not download, read,
7store, distribute, publish, copy or otherwise disseminate, use or expose this
8material unless having a written signed agreement with Algoryx Simulation AB, or having been
9advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10valid commercial license from Algoryx Simulation AB.
11
12Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13from using this software, unless otherwise stated in written agreements with
14Algoryx 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
25
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
42namespace agxSDK
43{
44 class MaterialManager;
45}
46
47namespace agxCollide
48{
49 class Geometry;
50
51
56 {
57 public:
59 {
60 NORMAL_FORCE = 0,
62 TANGENTIAL_FORCE_V
63 };
64
66 {
67 IMPACTING = 1 << 0,
73 NONHOLONOMIC = 1 << 1,
80 NODAMPING = 1 << 2,
81
82 HAVE_AREA = 1 << 3
83 };
84
85 public:
90
97
104 ContactPoint(agx::Vec3 thePoint, agx::Vec3f theNormal, agx::Real theDepth);
105
114 ContactPoint(agx::Vec3 point, agx::Vec3f normal, agx::Real depth, agx::Real area, agx::Real volume);
115
116
117
118
120 void clear();
121
123
124#ifndef SWIG
130 agx::Real& localForce( size_t idx );
131#endif
137 agx::Real localForce( size_t idx ) const;
138
143 agx::Vec3 getForce() const;
144
148 agx::Real getForceMagnitude() const;
149
153 agx::Vec3 getNormalForce() const;
154
158 agx::Real getNormalForceMagnitude() const;
159
163 agx::Real getTangentialForceUMagnitude() const;
164
168 agx::Real getTangentialForceVMagnitude() const;
169
173 agx::Real getTangentialForceMagnitude() const;
174
178 agx::Vec3 getTangentialForce() const;
179
184 agx::UInt32& faceIndex(size_t ith);
185
190 agx::UInt32 const& faceIndex(size_t ith) const;
191
196 agx::UInt8& faceFeature(size_t ith);
197
202 agx::UInt8 const& faceFeature(size_t ith) const;
203
208 agx::Physics::Geometry::ShapePtr& shape(size_t ith);
209
214 agx::Physics::Geometry::ShapePtr const& shape(size_t ith) const;
215
224 agx::Vec3 getWitnessPoint(size_t ith) const;
225
229 agx::Bool hasState( ContactPointState contactPointState ) const;
230
237 void setIsHolonomic( agx::Bool isHolonomic );
238
243 agx::Bool isHolonomic() const;
244
248 agx::Real getYoungsModulus() const;
249
255 void setYoungsModulus( agx::Real youngsModulus );
256
260 agx::Real getFrictionCoefficient(agx::ContactMaterial::FrictionDirection direction) const;
261
270
274 agx::Real getRestitution() const;
275
281 void setRestitution(agx::Real restitution);
282
286 agx::Real getTangentialRestitution(agx::ContactMaterial::FrictionDirection direction);
287
295 void setTangentialRestitution(agx::Real restitution, agx::ContactMaterial::FrictionDirection direction = agx::ContactMaterial::BOTH_PRIMARY_AND_SECONDARY);
296
300 agx::Real getTangentialCohesion( agx::ContactMaterial::FrictionDirection direction ) const;
301
309 };
310
311
317 template<typename T1, typename T2>
318 void copyContactPoint(const T1& from, T2& to)
319 {
320 to.point() = from.point();
321 to.normal() = from.normal();
322 to.depth() = from.depth();
323 to.area() = from.area();
324 to.volume() = from.volume();
325
326 to.velocity() = from.velocity();
327 to.enabled() = from.enabled();
328
329 to.shape1() = from.shape1();
330 to.shape2() = from.shape2();
331
332 to.faceIndex1() = from.faceIndex1();
333 to.faceIndex2() = from.faceIndex2();
334 to.faceFeature1() = from.faceFeature1();
335 to.faceFeature2() = from.faceFeature2();
336 to.state() = from.state();
337 }
338
339#ifndef SWIG
344
345
347#endif
349
354 {
355 public:
357
358 public:
361 NO_CONTACT = 0,
362 IMPACT_STATE = 1,
363 CONTACT_STATE = 2,
364 SEPARATION_STATE = 3
365 };
366
367 public:
372
378
382 void clear();
383
391 agx::Vec3f calculateRelativeVelocity( size_t pointIndex = 0 ) const;
392
400 static bool calculateSurfaceVelocity( const agxCollide::Geometry* geometry1, const agxCollide::Geometry* geometry2, LocalContactPoint& p );
401
409 static bool calculateSurfaceVelocity( const agxCollide::Geometry* geometry1, const agxCollide::Geometry* geometry2, ContactPoint& p );
410
415 agxCollide::Geometry* geometry( size_t ith );
416
421 const agxCollide::Geometry* geometry( size_t ith ) const;
422
428 agx::RigidBody* rigidBody( size_t ith );
429
435 const agx::RigidBody* rigidBody( size_t ith ) const;
436
438 ContactPointVector& points();
439
441 const ContactPointVector& points() const;
442
444 void* getCustomData();
445
447 const void* getCustomData() const;
448
453 void setCustomData( void* customData );
454
461 agx::ContactMaterial* getMaterial();
462
469 const agx::ContactMaterial* getMaterial() const;
470
476 const agx::ContactMaterial* getMaterial( bool ) const;
477
479 agx::UInt8 state() const;
480
483
487 void setEnable(bool flag);
488
497 int contains(agx::RigidBody * body) const;
498
507 int contains(agxCollide::Geometry * geometry) const;
508
512 bool isEnabled() const;
513
521
522
524
525
526
531 void setGeometry( size_t ith, Geometry* geom );
532
533 /***
534 When called, this contact should be removed before entering the solver
535 NOTE: Contacts are never removed, only marked as disabled
536 \param immediately - Should the contact be removed immediately
537 */
538 void markForRemoval( bool immediately );
539
545 bool shouldBeCalled() const;
546
550 void setMaterial( agx::ContactMaterial* material );
551
552 void setHasSurfaceVelocity( bool flag );
553
554 GeometryPair getGeometryPair();
555
556 void setHasInternalMaterial( bool flag );
557 bool getHasInternalMaterial( ) const;
558
559 void setState( agx::UInt8 state );
561 };
562
563
564
565 inline int GeometryContact::contains(agx::RigidBody * body) const
566 {
567 if (this->rigidBody(0) == body) return 0;
568 if (this->rigidBody(1) == body) return 1;
569 return -1;
570 }
571
573 {
574 if (this->geometry(0) == geometry) return 0;
575 if (this->geometry(1) == geometry) return 1;
576 return -1;
577 }
578
579
580
581#ifndef SWIG
582 //AGX_STATIC_ASSERT(sizeof(GeometryContact) == sizeof(agx::Physics::GeometryContactPtr));
583#endif
584
585 /* Implementation */
586 inline ContactPoint::ContactPoint() : agx::Physics::ContactPointPtr( agx::Physics::ContactPointModel::createInstance() )
587 {
588 }
589
590 inline ContactPoint::ContactPoint(agx::Physics::ContactPointPtr contact) : agx::Physics::ContactPointPtr(contact)
591 {
592 }
593
594
596 {
597 depth() = agx::Real( 0 );
598 enabled() = true;
599 point().set(0, 0, 0);
600 normal().set(0, 0, 0);
601 state() = agx::UInt8( 0 );
602 tangentU().set(0, 0, 0);
603 tangentV().set(0, 0, 0);
604 localForce().set( 0, 0, 0 );
605 velocity().set(0, 0, 0);
606 faceIndex1() = 0;
607 faceIndex2() = 0;
608 faceFeature1() = 0;
609 faceFeature2() = 0;
610 area() = agx::Real( 0 );
611 volume() = 0.;
614 }
615
616
618 {
619 agxAssert(idx < 3);
620 return localForce()[idx];
621 }
622
623
625 {
626 agxAssert(idx < 3);
627 return localForce()[idx];
628 }
629
630
631
633 {
635 }
636
637
639 {
640 agx::Real sqr =
644 return sqr > 0 ? std::sqrt( sqr ) : 0;
645 }
646
647
649 {
650 return agx::Vec3(normal()) * localForce()[ NORMAL_FORCE ];
651 }
652
653
655 {
656 return std::abs(localForce()[ NORMAL_FORCE ]);
657 }
658
659
661 {
664 return forceU + forceV;
665 }
666
667
669 {
670 return std::abs(localForce()[ TANGENTIAL_FORCE_U ]);
671 }
672
673
675 {
676 return std::abs(localForce()[ TANGENTIAL_FORCE_V ]);
677 }
678
679
681 {
683 return sqr > 0 ? std::sqrt( sqr ) : 0;
684 }
685
687 {
688 return ( state() & contactPointState ) != 0;
689 }
690
692 {
693 return !hasState( NONHOLONOMIC );
694 }
695
697 {
698 if ( isHolonomic )
699 {
700 // remove non-holonomic bit
701 state() = (agx::UInt8)( state() & ~NONHOLONOMIC );
702 }
703 else
704 {
705 // add non-holonomic bit
706 state() |= ( agx::UInt8 )( NONHOLONOMIC );
707 }
708 }
709
711 {
712
713 }
714
716 agx::Physics::GeometryContactPtr(contact)
717
718 {
719 }
720
722 {
723 agxAssert(ith < 2);
724 if(ith == 0)
725 return geometry1() ? geometry1().model() : nullptr;
726 else
727 return geometry2() ? geometry2().model() : nullptr;
728 }
729
731 {
732 agxAssert(ith < 2);
733 if(ith == 0)
734 return geometry1() ? geometry1().model() : nullptr;
735 else
736 return geometry2() ? geometry2().model() : nullptr;
737 }
738
739 AGX_FORCE_INLINE GeometryPair GeometryContact::getGeometryPair()
740 {
741 return GeometryPair(geometry(0), geometry(1));
742 }
743
744 AGX_FORCE_INLINE void GeometryContact::setGeometry( size_t ith, Geometry* geom )
745 {
746 agxAssert(ith < 2 );
747 if(ith == 0)
748 geometry1() = geom->getEntity();
749 else
750 geometry2() = geom->getEntity();
751 }
752
754 {
755 agx::Vec3 v1, v2;
756 if (pointIndex > points().size() - 1)
757 return agx::Vec3f();
758
759 const agx::RigidBody* rb1 = rigidBody(0);
760 const agx::RigidBody* rb2 = rigidBody(1);
761
762 if (rb1 != nullptr)
763 v1 = rb1->getVelocity() + (rb1->getAngularVelocity() ^ (points()[pointIndex].point() - rb1->getCmPosition()));
764 if (rb2 != nullptr)
765 v2 = rb2->getVelocity() + (rb2->getAngularVelocity() ^ (points()[pointIndex].point() - rb2->getCmPosition()));
766
767 return static_cast<agx::Vec3f>(v1 - v2);
768 }
769
770
772 const agxCollide::Geometry* geometry2,
773 ContactPoint& p)
774 {
776 lcp.point() = p.point();
778 p.velocity() = lcp.velocity();
779 return hasSurfaceVelocity;
780 }
781
782
784 {
785 agxAssert(ith < 2 );
786 auto body = ith == 0u ? body1() : body2();
787 return body ? body.model() : nullptr;
788 }
789
791 {
792 agxAssert(ith < 2 );
793 const auto body = ith == 0u ? body1() : body2();
794 return body ? body.model() : nullptr;
795 }
796
797
799 {
801 }
802
804 {
805 return reinterpret_cast<const ContactPointVector&>(agx::Physics::GeometryContactPtr::points());
806 }
807
809 {
810 return customData();
811 }
812
814 {
815 return customData();
816 }
817
818 inline void GeometryContact::setCustomData( void* customData )
819 {
820 this->customData() = customData;
821 }
822
823
824 AGX_FORCE_INLINE void GeometryContact::markForRemoval( bool immediately )
825 {
826 this->immediately() = immediately;
827 this->enabled() = false;
828 }
829
831 {
832 this->enabled() = flag;
833 }
834
836 {
837 return this->enabled();
838 }
839
840
841 AGX_FORCE_INLINE bool GeometryContact::shouldBeCalled() const
842 {
843 return !immediately();
844 }
845
847 {
848 if ( material() && material().isExplicit() )
849 return material().model();
850 return nullptr;
851 }
852
854 {
855 if ( material() && material().isExplicit() )
856 return material().model();
857 return nullptr;
858 }
859
861 {
862 return material() ? material().model() : nullptr;
863 }
864
865 AGX_FORCE_INLINE void GeometryContact::setMaterial( agx::ContactMaterial* material )
866 {
867 agxAssert( material != nullptr );
868 if (material)
869 this->material() = material->getEntity();
870 }
871
872 AGX_FORCE_INLINE void GeometryContact::setHasSurfaceVelocity( bool flag )
873 {
874 hasSurfaceVelocity() = flag;
875 }
876
877
878 AGX_FORCE_INLINE void GeometryContact::setHasInternalMaterial( bool flag )
879 {
880 hasInternalMaterial() = flag;
881 }
882
883 AGX_FORCE_INLINE bool GeometryContact::getHasInternalMaterial( ) const
884 {
885 return hasInternalMaterial();
886 }
887
889 {
890 if ( broadPhasePair() )
891 return broadPhasePair().state();
892
894 }
895
896 AGX_FORCE_INLINE void GeometryContact::setState( agx::UInt8 state )
897 {
900 }
901
903 {
904 if (ith == 0) return faceIndex1(); else return faceIndex2();
905 }
906
907
909 {
910 if (ith == 0) return faceIndex1(); else return faceIndex2();
911 }
912
913
915 {
916 if (ith == 0) return faceFeature1(); else return faceFeature2();
917 }
918
919
921 {
922 if (ith == 0) return faceFeature1(); else return faceFeature2();
923 }
924
925
927 {
928 if (ith == 0) return shape1(); else return shape2();
929 }
930
931
933 {
934 if (ith == 0) return shape1(); else return shape2();
935 }
936
937
939 {
940 if (ith == 0)
941 return point() - agx::Vec3(normal()) * (depth() * agx::Real(0.5));
942 else
943 return point() + agx::Vec3(normal()) * (depth() * agx::Real(0.5));
944 }
945
946
947
949 {
950 return this->youngsModulus();
951 }
952
953
954
956 {
958 }
959
960
961
963 {
964 size_t d = agx::clamp<size_t>(direction, 0u, 1u);
965 return friction()[d];
966 }
967
969 {
970 coefficient = agx::clamp(coefficient, 0.0, agx::Infinity);
971
973 friction() = agx::Vec2(coefficient);
974 }
975 else {
976 size_t d = agx::clamp<size_t>(direction, 0u, 1u);
977 friction()[d] = coefficient;
978 }
979 }
980
982 {
983 return restitution()[0];
984 }
985
987 {
988 this->restitution()[0] = agx::clamp(restitution, 0.0, agx::Infinity);
989 }
990
992 {
993 size_t d = agx::clamp<size_t>(direction, 0u, 1u);
994 return this->restitution()[1+d];
995 }
996
998 {
1000
1002 this->restitution()[1] = restitution;
1003 this->restitution()[2] = restitution;
1004 }
1005 else {
1006 size_t d = agx::clamp<size_t>(direction, 0u, 1u);
1007 this->restitution()[1+d] = restitution;
1008 }
1009 }
1010
1012 {
1013 size_t d = agx::clamp<size_t>( direction, 0u, 1u );
1014 return tangentialCohesion()[ d ];
1015 }
1016
1018 {
1019 tanCohesion = agx::clamp( tanCohesion, 0.0, agx::Infinity );
1020
1022 tangentialCohesion() = agx::Vec2( tanCohesion );
1023 }
1024 else {
1025 size_t d = agx::clamp<size_t>( direction, 0u, 1u );
1026 tangentialCohesion()[ d ] = tanCohesion;
1027 }
1028 }
1029}
1030
1031#ifdef _MSC_VER
1032# pragma warning(pop)
1033#endif
1034
#define AGXPHYSICS_EXPORT
A contact point in a contact data.
Definition: Contacts.h:56
agx::Real getForceMagnitude() const
Definition: Contacts.h:638
void clear()
Clear all values in this contact.
Definition: Contacts.h:595
agx::Real getRestitution() const
Definition: Contacts.h:981
agx::Real getNormalForceMagnitude() const
Definition: Contacts.h:654
agx::Real getTangentialForceVMagnitude() const
Definition: Contacts.h:674
ContactPoint(agx::Vec3 point, agx::Vec3f normal, agx::Real depth, agx::Real area, agx::Real volume)
Construct given point, normal, depth, area and volume.
agx::Bool isHolonomic() const
Definition: Contacts.h:691
ContactPoint(agx::Vec3 thePoint, agx::Vec3f theNormal, agx::Real theDepth)
Construct given point, normal and depth.
@ TANGENTIAL_FORCE_V
Tangential force V, orthogonal to the normal force and U.
Definition: Contacts.h:62
@ TANGENTIAL_FORCE_U
Tangential force U, orthogonal to the normal force and V.
Definition: Contacts.h:61
@ NORMAL_FORCE
Normal force.
Definition: Contacts.h:60
void setIsHolonomic(agx::Bool isHolonomic)
Set if contact point should be treated as a holonomic constraint ( regular contact constraint with de...
Definition: Contacts.h:696
void setTangentialRestitution(agx::Real restitution, agx::ContactMaterial::FrictionDirection direction=agx::ContactMaterial::BOTH_PRIMARY_AND_SECONDARY)
Set the tangential restitution coeffcient for a given tangential direction, or both.
Definition: Contacts.h:997
agx::Real getTangentialForceUMagnitude() const
Definition: Contacts.h:668
void setYoungsModulus(agx::Real youngsModulus)
Set the per contact point Young's modulus parameter.
Definition: Contacts.h:955
agx::Real getTangentialCohesion(agx::ContactMaterial::FrictionDirection direction) const
Definition: Contacts.h:1011
agx::UInt32 & faceIndex(size_t ith)
Definition: Contacts.h:902
agx::Physics::Geometry::ShapePtr & shape(size_t ith)
Definition: Contacts.h:926
agx::Bool hasState(ContactPointState contactPointState) const
Definition: Contacts.h:686
agx::Vec3 getWitnessPoint(size_t ith) const
Get witness point for ith geometry.
Definition: Contacts.h:938
agx::Vec3 getTangentialForce() const
Definition: Contacts.h:660
agx::Real getTangentialRestitution(agx::ContactMaterial::FrictionDirection direction)
Definition: Contacts.h:991
agx::Vec3 getNormalForce() const
Definition: Contacts.h:648
@ NONHOLONOMIC
This contact point is treated as a non-holonomic constraint in the normal direction - i....
Definition: Contacts.h:73
void setFrictionCoefficient(agx::Real coefficient, agx::ContactMaterial::FrictionDirection direction=agx::ContactMaterial::BOTH_PRIMARY_AND_SECONDARY)
Set the per contact point friction coefficient.
Definition: Contacts.h:968
agx::Vec3 getForce() const
Definition: Contacts.h:632
agx::Real getTangentialForceMagnitude() const
Definition: Contacts.h:680
agx::Real getFrictionCoefficient(agx::ContactMaterial::FrictionDirection direction) const
Definition: Contacts.h:962
agx::UInt8 & faceFeature(size_t ith)
Definition: Contacts.h:914
void setRestitution(agx::Real restitution)
Set the per contact point restitution parameter.
Definition: Contacts.h:986
ContactPoint()
Default constructor.
Definition: Contacts.h:586
agx::Real getYoungsModulus() const
Definition: Contacts.h:948
void setTangentialCohesion(agx::Real tanCohesion, agx::ContactMaterial::FrictionDirection direction=agx::ContactMaterial::BOTH_PRIMARY_AND_SECONDARY)
Set the per contact point tangential cohesion.
Definition: Contacts.h:1017
A contact between two geometries.
Definition: Contacts.h:354
void setCustomData(void *customData)
Store custom data for this Contact.
Definition: Contacts.h:818
agxCollide::Geometry * geometry(size_t ith)
Definition: Contacts.h:721
void setEnable(bool flag)
Set to false to disable the contact.
Definition: Contacts.h:830
agx::UInt8 state() const
Definition: Contacts.h:888
agx::RigidBody * rigidBody(size_t ith)
Returns access to rigid body data.
Definition: Contacts.h:783
agx::Vec3f calculateRelativeVelocity(size_t pointIndex=0) const
Calculate the relative velocity in a contact point.
Definition: Contacts.h:753
void removeContactPoint(ContactPoint &point)
remove the specified ContactPoint from the set of contact points.
void clear()
Clear contact points.
agx::ContactMaterial * getMaterial()
If the contact material for this geometry contact is explicit it can be accessed here.
Definition: Contacts.h:846
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:565
ContactState
Specify the state of the contact.
Definition: Contacts.h:360
@ NO_CONTACT
! No contact yet
Definition: Contacts.h:361
ContactPointVector & points()
Definition: Contacts.h:798
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.
agx::Bool hasImpactingPoints() const
GeometryContact()
Default constructor.
Definition: Contacts.h:710
The geometry representation used by the collision detection engine.
Definition: Geometry.h:92
Type-specific Array used for fast access into the data held by a Buffer.
Definition: Array.h:107
This class store the combine material properties between two agx::Material's.
Definition: Material.h:518
FrictionDirection
Specifies the direction of friction.
Definition: Material.h:521
AGXPHYSICS_EXPORT agx::UInt8 & state()
AGXPHYSICS_EXPORT agx::ContactMaterial *& model()
Pointer to a entity instance of type Physics.ContactPoint.
AGXPHYSICS_EXPORT agx::Vec3 & localForce()
AGXPHYSICS_EXPORT agx::Vec3 & point()
AGXPHYSICS_EXPORT agx::Vec3f & normal()
AGXPHYSICS_EXPORT agx::Vec2 & friction()
AGXPHYSICS_EXPORT agx::Real & youngsModulus()
AGXPHYSICS_EXPORT agx::UInt8 & faceFeature1()
The face feature of shape 1 in contact (e.g. voronoi region on triangle for trimesh).
AGXPHYSICS_EXPORT agx::Physics::Geometry::ShapePtr & shape1()
Shape number 1 in contact.
AGXPHYSICS_EXPORT agx::UInt8 & state()
Contact point state, such as impacting, resting etc.
AGXPHYSICS_EXPORT agx::UInt32 & faceIndex2()
The face index of shape 2 in contact (e.g. index of triangle for trimesh).
AGXPHYSICS_EXPORT agx::Physics::Geometry::ShapePtr & shape2()
Shape number 2 in contact.
AGXPHYSICS_EXPORT agx::Real & area()
AGXPHYSICS_EXPORT agx::Vec3 & restitution()
AGXPHYSICS_EXPORT agx::UInt32 & faceIndex1()
The face index of shape 1 in contact (e.g. index of triangle for trimesh).
AGXPHYSICS_EXPORT agx::Vec3f & velocity()
AGXPHYSICS_EXPORT agx::Bool & enabled()
AGXPHYSICS_EXPORT agx::Vec2 & tangentialCohesion()
AGXPHYSICS_EXPORT agx::Vec3f & tangentU()
AGXPHYSICS_EXPORT agx::Real & volume()
AGXPHYSICS_EXPORT agx::Vec3f & tangentV()
AGXPHYSICS_EXPORT agx::Real & depth()
AGXPHYSICS_EXPORT agx::UInt8 & faceFeature2()
The face feature of shape 2 in contact (e.g. voronoi region on triangle for trimesh).
AGXPHYSICS_EXPORT agx::Physics::ContactMaterialPtr & material()
A geometry contact hold contact information between two geometries.
AGXPHYSICS_EXPORT agx::Physics::RigidBodyPtr & body1()
body1 is the rigid body of geometry1, can be assumed to be a valid rigid body.
AGXPHYSICS_EXPORT agx::Bool & hasInternalMaterial()
AGXPHYSICS_EXPORT void *& customData()
AGXPHYSICS_EXPORT agx::Bool & hasSurfaceVelocity()
AGXPHYSICS_EXPORT agx::Bool & enabled()
AGXPHYSICS_EXPORT agxData::Array< agx::Physics::ContactPointPtr > & points()
The list of contact points.
AGXPHYSICS_EXPORT agx::Physics::GeometryPtr & geometry2()
AGXPHYSICS_EXPORT agx::Physics::BroadPhasePairPtr & broadPhasePair()
AGXPHYSICS_EXPORT agx::Physics::RigidBodyPtr & body2()
body2 is the rigid body of geometry2, can be NULL.
AGXPHYSICS_EXPORT agx::Bool & immediately()
AGXPHYSICS_EXPORT agx::Physics::GeometryPtr & geometry1()
AGXPHYSICS_EXPORT agxCollide::Geometry *& model()
Pointer to a entity instance of type Physics.Geometry.Shape.
Definition: ShapeEntity.h:196
The rigid body class, combining a geometric model and a frame of reference.
Definition: RigidBody.h:49
agx::Vec3 getAngularVelocity() const
Angular velocity in world coordinate frame.
Definition: RigidBody.h:1193
agx::Vec3 getVelocity() const
Velocity of center of mass frame origin, in world coordinate frame.
Definition: RigidBody.h:1188
agx::Vec3 getCmPosition() const
Definition: RigidBody.h:1203
void set(T x, T y, T z)
Definition: Vec3Template.h:459
#define agxAssert(expr)
Definition: debug.h:143
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: macros.h:89
#define AGX_STATIC_ASSERT(X)
Definition: macros.h:23
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: macros.h:88
#define AGX_FORCE_INLINE
Definition: macros.h:58
This namespace consists of a set of classes for handling geometric intersection tests including boole...
void copyContactPoint(const T1 &from, T2 &to)
Copy between the different kinds of contact points.
Definition: Contacts.h:318
agxData::Array< ContactPoint > ContactPointVector
Definition: Contacts.h:348
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
Definition: Constraint.h:31
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
uint32_t UInt32
Definition: Integer.h:32
Vec3T< Real > Vec3
The object holding 3 dimensional vectors and providing basic arithmetic.
Definition: agx/Vec3.h:36
bool Bool
Definition: Integer.h:40
T1 clamp(T1 v, T2 minimum, T3 maximum)
Definition: Math.h:318
Vec2T< Real > Vec2
The object holding 2 dimensional vectors and providing basic arithmetic.
Definition: Vec2.h:35
double Real
Definition: Real.h:41
uint8_t UInt8
Definition: Integer.h:30
const Real Infinity
Definition: Math.h:72
Vec3T< Real32 > Vec3f
Definition: agx/Vec3.h:39