Nameless Engine
Loading...
Searching...
No Matches
ne::Plane Struct Reference

#include <Plane.h>

Public Member Functions

 Plane ()=default
 
 Plane (const glm::vec3 &normal, const glm::vec3 &location)
 
bool isPointBehindPlane (const glm::vec3 &point) const
 

Public Attributes

glm::vec3 normal = glm::vec3(0.0F, 0.0F, 0.0F)
 
float distanceFromOrigin = 0.0F
 

Detailed Description

Plane represented by a normal and a distance.

Constructor & Destructor Documentation

◆ Plane() [1/2]

ne::Plane::Plane ( )
default

Creates uninitialized plane.

◆ Plane() [2/2]

ne::Plane::Plane ( const glm::vec3 &  normal,
const glm::vec3 &  location 
)

Initializes the plane.

Parameters
normalPlane's normal (expected to be of unit length).
locationLocation of a point that lies on the plane.

Member Function Documentation

◆ isPointBehindPlane()

bool ne::Plane::isPointBehindPlane ( const glm::vec3 &  point) const

Tells if the point is fully behind (inside the negative halfspace of) a plane.

Parameters
pointPoint to test.
Returns
true if the point is fully behind the plane, false otherwise.

Member Data Documentation

◆ distanceFromOrigin

float ne::Plane::distanceFromOrigin = 0.0F

Distance from the origin to the nearest point on the plane.

◆ normal

glm::vec3 ne::Plane::normal = glm::vec3(0.0F, 0.0F, 0.0F)

Plane's normal.


The documentation for this struct was generated from the following files: