Jet  v1.3.3
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
jet::ParticleSystemSolver3 Class Reference

Basic 3-D particle system solver. More...

#include <jet/particle_system_solver3.h>

Inheritance diagram for jet::ParticleSystemSolver3:
jet::PhysicsAnimation jet::Animation jet::SphSolver3 jet::PciSphSolver3

Classes

class  Builder
 Front-end to create ParticleSystemSolver3 objects step by step. More...
 

Public Member Functions

 ParticleSystemSolver3 ()
 Constructs an empty solver. More...
 
 ParticleSystemSolver3 (double radius, double mass)
 Constructs a solver with particle parameters. More...
 
virtual ~ParticleSystemSolver3 ()
 Destructor. More...
 
double dragCoefficient () const
 Returns the drag coefficient. More...
 
void setDragCoefficient (double newDragCoefficient)
 Sets the drag coefficient. More...
 
double restitutionCoefficient () const
 Sets the restitution coefficient. More...
 
void setRestitutionCoefficient (double newRestitutionCoefficient)
 Sets the restitution coefficient. More...
 
const Vector3Dgravity () const
 Returns the gravity. More...
 
void setGravity (const Vector3D &newGravity)
 Sets the gravity. More...
 
const ParticleSystemData3PtrparticleSystemData () const
 Returns the particle system data. More...
 
const Collider3Ptrcollider () const
 Returns the collider. More...
 
void setCollider (const Collider3Ptr &newCollider)
 Sets the collider. More...
 
const ParticleEmitter3Ptremitter () const
 Returns the emitter. More...
 
void setEmitter (const ParticleEmitter3Ptr &newEmitter)
 Sets the emitter. More...
 
const VectorField3Ptrwind () const
 Returns the wind field. More...
 
void setWind (const VectorField3Ptr &newWind)
 Sets the wind. More...
 
- Public Member Functions inherited from jet::PhysicsAnimation
 PhysicsAnimation ()
 Default constructor. More...
 
virtual ~PhysicsAnimation ()
 Destructor. More...
 
bool isUsingFixedSubTimeSteps () const
 Returns true if fixed sub-timestepping is used. More...
 
void setIsUsingFixedSubTimeSteps (bool isUsing)
 Sets true if fixed sub-timestepping is used. More...
 
unsigned int numberOfFixedSubTimeSteps () const
 Returns the number of fixed sub-timesteps. More...
 
void setNumberOfFixedSubTimeSteps (unsigned int numberOfSteps)
 Sets the number of fixed sub-timesteps. More...
 
void advanceSingleFrame ()
 Advances a single frame. More...
 
Frame currentFrame () const
 Returns current frame. More...
 
void setCurrentFrame (const Frame &frame)
 Sets current frame cursor (but do not invoke update()). More...
 
double currentTimeInSeconds () const
 Returns current time in seconds. More...
 
- Public Member Functions inherited from jet::Animation
 Animation ()
 
virtual ~Animation ()
 
void update (const Frame &frame)
 Updates animation state for given frame. More...
 

Static Public Member Functions

static Builder builder ()
 Returns builder fox ParticleSystemSolver3. More...
 

Protected Member Functions

void onInitialize () override
 Initializes the simulator. More...
 
void onAdvanceTimeStep (double timeStepInSeconds) override
 Called to advane a single time-step. More...
 
virtual void accumulateForces (double timeStepInSeconds)
 Accumulates forces applied to the particles. More...
 
virtual void onBeginAdvanceTimeStep (double timeStepInSeconds)
 Called when a time-step is about to begin. More...
 
virtual void onEndAdvanceTimeStep (double timeStepInSeconds)
 Called after a time-step is completed. More...
 
void resolveCollision ()
 Resolves any collisions occured by the particles. More...
 
void resolveCollision (ArrayAccessor1< Vector3D > newPositions, ArrayAccessor1< Vector3D > newVelocities)
 
void setParticleSystemData (const ParticleSystemData3Ptr &newParticles)
 Assign a new particle system data. More...
 
- Protected Member Functions inherited from jet::PhysicsAnimation
virtual unsigned int numberOfSubTimeSteps (double timeIntervalInSeconds) const
 Returns the required number of sub-timesteps for given time interval. More...
 

Detailed Description

Basic 3-D particle system solver.

This class implements basic particle system solver. It includes gravity, air drag, and collision. But it does not compute particle-to-particle interaction. Thus, this solver is suitable for performing simple spray-like simulations with low computational cost. This class can be further extend to add more sophisticated simulations, such as SPH, to handle particle-to-particle intersection.

See also
SphSolver3

Constructor & Destructor Documentation

◆ ParticleSystemSolver3() [1/2]

jet::ParticleSystemSolver3::ParticleSystemSolver3 ( )

Constructs an empty solver.

◆ ParticleSystemSolver3() [2/2]

