AGX Dynamics 2.42.3.1
Loading...
Searching...
No Matches
FailureSurface.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#pragma once
17#include <agx/Referenced.h>
22#include <agxTerrain/export.h>
23
24namespace agxTerrain
25{
26 namespace GroundCollapse
27 {
30
31 /*
32 Class that describes a failure surface used in the ground collapse algorithm.
33
34 A failure surface is a sphere that intersects points x_a and x_b on the terrain surface, and has a certain radius.
35 The radiusNumber, aNumber and bNumber are integers >= 0 that identify which failure surface it is in the
36 configuration of failure surfaces used in a ground collapse algorithm.
37 */
39 {
40 public:
41 FailureSurface(const agx::Vec3& upDirection,
42 const agx::Vec3& xa,
43 const agx::Vec3& xb,
44 agx::UInt radiusNumber,
45 agx::UInt aNumber=0,
46 agx::UInt bNumber=0 );
47
48 /*
49 Get the center position of the failure surface.
50 */
51 inline agx::Vec3 getPosition() const { return m_position; };
52
53 /*
54 Get the radius of the failure surface.
55 */
56 inline agx::Real getRadius() const { return m_radius; };
57
58 /*
59 Get the intersection point of the failure surface on/below the slope.
60 */
61 inline agx::Vec3 getXa() const { return m_xa; };
62
63 /*
64 Get the intersection point of the failure surface above the slope.
65 */
66 inline agx::Vec3 getXb() const { return m_xb; };
67
68 /*
69 \return the total outer area of the sphere that creates the failure surface.
70 */
71 inline agx::Real getArea() const { return agx::Real( 4.0 ) * agx::PI * std::pow( getRadius(), 2 ); };
72
73 /*
74 Check that the failure surface is defined correctly; that xA and xB are not the same and that the radius is greater than 0.
75 */
76 bool isValid();
77
78
81 inline agx::Vec3 getRadiusVector() const { return m_radiusVector; };
82 inline agx::UInt getRadiusNumber() const { return m_radiusNumber; };
83 inline agx::UInt getANumber() const { return m_ANumber; };
84 inline agx::UInt getBNumber() const { return m_BNumber; };
85 FailureSurface();
87
88 protected:
89 virtual ~FailureSurface();
90
91 private:
92 agx::Vec3 m_xa;
93 agx::Vec3 m_xb;
94 agx::UInt m_radiusNumber;
95
96 agx::UInt m_ANumber;
97 agx::UInt m_BNumber;
98
99 agx::Vec3 m_radiusVector;
100
101 agx::Vec3 m_position;
102 agx::Real m_radius;
103 };
104 }
105}
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
#define AGXSTREAM_DECLARE_SERIALIZABLE(T)
Use this in a Serializable class to add the required methods Important: Use full namespace in the dec...
Definition: Serializable.h:207
#define AGXTERRAIN_EXPORT
#define AGX_DECLARE_VECTOR_TYPES(type)
Definition: agx/Vector.h:34
This class is an abstract base class for all classes that can be stored and retrieved from an Archive...
Definition: Serializable.h:44
FailureSurface(const agx::Vec3 &upDirection, const agx::Vec3 &xa, const agx::Vec3 &xb, agx::UInt radiusNumber, agx::UInt aNumber=0, agx::UInt bNumber=0)
Base class providing referencing counted objects.
Definition: Referenced.h:120
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: macros.h:89
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: macros.h:88
The agxTerrain namespace contains a 3D model for a dynamic deformable Terrain and related classes.
Definition: Geometry.h:59
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
uint64_t UInt
Definition: Integer.h:27
static constexpr Real PI
Definition: Math.h:63
double Real
Definition: Real.h:41