gl3n.plane
-
Declaration
struct
PlaneT
(type = float) if (isFloatingPoint!type);Base template for all plane-types.
Parameters
type
all values get stored as this type (must be floating point)
-
Declaration
alias
pt
= type;Holds the internal type of the plane.
-
Declaration
alias
vec3
= Vector!(pt, 3);Convenience alias to the corresponding vector type.
-
Declaration
pt
a
;normal.x
-
Declaration
pt
b
;normal.y
-
Declaration
pt
c
;normal.z
-
Declaration
vec3
normal
;Holds the planes
normal
. -
Declaration
pt
d
;Holds the planes "constant" (HNF).
-
Declaration
this(pt
a
, ptb
, ptc
, ptd
);
this(vec3normal
, ptd
);Constructs the plane, from either four scalars of type pt or from
a
3-dimensional vector (=normal
) anda
scalar. -
Declaration
void
normalize
();Normalizes the plane inplace.
-
Declaration
const @property PlaneT
normalized
();Returns a
normalized
copy of the plane. -
Declaration
const pt
distance
(vec3point
);Returns the
distance
from apoint
to the plane.Note: the plane must be normalized, the result can be negative.
-
Declaration
const pt
ndistance
(vec3point
);Returns the distance from a
point
to the plane.Note: the plane does not have to be normalized, the result can be negative.
-