ProjectivePointNormalPlane3
public struct ProjectivePointNormalPlane3<Vector> : PointProjectablePlaneType where Vector : Vector3FloatingPoint
extension ProjectivePointNormalPlane3: ProjectiveSpace
extension ProjectivePointNormalPlane3: PlaneProjectiveSpace
extension ProjectivePointNormalPlane3: Equatable where Vector: Equatable
extension ProjectivePointNormalPlane3: Hashable where Vector: Hashable
A point-normal plane with a separate up and right vector used to control projection on the axis of the plane and compute the local X and Y axis.
-
A point on this plane.
Declaration
Swift
public var point: Vector
-
The normal of the plane’s surface.
Declaration
Swift
@UnitVector public var normal: Vector { get set }
-
A normalized vector perpendicular to
normal
andrightAxis
which defines the up, or y, axis for the projective plane.Declaration
Swift
@UnitVector public var upAxis: Vector { get set }
-
A normalized vector perpendicular to
normal
andupAxis
which defines the right, or x, axis for the projective plane.This value is derived from
normal
andupAxis
, and is provided along with those values to reduce recomputation when handling projections.Declaration
Swift
@UnitVector public var rightAxis: Vector { get set }
-
Declaration
Swift
public var pointOnPlane: Vector { get }
-
Declaration
Swift
public init(point: Vector, normal: Vector, upAxis: Vector, rightAxis: Vector)
-
Updates the value of this instance’s
point
.All other values remain the same.
Declaration
Swift
public mutating func changePoint(_ point: Vector)
-
Replaces this instance with a new
ProjectivePointNormalPlane3
with the samepoint
, but withnormal
,upAxis
, andrightAxis
swapped out to specified values. TherightAxis
value is computed from the providednormal
andupAxis
values.Declaration
Swift
public mutating func changeNormal(_ normal: Vector, upAxis: Vector)
-
Returns a new
ProjectivePointNormalPlane3
with the samepoint
as this plane’s, but withnormal
andupAxis
, andrightAxis
swapped out to specified values. TherightAxis
value is computed from the providednormal
andupAxis
values.Declaration
Swift
public func changingNormal(_ normal: Vector, upAxis: Vector) -> ProjectivePointNormalPlane3<Vector>
-
Creates a new
ProjectivePointNormalPlane3
by computingrightAxis
as well as correctingupAxis
during creation to ensure it is fully perpendicular tonormal
.Declaration
Swift
@inlinable static func makeCorrectedPlane(point: Vector, normal: Vector, upAxis: Vector) -> ProjectivePointNormalPlane3<Vector>
Parameters
point
The center point (origin) to this projective plane.
normal
The normal of the plane.
upAxis
The up-axis of the plane.
-
Returns a point normal plane with the same point and normal as this plane’s.
Declaration
Swift
var asPointNormalPlane: PointNormalPlane3<Vector> { get }
-
Declaration
Swift
public typealias Coordinates = Vector.SubVector2
-
With a given line, perform a plane-line intersection and project the resulting intersection vector into this projective plane.
Returns
nil
if this plane and the given line do not intersect.Declaration
Swift
public func projectLineIntersection<Line: Line3FloatingPoint>( _ line: Line ) -> Coordinates? where Line.Vector == Vector
-
Performs a projection of a given vector onto this plane.
Declaration
Swift
public func project2D(_ vector: Vector) -> Coordinates
-
Declaration
Swift
@inlinable public func attemptProjection(_ vector: Vector) -> Coordinates?
-
Declaration
Swift
@inlinable public func projectOut(_ proj: Coordinates) -> Vector