11#include <glm/vec3.hpp>
78 glm::vec3 halfExtents,
79 const WorldGeometry& world,
82 glm::vec3 prevWallNormal = glm::vec3(0.0f),
83 bool gravityFlipped =
false,
84 bool includeGroundDistance =
true);
88 glm::vec3 pos, glm::vec3 halfExtents,
const WorldGeometry& world,
float sphereRadius,
bool gravityFlipped =
false);
98 const WorldGeometry& world,
99 glm::vec3 continuityNormal,
100 glm::vec3 travelDir = glm::vec3{0.0f},
101 float lookaheadDist = 0.0f,
102 float checkDist = 24.0f,
103 uint32_t previousMeshIndex = UINT32_MAX,
104 uint32_t previousTriId = UINT32_MAX,
112 return std::abs(normal.y) < 0.3f;
Swept AABB and sphere collision queries against world geometry.
Triangle-mesh collision with BVH acceleration and seam welding.
Pure physics math — no ECS types, no registry.
Definition BroadphaseTree.cpp:11
bool isWallNormal(glm::vec3 normal)
Check if a surface normal represents a wall (not floor/ceiling).
Definition WallDetection.hpp:110
WallDetectionResult detectWalls(glm::vec3 pos, float yaw, glm::vec3 halfExtents, const WorldGeometry &world, float checkDist, float sphereRadius, glm::vec3 prevWallNormal, bool gravityFlipped, bool includeGroundDistance)
Detect walls to the left, right, and front of the player.
Definition WallDetection.cpp:308
TriRegion
Voronoi region of a triangle.
Definition TriMeshCollision.hpp:27
@ Face
Definition TriMeshCollision.hpp:28
WallAttachmentResult findWallRunAttachment(CapsuleShape capsule, glm::vec3 pos, const WorldGeometry &world, glm::vec3 continuityNormal, glm::vec3 travelDir, float lookaheadDist, float checkDist, uint32_t previousMeshIndex, uint32_t previousTriId, TriRegion previousRegion)
Find the best triangle-mesh wallrun attachment, with optional lookahead along the current travel dire...
Definition WallDetection.cpp:132
float probeWallrunGroundDistance(glm::vec3 pos, glm::vec3 halfExtents, const WorldGeometry &world, float sphereRadius, bool gravityFlipped)
Probe only the downward ground distance used by wallrun entry gates.
Definition WallDetection.cpp:492
Stable wallrun attachment target on authored triangle meshes.
Definition WallDetection.hpp:51
TriRegion region
Definition WallDetection.hpp:57
glm::vec3 normal
Definition WallDetection.hpp:54
uint32_t meshIndex
Definition WallDetection.hpp:55
uint32_t triId
Definition WallDetection.hpp:56
glm::vec3 anchor
Definition WallDetection.hpp:53
bool found
Definition WallDetection.hpp:52
Results of wall detection probes.
Definition WallDetection.hpp:22
glm::vec3 frontNormal
Surface normal of the front wall.
Definition WallDetection.hpp:39
uint32_t rightTriId
Triangle id for stable wallrun attachment, if applicable.
Definition WallDetection.hpp:33
uint32_t rightMeshIndex
Static trimesh index for stable wallrun attachment, if applicable.
Definition WallDetection.hpp:31
glm::vec3 frontPoint
World-space contact point on the front wall.
Definition WallDetection.hpp:40
TriRegion rightRegion
Closest triangle feature for wallrun seam traversal.
Definition WallDetection.hpp:35
glm::vec3 rightNormal
Surface normal of the right wall.
Definition WallDetection.hpp:27
glm::vec3 leftPoint
World-space contact point on the left wall.
Definition WallDetection.hpp:28
bool wallRight
True if a wall was detected to the right.
Definition WallDetection.hpp:25
glm::vec3 rightPoint
World-space contact point on the right wall.
Definition WallDetection.hpp:29
uint32_t leftMeshIndex
Static trimesh index for stable wallrun attachment, if applicable.
Definition WallDetection.hpp:30
bool wallFront
True if a wall was detected in front.
Definition WallDetection.hpp:38
bool wallLeft
True if a wall was detected to the left.
Definition WallDetection.hpp:24
uint32_t frontMeshIndex
Static trimesh index for the front-wall diagnostic, if applicable.
Definition WallDetection.hpp:41
uint32_t leftTriId
Triangle id for stable wallrun attachment, if applicable.
Definition WallDetection.hpp:32
uint32_t frontTriId
Triangle id for the front-wall diagnostic, if applicable.
Definition WallDetection.hpp:42
glm::vec3 leftNormal
Surface normal of the left wall.
Definition WallDetection.hpp:26
TriRegion frontRegion
Closest triangle feature for the front-wall diagnostic.
Definition WallDetection.hpp:43
float groundDistance
Distance to ground below the player (u).
Definition WallDetection.hpp:46
TriRegion leftRegion
Closest triangle feature for wallrun seam traversal.
Definition WallDetection.hpp:34