Toast Engine
Loading...
Searching...
No Matches
manifold.hpp File Reference

TODO: Brief description of the file's purpose. More...

#include "collision.hpp"
#include "collision_world.hpp"
#include "material_defaults.hpp"
#include "voxel_shape_data.hpp"
#include <array>
#include <cstddef>
#include <cstdint>
#include <glm/glm.hpp>
#include <optional>
#include <span>
#include <vector>
Include dependency graph for manifold.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  physics::ContactMaterial
struct  physics::ContactPoint
struct  physics::Manifold
struct  physics::CachedContact
struct  physics::CachedManifold
struct  physics::_detail::WorldSphere
struct  physics::_detail::WorldCapsule
struct  physics::_detail::WorldBox
struct  physics::_detail::SegmentClosestPoint
struct  physics::_detail::SegmentClosestPoints
struct  physics::_detail::BoxFeature
struct  physics::_detail::SegmentBoxClosestPoints
struct  physics::_detail::SegmentAabbClosestPoints
struct  physics::_detail::CapsuleVoxelContact
struct  physics::_detail::ContactCandidate
struct  physics::CollisionElement
struct  physics::BoxVoxelPairView
 Box/voxel roles already resolved so splitting one pair across jobs only pays that resolution once. More...
struct  physics::BoxVoxelSplitInfo
struct  physics::VoxelPairPartial
 One region share of a split pair candidates owned per call since concurrent regions need independent storage. More...
struct  physics::VoxelVoxelPairView
 A voxel-voxel pair with the smaller-shape-is-probe role already resolved, same reasoning as BoxVoxelPairView. More...
struct  physics::VoxelVoxelSplitInfo

Enumerations

enum class  BoxFeatureType : uint8_t { interior , face , edge , vertex }

Functions

auto physics::operator< (const Manifold &lhs, const Manifold &rhs) -> bool
auto physics::_detail::boxFeature (const glm::vec3 &point, const glm::vec3 &half_extents) -> BoxFeature
auto physics::_detail::contactFeature (const BoxFeature &feature) -> ContactFeatureID
auto physics::_detail::worldSphere (const Body &body, const SphereShape &sphere) -> WorldSphere
auto physics::_detail::worldCapsule (const Body &body, const CapsuleShape &capsule) -> WorldCapsule
auto physics::_detail::worldBox (const Body &body, const BoxShape &box) -> WorldBox
auto physics::_detail::closestPointOnSegment (const glm::vec3 &point, const glm::vec3 &segment_a, const glm::vec3 &segment_b) -> SegmentClosestPoint
auto physics::_detail::closestPointsBetweenSegments (const glm::vec3 &a0, const glm::vec3 &a1, const glm::vec3 &b0, const glm::vec3 &b1) -> SegmentClosestPoints
auto physics::_detail::closestPointOnBox (const glm::vec3 &point, const WorldBox &box) -> glm::vec3
auto physics::_detail::closestPointsSegmentBox (const glm::vec3 &segment_a, const glm::vec3 &segment_b, const WorldBox &box) -> SegmentBoxClosestPoints
auto physics::_detail::closestPointsSegmentAabb (const glm::vec3 &local_a, const glm::vec3 &local_b, const glm::vec3 &half_extents) -> SegmentAabbClosestPoints
auto physics::_detail::capsuleVoxelContact (const glm::vec3 &segment_a, const glm::vec3 &segment_b, float radius, const glm::vec3 &voxel_min, uint8_t normal_index) -> std::optional< CapsuleVoxelContact >
auto physics::_detail::perpendicularTo (const glm::vec3 &segment) -> glm::vec3
auto physics::_detail::combineMaterials (const PhysicsMaterial &a, const PhysicsMaterial &b) -> ContactMaterial
auto physics::_detail::surfaceMaterial (const voxel::PhysicalMaterial &material) -> PhysicsMaterial
auto physics::resolveBoxVoxelPair (CollisionWorldView world, BroadPhasePair pair) -> std::optional< BoxVoxelPairView >
auto physics::classifyBoxVoxelSplit (const BoxVoxelPairView &view) -> BoxVoxelSplitInfo
auto physics::splitVoxelRegions (const AABB &local_bounds, size_t region_count) -> std::vector< AABB >
 Splits local_bounds along its longest axis into up to region_count voxel-aligned, non-overlapping AABBs.
auto physics::collideBoxVoxelRegion (const BoxVoxelPairView &view, const AABB &region) -> VoxelPairPartial
void physics::mergeBoxVoxelPartials (BroadPhasePair pair, const BoxVoxelPairView &view, std::span< VoxelPairPartial > partials, std::vector< Manifold > &output)
auto physics::resolveVoxelVoxelPair (CollisionWorldView world, BroadPhasePair pair) -> std::optional< VoxelVoxelPairView >
auto physics::classifyVoxelVoxelSplit (const VoxelVoxelPairView &view) -> std::optional< VoxelVoxelSplitInfo >
 nullopt means the bounds do not actually overlap, distinct from a present-but-zero estimate
auto physics::collideVoxelVoxelRegion (const VoxelVoxelPairView &view, const AABB &probe_region) -> VoxelPairPartial
void physics::mergeVoxelVoxelPartials (BroadPhasePair pair, const VoxelVoxelPairView &view, std::span< VoxelPairPartial > partials, std::vector< Manifold > &output)
auto physics::collideSpheres (BroadPhasePair pair, CollisionElement a, CollisionElement b) -> std::optional< Manifold >
auto physics::collideSphereBox (BroadPhasePair pair, CollisionElement sphere_element, CollisionElement box_element) -> std::optional< Manifold >
auto physics::collideSphereCapsule (BroadPhasePair pair, CollisionElement sphere_element, CollisionElement capsule_element) -> std::optional< Manifold >
void physics::collideSphereVoxel (BroadPhasePair pair, CollisionElement sphere_element, CollisionElement voxel_element, const VoxelShapeData &voxel_data, std::vector< Manifold > &output)
auto physics::collideBoxes (BroadPhasePair pair, CollisionElement a, CollisionElement b) -> std::optional< Manifold >
void physics::collideBoxVoxel (BroadPhasePair pair, CollisionElement box_element, CollisionElement voxel_element, const VoxelShapeData &voxel_data, std::vector< Manifold > &output)
auto physics::collideCapsuleBox (BroadPhasePair pair, CollisionElement capsule_element, CollisionElement box_element) -> std::optional< Manifold >
void physics::collideCapsuleVoxel (BroadPhasePair pair, CollisionElement capsule_element, CollisionElement voxel_element, const VoxelShapeData &voxel_data, std::vector< Manifold > &output)
auto physics::collideCapsules (BroadPhasePair pair, CollisionElement a, CollisionElement b) -> std::optional< Manifold >
void physics::collideVoxelVoxel (BroadPhasePair pair, CollisionElement a, const VoxelShapeData &data_a, CollisionElement b, const VoxelShapeData &data_b, std::vector< Manifold > &output)

Variables

constexpr float physics::_detail::direction_epsilon_sq = 1.0e-10f
constexpr float physics::_detail::parallel_axis_epsilon_sq = 1.0e-10f
constexpr float physics::_detail::contact_tolerance = 1.0e-5f
constexpr float physics::_detail::duplicate_point_epsilon_sq = 1.0e-8f
constexpr float physics::_detail::unit_normal_tolerance = 1.0e-3f

Detailed Description

TODO: Brief description of the file's purpose.

Author
Xein
Date
10 Sep 2026