AGX Dynamics 2.41.2.0
Loading...
Searching...
No Matches
agxUtil.h File Reference

Go to the source code of this file.

Classes

class  agxUtil::ConstraintHolder
 Utility class to hold custom implementations of constraints. More...
 
class  agxUtil::GeneralContactEventListener< T >
 Utility class to get contact event callbacks to any class having the methods implemented. More...
 
class  agxUtil::GeneralStepListener< T >
 Utility class to get step event callbacks to any class having the methods implemented. More...
 
struct  agxUtil::JumpRequestWireOption
 Jump request options for wire nodes which parent isn't the given assembly/collection. More...
 
struct  agxUtil::LargerThanPred< T >
 Larger than operator to e.g., sort functions. More...
 
struct  agxUtil::LessThanPred< T >
 Less than operator to e.g., sort functions. More...
 
class  agxUtil::SceneRoot
 

Namespaces

namespace  agx
 The agx namespace contains the dynamics/math part of the AGX Dynamics API.
 
namespace  agxCollide
 This namespace consists of a set of classes for handling geometric intersection tests including boolean tests, penetration and contact sets.
 
namespace  agxControl
 This namespace contains general operation and action classes which can be used to control a agxSDK::Simulation.
 
namespace  agxSDK
 The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simulation system including Material, event listeners etc.
 
namespace  agxUtil
 The agxUtil namespace contain classes and methods for utility functionality.
 

Macros

#define callback_implementation(callback_name)
 
#define callback_implementation(callback_name, ArgT)
 

Typedefs

typedef agx::ref_ptr< ConstraintHolder > agxUtil::ConstraintHolderRef
 

Functions

template<typename T >
void agxUtil::addGroup (agxSDK::Assembly *assembly, T id)
 For the specified assembly, add the collision group ID to its geometries.
 
template<typename T >
void agxUtil::addGroup (const agx::RigidBody *body, const T &id)
 For the specified body, add the collision group ID to its geometries.
 
AGXPHYSICS_EXPORT void agxUtil::addParentVelocity (const agx::RigidBody *parentBody, agx::RigidBody *body)
 body will get the parents velocity added to its velocity as if it was rigidly attached.
 
AGXPHYSICS_EXPORT agx::AffineMatrix4x4 agxUtil::calculateCylinderTransform (const agx::Vec3 &startPoint, const agx::Vec3 &endPoint)
 Calculates transform that can be used for cylinders/capsules like geometries.
 
AGXPHYSICS_EXPORT agxCollide::BoundingAABB agxUtil::computeRigidBodyBoundingVolume (const agx::RigidBody *body)
 Compute the BoundingAABB for a specified rigid body using it's geometries.
 
template<typename ContainerT >
ContainerT agxUtil::copyContainerMemory (const ContainerT &container)
 Returns a copy of the passed container.
 
AGXPHYSICS_EXPORT agxControl::EventSensoragxUtil::createSinkOnGeometry (agxCollide::Geometry *geometry, bool onlyIncludeEmittedBodies)
 Utillity function for creating a "sink" on a geometry that will remove rigid bodies and particles that come into contact with it.
 
AGXPHYSICS_EXPORT bool agxUtil::extractConstraints (agx::ConstraintPtrVector &vec, agx::DynamicsSystem *system)
 Utility function to extract all constraints from the system.
 
AGXPHYSICS_EXPORT bool agxUtil::extractGeometries (agxCollide::GeometryPtrVector &geometries, agx::RigidBody *body)
 Utility function to extract all geometries from a RigidBody.
 
AGXPHYSICS_EXPORT bool agxUtil::extractGeometries (agxCollide::GeometryPtrVector &geometries, agxSDK::Assembly *assembly)
 Utility function to extract all geometries from an assembly (and its sub-assemblies), including geometries found in RigidBodies which are a part of the assembly (and sub-assemblies).
 
AGXPHYSICS_EXPORT bool agxUtil::extractGeometries (agxCollide::GeometryPtrVector &vec, agxCollide::Space *space)
 Utility function to extract all geometries from the space into a vector.
 
AGXPHYSICS_EXPORT bool agxUtil::extractRigidBodies (agx::RigidBodyPtrVector &bodies, agxSDK::Assembly *assembly)
 Utility function to extract all Rigid Bodies from an assembly (and its sub-assemblies).
 
template<typename ContainerT >
void agxUtil::freeContainerMemory (ContainerT &container)
 Free the memory held by the given container by swapping it with a default-constructed instance.
 
AGXPHYSICS_EXPORT size_t agxUtil::getContactMaterialVector (agxSDK::MaterialManager *mgr, agx::ContactMaterialPtrVector &contactMaterials)
 Get all contact materials from the material manager and add them to the supplied vector.
 
AGXPHYSICS_EXPORT size_t agxUtil::getMaterialVector (agxSDK::MaterialManager *mgr, agx::MaterialPtrVector &materials)
 Get all materials from the material manager and add them to the supplied vector.
 
AGXPHYSICS_EXPORT size_t agxUtil::getMeshData (const agxCollide::Mesh *mesh, agx::Vec3Vector &vertices, agx::UInt32Vector &indices)
 Extract vertices and indices from mesh.
 
template<typename ContainerT >
void agxUtil::insertionSort (ContainerT &container)
 Insertion sort, supports std::valarray.
 
template<typename ContainerT , typename Pred >
void agxUtil::insertionSort (ContainerT &container, Pred pred)
 Insertion sort, supports std::valarray.
 
