17#ifndef AGX_FRICTIONMODEL_H
18#define AGX_FRICTIONMODEL_H
27#pragma warning( push )
28#pragma warning( disable : 4589 )
36 class GeometryContact;
69 SCALE_BOUNDS = 1 << 1,
70 ITERATIVE_PROJECTION = 1 << 2,
71 HAS_CUSTOM_CONTACT_IMPLEMENTATION = 1 << 3,
74 ACCURATE_CONE_NL_DIRECT = 1 << 4,
99 int getCallbackMask()
const;
144 bool needsNlmcpCallbacks()
const;
151 bool hasCustomContactImplementation()
const;
343 return m_callbackMask;
363#pragma warning( pop )
#define AGX_DECLARE_POINTER_TYPES(type)
#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
The geometry representation used by the collision detection engine.
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Class for writing serialized data in binary format to a stream.
This class is an abstract base class for all classes that can be stored and retrieved from an Archive...
virtual ~BoxFrictionModel()
virtual void initialize(const Physics::GeometryContactPtr geometryContact, size_t pointIndex, agx::Real dt, agx::RangeReal &ret_boundU, agx::RangeReal &ret_boundV) const override
Initializes the bounds, i.e., max force for the tangential equations.
virtual agx::Real calculateNormalForce(const agxCollide::Geometry *geometry1, const agxCollide::Geometry *geometry2, const agx::Vec3 &point, const agx::Vec3 &normal, const agx::Real depth, const agx::Real dt, const size_t numPoints) const
Calculates/estimates the normal force at the current point.
BoxFrictionModel(agx::FrictionModel::SolveType solveType=agx::FrictionModel::SPLIT)
Default constructor with default (preferred) solve type SPLIT.
Base class for all friction models with interface and some utility/necessary methods implemented.
bool hasCustomContactImplementation() const
void setEnableCallbackMask(FrictionCallbackType mask, bool enable)
Enable/disable the given callback mask.
bool getEnableCallbackMask(FrictionCallbackType mask) const
void restore(agxStream::InputArchive &in) override
Restore.
void setSolveType(SolveType solveType)
Solve type for a friction model can be either DIRECT (all equations to the direct solver),...
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).
FrictionModel(int callbackMask, SolveType preferredSolveType)
Protected constructor given callback bask and preferred solve type.
@ HAS_CUSTOM_CONTACT_IMPLEMENTATION
Custom implementation of the contact constraints associated to this friction model with this state.
@ SCALE_BOUNDS
Scaled bounds, if direct, callbacks from CP-solver.
@ SPLIT
First Normal equation is calculated in the DIRECT solver, then in a second pass the normal and the fr...
@ DIRECT
Normal and friction equation calculated only in the DIRECT solver.
@ ITERATIVE
Normal and friction equation calculated only in the ITERATIVE solver.
@ DIRECT_AND_ITERATIVE
Normal and friction equation calculated both in the ITERATIVE and the DIRECT solver.
bool needsNlmcpCallbacks() const
virtual ~FrictionModel()
Destructor.
SolveType getSolveType() const
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.
virtual void matchForCustomContactImplementation(agxCollide::GeometryContact *geometryContact, agxSDK::Simulation *simulation)
int getCallbackMask() const
void store(agxStream::OutputArchive &out) const override
Store.
Iterative Projected Cone Friction (IPC friction) model.
IterativeProjectedConeFriction(agx::FrictionModel::SolveType solveType=agx::FrictionModel::SPLIT)
Default constructor.
bool getEnableDirectExactConeProjection() const
void setEnableDirectExactConeProjection(bool enable)
Enable/disable exact cone projection when solve type is DIRECT.
virtual ~IterativeProjectedConeFriction()
Base class providing referencing counted objects.
virtual void initialize(const Physics::GeometryContactPtr geometryContact, size_t pointIndex, Real dt, RangeReal &ret_boundU, RangeReal &ret_boundV) const override
Initializes the bounds to 0.
virtual ~ScaleBoxFrictionModel()
ScaleBoxFrictionModel(int callbackMask, SolveType preferredSolveType)
ScaleBoxFrictionModel(agx::FrictionModel::SolveType solveType=agx::FrictionModel::SPLIT)
Default constructor with default (preferred) solve type SPLIT.
This namespace consists of a set of classes for handling geometric intersection tests including boole...
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
The agx namespace contains the dynamics/math part of the AGX Dynamics API.