This module implements some abstract geometric shapes:
A Segment is 2 points.
When considered like a vector, it represents the arrow from a to b.
2D float segment.
3D float segment.
2D double segment.
3D double segment.
2D integer segment.
3D integer segment.
A Triangle is 3 points.
2D float triangle.
3D float triangle.
2D double triangle.
3D double triangle.
A Sphere is a point + a radius.
Creates a sphere from a point and a radius.
Sphere contains point test.
Sphere vs point Euclidean distance squared.
Sphere vs sphere intersection.
Sphere vs point Euclidean distance.
2D float sphere (ie. a circle).
3D float sphere.
2D double sphere (ie. a circle).
3D double sphere (ie. a circle).
A Ray ir a point + a direction.
Ray vs triangle intersection.
2D float ray.
3D float ray.
2D double ray.
3D double ray.
3D plane.
Normal (always stored normalized).
Create from four coordinates.
Create from a point and a normal.
Create from 3 non-aligned points.
Assign a plane with another plane.
3D float plane.
3D double plane.
3D frustum.
Create a frustum from 6 planes.
object is outside the frustum
object intersects with the frustum
object is inside the frustum
Point vs frustum intersection.
Sphere vs frustum intersection.
AABB vs frustum intersection.
True if
Tis a kind of Segment
True if
Tis a kind of Triangle
True if
Tis a kind of Sphere
True if
Tis a kind of Ray
True if
Tis a kind of Plane
True if
Tis a kind of Frustum
True if
Tis a kind of 2 dimensional Segment
True if
Tis a kind of 2 dimensional Triangle
True if
Tis a kind of 2 dimensional Sphere
True if
Tis a kind of 2 dimensional Ray
True if
Tis a kind of 3 dimensional Segment
True if
Tis a kind of 3 dimensional Triangle
True if
Tis a kind of 3 dimensional Sphere
True if
Tis a kind of 3 dimensional Ray
Get the numeric type used to measure a shape's dimensions.
static assert(is(DimensionType!seg2i == int)); static assert(is(DimensionType!triangle3d == double)); static assert(is(DimensionType!sphere2d == double)); static assert(is(DimensionType!ray3f == float)); static assert(is(DimensionType!planed == double)); static assert(is(DimensionType!(Frustum!real) == real));