Support Forum       G3D Web Page     
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Friends | List of all members
G3D::ParticleSystemModel Class Reference


Shared state for quickly instantiating particular types of ParticleSystems. More...

Inherits G3D::Model.

Classes

class  Emitter
 All properties are in object space. More...
 
class  Specification
 A single ParticleSystemModel::Emitter::Specification will cast directly to a ParticleSystemModel::Specification at Any parsing time. More...
 

Public Member Functions

 ParticleSystemModel ()
 We should support multiple materials per model. More...
 
virtual const StringclassName () const override
 Name of the G3D::Model subclass. More...
 
const std::pair< float, float > & coverageFadeTime (int e) const
 Fade in and fade out time for emitter e. More...
 
const Array< shared_ptr< Emitter > > & emitterArray () const
 
bool hasCoverageFadeTime () const
 True if any fadeTime is non-zero. More...
 
bool hasExpireTime () const
 True if any emitter's mean expiration time is finite. More...
 
bool hasPhysics () const
 
virtual bool intersect (const Ray &ray, const CoordinateFrame &cframe, float &maxDistance, Model::HitInfo &info=Model::HitInfo::ignore, const Entity *entity=nullptr, const Model::Pose *pose=nullptr) const
 Determines if the ray intersects the heightfield and fills the info with the proper information. More...
 
virtual const Stringname () const override
 Name of the instance (usually based on the filename it is loaded from) More...
 
virtual void pose (Array< shared_ptr< Surface > > &surfaceArray, const CFrame &rootFrame, const CFrame &prevFrame, const shared_ptr< Entity > &entity, const Model::Pose *pose, const Model::Pose *prevPose, const Surface::ExpressiveLightScatteringProperties &expressiveLightScatteringProperties) override
 This will be replaced soon with a version that takes a shared_ptr<Pose>. More...
 

Static Public Member Functions

static shared_ptr< ParticleSystemModelcreate (const Specification &specification, const String &name="")
 
static lazy_ptr< ModellazyCreate (const Specification &s, const String &name="")
 
static lazy_ptr< ModellazyCreate (const String &name, const Any &any)
 
static void setUseOptimizedIntersect (bool b)
 If true, complex models should use TriTree to accelerate intersect() calls where possible. More...
 
static bool useOptimizedIntersect ()
 

Protected Member Functions

 ParticleSystemModel (const Specification &spec, const String &name)
 
void init ()
 

Static Protected Member Functions

template<class T , class ... ArgTypes>
static shared_ptr< T > createShared (ArgTypes &&... args)
 Like std::make_shared, but works for protected constructors. More...
 

Protected Attributes

Array< std::pair< float, float > > m_coverageFadeTime
 These are stored explicitly to avoid chasing shared pointers during simulation. More...
 
Array< shared_ptr< Emitter > > m_emitterArray
 
bool m_hasCoverageFadeTime
 
bool m_hasExpireTime
 
bool m_hasPhysics
 
String m_name
 

Friends

class ParticleSystem
 

Detailed Description


Shared state for quickly instantiating particular types of ParticleSystems.

Constructor & Destructor Documentation

◆ ParticleSystemModel() [1/2]

G3D::ParticleSystemModel::ParticleSystemModel ( const Specification spec,
const String name 
)
protected

◆ ParticleSystemModel() [2/2]

G3D::ParticleSystemModel::ParticleSystemModel ( )
inline

We should support multiple materials per model.

Member Function Documentation

◆ className()

virtual const String& G3D::ParticleSystemModel::className ( ) const
inlineoverridevirtual

Name of the G3D::Model subclass.

Implements G3D::Model.

◆ coverageFadeTime()

const std::pair<float, float>& G3D::ParticleSystemModel::coverageFadeTime ( int  e) const
inline

Fade in and fade out time for emitter e.

Used during ParticleSystem::onSimulation

◆ create()

static shared_ptr<ParticleSystemModel> G3D::ParticleSystemModel::create ( const Specification specification,
const String name = "" 
)
static

Referenced by lazyCreate().

◆ createShared()

template<class T , class ... ArgTypes>
static shared_ptr<T> G3D::ReferenceCountedObject::createShared ( ArgTypes &&...  args)
inlinestaticprotectedinherited

Like std::make_shared, but works for protected constructors.

