Import std.math.geometry
Plane
struct
Public Struct Plane Implements Equatable, Printable
A flat surface without end, of the points p where Dot(Normal, p) is Distance, with a Normal of length 1. The side the Normal points to is in front.
Examples
Local ground = Plane.FromPointNormal(Vec3(0, 0, 0), Vec3(0, 1, 0))
Expect(ground.SignedDistance(Vec3(3, 2, 1)) == 2.0)
Expect(ground.Raycast(Ray(Vec3(0, 5, 0), Vec3(0, -1, 0))) == 5.0)std/math/geometry.fb, line 361
-
Which way it faces, of length 1.
-
Its distance from the origin along its Normal: Dot(Normal, p) for each point p on it.
-
@PanicsAtCaller Public Static Method FromPointNormal(point: Vec3, normal: Vec3): Planestatic method #The plane through the
point, facing the way thenormaldoes. A zeronormalpanics. -
The plane through the three points, facing the side they go counterclockwise around. Three on a line panic.
-
How far the
pointis in front of the plane, negative behind it. -
The
pointon the plane nearest the one given. -
How far along the
rayit meets the plane, from either side, 0 for a ray that starts on it, whichever way it goes. A ray along it misses. -
Its parts, as "Plane((0, 1, 0), 0)".
Report an issue with this page or with FutureBlitz on GitHub.