Skip to content
FutureBlitz

    Install

    Import std.math.geometry

    Plane

    std.math.geometry

    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

    • Public Field Normal: Vec3 field #

      Which way it faces, of length 1.

    • Public Field Distance: Float field #

      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): Plane static method #

      The plane through the point, facing the way the normal does. A zero normal panics.

    • @PanicsAtCaller Public Static Method FromPoints(a: Vec3, b: Vec3, c: Vec3): Plane static method #

      The plane through the three points, facing the side they go counterclockwise around. Three on a line panic.

    • Public Method SignedDistance(point: Vec3): Float method #

      How far the point is in front of the plane, negative behind it.

    • Public Method ClosestPoint(point: Vec3): Vec3 method #

      The point on the plane nearest the one given.

    • Public Method Raycast(ray: Ray): Float? method #

      How far along the ray it meets the plane, from either side, 0 for a ray that starts on it, whichever way it goes. A ray along it misses.

    • Public Method ToString(): String method #

      Its parts, as "Plane((0, 1, 0), 0)".

    Report an issue with this page or with FutureBlitz on GitHub.