A Brownian motion. More...
#include <ps_force.h>
Inherits NL3D::CPSForceIntensityHelper.
Public Member Functions | |
| CPSBrownianForce (float intensity=1.f) | |
| ========================================================== | |
| virtual void | serial (NLMISC::IStream &f) throw (NLMISC::EStream) |
| ======================================================================= | |
| virtual bool | isIntegrable (void) const |
| We provide a kind of integration on a predefined sequence. | |
| virtual void | integrate (float date, CPSLocated *src, uint32 startIndex, uint32 numObjects, NLMISC::CVector *destPos=NULL, NLMISC::CVector *destSpeed=NULL, bool accumulate=false, uint posStride=sizeof(NLMISC::CVector), uint speedStride=sizeof(NLMISC::CVector)) const |
| ========================================================== | |
| virtual void | integrateSingle (float startDate, float deltaT, uint numStep, const CPSLocated *src, uint32 indexInLocated, NLMISC::CVector *destPos, bool accumulate=false, uint posStride=sizeof(NLMISC::CVector)) const |
| ========================================================== | |
| void | setIntensity (float value) |
| ========================================================== | |
| void | setIntensityScheme (CPSAttribMaker< float > *scheme) |
| ========================================================== | |
| virtual void | computeForces (CPSLocated &target) |
| Compute the force on the targets. | |
| void | show () |
| Show the force (edition mode). | |
| void | setParametricFactor (float factor) |
| When used with parametric integration, this tells factor tells how fast the force acts on particle (how fast it go through the lookup table in fact). | |
| float | getParametricFactor () const |
Static Public Member Functions | |
| static void | initPrecalc () |
| perform initialisations | |
Protected Member Functions | |
| virtual CPSLocated * | getForceIntensityOwner (void) |
| deriver must return the located that own them here | |
| virtual void | newElement (const CPSEmitterInfo &info) |
| Generate a new element for this bindable. | |
| virtual void | deleteElement (uint32 index) |
| Delete an element given its index Attributes of the located that hold this bindable are still accessible for of the index given index out of range -> nl_assert. | |
| virtual void | resize (uint32 size) |
| Resize the bindable attributes containers DERIVERS SHOULD CALL THEIR PARENT VERSION should not be called directly. | |
Protected Attributes | |
| float | _ParametricFactor |
Static Protected Attributes | |
| static NLMISC::CVector | PrecomputedPos [] |
| used to avoid to have to call rand for each particle the force applies on... | |
| static NLMISC::CVector | PrecomputedSpeed [] |
| static NLMISC::CVector | PrecomputedImpulsions [] |
| various impulsion for normal motion | |
A Brownian motion.
Definition at line 573 of file ps_force.h.
| NL3D::CPSBrownianForce::CPSBrownianForce | ( | float | intensity = 1.f |
) |
==========================================================
Definition at line 1020 of file ps_force.cpp.
References NL3D::CPSLocatedBindable::_Name, NL3D::CParticleSystem::getSerializeIdentifierFlag(), NL_PS_FUNC, and setIntensity().
| void NL3D::CPSBrownianForce::computeForces | ( | CPSLocated & | target | ) | [virtual] |
Compute the force on the targets.
==========================================================
start at a random position in the precomp impulsion tab
Implements NL3D::CPSForce.
Definition at line 1309 of file ps_force.cpp.
References NL3D::CPSForceIntensity::_IntensityScheme, NL3D::CPSForceIntensity::_K, NL3D::CPSLocatedBindable::_Owner, NL3D::CPSAttrib< T >::begin(), NL3D::BFNumPrecomputedImpulsions, NL3D::CParticleSystem::EllapsedTime, NL3D::CPSAttribMaker< T >::get(), NL3D::CPSLocated::getInitialMass(), NL3D::CPSLocated::getInvMass(), NL3D::CPSLocated::getMassScheme(), NL3D::CPSLocated::getSize(), NL3D::CPSLocated::getSpeed(), NL3D::CParticleSystem::InsideSimLoop, min, NL_PS_FUNC, nlassert, PrecomputedImpulsions, NLMISC::CVector::x, and NLMISC::CVector::y.
| virtual void NL3D::CPSBrownianForce::deleteElement | ( | uint32 | index | ) | [inline, protected, virtual] |
Delete an element given its index Attributes of the located that hold this bindable are still accessible for of the index given index out of range -> nl_assert.
Reimplemented from NL3D::CPSForceIntensityHelper.
Definition at line 618 of file ps_force.h.
References NL3D::CPSForceIntensity::deleteForceIntensityElement().
| virtual CPSLocated* NL3D::CPSBrownianForce::getForceIntensityOwner | ( | void | ) | [inline, protected, virtual] |
deriver must return the located that own them here
Reimplemented from NL3D::CPSForceIntensityHelper.
Definition at line 616 of file ps_force.h.
References NL3D::CPSLocatedBindable::_Owner.
| float NL3D::CPSBrownianForce::getParametricFactor | ( | ) | const [inline] |
Definition at line 613 of file ps_force.h.
References _ParametricFactor.
| void NL3D::CPSBrownianForce::initPrecalc | ( | ) | [static] |
perform initialisations
==========================================================
create the pos table
Definition at line 1221 of file ps_force.cpp.
References NL3D::BFNumPrecomputedImpulsions, NL3D::BFNumPredefinedPos, NL3D::BFPredefinedNumInterp, NLMISC::frand(), NL_PS_FUNC, nlassert, NLMISC::CVector::Null, PrecomputedImpulsions, PrecomputedPos, PrecomputedSpeed, and NLMISC::CVector::set().
Referenced by NL3D::CPSUtil::registerForces().
| void NL3D::CPSBrownianForce::integrate | ( | float | date, | |
| CPSLocated * | src, | |||
| uint32 | startIndex, | |||
| uint32 | numObjects, | |||
| NLMISC::CVector * | destPos = NULL, |
|||
| NLMISC::CVector * | destSpeed = NULL, |
|||
| bool | accumulate = false, |
|||
| uint | posStride = sizeof(NLMISC::CVector), |
|||
| uint | speedStride = sizeof(NLMISC::CVector) | |||
| ) | const [virtual] |
==========================================================
MASS DIFFERENT FROM 1 IS NOT SUPPORTED
Reimplemented from NL3D::CPSForce.
Definition at line 1037 of file ps_force.cpp.
References NL3D::CPSForceIntensity::_K, _ParametricFactor, NL3D::CPSLocated::_PInfo, NL3D::CPSAttrib< T >::begin(), NL3D::BFNumPredefinedPos, NEXT_POS, NEXT_SPEED, NL_PS_FUNC, PrecomputedPos, PrecomputedSpeed, NLMISC::CVector::set(), NLMISC::CVector::x, NLMISC::CVector::y, and NLMISC::CVector::z.
| void NL3D::CPSBrownianForce::integrateSingle | ( | float | startDate, | |
| float | deltaT, | |||
| uint | numStep, | |||
| const CPSLocated * | src, | |||
| uint32 | indexInLocated, | |||
| NLMISC::CVector * | destPos, | |||
| bool | accumulate = false, |
|||
| uint | posStride = sizeof(NLMISC::CVector) | |||
| ) | const [virtual] |
==========================================================
fill start of datas (particle didn't exist at that time, so we fill by the start position)
Reimplemented from NL3D::CPSForce.
Definition at line 1152 of file ps_force.cpp.
References NL3D::CPSForceIntensity::_K, _ParametricFactor, NL3D::CPSLocated::_PInfo, NL3D::BFNumPredefinedPos, NL3D::BFPredefinedNumInterp, NL3D::CPSLocated::CParametricInfo::Date, NL3D::FillBufUsingSubdiv(), NL3D::CPSLocated::isParametricMotionEnabled(), NL_PS_FUNC, nlassert, NL3D::CPSLocated::CParametricInfo::Pos, PrecomputedPos, NL3D::ScaleFloatGE(), NL3D::CPSLocated::CParametricInfo::Speed, NLMISC::CVector::x, NLMISC::CVector::y, and NLMISC::CVector::z.
| bool NL3D::CPSBrownianForce::isIntegrable | ( | void | ) | const [virtual] |
We provide a kind of integration on a predefined sequence.
==========================================================
Reimplemented from NL3D::CPSForce.
Definition at line 1029 of file ps_force.cpp.
References NL3D::CPSForceIntensity::_IntensityScheme, and NL_PS_FUNC.
| virtual void NL3D::CPSBrownianForce::newElement | ( | const CPSEmitterInfo & | info | ) | [inline, protected, virtual] |
Generate a new element for this bindable.
They are generated according to the propertie of the class
Reimplemented from NL3D::CPSForceIntensityHelper.
Definition at line 617 of file ps_force.h.
References NL3D::CPSForceIntensity::newForceIntensityElement().
| virtual void NL3D::CPSBrownianForce::resize | ( | uint32 | size | ) | [inline, protected, virtual] |
Resize the bindable attributes containers DERIVERS SHOULD CALL THEIR PARENT VERSION should not be called directly.
Call CPSLOcated::resize instead
Reimplemented from NL3D::CPSForceIntensityHelper.
Definition at line 619 of file ps_force.h.
References NL3D::CPSForceIntensity::resizeForceIntensity().
| void NL3D::CPSBrownianForce::serial | ( | NLMISC::IStream & | f | ) | throw (NLMISC::EStream) [virtual] |
=======================================================================
Reimplemented from NL3D::CPSForceIntensityHelper.
Definition at line 1375 of file ps_force.cpp.
References NL_PS_FUNC, NL3D::CPSForceIntensityHelper::serial(), and NL3D::CPSForce::serial().
| void NL3D::CPSBrownianForce::setIntensity | ( | float | value | ) | [virtual] |
==========================================================
Reimplemented from NL3D::CPSForceIntensity.
Definition at line 1282 of file ps_force.cpp.
References NL3D::CPSForceIntensity::_IntensityScheme, NL_PS_FUNC, and NL3D::CPSForce::renewIntegrable().
Referenced by CPSBrownianForce().
| void NL3D::CPSBrownianForce::setIntensityScheme | ( | CPSAttribMaker< float > * | scheme | ) | [virtual] |
==========================================================
Reimplemented from NL3D::CPSForceIntensity.
Definition at line 1298 of file ps_force.cpp.
References NL3D::CPSForceIntensity::_IntensityScheme, NL3D::CPSForce::cancelIntegrable(), and NL_PS_FUNC.
| void NL3D::CPSBrownianForce::setParametricFactor | ( | float | factor | ) | [inline] |
When used with parametric integration, this tells factor tells how fast the force acts on particle (how fast it go through the lookup table in fact).
Definition at line 612 of file ps_force.h.
References _ParametricFactor.
| void NL3D::CPSBrownianForce::show | ( | ) | [inline, virtual] |
Show the force (edition mode).
Implements NL3D::CPSForce.
Definition at line 606 of file ps_force.h.
float NL3D::CPSBrownianForce::_ParametricFactor [protected] |
Definition at line 621 of file ps_force.h.
Referenced by getParametricFactor(), integrate(), integrateSingle(), and setParametricFactor().
NLMISC::CVector NL3D::CPSBrownianForce::PrecomputedImpulsions [static, protected] |
various impulsion for normal motion
Definition at line 626 of file ps_force.h.
Referenced by computeForces(), and initPrecalc().
NLMISC::CVector NL3D::CPSBrownianForce::PrecomputedPos [static, protected] |
used to avoid to have to call rand for each particle the force applies on...
Definition at line 622 of file ps_force.h.
Referenced by initPrecalc(), integrate(), and integrateSingle().
NLMISC::CVector NL3D::CPSBrownianForce::PrecomputedSpeed [static, protected] |
Definition at line 623 of file ps_force.h.
Referenced by initPrecalc(), and integrate().
1.6.1