17 #ifndef AGXMODEL_FRACTURESIMULATOR_H 18 #define AGXMODEL_FRACTURESIMULATOR_H 84 typedef std::function<void(FractureGenerator*,agxCollide::Geometry*, agx::RigidBody*)>
NewBodyCallback;
129 void setFractureMinimumSize(
agx::Real minsize);
135 void setGlobalFractureEnable(
bool enable);
138 bool getGlobalBreakageEnable()
const;
141 void setAddFractureFragmentsToGenerator(
bool enable);
197 void setResolution(
agx::Real resolution);
208 void setNewBodyCallback(NewBodyCallback callback);
222 static bool extractFractureGenerators(
236 void addNotification()
override;
241 void removeNotification()
override;
303 m_newBodyCallback(fractureListener, fractureGeomety, body);
322 void updateContactListener();
344 void clearBreakageContacts();
374 GeometryHashContainer m_breakableGeometries;
375 GeometryHashContainer m_breakerGeometries;
376 ExecuteFilterHashContainer m_breakerCollisionFilters;
377 bool m_enableGlobalFracture;
378 bool m_addFractureFragmentsToGenerator;
507 m_enableGlobalFracture = enable;
512 return m_enableGlobalFracture;
517 m_addFractureFragmentsToGenerator = enable;
522 m_fractureAlgorithm = algorithm;
527 return m_breakableGeometries.find(const_cast<agxCollide::Geometry*>(geometry)) != m_breakableGeometries.end();
532 return m_breakageContacts;
538 m_newBodyCallbackWrapper = newBodyCallback;
544 #endif // AGXMODEL_FRACTURESIMULATOR_H
Class for encapsulating fracture conditions for generating fractures in a breakable object...
virtual ~NewBodyCallbackWrapper()
Base Abstract class for encapsulating a callback that is executed on new fragments that are created i...
Derive from this class to implement a listener for simulation step events.
Vec3T< T > min(const Vec3T< T > &lhs, const Vec3T< T > &rhs)
Vec3T< T > max(const Vec3T< T > &lhs, const Vec3T< T > &rhs)
agx::SymmetricPair< agx::Physics::GeometryPtr > GeometryPair
Abstract base class that implements a filter that selects which events should trigger a Listener...
agx::HashVector< agxCollide::GeometryRef > GeometryHashContainer
void setFractureAlgorithm(FractureAlgorithm *algorithm)
Sets the FractureAlgorithm used in the fracture logic.
#define AGX_DECLARE_POINTER_TYPES(type)
virtual void onNewBody(agxModel::FractureGenerator *fractureListener, agxCollide::Geometry *fractureGeomety, agx::RigidBody *body) override final
Function that will be called in the fracture generator for each new rigid body fragment that are crea...
virtual bool match(const agxCollide::GeometryContact &gc) const
Called when narrow phase tests have determined overlap (when we have detailed intersection between th...
Base class providing referencing counted objects.
Contain classes for higher level modeling primitives, such as Tree, Terrain etc.
The geometry representation used by the collision detection engine.
agx::HashVector< agxSDK::ExecuteFilterRef > ExecuteFilterHashContainer
Vector containing 'raw' data.
agx::Real m_stressLevelToBreak
void setAddFractureFragmentsToGenerator(bool enable)
Set true/false if fragments generated by fracture should be included as breakable objects...
agx::Vector< agxCollide::Convex * > ConvexVector
void setGlobalFractureEnable(bool enable)
Set true/false if ALL contacts in the simulation should trigger possible fractures of breakable geome...
A range object has a min and max value of a given type and provides services to tell whether a value ...
virtual ~FractureAlgorithm()
The rigid body class, combining a geometric model and a frame of reference.
bool isBreakable(const agxCollide::Geometry *geometry) const
Returns true/false if the specified geometry is registered as a breakable object in the fracture logi...
#define AGXSTREAM_DECLARE_SERIALIZABLE(T)
Use this in a Serializable class to add the required methods Important: Use full namespace in the dec...
void setNewBodyCallbackWrapper(NewBodyCallbackWrapper *newBodyCallback)
Adds a class instance that holds a callback that will be called for every rigid body fragment created...
This class is an abstract base class for all classes that can be stored and retrieved from an Archive...
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
std::function< void(FractureGenerator *, agxCollide::Geometry *, agx::RigidBody *)> NewBodyCallback
#define AGX_DECLARE_VECTOR_TYPES(type)
virtual ~NewBodyCallbackWrapperLambda()
NewBodyCallbackWrapperLambda(const NewBodyCallback &newBodyCallback)
#define DOXYGEN_END_INTERNAL_BLOCK()
#define DOXYGEN_START_INTERNAL_BLOCK()
bool getGlobalBreakageEnable() const
Get true/false if ALL contacts in the simulation should trigger possible fractures of breakable geome...
Class for encapsulating a lambda that that will execute on new fragments created in the fracture gene...