Expand description
Geometric primitives for 3D graphics and collision detection.
This module provides common geometric shapes and primitives used in 3D graphics, physics simulations, and collision detection systems.
§Examples
use rs_math3d::primitives::{Ray, Plane, Tri3};
use rs_math3d::vector::Vector3;
// Create a ray from origin pointing along +X axis
let ray = Ray::new(
Vector3::new(0.0, 0.0, 0.0),
Vector3::new(1.0, 0.0, 0.0)
);
// Create a plane at z=5 facing down
let plane = Plane::new(
Vector3::new(0.0, 0.0, 1.0),
-5.0
);
Structs§
- Box3
- A 3D axis-aligned bounding box (AABB).
- Dimension
- A 2D dimension with width and height.
- Line
- An infinite line in 2D or 3D space.
- Parametric
Plane - Parametric Plane
- Plane
- Plane
- Ray
- A ray with an origin and direction.
- Rect
- A 2D axis-aligned rectangle.
- Segment
- A line segment with defined start and end points.
- Sphere3
- Sphere3
- Tri3
- Triangle
Functions§
- quad_
normal - Computes the normal vector of a quadrilateral.
- shortest_
segment3d_ between_ lines3d - Finds the shortest segment connecting two 3D lines.
- tri_
normal - Tri