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

#include <Sphere.h>

Public Member Functions

 Sphere ()=default
 
 Sphere (const glm::vec3 &center, float radius)
 
bool isBehindPlane (const Plane &plane) const
 

Public Attributes

glm::vec3 center = glm::vec3(0.0F, 0.0F, 0.0F)
 
float radius = 1.0F
 

Detailed Description

Sphere shape.

Constructor & Destructor Documentation

◆ Sphere() [1/2]

ne::Sphere::Sphere ( )
default

Creates uninitialized sphere.

◆ Sphere() [2/2]

ne::Sphere::Sphere ( const glm::vec3 &  center,
float  radius 
)

Initializes the sphere.

Parameters
centerLocation of the sphere's center point.
radiusSphere's radius.

Member Function Documentation

◆ isBehindPlane()

bool ne::Sphere::isBehindPlane ( const Plane plane) const

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

Parameters
planePlane to test.
Returns
true if the sphere is fully behind the plane, false if intersects or in front of it.

Member Data Documentation

◆ center

glm::vec3 ne::Sphere::center = glm::vec3(0.0F, 0.0F, 0.0F)

Location of the sphere's center point.

◆ radius

float ne::Sphere::radius = 1.0F

Sphere's radius.


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