Back

BaseProximityIntersection

The `BaseProximityIntersection` class in the SOFA framework serves as a base for intersection methods that use proximity-based computations. This class is part of the collision detection subsystem and provides functionality to manage distances used for identifying when objects are close enough (proximity) or in contact with each other. It introduces two main data fields: `alarmDistance` and `contactDistance`. The `alarmDistance` specifies a threshold above which intersection computations ignore proximity pairs, potentially reducing the search area during broad phase algorithms. Conversely, `contactDistance` defines the threshold below which contacts are created between objects. The class extends from `DiscreteIntersection`, indicating it is designed for discrete collision detection rather than continuous detection. It provides methods to retrieve and set these distances (`getAlarmDistance`, `setAlarmDistance`, `getContactDistance`, `setContactDistance`) and a method (`useProximity`) that returns true, signifying the use of proximity-based computations. The class also implements two main intersection-related functions: `testIntersection` for determining if two cubes are in proximity and `computeIntersection` for computing contacts between them. These methods are essential for integrating this component within broader collision detection pipelines.

abstract
`BaseProximityIntersection` manages proximity-based intersection computations using alarmDistance and contactDistance parameters to determine when objects are close enough or in contact with each other.
sheet
# BaseProximityIntersection ## Overview The `BaseProximityIntersection` class is part of the collision detection subsystem in SOFA, specifically managing proximity-based intersection computations. It extends from `DiscreteIntersection`, indicating it is designed for discrete collision detection. ## Parameters and Data - **alarmDistance (`d_alarmDistance`)**: A threshold above which intersection computations ignore proximity pairs. This parameter helps reduce the search area during broad phase algorithms. - **contactDistance (`d_contactDistance`)**: A threshold below which contacts are created between objects, defining when two cubes are considered to be in contact. ## Dependencies and Connections This component typically requires or exchanges data with other collision detection components within the scene graph. It fits into broader collision detection pipelines by efficiently determining proximity and contact between cubes. ## Practical Notes - The `alarmDistance` should be set appropriately to balance computational efficiency and accuracy in detecting proximities. - The `contactDistance` must be carefully chosen to ensure accurate contact detection without generating false positives.
description
The `BaseProximityIntersection` class in the SOFA framework serves as a base for intersection methods that use proximity-based computations. This class is part of the collision detection subsystem and provides functionality to manage distances used for identifying when objects are close enough (proximity) or in contact with each other. It introduces two main data fields: `alarmDistance` and `contactDistance`. The `alarmDistance` specifies a threshold above which intersection computations ignore proximity pairs, potentially reducing the search area during broad phase algorithms. Conversely, `contactDistance` defines the threshold below which contacts are created between objects. The class extends from `DiscreteIntersection`, indicating it is designed for discrete collision detection rather than continuous detection. It provides methods to retrieve and set these distances (`getAlarmDistance`, `setAlarmDistance`, `getContactDistance`, `setContactDistance`) and a method (`useProximity`) that returns true, signifying the use of proximity-based computations. The class also implements two main intersection-related functions: `testIntersection` for determining if two cubes are in proximity and `computeIntersection` for computing contacts between them. These methods are essential for integrating this component within broader collision detection pipelines.
maths
The `BaseProximityIntersection` class in the SOFA framework is designed to manage proximity-based collision detection between objects, specifically cubes. This class introduces two key distance parameters: `alarmDistance` and `contactDistance`, which are crucial for determining when objects are close enough or in contact with each other. ### Key Distance Parameters: - **Alarm Distance (`d_alarmDistance`)**: - *Definition*: A threshold above which intersection computations ignore proximity pairs. This parameter helps in reducing the search area during broad phase algorithms. - *Mathematical Representation*: Let $\text{alarmDist}$ be the alarm distance for a pair of cubes. If any dimension's minimum extent of one cube exceeds the maximum extent of the other cube by more than $\text{alarmDist}$, they are considered not in proximity. - **Contact Distance (`d_contactDistance`)**: - *Definition*: A threshold below which contacts are created between objects. This parameter defines when two cubes are considered to be in contact. - *Mathematical Representation*: Let $\text{contactDist}$ be the contact distance for a pair of cubes. If any dimension's minimum extent of one cube is within $\text{contactDist}$ of the maximum extent of the other cube, they are considered to be in contact. ### Intersection Methods: - **testIntersection**: This method checks if two cubes (`cube1` and `cube2`) are in proximity. The method returns true if any dimension's minimum extent of one cube is within $\text{alarmDist}$ + $\text{contactDistance}_1$ + $\text{contactDistance}_2$ of the maximum extent of the other cube. - *Mathematical Representation*: \[ \text{testIntersection} = \begin{cases} \text{false}, & \text{if } (minVect1[i] > maxVect2[i] + alarmDist) \lor (minVect2[i] > maxVect1[i] + alarmDist), \\ \text{true}, & \text{otherwise.} \end{cases} \] - **computeIntersection**: This method computes the contacts between two cubes if they are in contact, based on the `contactDistance`. The method returns an integer indicating the number of contacts computed. - *Mathematical Representation*: This function is abstract and needs to be implemented by derived classes. However, it can conceptually be represented as computing intersections based on the overlap distance within $\text{contactDist}$. ### Integration in Collision Detection Pipeline: - The `BaseProximityIntersection` class extends from `DiscreteIntersection`, indicating that it is designed for discrete collision detection. Discrete collision detection involves checking if objects intersect at specific time steps rather than continuously over a period of time. - The methods `testIntersection` and `computeIntersection` are essential components of the broader collision detection pipeline, where they help in efficiently determining proximity and contact between cubes. ### Summary: The `BaseProximityIntersection` class provides a framework for managing proximity-based intersection computations. It introduces key distance parameters (`alarmDistance` and `contactDistance`) that are used to determine when objects are close enough or in contact with each other. The class's methods efficiently check for proximity and compute contacts, making it an integral part of the collision detection subsystem in SOFA.
{
  "name": "BaseProximityIntersection",
  "main": {
    "name": "BaseProximityIntersection",
    "namespace": "sofa::component::collision::detection::intersection",
    "module": "Sofa.Component.Collision.Detection.Intersection",
    "include": "sofa/component/collision/detection/intersection/BaseProximityIntersection.h",
    "doc": "Base class for intersections methods using proximities.\nIt introduces Datas for the alarm distance and contact distance.\nCubes intersection is modified to use proximities.",
    "inherits": [
      "DiscreteIntersection"
    ],
    "templates": [],
    "data_fields": [
      {
        "name": "d_alarmDistance",
        "type": "SReal",
        "xmlname": "alarmDistance",
        "help": "Distance above which the intersection computations ignores the proximity pair. This distance can also be used in some broad phase algorithms to reduce the search area"
      },
      {
        "name": "d_contactDistance",
        "type": "SReal",
        "xmlname": "contactDistance",
        "help": "Distance below which a contact is created"
      }
    ],
    "links": [],
    "methods": [
      {
        "name": "useProximity",
        "return_type": "bool",
        "params": [],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getAlarmDistance",
        "return_type": "SReal",
        "params": [],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getContactDistance",
        "return_type": "SReal",
        "params": [],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "setAlarmDistance",
        "return_type": "void",
        "params": [
          {
            "name": "v",
            "type": "SReal"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "setContactDistance",
        "return_type": "void",
        "params": [
          {
            "name": "v",
            "type": "SReal"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "testIntersection",
        "return_type": "bool",
        "params": [
          {
            "name": "cube1",
            "type": "collision::geometry::Cube &"
          },
          {
            "name": "cube2",
            "type": "collision::geometry::Cube &"
          },
          {
            "name": "currentIntersection",
            "type": "const core::collision::Intersection *"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "computeIntersection",
        "return_type": "int",
        "params": [
          {
            "name": "cube1",
            "type": "collision::geometry::Cube &"
          },
          {
            "name": "cube2",
            "type": "collision::geometry::Cube &"
          },
          {
            "name": "contacts",
            "type": "OutputVector *"
          },
          {
            "name": "currentIntersection",
            "type": "const core::collision::Intersection *"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      }
    ]
  },
  "desc": {
    "description": "The `BaseProximityIntersection` class in the SOFA framework serves as a base for intersection methods that use proximity-based computations. This class is part of the collision detection subsystem and provides functionality to manage distances used for identifying when objects are close enough (proximity) or in contact with each other.\n\nIt introduces two main data fields: `alarmDistance` and `contactDistance`. The `alarmDistance` specifies a threshold above which intersection computations ignore proximity pairs, potentially reducing the search area during broad phase algorithms. Conversely, `contactDistance` defines the threshold below which contacts are created between objects.\n\nThe class extends from `DiscreteIntersection`, indicating it is designed for discrete collision detection rather than continuous detection. It provides methods to retrieve and set these distances (`getAlarmDistance`, `setAlarmDistance`, `getContactDistance`, `setContactDistance`) and a method (`useProximity`) that returns true, signifying the use of proximity-based computations.\n\nThe class also implements two main intersection-related functions: `testIntersection` for determining if two cubes are in proximity and `computeIntersection` for computing contacts between them. These methods are essential for integrating this component within broader collision detection pipelines."
  },
  "maths": {
    "maths": "The `BaseProximityIntersection` class in the SOFA framework is designed to manage proximity-based collision detection between objects, specifically cubes. This class introduces two key distance parameters: `alarmDistance` and `contactDistance`, which are crucial for determining when objects are close enough or in contact with each other.\n\n### Key Distance Parameters:\n- **Alarm Distance (`d_alarmDistance`)**: \n  - *Definition*: A threshold above which intersection computations ignore proximity pairs. This parameter helps in reducing the search area during broad phase algorithms.\n  - *Mathematical Representation*: Let $\\text{alarmDist}$ be the alarm distance for a pair of cubes. If any dimension's minimum extent of one cube exceeds the maximum extent of the other cube by more than $\\text{alarmDist}$, they are considered not in proximity.\n- **Contact Distance (`d_contactDistance`)**: \n  - *Definition*: A threshold below which contacts are created between objects. This parameter defines when two cubes are considered to be in contact.\n  - *Mathematical Representation*: Let $\\text{contactDist}$ be the contact distance for a pair of cubes. If any dimension's minimum extent of one cube is within $\\text{contactDist}$ of the maximum extent of the other cube, they are considered to be in contact.\n\n### Intersection Methods:\n- **testIntersection**: This method checks if two cubes (`cube1` and `cube2`) are in proximity. The method returns true if any dimension's minimum extent of one cube is within $\\text{alarmDist}$ + $\\text{contactDistance}_1$ + $\\text{contactDistance}_2$ of the maximum extent of the other cube.\n  - *Mathematical Representation*:\n    \\[\n    \\text{testIntersection} = \\begin{cases}\n      \\text{false}, & \\text{if } (minVect1[i] > maxVect2[i] + alarmDist) \\lor (minVect2[i] > maxVect1[i] + alarmDist), \\\\ \n      \\text{true}, & \\text{otherwise.}\n    \\end{cases}\n    \\]\n- **computeIntersection**: This method computes the contacts between two cubes if they are in contact, based on the `contactDistance`. The method returns an integer indicating the number of contacts computed.\n  - *Mathematical Representation*: This function is abstract and needs to be implemented by derived classes. However, it can conceptually be represented as computing intersections based on the overlap distance within $\\text{contactDist}$.\n\n### Integration in Collision Detection Pipeline:\n- The `BaseProximityIntersection` class extends from `DiscreteIntersection`, indicating that it is designed for discrete collision detection. Discrete collision detection involves checking if objects intersect at specific time steps rather than continuously over a period of time.\n- The methods `testIntersection` and `computeIntersection` are essential components of the broader collision detection pipeline, where they help in efficiently determining proximity and contact between cubes.\n\n### Summary:\nThe `BaseProximityIntersection` class provides a framework for managing proximity-based intersection computations. It introduces key distance parameters (`alarmDistance` and `contactDistance`) that are used to determine when objects are close enough or in contact with each other. The class's methods efficiently check for proximity and compute contacts, making it an integral part of the collision detection subsystem in SOFA."
  },
  "summary": {
    "abstract": "`BaseProximityIntersection` manages proximity-based intersection computations using alarmDistance and contactDistance parameters to determine when objects are close enough or in contact with each other.",
    "sheet": "# BaseProximityIntersection\n\n## Overview\nThe `BaseProximityIntersection` class is part of the collision detection subsystem in SOFA, specifically managing proximity-based intersection computations. It extends from `DiscreteIntersection`, indicating it is designed for discrete collision detection.\n\n## Parameters and Data\n- **alarmDistance (`d_alarmDistance`)**: A threshold above which intersection computations ignore proximity pairs. This parameter helps reduce the search area during broad phase algorithms.\n- **contactDistance (`d_contactDistance`)**: A threshold below which contacts are created between objects, defining when two cubes are considered to be in contact.\n\n## Dependencies and Connections\nThis component typically requires or exchanges data with other collision detection components within the scene graph. It fits into broader collision detection pipelines by efficiently determining proximity and contact between cubes.\n\n## Practical Notes\n- The `alarmDistance` should be set appropriately to balance computational efficiency and accuracy in detecting proximities.\n- The `contactDistance` must be carefully chosen to ensure accurate contact detection without generating false positives."
  }
}