Skip to content

Commit

Permalink
added distance function for plane
Browse files Browse the repository at this point in the history
  • Loading branch information
LunaTheFoxgirl committed May 16, 2024
1 parent 58d27d8 commit 433d870
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions inmath/plane.d
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,15 @@ struct PlaneT(type = float) if(isFloatingPoint!type) {
assert(p == pn);
}

/**
Returns the distance constant
*/
pragma(inline, true)
@property
pt distance() const {
return d;
}

/// Returns the distance from a point to the plane.
/// Note: the plane $(RED must) be normalized, the result can be negative.
pt distance(vec3 point) const {
Expand Down

0 comments on commit 433d870

Please sign in to comment.