Math v0.0.1
Sphere

Sphere structure. (In 3D space) More...

#include <sphere.hpp>

Public Member Functions

 Sphere (float radius=0.0f, f32x4 position=f32x4::zero) noexcept
 Creates a new sphere structure.
 
float getRadius () const noexcept
 Returns sphere radius.
 
void setRadius (float radius) noexcept
 Sets sphere radius.
 
f32x4 getPosition () const noexcept
 Returns position of the sphere in 3D space.
 
void setPosition (f32x4 position) noexcept
 Sets position of the sphere in 3D space.
 
bool operator== (const Sphere &v) const noexcept
 
bool operator!= (const Sphere &v) const noexcept
 

Static Public Attributes

static const Sphere one = Sphere(0.5f)
 
static const Sphere two = Sphere(1.0f)
 
static const Sphere half = Sphere(0.25f)
 

Protected Attributes

f32x4 posRad
 

Detailed Description

Sphere structure. (In 3D space)

Defined by a position point and radius.

Constructor & Destructor Documentation

◆ Sphere()

Sphere ( float radius = 0.0f,
f32x4 position = f32x4::zero )
inlinenoexcept

Creates a new sphere structure.

Parameters
radiustarget sphere radius
positionsphere position in 3D space

Member Function Documentation

◆ setRadius()

void setRadius ( float radius)
inlinenoexcept

Sets sphere radius.

Parameters
radiustarget sphere radius

◆ setPosition()

void setPosition ( f32x4 position)
inlinenoexcept

Sets position of the sphere in 3D space.

Parameters
positiontarget sphere position in 3D space