|
ParticleAPI 3.0.0
Performant particle system API in C++ for interactive graphics
|
A CSG union of multiple domains. More...
#include <pDomain.h>
Public Member Functions | |
| PDUnion () | |
| Use this one to create an empty PDUnion then call .insert() to add each item to it. More... | |
| PDUnion (const pDomain &A, const pDomain &B) | |
| PDUnion (const pDomain &A, const pDomain &B, const pDomain &C) | |
| PDUnion (const std::vector< std::shared_ptr< pDomain > > &DomList) | |
| Makes a copy of all the subdomains and point to the copies. More... | |
| PDUnion (const PDUnion &P) | |
| Makes a copy of all the subdomains and point to the copies. More... | |
| void | insert (const pDomain &A) |
| Insert another domain into this PDUnion. More... | |
| bool | Within (const pVec &pos) const |
| Returns true if pos is within any of the domains. More... | |
| pVec | Generate () const |
| Generate a point in any subdomain, chosen by the ratio of their sizes. More... | |
| float | Size () const |
| Returns the size of the domain (length, area, or volume). More... | |
| std::shared_ptr< pDomain > | copy () 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< pDomain > | copy () const =0 |
Public Attributes | |
| std::vector< std::shared_ptr< pDomain > > | Doms |
| float | TotalSize |
Public Attributes inherited from pDomain | |
| pDomainType_E | Which |
A CSG union of multiple domains.
A point is within this domain if it is within any subdomain. Generate returns a point from any subdomain. Within returns true if pos is within any subdomain.
All domains have a Size() that is used to apportion probability between the domains in the union. Sizes of domains of the same dimensionality are commensurate but sizes of differing dimensionality are not. Thus, to properly distribute probability of Generate() choosing each domain, it is wise to only combine domains that have the same dimensionality. Note that thin shelled cylinders, cones, and spheres, where InnerRadius==OuterRadius, are considered 2D, not 3D. Thin shelled discs (circles) are considered 1D. Points are 0D.
|
inline |
Makes a copy of all the subdomains and point to the copies.
Note that the Generate() function goes faster if you supply DomList with the largest domains first.
|
inlinevirtual |
Generate a point in any subdomain, chosen by the ratio of their sizes.
Implements pDomain.
|
inlinevirtual |
Returns the size of the domain (length, area, or volume).
Implements pDomain.
|
inlinevirtual |
Returns true if pos is within any of the domains.
Implements pDomain.
| std::vector<std::shared_ptr<pDomain> > Doms |
| float TotalSize |