AGX Dynamics 2.42.2.1
Loading...
Searching...
No Matches
PrimaryActiveZone.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
22
23namespace agxTerrain
24{
25 class Shovel;
26 class Terrain;
27
29
31 {
32 public:
33 PrimaryActiveZone( agx::Frame* parentFrame, Shovel* shovel, const agxCollide::GeometryRefVector& voxelCollisionGeometries );
34
36
38
40
42
44
45 void onPreCollide( Terrain* terrain, const agx::Line& cuttingEdge, const agx::Line& topEdge, const agx::Vec3& forwardVector );
46
47 void onPre( Terrain* terrain, const agx::Line& cuttingEdge, const agx::Line& topEdge, const agx::Vec3& forwardVector );
48
49 void onPost( Terrain* terrain, const agx::Line& cuttingEdge, const agx::Line& topEdge, const agx::Vec3& forwardVector );
50
52
54
55 void updateInnerShape( const agxCollide::GeometryRefVector& voxelCollisionGeometries );
56
57 void setSplittingPlane( const agx::Plane& plane );
58
60
61 protected:
63
64 private:
65
66 bool createInnerShape( Shovel* shovel, const agxCollide::GeometryRefVector& voxelCollisionGeometries );
67 bool createTeethInnerShape( Shovel* shovel );
68
69 bool finalizeInnerShapeFromVertices( const agx::Vec3Vector& vertices );
70
71 void calculateSecondarySeparationProperties( Shovel* shovel );
72
73 void calculateProjectedVectors(
74 const agx::Line& cuttingEdge,
75 const agx::Line& topEdge,
76 const agx::Vec3& forwardVector,
77 agx::Line& cuttingEdgeWorld,
78 agx::Line& topEdgeWorld );
79
80 agx::Vec3Vector performSecondIntersectionTest(
81 agx::Vec3Vector& vertices,
82 const MeshTransformPairVector& meshes,
83 const agx::Vec3& center,
84 const agx::Plane& cutTopPlane,
85 const agx::Plane& lowerCuttingEdgePlane,
86 agx::Real threshold,
87 bool dbgRender );
88
89 private:
90 // Active zone geometry and inner-shape
91 agxCollide::ConvexRef m_innerShape;
92 agxCollide::ConvexRef m_teethInnerShape;
93
94 // Planes used to sort particles
95 agx::Vector<agx::Plane> m_innerPlanes;
96 agx::Vector<agx::Plane> m_teethInnerPlanes;
97
98 // Pointer to shovel
99 Shovel* m_shovel;
100
101 // Secondary separation
102 agx::Real m_secondarySeparationAngle;
103 agx::Vec3 m_secondaryForwardVectorWorld;
104
105 // Projected vectors
106 agx::Vec3 m_projectedForwardVectorWorld;
107 agx::Vec3 m_projectedSecondaryForwardVectorWorld;
108 agx::Vec3 m_flatForwardVectorWorld;
109 };
110}
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
#define AGXTERRAIN_EXPORT
A convex class for geometric intersection tests.
Definition: Convex.h:36
void setSplittingPlane(const agx::Plane &plane)
const agx::Vector< agx::Plane > & getTeethInnerPlanes() const
void onPreCollide(Terrain *terrain, const agx::Line &cuttingEdge, const agx::Line &topEdge, const agx::Vec3 &forwardVector)
PrimaryActiveZone(agx::Frame *parentFrame, Shovel *shovel, const agxCollide::GeometryRefVector &voxelCollisionGeometries)
void onPost(Terrain *terrain, const agx::Line &cuttingEdge, const agx::Line &topEdge, const agx::Vec3 &forwardVector)
agx::Vec3 getSecondaryForwardDirectionWorld() const
void updateInnerShape(const agxCollide::GeometryRefVector &voxelCollisionGeometries)
ActiveZone::Type getType() const
const agxCollide::Convex * getTeethInnerShape() const
const agxCollide::Convex * getInnerShape() const
agx::Real getSecondarySeparationAngle() const
const agx::Vector< agx::Plane > & getInnerPlanes() const
void onPre(Terrain *terrain, const agx::Line &cuttingEdge, const agx::Line &topEdge, const agx::Vec3 &forwardVector)
Shovel object used to interact with a terrain via an active zone that converts solid terrain to dynam...
Definition: Shovel.h:63
A terrain model based a 3D grid model with overlapping height field that can be deformed by interacti...
Definition: Terrain.h:92
The object defining a frame of reference and providing transformations operations.
Definition: agx/Frame.h:68
Class representing the mathematical concept of a plane, also called a half- space.
Definition: agx/Plane.h:32
The agxTerrain namespace contains a 3D model for a dynamic deformable Terrain and related classes.
Definition: Geometry.h:59
double Real
Definition: Real.h:41