AGX Dynamics 2.42.3.1
Loading...
Searching...
No Matches
agxWire::ContactNode Class Reference

Contact node class is a node that, currently, is defined to live on an edge on a geometry (agxCollide::Geometry). More...

#include <Node.h>

+ Inheritance diagram for agxWire::ContactNode:

Public Types

enum  MovementRange { MOVEMENT_RANGE_START = 1 , MOVEMENT_RANGE_END = 2 }
 Clamp definition. More...
 
- Public Types inherited from agxWire::Node
enum  StateInfo {
  STANDARD = 0 , WAS_CONTACT = (1<< 0) , IS_HIGH_RES = (1<< 1) , IGNORE_BEND = (1<< 2) ,
  NO_LUMP_NEAR = (1<< 3) , NO_CIRCLE_CONTACT = (1<< 4) , GYPSY_CONTACT = (1<< 5) , NO_MOVEMENT_RANGE = (1<< 6) ,
  NO_FRICTION = (1<< 7) , SPLIT_ENABLED = (1<< 8) , INSIDE_OBJECT = (1<< 9) , WAS_CONTACT_LAST_TIMESTEP = (1<<10) ,
  PERMANENT_LUMP = (1<<11) , REPLACE_SUPERBEND_WITH_BEND = (1<<12) , LUMPED_NODE = (1<<13) , LUMP_CONTACT = (1<<14) ,
  WW_STABILIZED = (1<<15)
}
 Internal state a node may have. More...
 
enum  Type {
  NOT_DEFINED = 0 , EYE = (1<<0) , MISSING = (1<<1) , CONNECTING = (1<<2) ,
  FREE = (1<<3) , CONTACT = (1<<4) , BODY_FIXED = (1<<5) , STOP = (1 << 6) ,
  SHAPE_CONTACT = (1<<7)
}
 The supported node types. More...
 

Public Member Functions

 ContactNode (agxCollide::Geometry *geometry, const agx::Vec3 &shapeRelativeTranslate, const agx::Vec3 &shapeEdgeStart, const agx::Vec3 &shapeEdgeEnd, const agx::Vec3 &shapeEdge)
 Construct a contact node given geometry, translate, edge start and end and the edge direction (all points/vectors must be given in shape coordinate system).
 
 ContactNode (agxCollide::Geometry *geometry, const agx::Vec3 &shapeRelativeTranslate=agx::Vec3())
 Construct a contact node given geometry and relative translate in shape coordinates.
 
 ContactNode (ContactNode *cn)
 Like a copy constructor.
 
agxCollide::Geometry * getGeometry () const
 
MeshIndex * getMeshIndex ()
 
const MeshIndex * getMeshIndex () const
 
bool getNoStickContact () const
 
void setGeometry (agxCollide::Geometry *geometry)
 Assign new geometry to this node.
 
void setNoStickContact (bool noStickyContact)
 Enable this and the normal force vs gravity force test is ignored.
 
virtual void setTranslate (const agx::Vec3 &shapeTranslate) override
 Set translate of this contact wire node in shape coordinates.
 
- Public Member Functions inherited from agxWire::Node
void addState (int state)
 Add state mask to the current state.
 
BodyFixedNode * getAsBodyFixed ()
 
const BodyFixedNode * getAsBodyFixed () const
 
ConnectingNode * getAsConnecting ()
 
const ConnectingNode * getAsConnecting () const
 
ContactNode * getAsContact ()
 
const ContactNode * getAsContact () const
 
EyeNode * getAsEye ()
 
const EyeNode * getAsEye () const
 
EyeNode * getAsEyeLineNode ()
 
const EyeNode * getAsEyeLineNode () const
 
FreeNode * getAsFree ()
 
const FreeNode * getAsFree () const
 
ShapeContactNode * getAsShapeContact ()
 
const ShapeContactNode * getAsShapeContact () const
 
StopNode * getAsStop ()
 
const StopNode * getAsStop () const
 
agx::Referenced * getCustomData () const
 
NodeFrame * getFrame ()
 
const NodeFrame * getFrame () const
 
HighResolutionRange * getHighResolutionRange ()
 
const HighResolutionRange * getHighResolutionRange () const
 
bool getIgnoreBend () const
 
agx::Vec3 getIntegratedPosition (agx::Real t, bool onlyTranslational=true) const
 Calculates the position of this node at time t from now.
 
NodeMaterial * getMaterial ()
 