AGXPHYSICS_EXPORT bool agxUtil::isConvexMesh (const agxCollide::Mesh *mesh, agx::Real threshold=1E-5)
 Algorithm for determining if a mesh is convex.
 
template<typename ContainerT >
agx::Bool agxUtil::isSorted (const ContainerT &container)
 std::valarray friendly is sorted function.
 
AGXPHYSICS_EXPORT size_t agxUtil::jumpRequest (agxSDK::Assembly *collection, agx::RigidBody *parentBody, const agx::AffineMatrix4x4 &parentBodyWorldTransform, agx::UInt32 wireOptions=agx::UInt32(0))
 This method will perform a "jump request" will all bodies in the assembly, including bodies which are part of wires.
 
AGXPHYSICS_EXPORT agx::RealVector agxUtil::linspace (agx::Real start, agx::Real end, agx::UInt num)
 
template<typename T >
void agxUtil::removeGroup (agxSDK::Assembly *assembly, T id)
 For the specified assembly, remove the collision group ID from its geometries.
 
template<typename T >
void agxUtil::removeGroup (const agx::RigidBody *body, const T &id)
 For the specified body, remove the collision group ID to its geometries.
 
AGXPHYSICS_EXPORT bool agxUtil::setBodyMaterial (agx::RigidBody *body, agx::Material *material)
 Utility function to loop through a body and set the material for associated geometry.
 
AGXPHYSICS_EXPORT bool agxUtil::setEnableCollisions (agx::RigidBody *body, agxSDK::Assembly *assembly, bool enable)
 Enable or disable the collision between all geometries found in Assembly assembly and in RigidBody body.
 
AGXPHYSICS_EXPORT bool agxUtil::setEnableCollisions (agx::RigidBody *body, bool enable)
 Enable or disable collision for all geometries in a RigidBody.
 
AGXPHYSICS_EXPORT bool agxUtil::setEnableCollisions (agx::RigidBody *body, const agxCollide::Geometry *geom, bool enable)
 Enable or disable the collision between all geometries in RigidBody body the geometry geom.
 
AGXPHYSICS_EXPORT bool agxUtil::setEnableCollisions (agx::RigidBody *rb1, agx::RigidBody *rb2, bool enable)
 Enable or disable the collision between all geometries in RigidBody rb1 and RigidBody rb2.
 
AGXPHYSICS_EXPORT bool agxUtil::setEnableCollisions (agxCollide::Geometry *geo, agxSDK::Assembly *assembly, bool enable)
 Enable or disable the collision between all geometries found in Assembly assembly and a Geometry geo.
 
AGXPHYSICS_EXPORT bool agxUtil::setEnableCollisions (agxSDK::Assembly *a1, agxSDK::Assembly *a2, bool enable)
 Enable or disable the collision between all geometries found in Assembly g1 and in Assembly g2.
 
AGXPHYSICS_EXPORT bool agxUtil::setEnableCollisions (agxSDK::Assembly *assembly, agx::RigidBody *body, bool enable)
 Enable or disable the collision between all geometries found in Assembly assembly and in RigidBody body.
 
AGXPHYSICS_EXPORT bool agxUtil::setEnableCollisions (agxSDK::Assembly *assembly, agxCollide::Geometry *geo, bool enable)
 Enable or disable the collision between all geometries found in Assembly assembly and a Geometry geo.
 
AGXPHYSICS_EXPORT bool agxUtil::setEnableCollisions (const agxCollide::Geometry *geom, agx::RigidBody *body, bool enable)
 Enable or disable the collision between all geometries in RigidBody body the geometry geom.
 
AGXPHYSICS_EXPORT bool agxUtil::setEnableGeometries (agx::RigidBody *body, bool enable)
 Enable or disable all geometries in a RigidBody.
 
AGXPHYSICS_EXPORT void agxUtil::setMotionControl (agx::RigidBodyPtrVector &bodies, agx::RigidBody::MotionControl motionControl)
 Utility function to set motion control for a vector of rigid bodies.
 
AGXPHYSICS_EXPORT agx::Vec3 agxUtil::transformPointFromTo (const agx::Vec3 point, const agx::RigidBody *fromBody, const agx::RigidBody *toBody)
 Point transform from rigid body fromBody to rigid body toBody.
 
AGXPHYSICS_EXPORT agx::Vec3 agxUtil::transformVectorFromTo (const agx::Vec3 vec, const agx::RigidBody *fromBody, const agx::RigidBody *toBody)
 Vector transform from rigid body fromBody to rigid body toBody.
 

Macro Definition Documentation

◆ callback_implementation [1/2]

#define callback_implementation (   callback_name)
Value:
virtual void callback_name( const agx::TimeStamp& t ) \
{ \
if ( !m_obj.isValid() ) { \
getSimulation()->remove( this ); \
return; \
} \
m_obj->callback_name( t ); \
}
agx::Real TimeStamp
Definition: TimeStamp.h:26

Definition at line 642 of file agxUtil.h.

◆ callback_implementation [2/2]

#define callback_implementation (   callback_name,
  ArgT 
)
Value:
virtual agxSDK::ContactEventListener::KeepContactPolicy callback_name( const agx::TimeStamp& t, ArgT obj ) \
{ \
if ( !m_obj.isValid() ) { \
getSimulation()->remove( this ); \
} \
return m_obj->callback_name( t, obj ); \
}
KeepContactPolicy
Defines whether contact should be kept or removed after contact/impact methods returns.

Definition at line 642 of file agxUtil.h.