41 class ShapeContactNode;
42 class WireFrictionController;
43 class WireTensionController;
44 class WireFrictionConstraintImplementation;
61 #if HASH_FOR_WIRE == HASH_NEW
63 #elif HASH_FOR_WIRE == HASH_OLD
114 agx::Vec3& getElement( Elements element );
121 const agx::Vec3& getElement( Elements element )
const;
132 void setTranslate(
const agx::Vec3& translate );
161 const agx::Vec3& getWorldPosition()
const;
201 FIX_FRICTION_DIRECTION = (1<<2)
213 bool hasValidRestLength()
const;
219 bool isStick()
const;
232 void setActive(
bool active );
238 bool getActive()
const;
244 void setStick(
bool stick,
Direction dir );
273 bool getEnable()
const;
278 bool isEnabled()
const;
293 bool isInfCoefficient(
Direction dir )
const;
298 agx::Real getNormalForceMagnitude()
const;
305 void toggleGoForward();
310 bool getGoForward() const;
315 bool goForwardIsDirty() const;
321 void setGoForwardIsDirty();
326 void resetGoForwardIsDirty();
332 void updateStick( agx::
Real tension );
337 void setInvalidRestLength();
342 void store( agxStream::OutputArchive&
out ) const;
347 void restore( agxStream::InputArchive&
in, agxWire::
Node* node );
359 agx::
Real getRestLength() const;
365 agx::
Real getViolation() const;
370 friend class WireFrictionController;
373 friend class WireFrictionConstraintImplementation;
374 friend class WireOldContactController;
375 friend class WireDistanceCompositeConstraintImplementation;
381 void setRestLength( agx::
Real restLength );
387 void setViolation( agx::
Real violation );
393 void setViolationPerUnitLength( agx::
Real violationPerUnitLength );
398 agx::
Real getViolationPerUnitLength();
404 void setNormalForceMagnitude( agx::
Real normalForce );
413 bool m_stick[ BOTH ];
443 bool isActive()
const;
458 agx::Real getNodesPerUnitDistance()
const;
466 void setStartDistance(
agx::Real startDistance );
474 void setEndDistance(
agx::Real endDistance );
481 void setNodesPerUnitDistance(
agx::Real nodesPerUnitDistance );
529 SHAPE_CONTACT = (1<<7)
538 WAS_CONTACT = (1<< 0),
539 IS_HIGH_RES = (1<< 1),
540 IGNORE_BEND = (1<< 2),
541 NO_LUMP_NEAR = (1<< 3),
542 NO_CIRCLE_CONTACT = (1<< 4),
543 GYPSY_CONTACT = (1<< 5),
544 NO_MOVEMENT_RANGE = (1<< 6),
545 NO_FRICTION = (1<< 7),
546 SPLIT_ENABLED = (1<< 8),
547 INSIDE_OBJECT = (1<< 9),
548 WAS_CONTACT_LAST_TIMESTEP = (1<<10),
549 PERMANENT_LUMP = (1<<11),
550 REPLACE_SUPERBEND_WITH_BEND = (1<<12),
551 LUMPED_NODE = (1<<13),
552 LUMP_CONTACT = (1<<14),
553 WW_STABILIZED = (1<<15)
578 bool operator < (
const Data& other )
const;
645 const Data* local()
const;
650 const DataContainer& removed()
const {
return m_removed; }
660 const Data* intermediate(
agx::UInt i )
const;
674 DataContainer m_removed;
685 static
int findNodeState( const agxCollide::Geometry* geometry );
687 static agx::
Bool isContactType(const Node* node);
699 agx::
Bool isType( agx::
Int typeMask ) const;
707 Type getNodeType() const;
712 NodeFrame* getFrame();
717 const NodeFrame* getFrame() const;
724 NodeFrame& getNodeFrame();
730 SpatialState* getSpatialState();
735 const SpatialState* getSpatialState() const;
741 const agx::
Vec3& getWorldPosition() const;
746 const agx::
Vec3& getTranslate() const;
751 const agx::
Vec3& getPosition() const;
756 virtual
void setTranslate( const agx::
Vec3& translate );
761 void setTranslate( agx::
Real x, agx::
Real y, agx::
Real z );
766 agx::RigidBody* getRigidBody() const;
771 virtual
void reverse();
782 void setCustomData( agx::Referenced* customData );
787 agx::Referenced* getCustomData() const;
792 HighResolutionRange* getHighResolutionRange();
797 const HighResolutionRange* getHighResolutionRange() const;
806 agx::
Vec3 getIntegratedPosition( agx::
Real t,
bool onlyTranslational = true ) const;
811 virtual agx::
Vec3 getVelocity() const;
816 void setIgnoreBend(
bool ignoreBend );
821 bool getIgnoreBend() const;
826 int getState() const;
832 void addState(
int state );
838 void removeState(
int state );
843 NodeMaterial* getMaterial();
848 const NodeMaterial* getMaterial() const;
853 FreeNode* getAsFree();
858 const FreeNode* getAsFree() const;
863 BodyFixedNode* getAsBodyFixed();
868 const BodyFixedNode* getAsBodyFixed() const;
878 const EyeNode* getAsEye() const;
884 EyeNode* getAsEyeLineNode();
890 const EyeNode* getAsEyeLineNode() const;
895 ConnectingNode* getAsConnecting();
900 const ConnectingNode* getAsConnecting() const;
905 StopNode* getAsStop();
910 const StopNode* getAsStop() const;
915 ContactNode* getAsContact();
920 const ContactNode* getAsContact() const;
925 const ShapeContactNode* getAsShapeContact() const;
930 ShapeContactNode* getAsShapeContact();
939 void setInsideObject(
bool insideObject);
944 bool getInsideObject() const;
949 bool getWasContact() const;
954 bool getWasContactLastTimestep() const;
960 void setWasContact(
bool wasContact );
966 void setWasContactLastTimestep(
bool wasContact );
971 void setNoLumpNear(
bool noLumpNear );
976 bool getNoLumpNear() const;
981 void setNoCircleContact(
bool disableCircleContact );
986 bool getNoCircleContact() const;
992 void setGypsyContact(
bool gypsyContact);
998 bool getGypsyContact() const;
1006 void setNoMovementRange(
bool disableMovementRange);
1011 bool getNoMovementRange() const;
1017 void setNoFriction(
bool noFriction );
1023 bool getNoFriction() const;
1028 void setState(
int nodeState );
1040 int& geometryIndex();
1043 bool getIgnored()
const;
1044 int getGeometryIndex()
const;
1045 bool getAtBegin()
const;
1050 int m_geometryIndex;
1058 StoreRestoreData* getStoreRestoreData();
1063 const StoreRestoreData* getStoreRestoreData()
const;
1074 Tension() : raw( agx::
Real( 0 ) ), smoothed( agx::
Real( 0 ) ) {}
1082 Tension* getTension();
1087 const Tension* getTension()
const;
1136 ContactForce m_contactForce;
1138 agx::ref_ptr< agx::Referenced > m_customData;
1148 StoreRestoreData m_storeRestoreData;
1149 SpatialState m_spatialState;
1151 agx::observer_ptr< Node > m_parent;
1155 friend class agx::InternalData;
1160 agx::Referenced* getInternalData() const;
1166 void setInternalData( agx::Referenced* data );
1170 agx::ref_ptr<agx::Referenced> m_internalData;
1211 void create(
const agx::Vec3& position );
1249 void setRestLength(
agx::Real restLength );
1266 void setCurrentLength(
agx::Real currentLength );
1272 void changeCurrentLength(
agx::Real dl );
1287 void setIsLumpedNode(
bool lumpedNode );
1292 bool isLumpedNode()
const;
1297 void setIsLumpContact(
bool lumpContact );
1302 bool isLumpContact()
const;
1308 void setSplitEnabled(
bool splitEnabled );
1313 bool getSplitEnabled()
const;
1319 void setIsHighRes(
bool wasHighRes );
1324 bool getIsHighRes()
const;
1330 void setPermanentLump(
bool permantentLump );
1336 bool getPermanentLump()
const;
1363 virtual ~BodyFixedNode();
1368 void create( agx::RigidBody* rb, const agx::
Vec3& relativeTranslate );
1441 void setEnableReverseAddOfNormalNode(
bool reverseAdd );
1450 void setReverseAdd(
bool reverseAdd );
1455 bool getReverseAdd()
const;
1465 const EyeNode* getChildNode()
const;
1470 EyeNode* getParentNode()
const;
1485 void setVectorToChild(
const agx::Vec3& vec );
1490 virtual void reverse()
override;
1499 void setFixFrictionDirection(
bool fixFrictionDirection,
bool goForward );
1504 bool getFixFrictionDirection()
const;
1585 BodyFixedNode* getCmNode()
const;
1602 void fullTransform();
1608 void setSuperBendReplacedWithBend(
bool replaceSuperBend );
1613 bool getSuperBendReplacedWithBend() const;
1618 virtual
void updateConnection( agxWire::
Wire* ) {}
1638 virtual ~ConnectingNode();
1645 void create( agx::RigidBody* rb, const agx::
Vec3& relativeTranslate );
1648 BodyFixedNodeRef m_cmNode;
1691 void setReferenceDistance(
agx::Real referenceDistance );
1706 virtual ~StopNode();
1713 void create( agx::RigidBody* rb, const agx::
Vec3& relativeTranslate );
1733 MOVEMENT_RANGE_START = 1,
1734 MOVEMENT_RANGE_END = 2
1746 int getMeshCurrentTriangleIndex()
const;
1747 int getMeshNextTriangleIndexStart()
const;
1748 int getMeshNextTriangleIndexEnd()
const;
1749 int getMeshCurrentEdgeIndex()
const;
1750 int getMeshNextEdgeIndexStart()
const;
1751 int getMeshNextEdgeIndexEnd()
const;
1752 void setMeshCurrentIndex(
int meshCurrentTriangleIndex,
int meshCurrentEdgeIndex );
1753 void setMeshNextIndexStart(
int meshNextTriangleIndexStart,
int meshNextEdgeIndexStart );
1754 void setMeshNextIndexEnd(
int meshNextTriangleIndexEnd,
int meshNextEdgeIndexEnd );
1761 int m_meshCurrentTriangleIndex;
1762 int m_meshCurrentEdgeIndex;
1763 int m_meshNextTriangleIndexStart;
1764 int m_meshNextEdgeIndexStart;
1765 int m_meshNextTriangleIndexEnd;
1766 int m_meshNextEdgeIndexEnd;
1781 ContactNode( agxCollide::Geometry* geometry, const agx::
Vec3& shapeRelativeTranslate, const agx::
Vec3& shapeEdgeStart, const agx::
Vec3& shapeEdgeEnd, const agx::
Vec3& shapeEdge );
1787 ContactNode( ContactNode* cn );
1796 ContactNode( agxCollide::Geometry* geometry, const agx::
Vec3& shapeRelativeTranslate = agx::
Vec3() );
1801 agxCollide::Geometry* getGeometry() const;
1808 void setGeometry( agxCollide::Geometry* geometry );
1815 virtual
void setTranslate( const agx::Vec3& shapeTranslate ) override;
1820 void setNoStickContact(
bool noStickyContact );
1825 bool getNoStickContact() const;
1830 MeshIndex* getMeshIndex();
1835 const MeshIndex* getMeshIndex() const;
1844 agxCollide::Geometry* getNextGeometry() const;
1851 void setNextGeometry(agxCollide::Geometry* nextGeometry);
1856 const agx::Vec3& getShapeTranslate() const;
1861 void setShapeEdge(const agx::Vec3& shapeEdge);
1866 const agx::Vec3& getShapeEdge() const;
1871 void resetMovementRange(
int direction);
1878 void setMovementRange(const agx::Vec3& start, const agx::Vec3&
end);
1884 void getMovementRange(agx::Vec3& start, agx::Vec3& end) const;
1890 void getFullMovementRange(agx::Vec3& start, agx::Vec3& end) const;
1895 bool getIfOpenAngle() const;
1900 void setOpenAngle(
bool openAngle);
1905 size_t getClampedRangeInformation() const;
1910 const agx::Vec3& getPreviousPosition() const;
1915 void setPreviousPosition(agx::
Real t, agx::Vec3 start, agx::Vec3 edge);
1920 void resetPreviousPosition();
1925 bool clampMovementRange(const agx::Vec3& pos, MovementRange direction);
1930 void setShapeEdgeOffset(const agx::Vec3& offset);
1935 agx::Vec3 getShapeEdgeOffset() const;
1940 void setCollidedGeometry(agxCollide::Geometry* geometry, const agx::Vec3& depthVector);
1950 void resetCollidedGeometries();
1955 agx::Vec3 getParameterizedPosition(agx::
Real t) const;
1960 agx::
Real findParameterizedValue(agx::Vec3 localPosition) const;
1965 agx::
Real findParameterizedValueFullRange(agx::Vec3 localPosition) const;
1971 void analyzeCollidedGeometries();
1976 void copyGeometries(agxWire::ContactNode* cn);
1981 agx::
Real getEdgeVelocity() const;
1987 void setEdgeVelocity(agx::
Real vel);
1992 bool getCreatedFromDynamicContact() const;
2002 bool onSameGeometry( const agxWire::Node* otherNode ) const;
2010 bool initialize( agx::
Real wireRadius, agx::
Real wireRadiusMultiplier );
2026 virtual ~ContactNode();
2036 void create( agxCollide::Geometry* geometry, const agx::Vec3& shapeRelativeTranslate, const agx::Vec3& shapeEdgeStart, const agx::Vec3& shapeEdgeEnd, const agx::Vec3& shapeEdge );
2039 agx::observer_ptr< agxCollide::Geometry > m_geometry;
2040 agx::observer_ptr< agxCollide::Geometry > m_nextGeometry;
2041 agx::Vec3 m_shapeTranslate;
2042 agx::Vec3 m_shapeEdgeStart;
2043 agx::Vec3 m_shapeEdgeEnd;
2044 agx::Vec3 m_shapeEdge;
2045 agx::Vec3 m_shapeFullRangeStart;
2046 agx::Vec3 m_shapeFullRangeEnd;
2047 agx::Vec3 m_shapePreviousPosition;
2048 agx::Vec3 m_edgeOffsetFromSurface;
2053 MeshIndex m_meshIndex;
2058 return m_data[ TRANSLATE ];
2067 AGX_FORCE_INLINE const Node::SpatialState::Data* Node::SpatialState::intermediate( agx::
UInt i )
const
2069 return i < m_removed.size() ? m_removed.ptr() + i : i == m_removed.size() ? &m_local :
nullptr;
2072 AGX_FORCE_INLINE Node::SpatialState::Data* agxWire::Node::SpatialState::local()
2077 AGX_FORCE_INLINE const Node::SpatialState::Data* agxWire::Node::SpatialState::local()
const
2084 return &m_spatialState;
2087 AGX_FORCE_INLINE const agxWire::Node::SpatialState* Node::getSpatialState()
const
2089 return &m_spatialState;
2094 return m_internalData;
2106 return (
agx::Int( m_type ) & typeMask) != 0;
2121 return m_nf.getWorldPosition();
2126 return m_nf.getRigidBody();
2151 return m_connecting;
2156 return m_connecting;
2181 return m_shapeContact;
2186 return m_shapeContact;
2191 return &m_meshIndex;
2196 return &m_meshIndex;
InputRef< T > in(const char *name, T &obj)
Create an object with a name and a reference to the object that should be restored (usually a pointer...
agx::Real m_nodesPerUnitDistance
Direction
Friction direction in a wire.
AGXCORE_EXPORT Type * getType(const agx::String &name)
Vec3T< Real > Vec3
The object holding 3 dimensional vectors and providing basic arithmetic.
Stability parameters object defining the behavior of the constraints associated to this connecting no...
agx::ref_ptr< EyeNode > m_childNode
Type
The supported node types.
agx::Vector< NodeRef > NodeRefVector
bool m_activeConstraint
Tells you if the friction constraint is active.
Connecting nodes contains two nodes, one at center of mass and the other at the user defined position...
OutputRef< Serializable > out(const char *name, const Serializable *obj)
Return an object that contain the name and the object that should be serialized to an archive...
NodeRefListA NodeContainer
agx::RigidBody * getRigidBody() const
Node coordinate frame in another frame.
const ShapeContactNode * getAsShapeContact() const
NodeContainer::iterator NodeIterator
void AGXCORE_EXPORT transform(void *target, const Format *targetFormat, const void *source, const Format *sourceFormat, size_t numElements)
Transform data between two buffers.
#define AGXPHYSICS_EXPORT
Inheritance with partial specialization due to bug with ref_ptr containers.
Free node class used to route wires.
agx::ref_ptr< EyeNode > EyeNodeRef
agx::List< Node * > NodePtrListA
agx::Real m_violationPerUnitLength
Violation of the friction constraint.
agx::Real m_restLength
Rest length of the friction constraint.
NodeContainer::reverse_iterator NodeReverseIterator
agx::HashVector< agxCollide::GeometryRef, agx::Vec3 > GeometryRefDepthTable
char m_goForward
Bit mask for GO_FORWARD, IS_DIRTY...
Material definition for a wire node Specifies the friction of a wire for sliding through an EyeNode...
NodePtrContainer::const_iterator NodePtrConstIterator
agx::RigidBody * getRigidBody() const
Base class providing referencing counted objects.
agx::ref_ptr< FreeNode > FreeNodeRef
The body fixed node is attached to a body at a given offset.
Direction
The different directions in which a cable can be deformed.
Interface and placeholder of controllers/helpers for wires.
ContactNode * getAsContact()
Direction towards end of the wire.
Vector containing 'raw' data.
ConnectingNode * getAsConnecting()
agx::ref_ptr< ContactNode > ContactNodeRef
const agx::Vec3 & getWorldPosition() const
NodeContainer::const_reverse_iterator NodeConstReverseIterator
Stop node, wire end node used by winches.
Smart pointer for handling referenced counted objects.
typedef void(GLAD_API_PTR *GLDEBUGPROC)(GLenum source
NodePtrListA NodePtrContainer
agx::ref_ptr< Node > NodeRef
Object that defines the relation between different types of wires (agxWire::Wire).
The rigid body class, combining a geometric model and a frame of reference.
agx::List< NodeRef > NodeRefListA
BodyFixedNode * getAsBodyFixed()
Class to control variable node density along wires through routed nodes.
NodePtrContainer::iterator NodePtrIterator
#define AGXSTREAM_DECLARE_SERIALIZABLE(T)
Use this in a Serializable class to add the required methods Important: Use full namespace in the dec...
agx::Vector< Node * > NodePtrVector
This class is an abstract base class for all classes that can be stored and retrieved from an Archive...
Class for writing serialized data in binary format to a stream.
agx::Bool isType(agx::Int typeMask) const
Test several types, e.g., node->isType( agxWire::Node::EYE | agxWire::Node::CONNECTING )...
NodeContainer::const_iterator NodeConstIterator
Current transformed relative.
LinearProbingHashSetImplementation< KeyT, HashT >::iterator end(LinearProbingHashSetImplementation< KeyT, HashT > &set)
StateInfo
Internal state a node may have.
Class defining a node that is part of a wire.
Eye node is a type of node that can slide along a wire with or without friction.
agx::Real m_startDistance
Inheritance with partial specialization due to bug with ref_ptr containers.
Current transformed translate.
#define DOXYGEN_END_INTERNAL_BLOCK()
FrictionDirection
Internal.
agx::LinearProbingHashTable< Node *, NodeIterator > NodePtrNodeIterHash
#define DOXYGEN_START_INTERNAL_BLOCK()
agx::Real m_normalForceMagnitude
Magnitude of the normal force.