const NodeMaterial * getMaterial () const
 
NodeFrame & getNodeFrame ()
 
Type getNodeType () const
 
const agx::Vec3 & getPosition () const
 
agx::RigidBody * getRigidBody () const
 
int getState () const
 
const agx::Vec3 & getTranslate () const
 
Node::Type getType () const
 
virtual agx::Vec3 getVelocity () const
 
const agx::Vec3 & getWorldPosition () const
 
agx::Bool isType (agx::Int typeMask) const
 Test several types, e.g., node->isType( agxWire::Node::EYE | agxWire::Node::CONNECTING ).
 
void removeState (int state)
 Remove state mask from the current state.
 
virtual void reverse ()
 Only for internal use! Reverses all, internal, direction dependent structures.
 
void setCustomData (agx::Referenced *customData)
 Set custom data to this node.
 
void setIgnoreBend (bool ignoreBend)
 Flag if bend constraints should be ignored over this node.
 
void setTranslate (agx::Real x, agx::Real y, agx::Real z)
 Set the relative translate of this node in parent frame (body frame if body is set, otherwise world frame)
 
virtual void setTranslate (const agx::Vec3 &translate)
 Set the relative translate of this node in parent frame (body frame if body is set, otherwise world frame)
 
void transform ()
 Transforms the frame.
 
- Public Member Functions inherited from agx::Referenced
 Referenced ()
 Default constructor.
 
 Referenced (const Referenced &)
 
template<typename T >
T * as ()
 Subclass casting.
 
template<typename T >
const T * as () const
 
template<typename T >
T * asSafe ()
 Safe subclass casting, return nullptr if template type does not match.
 
template<typename T >
const T * asSafe () const
 
int getReferenceCount () const
 
template<typename T >
bool is () const
 Subclass test.
 
Referenced & operator= (const Referenced &)
 Assignment operator. Will increment the number of references to the referenced object.
 
void reference (void *ptr=nullptr) const
 Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it.
 
void unreference (void *ptr=nullptr) const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it.
 
void unreference_nodelete () const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it.
 
- Public Member Functions inherited from agxStream::Serializable
virtual ~Serializable ()
 Destructor for normal C++ use but hidden from SWIG bindings.
 
virtual const char * getClassName () const
 
bool getEnableSerialization () const
 
bool getEnableUuidGeneration ()
 
agx::UInt32 getIndex () const
 This index is given at creation of this object.
 
virtual StorageAgent * getStorageAgent () const =0
 
agx::Uuid getUuid () const
 
bool isFinished () const
 
void setEnableSerialization (bool flag)
 Set to false to disable serialization of this object.
 
void setFinished ()
 Tells this class that it is restored correctly and should not be deleted during destruction of an Archive.
 
void setUuid (const agx::Uuid &uuid)
 Explicitly set a Uuid on a serializable object.
 

Protected Member Functions

 ContactNode ()
 Protected default constructor.
 
virtual ~ContactNode ()
 Destructor.
 
void create (agxCollide::Geometry *geometry, const agx::Vec3 &shapeRelativeTranslate, const agx::Vec3 &shapeEdgeStart, const agx::Vec3 &shapeEdgeEnd, const agx::Vec3 &shapeEdge)
 Create method all public constructors should use.
 
- Protected Member Functions inherited from agxWire::Node
 Node ()
 Default constructor.
 
 Node (Type type)
 Constructor given general node type.
 
virtual ~Node ()
 Destructor.
 
- Protected Member Functions inherited from agx::Referenced
virtual ~Referenced ()
 Destructor.
 
void allocateObserverVector () const
 
void deleteUsingDeleteHandler () const
 
- Protected Member Functions inherited from agxStream::Serializable
 Serializable ()
 Default constructor.
 
 Serializable (const Serializable &other)
 Copy constructor.
 
void generateUuid ()
 

Protected Attributes

size_t m_clamped
 
GeometryRefDepthTable m_collidedGeometries
 
agx::Vec3 m_edgeOffsetFromSurface
 
agx::Real m_edgeVelocity
 
agx::observer_ptr< agxCollide::Geometry > m_geometry
 
MeshIndex m_meshIndex
 
agx::observer_ptr< agxCollide::Geometry > m_nextGeometry
 
bool m_openAngle
 
agx::Vec3 m_shapeEdge
 
agx::Vec3 m_shapeEdgeEnd
 
agx::Vec3 m_shapeEdgeStart
 
