|
Physics Simulation & Visualization Tool 0.1
A C++ physics simulation engine with real-time 3D visualization
|
Mathematical utility functions for 3D graphics and physics. More...
Go to the source code of this file.
Data Structures | |
| struct | Math::HitResult |
| Represents the result of a ray-object intersection test. More... | |
Namespaces | |
| namespace | Math |
| Mathematical and geometric utility functions. | |
Functions | |
| std::optional< float > | Math::intersectTriangle (const Ray &ray, const glm::vec3 &v0, const glm::vec3 &v1, const glm::vec3 &v2) |
| Tests ray-triangle intersection using Möller-Trumbore algorithm. | |
| glm::vec3 | Math::screenToWorldRayDirection (double mouseX, double mouseY, int fbWidth, int fbHeight, const glm::mat4 &view, const glm::mat4 &projection) |
| Converts screen coordinates to a world-space ray direction. | |
| std::optional< HitResult > | Math::findFirstHit (const std::vector< IPickable * > &objects, const Ray &ray, IPickable *priority=nullptr) |
| Finds the first object intersected by a ray. | |
Mathematical utility functions for 3D graphics and physics.
Provides ray-object intersection tests, coordinate transformations, and geometric utility functions used throughout the rendering and physics systems.
Definition in file MathUtils.h.
| struct Math::HitResult |
Represents the result of a ray-object intersection test.
Contains information about which object was hit by a ray and the distance from the ray origin to the intersection point.
Definition at line 146 of file MathUtils.h.
| Data Fields | ||
|---|---|---|
| float | distance | Distance from the ray origin to the intersection point. Infinity if no hit. |
| IPickable * | object | Pointer to the hit object, or nullptr if no intersection. |