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
161 const agx::Vec3& getWorldPosition()
const;
201 FIX_FRICTION_DIRECTION = (1<<2)
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;
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 ];
493 void store(
agxStream::OutputArchive& out ) const;
498 void restore(
agxStream::InputArchive& in );
503 agx::Real m_startDistance;
505 agx::Real m_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;
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;
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 );
878 const
EyeNode* getAsEye() const;
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;
1155 friend class
agx::InternalData;
1160 agx::Referenced* getInternalData() const;
1166 void setInternalData(
agx::Referenced* data );
1170 agx::ref_ptr<
agx::Referenced> m_internalData;
1249 void setRestLength(
agx::Real restLength );
1255 void changeRestLength(
agx::Real dl );
1260 agx::Real getRestLength() const;
1266 void setCurrentLength(
agx::Real currentLength );
1272 void changeCurrentLength(
agx::Real dl );
1277 agx::Real getCurrentLength() const;
1282 agx::Real getViolation() const;
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;
1368 void create(
agx::RigidBody* rb, const
agx::Vec3& relativeTranslate );
1441 void setEnableReverseAddOfNormalNode(
bool reverseAdd );
1450 void setReverseAdd(
bool reverseAdd );
1455 bool getReverseAdd() const;
1475 agx::Real getDistanceToChild() const;
1480 agx::Vec3 getVectorToChild() const;
1485 void setVectorToChild( const
agx::Vec3& vec );
1490 virtual
void reverse() override;
1499 void setFixFrictionDirection(
bool fixFrictionDirection,
bool goForward );
1504 bool getFixFrictionDirection() const;
1540 void create(
agx::RigidBody* rb, const
agx::Vec3& relativeTranslate, const
agx::Vec3& extraEyeVector,
agx::Real radius );
1608 void setSuperBendReplacedWithBend(
bool replaceSuperBend );
1613 bool getSuperBendReplacedWithBend() const;
1618 virtual
void updateConnection(
agxWire::
Wire* ) {}
1645 void create(
agx::RigidBody* rb, const
agx::Vec3& relativeTranslate );
1685 agx::Real getReferenceDistance() const;
1691 void setReferenceDistance(
agx::Real referenceDistance );
1713 void create(
agx::RigidBody* rb, const
agx::Vec3& relativeTranslate );
1716 agx::Real m_referenceDistance;
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;
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();
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();
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 );
2036 void create(
agxCollide::Geometry* geometry, const
agx::Vec3& shapeRelativeTranslate, const
agx::Vec3& shapeEdgeStart, const
agx::Vec3& shapeEdgeEnd, const
agx::Vec3& 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 ];
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;
#define AGXSTREAM_DECLARE_SERIALIZABLE(T)
Use this in a Serializable class to add the required methods Important: Use full namespace in the dec...
#define AGXPHYSICS_EXPORT
Class for writing serialized data in binary format to a stream.
The body fixed node is attached to a body at a given offset.
BodyFixedNode(agx::RigidBody *rb, agx::Real relTranslate_x, agx::Real relTranslate_y, agx::Real relTranslate_z)
Construct a body fixed wire node given a rigid body and relative position (rigid body frame).
BodyFixedNode(agx::RigidBody *rb, const agx::Vec3 &relativeTranslate=agx::Vec3())
Construct a body fixed wire node given a rigid body and relative position (rigid body frame).
Connecting nodes contains two nodes, one at center of mass and the other at the user defined position...
ConnectingNode(agx::RigidBody *rb, const agx::Vec3 &relativeTranslate, agx::Real radius)
Construct connecting node given body, model frame offset and radius.
void fullTransform()
Transform this and (if present) the center of mass node.
agx::Real getOffsetLength() const
BodyFixedNode * getCmNode() const
void setCmNode(agxWire::BodyFixedNode *cmNode)
Internal method used by serialization to assign the stored center of mass node.
Eye node is a type of node that can slide along a wire with or without friction.
EyeNode(agx::RigidBody *rb, agx::Real relTranslate_x, agx::Real relTranslate_y, agx::Real relTranslate_z, const agx::Vec3 &extraEyeVector=agx::Vec3(), agx::Real radius=agx::Real(0))
Construct a sliding node given a body, model center offset and a radius.
EyeNode(agx::RigidBody *rb, const agx::Vec3 &relativeTranslate, agx::Real radius=agx::Real(0))
Construct a sliding node given a body, model center offset and a radius.
void setRadius(agx::Real radius)
Set the radius of this eye node.
EyeNode(agx::RigidBody *rb, const agx::Vec3 &relativeTranslate, const agx::Vec3 &extraEyeVector, agx::Real radius=agx::Real(0))
Construct a sliding node given a body, model center offset and a radius.
agx::Real getRadius() const
EyeNode(agx::RigidBody *rb, agx::Real radius=agx::Real(0))
Construct a sliding node given a body and a radius.
Free node class used to route wires.
void create(const agx::Vec3 &position)
Create method for all constructors.
FreeNode(agx::Real x, agx::Real y, agx::Real z)
Constructs given world position.
FreeNode()
Not defined to create this node without a position.
virtual ~FreeNode()
Destructor.
FreeNode(const agx::Vec3 &position)
Constructs given world position.
Class to control variable node density along wires through routed nodes.
void set(agx::Real startDistance, agx::Real endDistance, agx::Real nodesPerUnitDistance)
Function to activate the high resolution for a node in a wire.
agx::Real getNodesPerUnitDistance() const
void setNodesPerUnitDistance(agx::Real nodesPerUnitDistance)
Assign new resolution (number of nodes per unit distance).
agx::Real getStartDistance() const
void setStartDistance(agx::Real startDistance)
Assign new start distance.
void setEndDistance(agx::Real endDistance)
Assign new end distance.
agx::Real getEndDistance() const
HighResolutionRange()
Default constructor.
void reverse()
Reverse range (distances).
Node coordinate frame in another frame.
agx::Vec3 & getElement(Elements element)
Data access.
const agx::Vec3 & getTranslate() const
agx::Vec3 calculateCmOffset(const agx::RigidBody *rb) const
Manly for writing Jacobian data to the solver.
const agx::Vec3 & getElement(Elements element) const
Data access.
@ ORG_TRANSLATE
Original translate.
@ TRANSLATE
Current transformed translate.
@ REL_BODY_TRANSLATE
Current transformed relative.
void transform()
Recalculates TRANSLATE and REL_BODY_TRANSLATE.
void setRigidBody(agx::RigidBody *body)
Set rigid body.
void setTranslate(agx::Real x, agx::Real y, agx::Real z)
Set original translate (world frame if this node frame doesn't have a rigid body).
void setTranslate(const agx::Vec3 &translate)
Set original translate (world frame if this node frame doesn't have a rigid body).
NodeFrame()
Default constructor.
Material definition for a wire node Specifies the friction of a wire for sliding through an EyeNode.
char m_goForward
Bit mask for GO_FORWARD, IS_DIRTY...
agx::Real getFrictionCoefficient(Direction dir) const
agx::Real getKinematicContactNodeVelocityScale(Direction dir) const
agx::Real getNormalForceMagnitude() const
bool getActive() const
Internal method.
void setActive(bool active)
Internal method.
Direction
Friction direction in a wire.
@ POSITIVE
Direction towards end of the wire.
FrictionDirection
Internal.
void setStick(bool stick, Direction dir)
Internal method.
agx::Real getMaxForce(Direction dir)
agx::Real m_normalForceMagnitude
Magnitude of the normal force.
bool isInfCoefficient(Direction dir) const
agx::Real m_violationPerUnitLength
Violation of the friction constraint.
Direction getActiveDirection() const
void setFrictionCoefficient(agx::Real coeff, Direction dir=BOTH)
Set stick friction coefficient in one or both directions.
agx::Real m_restLength
Rest length of the friction constraint.
bool hasValidRestLength() const
Internal method.
bool m_activeConstraint
Tells you if the friction constraint is active.
bool isStick() const
Internal method.
bool isStick(Direction dir) const
Internal method.
void setKinematicContactNodeVelocityScale(agx::Real scaler, Direction dir=BOTH)
Set slide friction coefficient in one or both directions.
NodeMaterial()
Default constructor.
Class defining a node that is part of a wire.
StateInfo
Internal state a node may have.
Type
The supported node types.
Stop node, wire end node used by winches.
agx::Vec3 getNormal() const
StopNode(agx::RigidBody *rb, const agx::Vec3 &relativeTranslate)
Construct a stop node (mostly used internally).
void setNormal(agx::Vec3 normal)
Assign new value for the normal.
Interface and placeholder of controllers/helpers for wires.
Inheritance with partial specialization due to bug with ref_ptr containers.
Inheritance with partial specialization due to bug with ref_ptr containers.
Base class providing referencing counted objects.
The rigid body class, combining a geometric model and a frame of reference.
Vector containing 'raw' data.
Smart pointer for handling referenced counted objects.
#define DOXYGEN_END_INTERNAL_BLOCK()
#define DOXYGEN_START_INTERNAL_BLOCK()
This namespace consists of a set of classes for handling geometric intersection tests including boole...
This namespace contain classes for streaming classes into archives, ASCII, binary for storage (serial...
Implements a Wire model with adaptive resolution.
NodeRefListA NodeContainer
NodePtrContainer::iterator NodePtrIterator
NodePtrContainer::const_iterator NodePtrConstIterator
agx::Vector< Node * > NodePtrVector
NodeContainer::const_iterator NodeConstIterator
agx::List< Node * > NodePtrListA
agx::ref_ptr< Node > NodeRef
NodePtrListA NodePtrContainer
agx::HashVector< agxCollide::GeometryRef, agx::Vec3 > GeometryRefDepthTable
NodeContainer::const_reverse_iterator NodeConstReverseIterator
NodeContainer::reverse_iterator NodeReverseIterator
agx::Vector< NodeRef > NodeRefVector
agx::LinearProbingHashTable< Node *, NodeIterator > NodePtrNodeIterHash
agx::List< NodeRef > NodeRefListA
NodeContainer::iterator NodeIterator
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
Stability parameters object defining the behavior of the constraints associated to this connecting no...
StabilityParameters(agx::Real youngsModulus, agx::Real damping, agx::Bool active)