AGX Dynamics 2.42.2.1
Loading...
Searching...
No Matches
ForbiddenBound.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#include <agxTerrain/export.h>
20#include <agxRender/Color.h>
21#include <agx/AffineMatrix4x4.h>
22#include <agx/Frame.h>
23#include <agx/BitState.h>
24#include <agx/Vector.h>
25#include <agx/Referenced.h>
26
27
28namespace agxTerrain
29{
30 class Terrain;
31
39 {
40 public:
49 virtual bool containsIndex( const agx::Vec3i& terrainIndex, agxTerrain::Terrain* terrain ) const = 0;
50
59 virtual bool containsPosition( const agx::Vec3& position, agxTerrain::Terrain* terrain ) const = 0;
60
61
62 virtual void debugRender( agxTerrain::Terrain* terrain,
63 agx::Real size,
64 const agxRender::Color& color,
65 bool isStatic ) const = 0;
66
68
72 void setEnable( bool enable ) { m_enable = enable; }
73
77 bool getEnable() const { return m_enable; }
78
83 void setEnableDebugRendering( bool enable ) { m_enableDebugRendering = enable; }
84
89 bool getEnableDebugRendering() const { return m_enableDebugRendering; }
90
91 protected:
93 virtual ~IForbiddenBound() = default;
94
99 void restore( agxStream::InputArchive& in ) override;
100
105 void store( agxStream::OutputArchive& out ) const override;
106
107 protected:
109 // We do not serialize this variable
111 };
112
113
114
121 {
122 public:
132 const agxCollide::BoundingAABB& bound,
134 agx::Frame* parentTransform = nullptr );
135
144 virtual bool containsIndex( const agx::Vec3i& terrainIndex, agxTerrain::Terrain* terrain ) const override;
145
154 virtual bool containsPosition( const agx::Vec3& position, agxTerrain::Terrain* terrain ) const override;
155
157 agxCollide::BoundingAABB getBound() const { return m_bound; }
158 void setBound(const agxCollide::BoundingAABB& bound) { m_bound = bound; }
159
161 agx::Frame* getParentFrame() const { return m_parentTransform; }
162
164 const agx::AffineMatrix4x4& getLocalTransform() const { return m_localTransform; }
166
168
169 virtual void debugRender( agxTerrain::Terrain* terrain,
170 agx::Real size,
171 const agxRender::Color& color,
172 bool isStatic ) const override;
173
175
177 protected:
179 virtual ~ForbiddenBound() = default;
180
181 protected:
182 agxCollide::BoundingAABB m_bound;
183 agx::AffineMatrix4x4 m_localTransform;
184 agx::AffineMatrix4x4 m_invLocalTransform;
185 agx::FrameRef m_parentTransform;
186 };
187
188
189
196 {
197 public:
205
214 virtual bool containsIndex( const agx::Vec3i& terrainIndex, agxTerrain::Terrain* terrain ) const override;
215
224 virtual bool containsPosition( const agx::Vec3& position, agxTerrain::Terrain* terrain ) const override;
225
227 agx::Bound3i getBound() const { return m_bound; }
228
230
231 virtual void debugRender( agxTerrain::Terrain* terrain,
232 agx::Real size,
233 const agxRender::Color& color,
234 bool isStatic ) const override;
235
237
239
240 protected:
242 virtual ~ForbiddenIndexBound() = default;
243
244 protected:
245 agx::Bound3i m_bound;
246 };
247
248
249
256 {
257 public:
265
277 virtual bool containsIndex( const agx::Vec3i& terrainIndex, agxTerrain::Terrain* terrain ) const override;
278
287 virtual bool containsPosition( const agx::Vec3& position, agxTerrain::Terrain* terrain ) const override;
288
289
291 agx::Bound2i getBound() const { return m_bound; }
292
294
295 virtual void debugRender( agxTerrain::Terrain* terrain,
296 agx::Real size,
297 const agxRender::Color& color,
298 bool isStatic ) const override;
299
301
303
304 protected:
306 virtual ~ForbiddenIndex2DBound() = default;
307
308 protected:
309 agx::Bound2i m_bound;
310 };
311}
#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
Axis aligned bounding box implementation.
Definition: BoundingAABB.h:38
Utility color class with "common colors".
Definition: Color.h:48
Class for reading a binary stream of serialized data.
Definition: InputArchive.h:51
Class for writing serialized data in binary format to a stream.
Definition: OutputArchive.h:57
This class is an abstract base class for all classes that can be stored and retrieved from an Archive...
Definition: Serializable.h:44
Class for specifying a 3D bound where terrain operations like merging and avalanching is forbbiden.
const agx::AffineMatrix4x4 & getLocalTransform() const
void setLocalTransform(const agx::AffineMatrix4x4 &transform)
agxCollide::BoundingAABB getBound() const
agx::Frame * getParentFrame() const
void setBound(const agxCollide::BoundingAABB &bound)
virtual bool containsPosition(const agx::Vec3 &position, agxTerrain::Terrain *terrain) const override
Checks if the specified world position is contained in the ForbiddenBound for a specified terrain.
ForbiddenBound(const agxCollide::BoundingAABB &bound, agx::AffineMatrix4x4 localTransform=agx::AffineMatrix4x4(), agx::Frame *parentTransform=nullptr)
Constructor for a 3D position ForbiddenBound.
virtual bool containsIndex(const agx::Vec3i &terrainIndex, agxTerrain::Terrain *terrain) const override
Checks if the specified terrain index is contained in the ForbiddenBound for a specified terrain.
Class for specifying a 2D terrain index bound where terrain operations like merging and avalanching i...
virtual bool containsIndex(const agx::Vec3i &terrainIndex, agxTerrain::Terrain *terrain) const override
Checks if the specified terrain index is contained in the ForbiddenBound for a specified terrain.
ForbiddenIndex2DBound(const agx::Bound2i &bound)
Constructor for a 2D index ForbiddenBound.
virtual bool containsPosition(const agx::Vec3 &position, agxTerrain::Terrain *terrain) const override
Checks if the specified world position is contained in the ForbiddenBound for a specified terrain.
Class for specifying a 3D terrain index bound where terrain operations like merging and avalanching i...
virtual bool containsIndex(const agx::Vec3i &terrainIndex, agxTerrain::Terrain *terrain) const override
Checks if the specified terrain index is contained in the ForbiddenBound for a specified terrain.
ForbiddenIndexBound(const agx::Bound3i &bound)
Constructor for a 3D index ForbiddenBound.
virtual bool containsPosition(const agx::Vec3 &position, agxTerrain::Terrain *terrain) const override
Checks if the specified world position is contained in the ForbiddenBound for a specified terrain.
agx::Bound3i getBound() const
Base abstract class for specifying different types of bounds bound where terrain operations like merg...
void setEnable(bool enable)
Set enable of the forbidden bound.
AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE(IForbiddenBound)
virtual bool containsPosition(const agx::Vec3 &position, agxTerrain::Terrain *terrain) const =0
Checks if the specified world position is contained in the ForbiddenBound for a specified terrain.
virtual void debugRender(agxTerrain::Terrain *terrain, agx::Real size, const agxRender::Color &color, bool isStatic) const =0
void restore(agxStream::InputArchive &in) override
Restore.
void store(agxStream::OutputArchive &out) const override
Store.
bool getEnable() const
Get enable of the forbidden bound.
virtual bool containsIndex(const agx::Vec3i &terrainIndex, agxTerrain::Terrain *terrain) const =0
Checks if the specified terrain index is contained in the ForbiddenBound for a specified terrain.
virtual ~IForbiddenBound()=default
bool getEnableDebugRendering() const
void setEnableDebugRendering(bool enable)
Set enable of debug rendering of the forbidden bound.
A terrain model based a 3D grid model with overlapping height field that can be deformed by interacti...
Definition: Terrain.h:92
A BoundT represents a range defined by a minimum and a maximum value.
Definition: Bound.h:37
The object defining a frame of reference and providing transformations operations.
Definition: agx/Frame.h:68
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
This namespace consists of a set of classes for handling geometric intersection tests including boole...
Namespace containing classes for handling debug rendering of collision geometries,...
Definition: Constraint.h:36
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.
double Real
Definition: Real.h:41