AGX Dynamics 2.42.3.1
Loading...
Searching...
No Matches
TerrainFrictionModels.h
Go to the documentation of this file.
1/*
2Copyright 2007-2025. Algoryx Simulation AB.
3
4All AGX source code, intellectual property, documentation, sample code,
5tutorials, scene files and technical white papers, are copyrighted, proprietary
6and confidential material of Algoryx Simulation AB. You may not download, read,
7store, distribute, publish, copy or otherwise disseminate, use or expose this
8material unless having a written signed agreement with Algoryx Simulation AB, or having been
9advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10valid commercial license from Algoryx Simulation AB.
11
12Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13from using this software, unless otherwise stated in written agreements with
14Algoryx Simulation AB.
15*/
16
17#pragma once
18
21#include <agxCollide/Contacts.h>
22#include <array>
23
24
25
26namespace agxTerrain
27{
35 {
36 public:
39 agx::UInt numPoints=4 );
41
42 virtual void initialize( const agx::Physics::GeometryContactPtr geometryContact,
43 size_t pointIndex,
44 agx::Real dt,
45 agx::RangeReal& ret_boundU,
46 agx::RangeReal& ret_boundV ) const override;
47
49 agx::Real normalForce,
50 const agx::Vec3f& normal,
51 const agx::Vec3& point );
52 void onPre();
53 void clear();
54
55 agx::Vec3f getCachedNormal( agx::UInt pointIndex ) const { return m_cachedNormals[ pointIndex ]; }
56
57 agx::Real getCachedNormalForce( agx::UInt pointIndex ) const { return m_cachedNormalForce[ pointIndex ]; }
58
59 agx::Vec3 getCachedPoint( agx::UInt pointIndex ) const { return m_cachedPoints[ pointIndex ]; }
60
61 agx::UInt getNumPoints() const { return m_cachedNormalForce.size(); }
62
63 private:
64 // Shovel contacts always contains up to N points. They all
65 // appear in the same order.
66 agx::RealVector m_cachedNormalForce;
67 agx::Vec3fVector m_cachedNormals;
68 agx::Vec3Vector m_cachedPoints;
69 mutable size_t m_currentPointIndex;
70 };
71
73}
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
agx::Vec3 getCachedPoint(agx::UInt pointIndex) const
ShovelAggregateFrictionModel(agx::Frame *frame, agx::FrictionModel::SolveType solveType=agx::FrictionModel::DIRECT, agx::UInt numPoints=4)
agx::Vec3f getCachedNormal(agx::UInt pointIndex) const
agx::Real getCachedNormalForce(agx::UInt pointIndex) const
virtual void initialize(const agx::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.
void setCachedNormalForce(agx::UInt pointIndex, agx::Real normalForce, const agx::Vec3f &normal, const agx::Vec3 &point)
size_t size() const
Definition: Container.h:134
The object defining a frame of reference and providing transformations operations.
Definition: agx/Frame.h:68
@ DIRECT
Normal and friction equation calculated only in the DIRECT solver.
Definition: FrictionModel.h:60
Box friction model with oriented friction box.
A geometry contact hold contact information between two geometries.
The agxTerrain namespace contains a 3D model for a dynamic deformable Terrain and related classes.
Definition: Geometry.h:59
agx::Real getAverageContactForce(agxCollide::GeometryContactPtrVector matches, bool print=false)
uint64_t UInt
Definition: Integer.h:27
double Real
Definition: Real.h:41