agx::Vec3 m_shapeFullRangeEnd
 
agx::Vec3 m_shapeFullRangeStart
 
agx::Vec3 m_shapePreviousPosition
 
agx::Vec3 m_shapeTranslate
 
- Protected Attributes inherited from agxWire::Node
BodyFixedNode * m_bodyFixed
 
ConnectingNode * m_connecting
 
ContactNode * m_contact
 
ContactForce m_contactForce
 
agx::ref_ptr< agx::Referenced > m_customData
 
EyeNode * m_eye
 
FreeNode * m_free
 
HighResolutionRange m_highResolutionRange
 
NodeMaterial m_material
 
NodeFrame m_nf
 
int m_nodeState
 
agx::observer_ptr< Node > m_parent
 
ShapeContactNode * m_shapeContact
 
SpatialState m_spatialState
 
StopNode * m_stop
 
StoreRestoreData m_storeRestoreData
 
Tension m_tension
 
Type m_type
 
- Protected Attributes inherited from agx::Referenced
Mutex m_mutex
 
ObserverContainer m_observers
 
AtomicValue m_refCount
 

Additional Inherited Members

- Static Public Member Functions inherited from agxWire::Node
static int findNodeState (const agxCollide::Geometry *geometry)
 Class used to track nodes when CCD is used.
 
static agx::Bool isContactType (const Node *node)
 
static agx::Bool isContactType (const Node::Type &type)
 
- Static Public Member Functions inherited from agx::Referenced
template<typename T >
static bool ValidateCast (const Referenced *object)
 
- Static Public Member Functions inherited from agxStream::Serializable
static void setEnableUuidGeneration (bool flag)
 Specify if there should be UUID:s generated for each new Serializable object. By default it is enabled.
 
- Static Protected Member Functions inherited from agx::Referenced
static DeleteHandler * getDeleteHandler ()
 
static void setDeleteHandler (DeleteHandler *handler)
 Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.
 

Detailed Description

Contact node class is a node that, currently, is defined to live on an edge on a geometry (agxCollide::Geometry).

Definition at line 1725 of file agxWire/Node.h.

Member Enumeration Documentation

◆ MovementRange

Clamp definition.

Enumerator
MOVEMENT_RANGE_START 

Clamped at edge start.

MOVEMENT_RANGE_END 

Clamped at edge end.

Definition at line 1731 of file agxWire/Node.h.

Constructor & Destructor Documentation

◆ ContactNode() [1/4]

agxWire::ContactNode::ContactNode ( agxCollide::Geometry *  geometry,
const agx::Vec3 &  shapeRelativeTranslate,
const agx::Vec3 &  shapeEdgeStart,
const agx::Vec3 &  shapeEdgeEnd,
const agx::Vec3 &  shapeEdge 
)

Construct a contact node given geometry, translate, edge start and end and the edge direction (all points/vectors must be given in shape coordinate system).

Parameters
geometry- geometry with one shape
shapeRelativeTranslate- translate relative the shape
shapeEdgeStart- edge start given in shape coordinates
shapeEdgeEnd- edge end given in shape coordinates
shapeEdge- edge direction given in shape coordinates

◆ ContactNode() [2/4]

agxWire::ContactNode::ContactNode ( ContactNode *  cn)

Like a copy constructor.

This node will be a copy of cn.

Parameters
cn- contact node to copy

◆ ContactNode() [3/4]

agxWire::ContactNode::ContactNode ( agxCollide::Geometry *  geometry,
const agx::Vec3 &  shapeRelativeTranslate = agx::Vec3() 
)

Construct a contact node given geometry and relative translate in shape coordinates.

Note that the translate will be corrected to fit the shape. A movement range and edge will be calculated when this node is added to a wire.

Parameters
geometry- a geometry with one supported shape (supported shapes: box and cylinder)
shapeRelativeTranslate- translate in shape coordinates

◆ ContactNode() [4/4]

agxWire::ContactNode::ContactNode ( )
protected

Protected default constructor.

◆ ~ContactNode()

virtual agxWire::ContactNode::~ContactNode ( )
protectedvirtual

Destructor.

Member Function Documentation

◆ create()

void agxWire::ContactNode::create ( agxCollide::Geometry *  geometry,
const agx::Vec3 &  shapeRelativeTranslate,
const agx::Vec3 &  shapeEdgeStart,
const agx::Vec3 &  shapeEdgeEnd,
const agx::Vec3 &  shapeEdge 
)
protected

