AGX Dynamics 2.38.0.2
Loading...
Searching...
No Matches
WireContactController.h
Go to the documentation of this file.
1/*
2Copyright 2007-2024. 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
20#include <agx/Referenced.h>
21#include <agx/Vec3.h>
22#include <agxWire/Node.h>
24#include <agxWire/WireUtils.h>
25
27
28namespace agxSDK
29{
30 class SimulationProxy;
31}
32
33namespace agxCollide
34{
35 class Shape;
36 class GeometryContactPtr;
37 class Geometry;
38}
39
40namespace agxWire
41{
42 class Wire;
43 class WireGeometryController;
44
46 typedef agx::HashVector< Node*, GeometryContactVector > NodePtrGeometryContactVectorTable;
47 typedef agx::Vector< std::pair< ShapeContactNode*, agx::Real> > ShapeContactRealPairVector;
49
50 typedef agx::HashSet<agxCollide::Shape*> ShapeSet;
51 typedef agx::HashTable<ShapeContactNode*, ShapeSet > NodeShapeSetVector;
52
53 class AGXPHYSICS_EXPORT WireContactController : public agx::Referenced
54 {
55 public:
56 WireContactController( Wire* wire );
57
58 virtual agx::Bool handleGeometryContact(agxCollide::GeometryContact* geometryContact, agxCollide::Geometry* otherGeometry) = 0;
59
60 agx::Vec3 calculateContactNodeShapeEdgeOffset(ContactNode* cln, agxCollide::Shape* shape, const agx::Real& wireRadius) const;
61
62 virtual void preCollideUpdate() = 0;
63 virtual void preUpdate() = 0;
64 virtual void postUpdate() = 0;
65
66 static Node* changeToContact(Node* node, Wire* wire, agxCollide::Shape* shape, const agx::Vec3& cPoint,
67 const agx::Vec3& cNormal, const agx::Real& cDepth, const agx::Bool removeNode);
68
69 const agxSDK::SimulationProxy* getSimulationProxy() const;
70 agxWire::WireGeometryController* getGeometryController();
71 const agxWire::WireGeometryController* getGeometryController() const;
72 agxWire::WireDistanceCompositeConstraint* getWireDistanceCompositeConstraint();
73 const agxWire::WireDistanceCompositeConstraint* getWireDistanceCompositeConstraint() const;
74
75 protected:
76
77 void clearTempData();
78
79 virtual ~WireContactController();
80
81
82 protected:
83 Wire* m_wire;
84 };
85
86 typedef agx::ref_ptr< WireContactController > WireContactControllerRef;
87}
88
#define AGXPHYSICS_EXPORT
A contact between two geometries.
Definition Contacts.h:271
The geometry representation used by the collision detection engine.
Definition Geometry.h:92
Base class for a shape.
Definition Shape.h:54
Interface class used by internal objects running in parallel.
Inheritance with partial specialization due to bug with ref_ptr containers.
This class is a combined container which has the find complexity of a HashTable, deterministic iterat...
Definition HashVector.h:41
Inheritance with partial specialization due to bug with ref_ptr containers.
Base class providing referencing counted objects.
Definition Referenced.h:120
Templated vector class.
Definition agx/Vector.h:53
Smart pointer for handling referenced counted objects.
Definition ref_ptr.h:30
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition macros.h:97
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition macros.h:96
This namespace consists of a set of classes for handling geometric intersection tests including boole...
agx::Vector< GeometryContact > GeometryContactVector
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
Definition Constraint.h:31
Implements a Wire model with adaptive resolution.
Definition MergedBody.h:40
bool Bool
Definition Integer.h:40
double Real
Definition Real.h:42