106 agx::Real constantNormalForceMagnitude = 0.0,
107 bool scaleWithDepth =
false );
155 const size_t numPoints )
const override;
167 CONSTANT_NORMAL_FORCE = 1 << 0,
168 SCALE_WITH_DEPTH = 1 << 1,
171 using Flags = agx::BitState<Flag, std::underlying_type_t<Flag>>;
174 agx::Real constantNormalForceMagnitude{};
178 InternalState m_state;
192 using Base::TrackFrictionModelImpl;
214 using Base::TrackFrictionModelImpl;
237 if ( t1 !=
nullptr || t2 !=
nullptr ) {
238 const auto t = t1 !=
nullptr ? t1 : t2;
240 sign *= 1.0 - 2.0 *
agx::Real( t1 ==
nullptr );
243 primaryDirectionWorld = rb->getFrame()->transformVectorToWorld(
agx::Vec3::Z_AXIS() );
247 primaryDirectionWorld = normal.
cross( sign * wheel->getRotationAxis() ).
normal();
#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 AGXVEHICLE_EXPORT
The geometry representation used by the collision detection engine.
agx::RigidBody * getRigidBody()
The agx::BoxFrictionModel with oriented friction directions calculated from interacting track instanc...
void setEnableScaleWithDepth(bool enable)
Enable/disable scale of the given normal force with the contact point depth resulting in a maximum fr...
agx::Real getConstantNormalForceMagnitude() const
void setEnableConstantNormalForceMagnitude(bool enable)
Enable/disable use of given/constant normal force magnitude.
bool getEnableScaleWithDepth() const
TrackBoxFrictionModel(agx::FrictionModel::SolveType solveType=agx::FrictionModel::SPLIT, agx::Real constantNormalForceMagnitude=0.0, bool scaleWithDepth=false)
Construct given solve type, (optional) constant normal force magnitude and/or (optional) state to sca...
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 override
void setConstantNormalForceMagnitude(agx::Real constantNormalForceMagnitude)
Assign normal force magnitude.
bool getEnableConstantNormalForceMagnitude() const
virtual ~TrackBoxFrictionModel()=default
Track friction model that calculates the friction directions given the well defined coordinate frames...
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 override
Calculating the friction directions such as the primary direction is along the first interacting trac...
virtual ~TrackFrictionModelImpl()=default
The agx::IterativeProjectedConeFriction with oriented friction directions calculated from interacting...
virtual ~TrackIterativeProjectedConeFrictionModel()=default
The agx::ScaleBoxFrictionModel with oriented friction directions calculated from interacting track in...
virtual ~TrackScaleBoxFrictionModel()=default
static Track * get(agx::RigidBody *rb)
@ SPLIT
First Normal equation is calculated in the DIRECT solver, then in a second pass the normal and the fr...
static void calculateTangentPlane(const Vec3 &primaryDirectionWorld, const Vec3 &normal, Vec3 &ret_u, Vec3 &ret_v)
Calculates friction tangents directions given primaryDirectionWorld and contact normal.
const Vec3T cross(const Vec3T &rhs) const
Cross product method.
AGXVEHICLE_EXPORT bool isTrackSegment(const Track &track, const agx::RigidBody &rb)
Check if the given rb is a track segment type of body, e.g., a node or a segment sensor.
AGXVEHICLE_EXPORT const TrackWheel * findWheel(const Track &track, const agx::RigidBody &rb)
Finds the wheel instance in the given track if rb is a track sensor of the wheel.
This namespace contains classes related to vehicles dynamics.
static void calculateTrackTangentPlane(const agxCollide::Geometry *g1, const agxCollide::Geometry *g2, const agx::Vec3 &normal, agx::Vec3 &ret_u, agx::Vec3 &ret_v)