AGX Dynamics 2.38.0.2
Loading...
Searching...
No Matches
SoilWedge.h
Go to the documentation of this file.
1/*
2Copyright 2007-2024. 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
19#include <agx/agx.h>
20#include <agx/Plane.h>
21
22#include <agxCollide/Geometry.h>
24#include <agxCollide/Convex.h>
25
26namespace agxTerrain
27{
29 {
30 public:
31 enum Side
32 {
33 MID = 0,
34 LEFT = 1,
35 RIGHT = 2
36 };
37
47
48 static const std::array<Side, 3> SideIterable;
49
51
52 bool getEnable() const;
53
54 void setEnable(bool enabled);
55
57
58 const agx::Vec3& getCuttingPoint(Side side) const;
59
61
62 const agx::Vec3& getTopPoint(Side side) const;
63
65
66 const agx::Vec3& getFailurePoint(Side side) const;
67
68 std::array<agx::Plane, 3>& getPlanes();
69
70 const std::array<agx::Plane, 3>& getPlanes() const;
71
73
75
77
79
81
83
85
87
89
91
92 void setCuttingPoint(const agx::Vec3& point, Side side);
93
94 void setTopPoint(const agx::Vec3& point, Side side);
95
96 void setFailurePoint(const agx::Vec3& point, Side side);
97
98 void setPlanes(const std::array<agx::Plane, 3>& planes);
99
101
103
105
107
109
110 bool isBorderProjected() const;
111
112 private:
113
114 private:
115 bool m_enabled;
116 std::array<agx::Vec3, 3> m_cutPoints;
117 std::array<agx::Vec3, 3> m_topPoints;
118 std::array<agx::Vec3, 3> m_failPoints;
119 std::array<agx::Plane, 3> m_planes;
120 agx::Real m_failureAngle;
121 agx::Real m_terrainInclination;
122 agx::Real m_toolInclination;
123 bool m_isBorderProjected = false;
125 };
126
128
129
130
131
133 {
134 return m_cutPoints[side];
135 }
136
137
138
139 inline const agx::Vec3& SoilWedge::getCuttingPoint(Side side) const
140 {
141 return m_cutPoints[side];
142 }
143
144
145
147 {
148 return m_topPoints[side];
149 }
150
151
152
153 inline const agx::Vec3& SoilWedge::getTopPoint(Side side) const
154 {
155 return m_topPoints[side];
156 }
157
158
159
161 {
162 return m_failPoints[side];
163 }
164
165
166
167 inline const agx::Vec3& SoilWedge::getFailurePoint(Side side) const
168 {
169 return m_failPoints[side];
170 }
171
172
173
174
175}
A convex class for geometric intersection tests.
Definition Convex.h:37
void setEnable(bool enabled)
void constructTriangleArrayAndIndices(agx::Vec3Vector &vertices, agx::UInt32Vector &indices) const
agx::Vec3 & getFailurePoint(Side side)
Definition SoilWedge.h:160
agx::Real getFailureAngle() const
const std::array< agx::Plane, 3 > & getPlanes() const
bool isBorderProjected() const
void setPlanes(const std::array< agx::Plane, 3 > &planes)
agx::Real & getFailureAngle()
void setFailureAngle(agx::Real angle)
agxCollide::Convex * getMesh()
void setTerrainInclination(agx::Real angle)
agx::Real getToolInclination() const
agx::Real & getToolInclination()
bool getEnable() const
std::array< agx::Plane, 3 > & getPlanes()
static const std::array< Side, 3 > SideIterable
Definition SoilWedge.h:48
agx::Vec3 & getTopPoint(Side side)
Definition SoilWedge.h:146
void setBorderProjected(bool isBorderProjected)
const agxCollide::Convex * getMesh() const
agx::Real getTerrainInclination() const
void setMesh(agxCollide::Convex *convex)
void setCuttingPoint(const agx::Vec3 &point, Side side)
bool hasIntersectingSideNormals() const
void setFailurePoint(const agx::Vec3 &point, Side side)
agx::Vec3 & getCuttingPoint(Side side)
Definition SoilWedge.h:132
void setToolInclination(agx::Real angle)
void setTopPoint(const agx::Vec3 &point, Side side)
agx::Real & getTerrainInclination()
Templated vector class.
Definition agx/Vector.h:53
The agxTerrain namespace contains a 3D model for a dynamic deformable Terrain and related classes.
Definition Geometry.h:59
agx::Vector< SoilWedge > SoilWedgeVector
Definition SoilWedge.h:127
uint32_t UInt32
Definition Integer.h:32
double Real
Definition Real.h:42