AGX Dynamics  2.37.3.2
DeformerActiveZone.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2024. Algoryx Simulation AB.
3 
4 All AGX source code, intellectual property, documentation, sample code,
5 tutorials, scene files and technical white papers, are copyrighted, proprietary
6 and confidential material of Algoryx Simulation AB. You may not download, read,
7 store, distribute, publish, copy or otherwise disseminate, use or expose this
8 material unless having a written signed agreement with Algoryx Simulation AB, or having been
9 advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10 valid commercial license from Algoryx Simulation AB.
11 
12 Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13 from using this software, unless otherwise stated in written agreements with
14 Algoryx Simulation AB.
15 */
16 
17 #pragma once
18 
19 #include <agx/config/AGX_USE_AGXTERRAIN.h>
20 
21 #include <agxTerrain/ActiveZone.h>
22 
23 
24 namespace agxTerrain
25 {
26 
27  class DeformerCollection;
28 
30 
32  {
33  public:
34  DeformerActiveZone(agx::Frame* parentFrame, DeformerCollection* deformer);
35 
36  ActiveZone::Type getType() const override;
37 
38  void onPreCollide(Terrain* terrain, const agx::Line& cuttingEdge, const agx::Line& topEdge, const agx::Vec3& forwardVector) override;
39 
40  void onPre(Terrain* terrain, const agx::Line& cuttingEdge, const agx::Line& topEdge, const agx::Vec3& forwardVector) override;
41 
42  void onPost(Terrain* terrain, const agx::Line& cuttingEdge, const agx::Line& topEdge, const agx::Vec3& forwardVector) override;
43 
44  agx::Line getRotatedCuttingEdgeWorld() const;
45 
46  agx::Line getRotatedTopEdgeWorld() const;
47 
48  protected:
49  virtual ~DeformerActiveZone();
50 
51  private:
52 
53  void calculateProjectedVectors(Terrain* terrain,
54  const agx::Line& cuttingEdge,
55  const agx::Line& topEdge,
56  const agx::Vec3& forwardVector,
57  agx::Line& cuttingEdgeWorld,
58  agx::Line& topEdgeWorld);
59 
60  private:
61  agx::Vec3 m_projectedForwardVector;
62  agx::Vec3 m_flatForwardVector;
63  agx::Line m_rotatedCuttingEdgeWorld;
64  agx::Line m_rotatedTopEdgeWorld;
65 
66  DeformerCollection* m_deformer;
67  };
68 }
AGXCORE_EXPORT Type * getType(const agx::String &name)
A terrain model based a 3D grid model with overlapping height field that can be deformed by interacti...
The agxTerrain namespace contains a 3D model for a dynamic deformable Terrain and related classes...
Definition: Geometry.h:59
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
#define AGXTERRAIN_EXPORT
The object defining a frame of reference and providing transformations operations.
Definition: Frame.h:67