JSim 2026.06.01-p(1)
Loading...
Searching...
No Matches
collision_detector.hpp
Go to the documentation of this file.
1// Copyright (c) JSim contributors.
2// Open Source Software; you can modify and/or share it under the terms of
3// the LGPLv3 license file in the root directory of this project.
4
5#pragma once
6
10#include <vector>
11
12namespace frcsim {
13
24
29 std::vector<ContactPoint> contacts;
30 bool hasCollision = false;
31};
32
37public:
38 virtual ~CollisionDetector() = default;
39
51 const Shape* shapeA, const Vector3& posA, const Quaternion& rotA,
52 const Shape* shapeB, const Vector3& posB, const Quaternion& rotB) = 0;
53};
54
55} // namespace frcsim
Pure virtual interface for collision detection algorithms.
Definition collision_detector.hpp:36
virtual CollisionManifold DetectCollision(const Shape *shapeA, const Vector3 &posA, const Quaternion &rotA, const Shape *shapeB, const Vector3 &posB, const Quaternion &rotB)=0
Computes the collision manifold between two generic shapes.
virtual ~CollisionDetector()=default
Base class for all collision geometries in the physics engine.
Definition shape.hpp:28
Definition vector.hpp:13
Represents the result of a collision check between two shapes.
Definition collision_detector.hpp:28
std::vector< ContactPoint > contacts
Generated contact points.
Definition collision_detector.hpp:29
bool hasCollision
True if shapes are penetrating.
Definition collision_detector.hpp:30
Describes a single contact point between two colliding bodies.
Definition collision_detector.hpp:17
Vector3 pointOnB
Contact point in local space of body B.
Definition collision_detector.hpp:19
Vector3 pointOnA
Contact point in local space of body A.
Definition collision_detector.hpp:18
Vector3 worldPoint
Contact point in world space.
Definition collision_detector.hpp:20
double depth
Penetration depth (positive means overlap).
Definition collision_detector.hpp:22
Vector3 normal
Collision normal vector pointing from A to B.
Definition collision_detector.hpp:21
Unit-quaternion rotation representation and rotation algebra helpers.
Definition quaternion.hpp:25
3D vector utility used throughout JSim physics.
Definition vector.hpp:22