jet::ParticleSystemSolver3::ParticleSystemSolver3 ( double  radius,
double  mass 
)

Constructs a solver with particle parameters.

◆ ~ParticleSystemSolver3()

virtual jet::ParticleSystemSolver3::~ParticleSystemSolver3 ( )
virtual

Destructor.

Member Function Documentation

◆ accumulateForces()

virtual void jet::ParticleSystemSolver3::accumulateForces ( double  timeStepInSeconds)
protectedvirtual

Accumulates forces applied to the particles.

Reimplemented in jet::SphSolver3.

◆ builder()

static Builder jet::ParticleSystemSolver3::builder ( )
static

Returns builder fox ParticleSystemSolver3.

◆ collider()

const Collider3Ptr& jet::ParticleSystemSolver3::collider ( ) const

Returns the collider.

◆ dragCoefficient()

double jet::ParticleSystemSolver3::dragCoefficient ( ) const

Returns the drag coefficient.

◆ emitter()

const ParticleEmitter3Ptr& jet::ParticleSystemSolver3::emitter ( ) const

Returns the emitter.

◆ gravity()

const Vector3D& jet::ParticleSystemSolver3::gravity ( ) const

Returns the gravity.

◆ onAdvanceTimeStep()

void jet::ParticleSystemSolver3::onAdvanceTimeStep ( double  timeStepInSeconds)
overrideprotectedvirtual

Called to advane a single time-step.

Implements jet::PhysicsAnimation.

◆ onBeginAdvanceTimeStep()

virtual void jet::ParticleSystemSolver3::onBeginAdvanceTimeStep ( double  timeStepInSeconds)
protectedvirtual

Called when a time-step is about to begin.

Reimplemented in jet::SphSolver3, and jet::PciSphSolver3.

◆ onEndAdvanceTimeStep()

virtual void jet::ParticleSystemSolver3::onEndAdvanceTimeStep ( double  timeStepInSeconds)
protectedvirtual

Called after a time-step is completed.

Reimplemented in jet::SphSolver3.

◆ onInitialize()

void jet::ParticleSystemSolver3::onInitialize ( )
overrideprotectedvirtual

Initializes the simulator.

Reimplemented from jet::PhysicsAnimation.

◆ particleSystemData()

const ParticleSystemData3Ptr& jet::ParticleSystemSolver3::particleSystemData ( ) const

Returns the particle system data.

This function returns the particle system data. The data is created when this solver is constructed and also owned by the solver.

Returns
The particle system data.

◆ resolveCollision() [1/2]

void jet::ParticleSystemSolver3::resolveCollision ( )
protected

Resolves any collisions occured by the particles.

◆ resolveCollision() [2/2]

void jet::ParticleSystemSolver3::resolveCollision ( ArrayAccessor1< Vector3D newPositions,
ArrayAccessor1< Vector3D newVelocities 
)
protected

Resolves any collisions occured by the particles where the particle state is given by the position and velocity arrays.

◆ restitutionCoefficient()

double jet::ParticleSystemSolver3::restitutionCoefficient ( ) const

Sets the restitution coefficient.

◆ setCollider()

void jet::ParticleSystemSolver3::setCollider ( const Collider3Ptr newCollider)

Sets the collider.

◆ setDragCoefficient()

void jet::ParticleSystemSolver3::setDragCoefficient ( double  newDragCoefficient)

Sets the drag coefficient.

The drag coefficient controls the amount of air-drag. The coefficient should be a positive number and 0 means no drag force.

Parameters
[in]newDragCoefficientThe new drag coefficient.

◆ setEmitter()

void jet::ParticleSystemSolver3::setEmitter ( const ParticleEmitter3Ptr newEmitter)

Sets the emitter.

◆ setGravity()

void jet::ParticleSystemSolver3::setGravity ( const Vector3D newGravity)

Sets the gravity.

◆ setParticleSystemData()

void jet::ParticleSystemSolver3::setParticleSystemData ( const ParticleSystemData3Ptr newParticles)
protected

Assign a new particle system data.

◆ setRestitutionCoefficient()

void jet::ParticleSystemSolver3::setRestitutionCoefficient ( double  newRestitutionCoefficient)

Sets the restitution coefficient.

The restitution coefficient controls the bouncy-ness of a particle when it hits a collider surface. The range of the coefficient should be 0 to 1 – 0 means no bounce back and 1 means perfect reflection.

Parameters
[in]newRestitutionCoefficientThe new restitution coefficient.

◆ setWind()

void jet::ParticleSystemSolver3::setWind ( const VectorField3Ptr newWind)

Sets the wind.

Wind can be applied to the particle system by setting a vector field to the solver.

Parameters
[in]newWindThe new wind.

◆ wind()

const VectorField3Ptr& jet::ParticleSystemSolver3::wind ( ) const

Returns the wind field.


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