tiny.geometry.Plane
Defined in tiny.geometry.
The points p with normal · p = offset.
API (5)
Actions
Public operations.
fromPointNormalfromTriangle: The plane through a triangle, or null for a degenerate triangle.signedDistance
Fields and members
Public fields and members.
Source
Source: lib/geometry/src/primitive.zig:190
zig
/// The points `p` with `normal · p = offset`. The normal is unit length, so/// `signedDistance` is a distance.pub const Plane = struct { normal: Vec3, offset: f32, pub fn fromPointNormal(point: Vec3, unit_normal: Vec3) Plane { return .{ .normal = unit_normal, .offset = unit_normal.dot(point) }; } /// The plane through a triangle, or null for a degenerate triangle. pub fn fromTriangle(triangle: Triangle) ?Plane { const n = triangle.normal() orelse return null; return fromPointNormal(triangle.a, n); } pub fn signedDistance(plane: Plane, p: Vec3) f32 { return plane.normal.dot(p) - plane.offset; }};Source: lib/geometry/src/root.zig:20
zig
pub const Plane = primitive.Plane;Audit
| Definitions | 4 |
|---|---|
| Public names | 4 |
| Members | 2 |
| Version | 26.7.0 |
| Revision | daab053ee433 |