ParticleAPI 3.0.0
Performant particle system API in C++ for interactive graphics
Public Member Functions | Public Attributes | List of all members
PDSphere Struct Reference

Sphere. More...

#include <pDomain.h>

Inheritance diagram for PDSphere:
pDomain

Public Member Functions

 PDSphere (const pVec &Center, const float OuterRadius, const float InnerRadius=0.0f)
 
void PDSphere_Cons (const pVec &Center, const float OuterRadius, const float InnerRadius=0.0f)
 
bool Within (const pVec &pos) const
 Returns true if the point lies within the thick shell. More...
 
pVec Generate () const
 Returns a random point in the thick spherical shell. More...
 
float Size () const
 Returns the thick spherical shell volume or the thin spherical shell area if OuterRadius==InnerRadius. More...
 
std::shared_ptr< pDomaincopy () const
 
virtual bool Within (const pVec &) const =0
 Returns true if the given point is within the domain. More...
 
virtual pVec Generate () const =0
 Returns a random point in the domain. More...
 
virtual float Size () const =0
 Returns the size of the domain (length, area, or volume). More...
 
virtual std::shared_ptr< pDomaincopy () const =0
 

Public Attributes

pVec ctr
 
float radIn
 
float radOut
 
float radInSqr
 
float radOutSqr
 
float radDif
 
float vol
 
bool ThinShell
 
- Public Attributes inherited from pDomain
pDomainType_E Which
 

Detailed Description

Sphere.

The point Center is the center of the sphere. OuterRadius is the outer radius of the spherical shell and InnerRadius is the inner radius.

Generate returns a random point in the thick shell at a distance between OuterRadius and InnerRadius from point Center. If InnerRadius is 0, then it is the whole sphere. Within returns true if the point lies within the thick shell at a distance between InnerRadius to OuterRadius from point Center.

Constructor & Destructor Documentation

◆ PDSphere()

PDSphere ( const pVec Center,
const float  OuterRadius,
const float  InnerRadius = 0.0f 
)
inline

Member Function Documentation

◆ copy()

std::shared_ptr< pDomain > copy ( ) const
inlinevirtual

Implements pDomain.

◆ Generate()

pVec Generate ( ) const
inlinevirtual

Returns a random point in the thick spherical shell.

Implements pDomain.

◆ PDSphere_Cons()

void PDSphere_Cons ( const pVec Center,
const float  OuterRadius,
const float  InnerRadius = 0.0f 
)
inline

◆ Size()

float Size ( ) const
inlinevirtual

Returns the thick spherical shell volume or the thin spherical shell area if OuterRadius==InnerRadius.

Implements pDomain.

◆ Within()

bool Within ( const pVec pos) const
inlinevirtual

Returns true if the point lies within the thick shell.

Implements pDomain.

Member Data Documentation

◆ ctr

pVec ctr

◆ radDif

float radDif

◆ radIn

float radIn

◆ radInSqr

float radInSqr

◆ radOut

float radOut

◆ radOutSqr

float radOutSqr

◆ ThinShell

bool ThinShell

◆ vol

float vol

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