AGX Dynamics 2.38.0.2
Loading...
Searching...
No Matches
PrimaryActiveZone.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/config/AGX_USE_AGXTERRAIN.h>
20
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
41 void onPreCollide( Terrain* terrain, const agx::Line& cuttingEdge, const agx::Line& topEdge, const agx::Vec3& forwardVector );
42
43 void onPre( Terrain* terrain, const agx::Line& cuttingEdge, const agx::Line& topEdge, const agx::Vec3& forwardVector );
44
45 void onPost( Terrain* terrain, const agx::Line& cuttingEdge, const agx::Line& topEdge, const agx::Vec3& forwardVector );
46
48
50
51 void updateInnerShape( const agxCollide::GeometryRefVector& voxelCollisionGeometries );
52
53 protected:
55
56 private:
57
58 void createInnerShape( const Shovel* shovel, const agxCollide::GeometryRefVector& voxelCollisionGeometries );
59
60 bool finalizeInnerShapeFromVertices( const agx::Vec3Vector& vertices );
61
62 void calculateSecondarySeparationProperties( Shovel* shovel );
63
64 void calculateProjectedVectors( Terrain* terrain,
65 const agx::Line& cuttingEdge,
66 const agx::Line& topEdge,
67 const agx::Vec3& forwardVector,
68 agx::Line& cuttingEdgeWorld,
69 agx::Line& topEdgeWorld );
70
71 bool findPlaneMeshCenterPoint(
72 agx::Vec3 planePoint,
73 agx::Vec3 planeNormal,
74 agx::Real rayLength,
75 const MeshTransformPairVector& meshes,
76 agx::Vec3& result );
77
78 bool isTriangleFirstInRay(
79 const agx::Vec3& bottom,
80 const agx::Vec3& top,
81 const agxCollide::Mesh::Triangle& triangle,
82 const MeshTransformPairVector& meshes );
83
84 agx::Vec3Vector performSecondIntersectionTest(
85 agx::Vec3Vector& vertices,
86 const MeshTransformPairVector& meshes,
87 const agx::Vec3& center);
88
89 private:
90 // Active zone geometry and inner-shape
91 agxCollide::ConvexRef m_innerShape;
92
93 // Planes used to sort particles
94 agx::Vector<agx::Plane> m_innerPlanes;
95
96 // Pointer to shovel
97 Shovel* m_shovel;
98
99 // Secondary separation
100 agx::Real m_secondarySeparationAngle;
101 agx::Vec3 m_secondaryForwardVector;
102
103 // Projected vectors
104 agx::Vec3 m_projectedForwardVector;
105 agx::Vec3 m_projectedSecondaryForwardVector;
106 agx::Vec3 m_flatForwardVector;
107 };
108}
#define AGX_DECLARE_POINTER_TYPES(type)
Definition Referenced.h:254
#define AGXTERRAIN_EXPORT
A convex class for geometric intersection tests.
Definition Convex.h:37
Class for more intuitive access to the Mesh's mesh data.
Definition Mesh.h:79
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)
void updateInnerShape(const agxCollide::GeometryRefVector &voxelCollisionGeometries)
ActiveZone::Type getType() const
agx::Vec3 getSecondaryCuttingDirection() 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)
A terrain model based a 3D grid model with overlapping height field that can be deformed by interacti...
Definition Terrain.h:86
The object defining a frame of reference and providing transformations operations.
Definition agx/Frame.h:68
The agxTerrain namespace contains a 3D model for a dynamic deformable Terrain and related classes.
Definition Geometry.h:59
double Real
Definition Real.h:42