Forum Replies Created
-
AuthorPosts
-
RomainBlocked
Thanks for the scene,
the problem occurs when you use collision models in different subgraphs containing each one their own solver. When a collision happens, the ContactGroupManager component gathers the subgraphs in a new node and create a new solver at its root to be able to manage the contact responses implicitly. When the collision stop, the graph is restored to its initial shape, the memory leak seems to come from the ContactGroupManager component (maybe temporary graph or component are not correctly deleted).Here is a simpler code which exhibit this issue: memory leak scene
You can avoid this problem by placing an unique implicit solver (with numerical solver) at the root of your scene. I also recommend you to use MinProximityIntersection or NewProximityIntersection (which is almost the same except that it only requires triangle model instead of triangle + line + point) instead of LocalMinDistance which seems a bit obsolete.
Cheers,
Romain.RomainBlockedHi Thomas,
I would like to reproduce this issue, Which collision model are involved? I tested the LocalMinDistance whith triangle/sphere interaction and I do not observe any leaks.
Do you have a scene which exhibit this memory leak?Cheers,
Romain.RomainBlockedHello,
you will find components implementing broad phase and narrow phase in the module SofaBaseCollision, you can take a look to the BruteForceDetection class which implements both. note that the narrow phase requires additionnal components like MinProximityDetection which provides the intersection test functions.Hope that it will help you,
Romain.30 September 2015 at 08:43 in reply to: [SOLVED] How to develop collision model that support different proximity? #3708RomainBlockedYou need to add manually the pairs of collision models that involve your new models in the intersector map. Take a look to the constructor in MeshNewProximityIntersection.cpp
you will need to add lines in the follosing form
intersection->intersectors.add<YourTriangleModel, AnotherModel, YourProximityIntersection>(this);by example
intersection->intersectors.add<WengTriangleModel, PointModel, MeshNewProximityIntersection>(this);
to enable collision between Point and your new triangle model, in the case where you add directly the function int computeIntersection(WengTriangleModel&, PointModel&, OutputVector*) directly in the class MeshNewProximityIntersection.For each pair of collision models that involve your new models you will need to write a computeIntersection function and add this new pair in the intersector map.
29 September 2015 at 09:49 in reply to: [SOLVED] How to develop collision model that support different proximity? #3696RomainBlockedHello Weng,
1) your approach is good, be sure to also create a new class that derives of core::TCollisionElementIterator<MyTriangleModel>, It’s this one which must be added to the scene. You can add a vector to the derived class of collision model to store custom proximities for each triangle.
2) You need to modify/create an intersection method to take into account these new models. I advise you to take a look to the NewProximityIntersection component which only requires Triangle models for mesh intersection (no need of point or line models), the code which handles the mesh collision is in MeshNewProximityIntersection. You will need to write the following function:
int computeIntersection(MyTriangle&, MyTriangle&, OutputVector*)
(that should be very similar to the one with Triangles but it will use the custom proximity).
Don’t forget to register this new intersection method (check the .cpp).Hope that can help,
Romain -
AuthorPosts