Call as createShared<myclass>.

◆ emitterArray()

const Array<shared_ptr<Emitter> >& G3D::ParticleSystemModel::emitterArray ( ) const
inline

◆ hasCoverageFadeTime()

bool G3D::ParticleSystemModel::hasCoverageFadeTime ( ) const
inline

True if any fadeTime is non-zero.

◆ hasExpireTime()

bool G3D::ParticleSystemModel::hasExpireTime ( ) const
inline

True if any emitter's mean expiration time is finite.

◆ hasPhysics()

bool G3D::ParticleSystemModel::hasPhysics ( ) const
inline

◆ init()

void G3D::ParticleSystemModel::init ( )
protected

◆ intersect()

virtual bool G3D::Model::intersect ( const Ray ray,
const CoordinateFrame cframe,
float &  maxDistance,
Model::HitInfo info = Model::HitInfo::ignore,
const Entity entity = nullptr,
const Model::Pose pose = nullptr 
) const
inlinevirtualinherited

Determines if the ray intersects the heightfield and fills the info with the proper information.

Parameters
maxDistanceMax distance to trace to on input, hit distance written on output if hit

Reimplemented in G3D::ArticulatedModel, G3D::MD2Model, G3D::MD3Model, G3D::HeightfieldModel, G3D::PointModel, G3D::VoxelModel, and G3D::FontModel.

◆ lazyCreate() [1/2]

static lazy_ptr<Model> G3D::ParticleSystemModel::lazyCreate ( const Specification s,
const String name = "" 
)
inlinestatic

Referenced by lazyCreate().

◆ lazyCreate() [2/2]

static lazy_ptr<Model> G3D::ParticleSystemModel::lazyCreate ( const String name,
const Any any 
)
inlinestatic

◆ name()

virtual const String& G3D::ParticleSystemModel::name ( ) const
inlineoverridevirtual

Name of the instance (usually based on the filename it is loaded from)

Implements G3D::Model.

Referenced by lazyCreate().

◆ pose()

virtual void G3D::ParticleSystemModel::pose ( Array< shared_ptr< Surface > > &  surfaceArray,
const CFrame rootFrame,
const CFrame prevFrame,
const shared_ptr< Entity > &  entity,
const Model::Pose pose,
const Model::Pose prevPose,
const Surface::ExpressiveLightScatteringProperties e 
)
inlineoverridevirtual

This will be replaced soon with a version that takes a shared_ptr<Pose>.

Parameters
poseMust have the subclass of Model::Pose appropriate to the Model subclass.

Implements G3D::Model.

◆ setUseOptimizedIntersect()

static void G3D::Model::setUseOptimizedIntersect ( bool  b)
inlinestaticinherited

If true, complex models should use TriTree to accelerate intersect() calls where possible.

This can make the first intersect() call very slow for the tree build and can make loading slow. It may not affect performance of skinned or articulated models that animate.

This value should be set before the models are loaded. If it is changed after a model is loaded, the Model is not required to respond to it.

Default: false

◆ useOptimizedIntersect()

static bool G3D::Model::useOptimizedIntersect ( )
inlinestaticinherited

Friends And Related Function Documentation

◆ ParticleSystem

friend class ParticleSystem
friend

Member Data Documentation

◆ m_coverageFadeTime

Array<std::pair<float, float> > G3D::ParticleSystemModel::m_coverageFadeTime
protected

These are stored explicitly to avoid chasing shared pointers during simulation.

Referenced by coverageFadeTime().

◆ m_emitterArray

Array<shared_ptr<Emitter> > G3D::ParticleSystemModel::m_emitterArray
protected

Referenced by emitterArray().

◆ m_hasCoverageFadeTime

bool G3D::ParticleSystemModel::m_hasCoverageFadeTime
protected

Referenced by hasCoverageFadeTime().

◆ m_hasExpireTime

bool G3D::ParticleSystemModel::m_hasExpireTime
protected

Referenced by hasExpireTime().

◆ m_hasPhysics

bool G3D::ParticleSystemModel::m_hasPhysics
protected

Referenced by hasPhysics().

◆ m_name

String G3D::ParticleSystemModel::m_name
protected

Referenced by name().


documentation generated on Wed Nov 24 2021 08:01:58 using doxygen 1.8.15