Create method all public constructors should use.

Parameters
geometry- geometry this node is relative to
shapeRelativeTranslate- shape offset (shape coordinate system)
shapeEdgeStart- start of edge in shape coordinates
shapeEdgeEnd- end of edge in shape coordinates
shapeEdge- direction of the edge in shape coordinates

◆ getGeometry()

agxCollide::Geometry * agxWire::ContactNode::getGeometry ( ) const
Returns
this the geometry this code is in contact with

◆ getMeshIndex() [1/2]

ContactNode::MeshIndex * agxWire::ContactNode::getMeshIndex ( )
Returns
the mesh index class

Definition at line 2189 of file agxWire/Node.h.

◆ getMeshIndex() [2/2]

const ContactNode::MeshIndex * agxWire::ContactNode::getMeshIndex ( ) const
Returns
the mesh index class

Definition at line 2194 of file agxWire/Node.h.

◆ getNoStickContact()

bool agxWire::ContactNode::getNoStickContact ( ) const
Returns
true if no stick contact is enabled

◆ setGeometry()

void agxWire::ContactNode::setGeometry ( agxCollide::Geometry *  geometry)

Assign new geometry to this node.

The node state will be updated but not the relative offset.

Parameters
geometry- new geometry

◆ setNoStickContact()

void agxWire::ContactNode::setNoStickContact ( bool  noStickyContact)

Enable this and the normal force vs gravity force test is ignored.

◆ setTranslate()

virtual void agxWire::ContactNode::setTranslate ( const agx::Vec3 &  shapeTranslate)
overridevirtual

Set translate of this contact wire node in shape coordinates.

Internal method

Parameters
shapeTranslate- translate given in shape coordinate system

Reimplemented from agxWire::Node.

Member Data Documentation

◆ m_clamped

size_t agxWire::ContactNode::m_clamped
protected

Definition at line 2050 of file agxWire/Node.h.

◆ m_collidedGeometries

GeometryRefDepthTable agxWire::ContactNode::m_collidedGeometries
protected

Definition at line 2049 of file agxWire/Node.h.

◆ m_edgeOffsetFromSurface

agx::Vec3 agxWire::ContactNode::m_edgeOffsetFromSurface
protected

Definition at line 2048 of file agxWire/Node.h.

◆ m_edgeVelocity

agx::Real agxWire::ContactNode::m_edgeVelocity
protected

Definition at line 2052 of file agxWire/Node.h.

◆ m_geometry

agx::observer_ptr< agxCollide::Geometry > agxWire::ContactNode::m_geometry
protected

Definition at line 2039 of file agxWire/Node.h.

◆ m_meshIndex

MeshIndex agxWire::ContactNode::m_meshIndex
protected

Definition at line 2053 of file agxWire/Node.h.

◆ m_nextGeometry

agx::observer_ptr< agxCollide::Geometry > agxWire::ContactNode::m_nextGeometry
protected

Definition at line 2040 of file agxWire/Node.h.

◆ m_openAngle

bool agxWire::ContactNode::m_openAngle
protected

Definition at line 2051 of file agxWire/Node.h.

◆ m_shapeEdge

agx::Vec3 agxWire::ContactNode::m_shapeEdge
protected

Definition at line 2044 of file agxWire/Node.h.

◆ m_shapeEdgeEnd

agx::Vec3 agxWire::ContactNode::m_shapeEdgeEnd
protected

Definition at line 2043 of file agxWire/Node.h.

◆ m_shapeEdgeStart

agx::Vec3 agxWire::ContactNode::m_shapeEdgeStart
protected

Definition at line 2042 of file agxWire/Node.h.

◆ m_shapeFullRangeEnd

agx::Vec3 agxWire::ContactNode::m_shapeFullRangeEnd
protected

Definition at line 2046 of file agxWire/Node.h.

◆ m_shapeFullRangeStart

agx::Vec3 agxWire::ContactNode::m_shapeFullRangeStart
protected

Definition at line 2045 of file agxWire/Node.h.

◆ m_shapePreviousPosition

agx::Vec3 agxWire::ContactNode::m_shapePreviousPosition
protected

Definition at line 2047 of file agxWire/Node.h.

◆ m_shapeTranslate

agx::Vec3 agxWire::ContactNode::m_shapeTranslate
protected

Definition at line 2041 of file agxWire/Node.h.


The documentation for this class was generated from the following file: