-
Notifications
You must be signed in to change notification settings - Fork 343
[Collision] Add ccd collision detection based on TightInclusion method #5792
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
hugtalbot
merged 21 commits into
sofa-framework:master
from
bakpaul:25_11_add_CCD_collision_detection
Dec 16, 2025
+572
−77
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
3e4c963
Add tight inclusion as dependency in cmake
bakpaul 39da862
Compiling with edge edge and point triangle
bakpaul 18ed8c7
Little cleaning
bakpaul ba61b56
WIP modify cube collision and pipeline to enable CCD
bakpaul 2ff511b
Revert changes on cube models
bakpaul b4d87d3
Add a way to specify the type of continuous collision wanted
bakpaul 4adae26
Code wortking !
bakpaul 096047b
Rename CCDIntersection into CCDTightInclusionIntersection
bakpaul 44e6681
Merge branch 'master' into 25_11_add_CCD_collision_detection
bakpaul d30454b
Fix bad diff
bakpaul 1f6c43d
Fix continuous position computationf or freemotion
bakpaul 0c4e5ee
Merge branch 'master' into 25_11_add_CCD_collision_detection
hugtalbot ec7861c
Merge remote-tracking branch 'origin/master' into 25_11_add_CCD_colli…
bakpaul fa3cc9f
Fix Cuda compilation
bakpaul 17bc19f
Fix barycentric coordinates for Edge Edge collision + remove debug ou…
bakpaul 7ed2f56
Merge branch 'master' into 25_11_add_CCD_collision_detection
hugtalbot 252f55e
Merge branch 'master' into 25_11_add_CCD_collision_detection
bakpaul 1663407
Merge branch 'master' into 25_11_add_CCD_collision_detection
bakpaul 302d482
Remove unwanted change
bakpaul 09f2644
Merge branch 'master' into 25_11_add_CCD_collision_detection
fredroy 17fd10c
Update Sofa/Component/Collision/Geometry/src/sofa/component/collision…
bakpaul File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
305 changes: 305 additions & 0 deletions
305
...ion/src/sofa/component/collision/detection/intersection/CCDTightInclusionIntersection.cpp
Large diffs are not rendered by default.
Oops, something went wrong.
124 changes: 124 additions & 0 deletions
124
...ction/src/sofa/component/collision/detection/intersection/CCDTightInclusionIntersection.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,124 @@ | ||
| /****************************************************************************** | ||
| * SOFA, Simulation Open-Framework Architecture * | ||
| * (c) 2006 INRIA, USTL, UJF, CNRS, MGH * | ||
| * * | ||
| * This program is free software; you can redistribute it and/or modify it * | ||
| * under the terms of the GNU Lesser General Public License as published by * | ||
| * the Free Software Foundation; either version 2.1 of the License, or (at * | ||
| * your option) any later version. * | ||
| * * | ||
| * This program is distributed in the hope that it will be useful, but WITHOUT * | ||
| * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * | ||
| * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License * | ||
| * for more details. * | ||
| * * | ||
| * You should have received a copy of the GNU Lesser General Public License * | ||
| * along with this program. If not, see <http://www.gnu.org/licenses/>. * | ||
| ******************************************************************************* | ||
| * Authors: The SOFA Team and external contributors (see Authors.txt) * | ||
| * * | ||
| * Contact information: [email protected] * | ||
| ******************************************************************************/ | ||
| #pragma once | ||
| #include <sofa/component/collision/detection/intersection/config.h> | ||
|
|
||
| #include <sofa/component/collision/detection/intersection/BaseProximityIntersection.h> | ||
|
|
||
| #include <sofa/component/collision/geometry/SphereModel.h> | ||
| #include <sofa/component/collision/geometry/TriangleModel.h> | ||
| #include <sofa/component/collision/geometry/LineModel.h> | ||
| #include <sofa/component/collision/geometry/PointModel.h> | ||
| #include <sofa/component/collision/geometry/CubeModel.h> | ||
| #include <sofa/component/collision/geometry/RayModel.h> | ||
|
|
||
| namespace sofa::component::collision::detection::intersection | ||
| { | ||
|
|
||
| /** | ||
| * Intersection methods using proximities. Filters are added to limit the number of contacts. | ||
| * The following pairs of collision models are supported: | ||
| * - Cube/Cube | ||
| * - Line/Line | ||
| * - Triangle/Point | ||
| * The following pairs of collision models are ignored: | ||
| * - Sphere/Sphere | ||
| * - Sphere/Point | ||
| * - Point/Point | ||
| * - Line/Point | ||
| * - Line/Sphere | ||
| * - Triangle/Line | ||
| * - Triangle/Triangle | ||
| * - Triangle/Sphere | ||
| * - Ray/Triangle | ||
| * - Ray/Sphere | ||
| * - Ray/Point | ||
| * - Ray/Line | ||
| */ | ||
| class SOFA_COMPONENT_COLLISION_DETECTION_INTERSECTION_API CCDTightInclusionIntersection | ||
| : public BaseProximityIntersection | ||
| { | ||
| public: | ||
| SOFA_CLASS(CCDTightInclusionIntersection, BaseProximityIntersection); | ||
|
|
||
| typedef core::collision::IntersectorFactory<CCDTightInclusionIntersection> IntersectorFactory; | ||
|
|
||
| protected: | ||
| CCDTightInclusionIntersection(); | ||
|
|
||
| public: | ||
| void init() override; | ||
|
|
||
| virtual bool useContinuous() const override; | ||
| virtual core::CollisionModel::ContinuousIntersectionTypeFlag continuousIntersectionType() const; | ||
|
|
||
|
|
||
| bool testIntersection(collision::geometry::Cube&, collision::geometry::Cube&, | ||
| const core::collision::Intersection* currentIntersection) override; | ||
|
|
||
| // bool testIntersection(collision::geometry::Point&, collision::geometry::Point&, const | ||
| // core::collision::Intersection* currentIntersection); bool | ||
| // testIntersection(collision::geometry::Sphere&, collision::geometry::Point&, const | ||
| // core::collision::Intersection* currentIntersection); bool | ||
| // testIntersection(collision::geometry::Sphere&, collision::geometry::Sphere&, const | ||
| // core::collision::Intersection* currentIntersection) override; bool | ||
| // testIntersection(collision::geometry::Line&, collision::geometry::Point&, const | ||
| // core::collision::Intersection* currentIntersection); bool | ||
| // testIntersection(collision::geometry::Line&, collision::geometry::Sphere&, const | ||
| // core::collision::Intersection* currentIntersection); | ||
| bool testIntersection(collision::geometry::Line&, collision::geometry::Line&, | ||
| const core::collision::Intersection* currentIntersection); | ||
| bool testIntersection(collision::geometry::Triangle&, collision::geometry::Point&, | ||
| const core::collision::Intersection* currentIntersection); | ||
| // int testIntersection(collision::geometry::Triangle&, collision::geometry::Sphere&, const | ||
| // core::collision::Intersection* currentIntersection); | ||
|
|
||
| int computeIntersection(collision::geometry::Cube&, collision::geometry::Cube&, OutputVector*, | ||
| const core::collision::Intersection* currentIntersection) override; | ||
| // int computeIntersection(collision::geometry::Point&, collision::geometry::Point&, | ||
| // OutputVector*, const core::collision::Intersection* currentIntersection); int | ||
| // computeIntersection(collision::geometry::Sphere&, collision::geometry::Point&, OutputVector*, | ||
| // const core::collision::Intersection* currentIntersection); int | ||
| // computeIntersection(collision::geometry::Sphere&, collision::geometry::Sphere&, | ||
| // OutputVector*, const core::collision::Intersection* currentIntersection) override; int | ||
| // computeIntersection(collision::geometry::Line&, collision::geometry::Point&, OutputVector*, | ||
| // const core::collision::Intersection* currentIntersection); int | ||
| // computeIntersection(collision::geometry::Line&, collision::geometry::Sphere&, OutputVector*, | ||
| // const core::collision::Intersection* currentIntersection); | ||
hugtalbot marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| int computeIntersection(collision::geometry::Line&, collision::geometry::Line&, OutputVector*, | ||
| const core::collision::Intersection* currentIntersection); | ||
| int computeIntersection(collision::geometry::Triangle&, collision::geometry::Point&, | ||
| OutputVector*, | ||
| const core::collision::Intersection* currentIntersection); | ||
| // int computeIntersection(collision::geometry::Triangle&, collision::geometry::Sphere&, | ||
| // OutputVector*, const core::collision::Intersection* currentIntersection); int | ||
| // computeIntersection(collision::geometry::Ray&, collision::geometry::Sphere&, OutputVector*, | ||
| // const core::collision::Intersection* currentIntersection); int | ||
| // computeIntersection(collision::geometry::Ray&, collision::geometry::Triangle&, OutputVector*, | ||
| // const core::collision::Intersection* currentIntersection); | ||
hugtalbot marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
|
|
||
| Data<sofa::helper::OptionsGroup> d_continuousCollisionType; | ||
| Data<SReal> d_tolerance; | ||
| Data<long> d_maxIterations; | ||
| }; | ||
| } // namespace sofa::component::collision::detection::intersection | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.