AGX Dynamics 2.38.0.2
Loading...
Searching...
No Matches
ContactZoneManager.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#ifndef AGX_CONTACTZONEMANAGER_H
18#define AGX_CONTACTZONEMANAGER_H
19
20#include <agx/Random.h>
21#include <agx/Vec3.h>
22#include <agx/Vec4.h>
28
29#include "Util.h"
30#include "Common.h"
31
32
33namespace agx { namespace Physics { namespace HierarchicalGrid {
34
35 // typedef agx::HashTable<agx::Vec3i, agx::Physics::HierarchicalGrid::ContactZonePtr, agx::HashFn< agx::Vec3i >, agxData::BufferProxyAllocator> ContactZoneTable;
36 // typedef agx::HashTable<agx::UInt64, agx::Physics::HierarchicalGrid::ContactZoneDependencyPtr, agx::HashFn< agx::UInt64 >, agxData::BufferProxyAllocator> ZoneDependencyTable;
37
39 {
40 public:
42 CellData& cell,
43 ContactZoneData& zone,
44 ContactZoneDependencyData& dependency,
45 GridTierData& gridTier,
46 // ContactZoneTable& zoneTable,
47 // ZoneDependencyTable& zoneDependencyTable,
48 UInt contactZoneAccumulationLevel,
49 ContactZonePtr& iterationStartZone,
50 ContactZonePtr& iterationEndZone
51 );
52
54
55 ContactZoneInstance getContactZone(Index cellIndex1, Index cellIndex2);
56
62
64
65
66 // Automatically called by destructor
68
69 private:
70 // void addDependency(ContactZonePtr parent, ContactZonePtr child);
71 // void removeDependency(ContactZonePtr parent, ContactZonePtr child);
72 // void addChildDependenciesToCorner(ContactZonePtr parent, const Vec3i& cornerId);
73 // void addChildDependenciesToEdge(ContactZonePtr parent, const Vec3i& edgeId);
74 // void addParentDependenciesToInternal(ContactZonePtr child, const Vec3i& internalId);
75 // void addParentDependenciesToEdge(ContactZonePtr child, const Vec3i& edgeId);
76 // void removeRedundantDependencies(ContactZonePtr zone);
77
78 ContactZonePtr createZone(const Vec3i& id, ZoneCategory zoneType, Index tierIndex);
79
80 // To calm the compiler
81 ContactZoneManager& operator=(const ContactZoneManager&) { return *this; }
82
83 Vec4f generateRandomColor();
84
85 private:
86 CellData& m_cell;
87 ContactZoneData& m_zone;
88 ContactZoneDependencyData& m_dependency;
89 GridTierData& m_gridTier;
90 // ContactZoneTable& m_zoneTable;
91 // ZoneDependencyTable& m_zoneDependencyTable;
92 UInt m_contactZoneAccumulationLevel;
93
94 // The following two members are used only if CALCULATE_INCREMENTAL_DEPENDENCIES in
95 // the .cpp file is none-zero, which it usually isn't.
96 #ifdef __clang__
97 # pragma clang diagnostic push
98 # pragma clang diagnostic ignored "-Wunused-private-field"
99 #endif
100 ContactZonePtr& m_iterationStartZone;
101 ContactZonePtr& m_iterationEndZone;
102 #ifdef __clang__
103 # pragma clang diagnostic pop
104 #endif
105
106 Vector<ContactZoneDependencyPtr> m_removedDependencies;
107
108 UniformReal32Generator m_randomGenerator;
109 };
110
111
112
113
114}}}
115
116
117#endif /* AGX_CONTACTZONEMANAGER_H */
Only use as member allocated variable.
Definition Value.h:285
ContactZonePtr createInternalZone(Index cellIndex, Index tierIndex)
ContactZonePtr createCornerZone(const Vec3i &id, Index tierIndex)
ContactZoneInstance getContactZone(Index cellIndex1, Index cellIndex2)
ContactZonePtr createFaceZone(const Vec3i &id, Index tierIndex)
ContactZonePtr createEdgeZone(const Vec3i &id, Index tierIndex)
void removeZones(agxData::Array< ContactZonePtr > &emptyZones)
ContactZoneManager(CellData &cell, ContactZoneData &zone, ContactZoneDependencyData &dependency, GridTierData &gridTier, UInt contactZoneAccumulationLevel, ContactZonePtr &iterationStartZone, ContactZonePtr &iterationEndZone)
ContactZonePtr createBoundaryZone(const Vec3i &id, Index tierIndex)
Pointer to a entity instance of type Physics.HierarchicalGrid.ContactZone.
A class holding 4 dimensional vectors and providing basic arithmetic.
Templated vector class.
Definition agx/Vector.h:53
ZoneCategory
The 27 internal zones are following categories (box features) and counts: Internal: 1 Face: 6 Edge: 1...
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
uint64_t UInt
Definition Integer.h:27
UInt32 Index
Definition Integer.h:44