Back

BruteForceBroadPhase

The `BruteForceBroadPhase` component is part of the SOFA framework's collision detection algorithms, specifically within the broad phase of collision detection. Its role is to perform extensive pair-wise collision tests based on the bounding volumes (typically axis-aligned bounding boxes) of collision models. This algorithm aims to limit the number of object pairs that need further examination in the narrow phase by testing all possible pairs and identifying potential intersections. ### Key Features: - **Pair-Wise Collision Testing**: The component tests all possible pairs of objects, resulting in a computational complexity of O(n^2/2) for n objects. - **Bounding Volume Intersection**: It uses bounding volumes (usually axis-aligned bounding boxes) to determine whether two objects might intersect. If they do not intersect based on their bounding volumes, further detailed collision checks are avoided. - **Self-Collision Handling**: The component can handle self-collisions by checking if an object intersects with itself and adding such pairs for narrow phase examination if necessary. - **Bounding Box Filtering**: It allows filtering out objects that do not intersect a specified bounding box. If a `d_box` is defined, objects outside this box are ignored from further collision detection. ### Methods: - **addCollisionModel**: Adds a new collision model to the list of models being tested for intersections. This method checks if the model intersects with previously added models and adds pairs that might intersect to be further investigated in the narrow phase. - **keepCollisionBetween**: Determines whether two collision models should be considered for intersection based on their ability to collide with each other. - **doesSelfCollide**: Checks if a given collision model can collide with itself, which is useful for self-intersection detection within complex objects. - **intersectWithBoxModel**: Verifies if the given collision model intersects with a predefined bounding box (`d_box`). ### Usage: This component is particularly useful when a detailed and thorough broad phase collision test is required. While computationally expensive, it ensures that no potential collisions are missed by testing all pairs of objects.

