|
AGX Dynamics 2.42.3.1
|
Base class for all friction models with interface and some utility/necessary methods implemented. More...
#include <FrictionModel.h>
Inheritance diagram for agx::FrictionModel:Public Types | |
| enum | FrictionCallbackType { NONE = 0 , INITIALIZE = 1 << 0 , SCALE_BOUNDS = 1 << 1 , ITERATIVE_PROJECTION = 1 << 2 , HAS_CUSTOM_CONTACT_IMPLEMENTATION = 1 << 3 , ACCURATE_CONE_NL_DIRECT = 1 << 4 } |
| enum | SolveType { NOT_DEFINED , DIRECT , ITERATIVE , SPLIT , DIRECT_AND_ITERATIVE } |
Public Member Functions | |
| AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE (agx::FrictionModel) | |
| virtual void | calculateTangentPlane (const agxCollide::Geometry *geometry1, const agxCollide::Geometry *geometry2, const agx::Vec3 &point, const agx::Vec3 &normal, const agx::Real depth, agx::Vec3 &ret_u, agx::Vec3 &ret_v) const |
| Calculates friction plane given normal. | |
| int | getCallbackMask () const |
| bool | getEnableCallbackMask (FrictionCallbackType mask) const |
| SolveType | getSolveType () const |
| bool | hasCustomContactImplementation () const |
| virtual void | initialize (const Physics::GeometryContactPtr geometryContact, size_t pointIndex, agx::Real dt, agx::RangeReal &ret_boundU, agx::RangeReal &ret_boundV) const =0 |
| Initializes bounds given contact point (pointIndex). | |
| virtual void | matchForCustomContactImplementation (agxCollide::GeometryContact *geometryContact, agxSDK::Simulation *simulation) |
| bool | needsNlmcpCallbacks () const |
| void | setSolveType (SolveType solveType) |
| Solve type for a friction model can be either DIRECT (all equations to the direct solver), ITERATIVE (all equations to the iterative solver), SPLIT (normal equations both direct and iterative and tangential equations only iterative) and DIRECT_AND_ITERATIVE (both normal and tangential equations are solved both direct and iterative). | |
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. | |
Static Public Member Functions | |
| static void | calculateTangentPlane (const Vec3 &primaryDirectionWorld, const Vec3 &normal, Vec3 &ret_u, Vec3 &ret_v) |
| Calculates friction tangents directions given primaryDirectionWorld and contact normal. | |
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. | |
Protected Member Functions | |
| FrictionModel (int callbackMask, SolveType preferredSolveType) | |
| Protected constructor given callback bask and preferred solve type. | |
| virtual | ~FrictionModel () |
| Destructor. | |
| void | restore (agxStream::InputArchive &in) override |
| Restore. | |
| void | setEnableCallbackMask (FrictionCallbackType mask, bool enable) |
| Enable/disable the given callback mask. | |
| void | store (agxStream::OutputArchive &out) const override |
| Store. | |
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 () |
Additional Inherited Members | |
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. | |
Protected Attributes inherited from agx::Referenced | |
| Mutex | m_mutex |
| ObserverContainer | m_observers |
| AtomicValue | m_refCount |
Base class for all friction models with interface and some utility/necessary methods implemented.
Definition at line 52 of file FrictionModel.h.
Definition at line 67 of file FrictionModel.h.
Definition at line 57 of file FrictionModel.h.
|
protected |
Protected constructor given callback bask and preferred solve type.
| callbackMask | - callback mask from FrictionCallbackType |
| preferredSolveType | - if no one assigns solve type, this is the "default" solve type |
|
protectedvirtual |
Destructor.
| agx::FrictionModel::AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE | ( | agx::FrictionModel | ) |
|
virtual |
Calculates friction plane given normal.
Only valid if normal, ret_u and ret_v are orthogonal.
| geometry1 | - first geometry in the geometry contact |
| geometry2 | - the other geometry in the geometry contact |
| point | - contact point in world coordinate system |
| normal | - contact normal in world coordinate system |
| depth | - penetration depth |
| ret_u | - returned, primary direction in friction plane |
| ret_v | - returned, secondary direction in the friction plane |
Reimplemented in agx::OrientedFrictionModelImpl< agx::BoxFrictionModel >, agx::OrientedFrictionModelImpl< agx::IterativeProjectedConeFriction >, agx::OrientedFrictionModelImpl< agx::ScaleBoxFrictionModel >, agxModel::TireFriction, agxVehicle::TrackFrictionModelImpl< agx::BoxFrictionModel >, agxVehicle::TrackFrictionModelImpl< agx::IterativeProjectedConeFriction >, and agxVehicle::TrackFrictionModelImpl< agx::ScaleBoxFrictionModel >.
|
inlinestatic |
Calculates friction tangents directions given primaryDirectionWorld and contact normal.
| primaryDirectionWorld | - primary friction direction in world frame, transformed to ret_u | |
| normal | - friction plane normal (contact normal direction) | |
| [out] | ret_u | - resulting primary direction in world coordinates |
| [out] | ret_v | - resulting secondary direction in world coordinates |
Definition at line 365 of file FrictionModel.h.
References agx::Attachment::createAttachmentBase(), agx::Vec3T< T >::cross(), agx::Vec3T< T >::normalize(), and agx::RealEpsilon.
Referenced by agx::OrientedFrictionModelImpl< T >::calculateTangentPlane(), and agxVehicle::calculateTrackTangentPlane().
| int agx::FrictionModel::getCallbackMask | ( | ) | const |
Definition at line 386 of file FrictionModel.h.
| bool agx::FrictionModel::getEnableCallbackMask | ( | FrictionCallbackType | mask | ) | const |
| mask | - callback mask to check |
| FrictionModel::SolveType agx::FrictionModel::getSolveType | ( | ) | const |
Definition at line 381 of file FrictionModel.h.
|
inline |
Definition at line 396 of file FrictionModel.h.
References HAS_CUSTOM_CONTACT_IMPLEMENTATION.
|
pure virtual |
Initializes bounds given contact point (pointIndex).
| geometryContact | - geometry contact |
| pointIndex | - point in geometry contact |
| dt | - time step |
| ret_boundU | - returned, primary direction bounds |
| ret_boundV | - returned, secondary direction bounds |
Implemented in agxTerrain::ShovelAggregateFrictionModel, agx::BoxFrictionModel, and agx::ScaleBoxFrictionModel.
|
inlinevirtual |
Reimplemented in agx::DirectMultiTangentsFrictionModel, and agx::TerrainWheelForceModel.
Definition at line 401 of file FrictionModel.h.
| bool agx::FrictionModel::needsNlmcpCallbacks | ( | ) | const |
Definition at line 391 of file FrictionModel.h.
References DIRECT, DIRECT_AND_ITERATIVE, and SCALE_BOUNDS.
|
overrideprotected |
Restore.
Abstract serializable, so child classes must explicitly call these methods.
|
protected |
Enable/disable the given callback mask.
| mask | - callback mask to change |
| enable | - enable flag |
| void agx::FrictionModel::setSolveType | ( | SolveType | solveType | ) |
Solve type for a friction model can be either DIRECT (all equations to the direct solver), ITERATIVE (all equations to the iterative solver), SPLIT (normal equations both direct and iterative and tangential equations only iterative) and DIRECT_AND_ITERATIVE (both normal and tangential equations are solved both direct and iterative).
| solveType | - solve type definition |
|
overrideprotected |
Store.
Abstract serializable, so child classes must explicitly call these methods.