Untold Engine  Beta v0.0.16
docs
U4DEngine::U4DPlane Class Reference

The U4DPlane class implements a mathematical representation of a 3D plane. More...

Public Member Functions

 U4DPlane ()
 Constructor which creates a 3D plane with zero normal vector and zero distance from point to plane.
 
 U4DPlane (U4DPoint3n &uPoint1, U4DPoint3n &uPoint2, U4DPoint3n &uPoint3)
 Constructor which creates a 3D plane given three noncollinear points (ordered CCW). This constructor in essence computes the plane equation.
 
 U4DPlane (U4DVector3n &uNormal, float uDistance)
 Constructor which creates a 3D plane given a normal vector and the distance from a point to plane.
 
 U4DPlane (U4DVector3n &uNormal, U4DPoint3n &uPoint)
 Constructor which creates a 3D plane given a normal vector and a 3D point in space.
 
 ~U4DPlane ()
 Destructor of the class.
 
 U4DPlane (const U4DPlane &a)
 Copy constructor for a 3D plane object.
 
U4DPlaneoperator= (const U4DPlane &a)
 Copy constructor for a 3D plane object. More...
 
U4DPoint3n closestPointToPlane (U4DPoint3n &uPoint)
 Method which computes the closest 3D point to a plane. More...
 
float magnitudeOfPointToPlane (U4DPoint3n &uPoint)
 Method which computes the magnitude(distance) of a 3D point to a plane. More...
 
float magnitudeSquareOfPointToPlane (U4DPoint3n &uPoint)
 Method which computes the square magnitude(distance) of a 3D point to a plane. That is, it does not compute the square root of the magnitude. More...
 
bool intersectSegment (U4DSegment &uSegment, U4DPoint3n &uIntersectionPoint)
 Method which computes if a 3D segment intersects a 3D plane. More...
 
bool intersectPlane (U4DPlane &uPlane, U4DPoint3n &uIntersectionPoint, U4DVector3n &uIntersectionVector)
 Method which computes if two 3D planes intersect. More...
 
bool intersectPlanes (U4DPlane &uPlane2, U4DPlane &uPlane3, U4DPoint3n &uIntersectionPoint)
 Method which computes if three 3D planes intersect. More...
 
float angle (U4DPlane &uPlane)
 Compute the angle between planes. The plane normals must be normalized. More...
 

Public Attributes

U4DVector3n n
 Plane Normal 3D vector. The point on a plane satisfy n.dox(x)=d.
 
float d
 Distance of a 3D point to the plane. d=n.dot(p) for a given p on the plane.
 

Detailed Description

The U4DPlane class implements a mathematical representation of a 3D plane.

Member Function Documentation

◆ angle()

float U4DEngine::U4DPlane::angle ( U4DPlane uPlane)

Compute the angle between planes. The plane normals must be normalized.

Parameters
uPlanePlane to compute angle
Returns
Returns the angle in degrees

◆ closestPointToPlane()

U4DPoint3n U4DEngine::U4DPlane::closestPointToPlane ( U4DPoint3n uPoint)

Method which computes the closest 3D point to a plane.

Parameters
uPoint3D point to compute the closest point to a plane
Returns
Returns the closest 3D point to the plane

◆ intersectPlane()

bool U4DEngine::U4DPlane::intersectPlane ( U4DPlane uPlane,
U4DPoint3n uIntersectionPoint,
U4DVector3n uIntersectionVector 
)

Method which computes if two 3D planes intersect.

Parameters
uPlane3D plane to test intersection
uIntersectionPoint3D point where intersection occurs
uIntersectionVector3D vector produced by the intersection between the two planes
Returns
Returns true if two 3D planes intersect

◆ intersectPlanes()

bool U4DEngine::U4DPlane::intersectPlanes ( U4DPlane uPlane2,
U4DPlane uPlane3,
U4DPoint3n uIntersectionPoint 
)

Method which computes if three 3D planes intersect.

Parameters
uPlane2First 3D plane to test intersection
uPlane3Second 3D plane to test intersection
uIntersectionPoint3D point where intersection occurs
Returns
Returns true if three 3D planes intersect

◆ intersectSegment()

bool U4DEngine::U4DPlane::intersectSegment ( U4DSegment uSegment,
U4DPoint3n uIntersectionPoint 
)

Method which computes if a 3D segment intersects a 3D plane.

Parameters
uSegment3D segment to test intersection
uIntersectionPoint3D point where intersection occurs.
Returns
Returns true if the 3D segment intersects the 3D plane

◆ magnitudeOfPointToPlane()

float U4DEngine::U4DPlane::magnitudeOfPointToPlane ( U4DPoint3n uPoint)

Method which computes the magnitude(distance) of a 3D point to a plane.

Parameters
uPoint3D point to compute the magnitude(distance) to a plane
Returns
Returns the magnitude(distance) of a 3D point to plane

◆ magnitudeSquareOfPointToPlane()

float U4DEngine::U4DPlane::magnitudeSquareOfPointToPlane ( U4DPoint3n uPoint)

Method which computes the square magnitude(distance) of a 3D point to a plane. That is, it does not compute the square root of the magnitude.

Parameters
uPoint3D point to compute the square magnitude(distance) to a plane
Returns
Returns the square magnitude(distance) of a 3D point to plane. That is, it does not compute the square root of the magnitude

◆ operator=()

U4DPlane & U4DEngine::U4DPlane::operator= ( const U4DPlane a)

Copy constructor for a 3D plane object.

Parameters
a3D plane to copy
Returns
Returns a copy of the 3D plane object