Class which will go through contacting/separating bodies and determine if the bodies can be merged (geometries from bodyA can go into bodyB and bodyB will now move as one rigid body) or split (the original geometries of bodyA can be transferred back so BodyA can move as a separate body).
More...
|
| | MergeSplit (agxCollide::Space *space=nullptr) |
| | Default constructor. More...
|
| |
| void | clear () |
| | Split all merged bodies, clear all data structures. More...
|
| |
| const char * | getClassName () const override |
| |
| bool | getEnable () const |
| |
| Listener * | getListener () |
| |
| const Listener * | getListener () const |
| |
| bool | getSplitInPost () const |
| |
| agxStream::StorageAgent * | getStorageAgent () const override |
| |
| MergeSplitThreshold * | getThreshold () |
| |
| const MergeSplitThreshold * | getThreshold () const |
| |
| bool | isEnabled () const |
| |
| void | merge () |
| | Explicit call to merge, will go and ask space for contacts and separations and see if something can be merged based on those contacts. More...
|
| |
| bool | merge (agx::RigidBody *child, agx::RigidBody *parent) |
| | Explicitly merge two bodies. More...
|
| |
| void | post (const agx::TimeStamp &t) |
| |
| void | pre (const agx::TimeStamp &t) |
| |
| virtual void | restore (agxStream::InputArchive &in) override |
| |
| void | setEnable (bool flag) |
| | Enable/disable MergeSplit. More...
|
| |
| void | setListener (Listener *listener) |
| | Specify a point to a listener that will be called upon merge/split events. More...
|
| |
| void | setSpace (agxCollide::Space *space) |
| | Tell MergeSplit which space to use for accessing contacts. More...
|
| |
| void | setSplitInPost (bool flag) |
| | Specifies whether the split should occur in the pre solver step, or in the post step. More...
|
| |
| void | split () |
| | Explicit call to split, will go and ask space for contacts and separations and see if something can be split based on those contacts. More...
|
| |
| bool | split (agxCollide::Geometry *geometry, bool shouldUpdateContacts=true, bool forceSplit=false, bool splitImmediately=true) |
| | Take a specified geometry geometry and locate its ORIGINAL body (which was the original body that this geometry belonged to) and split that. More...
|
| |
| bool | split (agx::RigidBody *bodyToBeSplit, bool forceSplit=false, bool splitImmediately=true) |
| | Take the specified body bodyToBeSplit and if it is merged, then split it from any parents, make it a free non-merged body. More...
|
| |
| virtual void | store (agxStream::OutputArchive &out) const override |
| |
| bool | validate () |
| |
| | Referenced () |
| | Default constructor. More...
|
| |
| | Referenced (const Referenced &) |
| |
| template<typename T > |
| T * | as () |
| | Subclass casting. More...
|
| |
| template<typename T > |
| const T * | as () const |
| |
| template<typename T > |
| T * | asSafe () |
| | Safe subclass casting, return nullptr if template type does not match. More...
|
| |
| template<typename T > |
| const T * | asSafe () const |
| |
| int | getReferenceCount () const |
| |
| template<typename T > |
| bool | is () const |
| | Subclass test. More...
|
| |
| Referenced & | operator= (const Referenced &) |
| | Assignment operator. Will increment the number of references to the referenced object. More...
|
| |
| void | reference (void *ptr=nullptr) const |
| | Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it. More...
|
| |
| void | unreference (void *ptr=nullptr) const |
| | Decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
|
| |
| void | unreference_nodelete () const |
| | Decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
|
| |
| virtual | ~Serializable () |
| | Destructor for normal C++ use but hidden from SWIG bindings. More...
|
| |
| bool | getEnableSerialization () const |
| |
| bool | getEnableUuidGeneration () |
| |
| agx::UInt32 | getIndex () const |
| | This index is given at creation of this object. More...
|
| |
| agx::Uuid | getUuid () const |
| |
| bool | isFinished () const |
| |
| void | setEnableSerialization (bool flag) |
| | Set to false to disable serialization of this object. More...
|
| |
| void | setFinished () |
| | Tells this class that it is restored correctly and should not be deleted during destruction of an Archive. More...
|
| |
| void | setUuid (const agx::Uuid &uuid) |
| | Explicitly set a Uuid on a serializable object. More...
|
| |
|
| virtual | ~MergeSplit () |
| |
| bool | _split (agx::RigidBody *bodyToBeSplit, agxCollide::GeometryContact *contact, bool forceSplit=false, bool splitImmediately=true) |
| | Take the specified body bodyToBeSplit and if it is merged, then split it from any parents, make it a free non-merged body. More...
|
| |
| void | addNotification () |
| |
| void | clearStats () |
| |
| MergeSplitBodyStorage * | getBodyStorage () |
| |
| bool | merge (const agxCollide::GeometryContactPtrVector &contacts) |
| |
| bool | performMerge (agx::RigidBody *child, agx::RigidBody *parent) |
| |
| void | prepareForMerge (agx::RigidBody *body) |
| |
| void | registerGeometriesBodies (agxSDK::Simulation *sim) |
| |
| bool | removeFromBodyStorage (agx::RigidBody *body) |
| |
| void | removeNotification () |
| |
| void | returnBodyStorage (MergeSplitBodyStorage *bodyStorage) |
| |
| bool | shouldMerge (agx::RigidBody *body1, agx::RigidBody *body2, agxCollide::GeometryContact *contact) const |
| |
| bool | sleep (agx::RigidBody *body1, agx::RigidBody *body2) |
| |
| bool | split (const agxCollide::GeometryContactPtrVector &contacts) |
| |
| bool | split (agxCollide::Geometry *geom1, agxCollide::Geometry *geom2, agxCollide::GeometryContact *contact=nullptr) |
| |
| bool | split (const agxCollide::SeparationPairVector &separations) |
| |
| void | transferGeometries (agx::RigidBody *child, agxCollide::GeometryRefVector geometries, agx::RigidBody *parent) |
| |
| void | updateContacts (const agxCollide::GeometryContactPtrVector &contacts, bool removeContacts=false) const |
| |
| bool | wake (agx::RigidBody *body1, agx::RigidBody *body2) |
| |
| virtual | ~Referenced () |
| | Destructor. More...
|
| |
| void | allocateObserverVector () const |
| |
| void | deleteUsingDeleteHandler () const |
| |
| | Serializable () |
| | Default constructor. More...
|
| |
| | Serializable (const Serializable &other) |
| | Copy constructor. More...
|
| |
| void | generateUuid () |
| |
Class which will go through contacting/separating bodies and determine if the bodies can be merged (geometries from bodyA can go into bodyB and bodyB will now move as one rigid body) or split (the original geometries of bodyA can be transferred back so BodyA can move as a separate body).
Default is splitting bodies due to contacts in a PRE step, that is after contacts are generated and before solver.
- Deprecated:
- Instead we recommend using AMOR/MergeSplitHandler
Definition at line 37 of file MergeSplit.h.
Explicitly merge two bodies.
parent will be parent if the following is true:
parent is static, child is not parent has a constraint attached to itself, child has not
If the above rules fails, the two bodies will be swapped and child will be parent. If merge cannot proceed (if both bodies are static or both have constraints, the method will return false).
There is currently no test if any of the two bodies are already merged. If so, the result will be unpredicted.
- Parameters
-
| child | - The body that will be the child unless above rule fails |
| parent | - The body that will be the parent unless above rule fails |
- Returns
- true if merge was done, false if something went wrong.
| void agx::MergeSplit::setSplitInPost |
( |
bool |
flag | ) |
|
Specifies whether the split should occur in the pre solver step, or in the post step.
A system where split occurs in pre will appear more dynamic and realistic, however, it will probably result in a more overall dynamic system with somewhat lower performance. Splitting in pre might also cause jitter in large piles, due to that when splitting in pre, no contacts are created until next time step. Meaning that gravity will pull the split body, let it fall during one time step, and at the next contacts will be created and it will be stabilized. So for single objects on merged ground split in pre will work just fine, for larger piles, some jitter might be noticed.
- Parameters
-
| flag | if true, the split will occur in post, otherwise in pre (default) |