abstract
The `BruteForceBroadPhase` performs extensive pair-wise collision tests based on bounding volumes to identify potential intersections between objects during the broad phase of collision detection in SOFA simulations.
sheet
# BruteForceBroadPhase **Overview** The `BruteForceBroadPhase` component is part of the SOFA framework's collision detection algorithms, specifically for the broad phase. It performs extensive pair-wise tests based on bounding volumes (typically axis-aligned bounding boxes) to identify potential intersections between objects. This reduces the number of pairs that need further examination in the narrow phase by testing all possible pairs and identifying those that might intersect. **Parameters and Data** The `BruteForceBroadPhase` component does not expose any significant data fields or parameters beyond its inherited methods from the parent class `BroadPhaseDetection`. The primary functionality is provided through its methods, which handle adding collision models, checking intersections, and self-collision handling. **Dependencies and Connections** The `BruteForceBroadPhase` typically requires a set of collision models to be added for testing. It fits into the scene graph by being part of the broad phase detection process, where it outputs pairs of objects that can potentially intersect. These pairs are then used as input for narrow phase algorithms. **Practical Notes** The `BruteForceBroadPhase` has a computational complexity of O(n^2/2) due to its extensive pair-wise testing approach, making it suitable for scenarios where thorough collision detection is critical despite higher computational costs. It ensures no potential collisions are missed by testing all pairs of objects.
description
The `BruteForceBroadPhase` component is part of the SOFA framework's collision detection algorithms, specifically within the broad phase of collision detection. Its role is to perform extensive pair-wise collision tests based on the bounding volumes (typically axis-aligned bounding boxes) of collision models. This algorithm aims to limit the number of object pairs that need further examination in the narrow phase by testing all possible pairs and identifying potential intersections. ### Key Features: - **Pair-Wise Collision Testing**: The component tests all possible pairs of objects, resulting in a computational complexity of O(n^2/2) for n objects. - **Bounding Volume Intersection**: It uses bounding volumes (usually axis-aligned bounding boxes) to determine whether two objects might intersect. If they do not intersect based on their bounding volumes, further detailed collision checks are avoided. - **Self-Collision Handling**: The component can handle self-collisions by checking if an object intersects with itself and adding such pairs for narrow phase examination if necessary. - **Bounding Box Filtering**: It allows filtering out objects that do not intersect a specified bounding box. If a `d_box` is defined, objects outside this box are ignored from further collision detection. ### Methods: - **addCollisionModel**: Adds a new collision model to the list of models being tested for intersections. This method checks if the model intersects with previously added models and adds pairs that might intersect to be further investigated in the narrow phase. - **keepCollisionBetween**: Determines whether two collision models should be considered for intersection based on their ability to collide with each other. - **doesSelfCollide**: Checks if a given collision model can collide with itself, which is useful for self-intersection detection within complex objects. - **intersectWithBoxModel**: Verifies if the given collision model intersects with a predefined bounding box (`d_box`). ### Usage: This component is particularly useful when a detailed and thorough broad phase collision test is required. While computationally expensive, it ensures that no potential collisions are missed by testing all pairs of objects.
maths
The `BruteForceBroadPhase` component in the SOFA framework is designed to perform comprehensive pair-wise collision tests during the broad phase of collision detection. Its primary function is to identify potential intersections between objects based on their bounding volumes, typically axis-aligned bounding boxes (AABB). This process narrows down the number of object pairs that require more detailed examination in the narrow phase. ### Key Mathematical and Physical Concepts: 1. **Bounding Volume Intersection**: - The component uses AABBs to determine whether two objects might intersect. Given an object with bounding box \( B_i = (x_{min,i}, x_{max,i}, y_{min,i}, y_{max,i}, z_{min,i}, z_{max,i}) \) and another object with bounding box \( B_j = (x_{min,j}, x_{max,j}, y_{min,j}, y_{max,j}, z_{min,j}, z_{max,j}) \), the intersection test can be formulated as: \[ B_i \cap B_j \neq \emptyset \iff \begin{cases} x_{min,i} \leq x_{max,j} \text{ and } x_{min,j} \leq x_{max,i}, \\ y_{min,i} \leq y_{max,j} \text{ and } y_{min,j} \leq y_{max,i}, \\ z_{min,i} \leq z_{max,j} \text{ and } z_{min,j} \leq z_{max,i} \end{cases} \] 2. **Pair-Wise Collision Testing**: - The component tests all possible pairs of objects, resulting in a computational complexity of O(n^2/2) for n objects. Given a set of objects \( O = \{O_1, O_2, ..., O_n\} \), the number of unique pairs is given by: \[ \text{Number of pairs} = \binom{n}{2} = \frac{n(n-1)}{2} \] 3. **Self-Collision Handling**: - The component checks if an object intersects with itself, which is particularly useful for complex objects that can fold or deform in such a way as to collide with their own parts. This is done by checking the intersection between the bounding volumes of different parts of the same object. 4. **Bounding Box Filtering**: - The `d_box` parameter allows filtering out objects that do not intersect a specified bounding box. If an object's bounding volume does not intersect this predefined box, it is ignored from further collision detection. This can be formulated as checking whether \( B_i \cap d_{box} \neq \emptyset \). ### Algorithmic Description: - **Initialization**: The algorithm initializes by resetting the list of previously added collision models. - **Addition and Intersection Checks**: - When a new collision model is added, it is compared with all previously added models using bounding volume intersection tests. If two bounding volumes intersect, their pair is flagged for further examination in the narrow phase. - **Self-Collision Check**: The algorithm checks if the object can collide with itself by testing the intersection of its own parts' bounding volumes. - **Bounding Box Filtering**: Objects outside a predefined bounding box are ignored from further collision detection. ### Computational Complexity**: - The primary operation in `BruteForceBroadPhase` is the pair-wise comparison, leading to a computational complexity of O(n^2/2) for n objects. This makes it suitable for scenarios where thorough collision testing is critical despite higher computational costs.
{
  "name": "BruteForceBroadPhase",
  "main": {
    "name": "BruteForceBroadPhase",
    "namespace": "sofa::component::collision::detection::algorithm",
    "module": "Sofa.Component.Collision.Detection.Algorithm",
    "include": "sofa/component/collision/detection/algorithm/BruteForceBroadPhase.h",
    "doc": "Broad phase collision detection using extensive pair-wise tests.\n\nPerform an extensive pair-wise collision test based on the bounding volume of collision models\nThis component is a broad phase algorithm used during collision detection to limit the number of pairs of objects\nthat need to be checked for intersection. The algorithm output is a list of pairs of objects that can potentially\nbe in intersection. This list is then used as an input for a narrow phase algorithm.\nIn this algorithm, all possible pairs of objects are tested (brute force test). If there are n objects, there will be\nn^2/2 tests. The tests are based on the bounding volume of the objects, usually an axis-aligned bounding box.",
    "inherits": [
      "BroadPhaseDetection"
    ],
    "templates": [],
    "data_fields": [],
    "links": [],
    "methods": [
      {
        "name": "init",
        "return_type": "void",
        "params": [],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "reinit",
        "return_type": "void",
        "params": [],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "beginBroadPhase",
        "return_type": "void",
        "params": [],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "addCollisionModel",
        "return_type": "void",
        "params": [
          {
            "name": "cm",
            "type": "core::CollisionModel *"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "keepCollisionBetween",
        "return_type": "bool",
        "params": [
          {
            "name": "cm1",
            "type": "core::CollisionModel *"
          },
          {
            "name": "cm2",
            "type": "core::CollisionModel *"
          }
        ],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": true,
        "access": "public"
      },
      {
        "name": "needsDeepBoundingTree",
        "return_type": "bool",
        "params": [],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "doesSelfCollide",
        "return_type": "bool",
        "params": [
          {
            "name": "cm",
            "type": "core::CollisionModel *"
          }
        ],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "protected"
      },
      {
        "name": "intersectWithBoxModel",
        "return_type": "bool",
        "params": [
          {
            "name": "cm",
            "type": "core::CollisionModel *"
          }
        ],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "protected"
      }
    ]
  },
  "desc": {
    "description": "The `BruteForceBroadPhase` component is part of the SOFA framework's collision detection algorithms, specifically within the broad phase of collision detection. Its role is to perform extensive pair-wise collision tests based on the bounding volumes (typically axis-aligned bounding boxes) of collision models. This algorithm aims to limit the number of object pairs that need further examination in the narrow phase by testing all possible pairs and identifying potential intersections.\n\n### Key Features:\n- **Pair-Wise Collision Testing**: The component tests all possible pairs of objects, resulting in a computational complexity of O(n^2/2) for n objects.\n- **Bounding Volume Intersection**: It uses bounding volumes (usually axis-aligned bounding boxes) to determine whether two objects might intersect. If they do not intersect based on their bounding volumes, further detailed collision checks are avoided.\n- **Self-Collision Handling**: The component can handle self-collisions by checking if an object intersects with itself and adding such pairs for narrow phase examination if necessary.\n- **Bounding Box Filtering**: It allows filtering out objects that do not intersect a specified bounding box. If a `d_box` is defined, objects outside this box are ignored from further collision detection.\n\n### Methods:\n- **addCollisionModel**: Adds a new collision model to the list of models being tested for intersections. This method checks if the model intersects with previously added models and adds pairs that might intersect to be further investigated in the narrow phase.\n- **keepCollisionBetween**: Determines whether two collision models should be considered for intersection based on their ability to collide with each other.\n- **doesSelfCollide**: Checks if a given collision model can collide with itself, which is useful for self-intersection detection within complex objects.\n- **intersectWithBoxModel**: Verifies if the given collision model intersects with a predefined bounding box (`d_box`).\n\n### Usage:\nThis component is particularly useful when a detailed and thorough broad phase collision test is required. While computationally expensive, it ensures that no potential collisions are missed by testing all pairs of objects.\n"
  },
  "maths": {
    "maths": "The `BruteForceBroadPhase` component in the SOFA framework is designed to perform comprehensive pair-wise collision tests during the broad phase of collision detection. Its primary function is to identify potential intersections between objects based on their bounding volumes, typically axis-aligned bounding boxes (AABB). This process narrows down the number of object pairs that require more detailed examination in the narrow phase.\n\n### Key Mathematical and Physical Concepts:\n\n1. **Bounding Volume Intersection**:\n   - The component uses AABBs to determine whether two objects might intersect. Given an object with bounding box \\( B_i = (x_{min,i}, x_{max,i}, y_{min,i}, y_{max,i}, z_{min,i}, z_{max,i}) \\) and another object with bounding box \\( B_j = (x_{min,j}, x_{max,j}, y_{min,j}, y_{max,j}, z_{min,j}, z_{max,j}) \\), the intersection test can be formulated as:\n   \n   \\[ B_i \\cap B_j \\neq \\emptyset \\iff\n   \\begin{cases}\n       x_{min,i} \\leq x_{max,j} \\text{ and } x_{min,j} \\leq x_{max,i}, \\\\\n       y_{min,i} \\leq y_{max,j} \\text{ and } y_{min,j} \\leq y_{max,i}, \\\\\n       z_{min,i} \\leq z_{max,j} \\text{ and } z_{min,j} \\leq z_{max,i}\n   \\end{cases}\n   \\]\n\n2. **Pair-Wise Collision Testing**:\n   - The component tests all possible pairs of objects, resulting in a computational complexity of O(n^2/2) for n objects. Given a set of objects \\( O = \\{O_1, O_2, ..., O_n\\} \\), the number of unique pairs is given by:\n   \n   \\[ \\text{Number of pairs} = \\binom{n}{2} = \\frac{n(n-1)}{2} \\]\n\n3. **Self-Collision Handling**:\n   - The component checks if an object intersects with itself, which is particularly useful for complex objects that can fold or deform in such a way as to collide with their own parts. This is done by checking the intersection between the bounding volumes of different parts of the same object.\n\n4. **Bounding Box Filtering**:\n   - The `d_box` parameter allows filtering out objects that do not intersect a specified bounding box. If an object's bounding volume does not intersect this predefined box, it is ignored from further collision detection. This can be formulated as checking whether \\( B_i \\cap d_{box} \\neq \\emptyset \\).\n\n### Algorithmic Description:\n\n- **Initialization**: The algorithm initializes by resetting the list of previously added collision models.\n\n- **Addition and Intersection Checks**:\n   - When a new collision model is added, it is compared with all previously added models using bounding volume intersection tests. If two bounding volumes intersect, their pair is flagged for further examination in the narrow phase.\n\n- **Self-Collision Check**: The algorithm checks if the object can collide with itself by testing the intersection of its own parts' bounding volumes.\n\n- **Bounding Box Filtering**: Objects outside a predefined bounding box are ignored from further collision detection.\n\n### Computational Complexity**:\n   - The primary operation in `BruteForceBroadPhase` is the pair-wise comparison, leading to a computational complexity of O(n^2/2) for n objects. This makes it suitable for scenarios where thorough collision testing is critical despite higher computational costs.\n"
  },
  "summary": {
    "abstract": "The `BruteForceBroadPhase` performs extensive pair-wise collision tests based on bounding volumes to identify potential intersections between objects during the broad phase of collision detection in SOFA simulations.",
    "sheet": "# BruteForceBroadPhase\n\n**Overview**\n\nThe `BruteForceBroadPhase` component is part of the SOFA framework's collision detection algorithms, specifically for the broad phase. It performs extensive pair-wise tests based on bounding volumes (typically axis-aligned bounding boxes) to identify potential intersections between objects. This reduces the number of pairs that need further examination in the narrow phase by testing all possible pairs and identifying those that might intersect.\n\n**Parameters and Data**\n\nThe `BruteForceBroadPhase` component does not expose any significant data fields or parameters beyond its inherited methods from the parent class `BroadPhaseDetection`. The primary functionality is provided through its methods, which handle adding collision models, checking intersections, and self-collision handling.\n\n**Dependencies and Connections**\n\nThe `BruteForceBroadPhase` typically requires a set of collision models to be added for testing. It fits into the scene graph by being part of the broad phase detection process, where it outputs pairs of objects that can potentially intersect. These pairs are then used as input for narrow phase algorithms.\n\n**Practical Notes**\n\nThe `BruteForceBroadPhase` has a computational complexity of O(n^2/2) due to its extensive pair-wise testing approach, making it suitable for scenarios where thorough collision detection is critical despite higher computational costs. It ensures no potential collisions are missed by testing all pairs of objects."
  }
}