#include <ps_force.h>
Inheritance diagram for NL3D::CPSCylindricVortex:
Definition at line 729 of file ps_force.h.
Public Member Functions | |
virtual void | attachTarget (CPSLocated *ptr) |
inherited from CPSLocatedBindableTarget, we use that to tell wether this force is integrable or not | |
virtual bool | completeBBox (NLMISC::CAABBox &box) const |
NLMISC::CVector | computeI (void) const |
NLMISC::CVector | computeJ (void) const |
NLMISC::CVector | computeK (void) const |
CPSCylindricVortex (float intensity=1.f) | |
void | detachTarget (CPSLocated *ptr) |
virtual bool | doesProduceBBox (void) const |
Override of CPSLocatedBindable::doesProduceBBox. forces usually are not part of the bbox. | |
virtual void | enumTexs (std::vector< NLMISC::CSmartPtr< ITexture > > &dest, IDriver &drv) |
virtual void | finalize (void) |
*************************************************************************************** | |
virtual std::string | getClassName ()=0 |
IDriver * | getDriver () const |
shortcut to get an instance of the driver | |
uint32 | getExternID (void) const |
get the extern ID of this located bindable | |
const CFontGenerator * | getFontGenerator (void) const |
Shortcut to get the font generator if one was set (const version). | |
CFontGenerator * | getFontGenerator (void) |
Shortcut to get the font generator if one was set. | |
const CFontManager * | getFontManager (void) const |
Shortcut to get the font manager if one was set (const version). | |
CFontManager * | getFontManager (void) |
*************************************************************************************** | |
float | getIntensity (void) const |
get the constant intensity that was set for the force | |
const CPSAttribMaker< float > * | getIntensityScheme (void) const |
CPSAttribMaker< float > * | getIntensityScheme (void) |
get the attribute maker for a non constant intensity | |
const NLMISC::CMatrix & | getInvertedSysMat (void) const |
shortcut to get the inverted matrix of the system | |
const NLMISC::CMatrix & | getInvertedViewMat (void) const |
shortcut to get the inverted view matrix | |
const NLMISC::CMatrix & | getLocalToWorldMatrix () const |
Shortcut to get the local to world matrix. | |
TPSLod | getLOD (void) const |
get the valid lods for that object | |
virtual NLMISC::CMatrix | getMatrix (uint32 index) const |
std::string | getName (void) const |
get the located bindable name (edition purpose) | |
uint32 | getNbTargets (void) const |
return the number of targets | |
virtual NLMISC::CVector | getNormal (uint32 index) |
if the object only needs a normal, this return the normal. If not, is return (0, 0, 0) | |
const CPSLocated * | getOwner (void) const |
get the located that owns this bindable (const version) | |
CPSLocated * | getOwner (void) |
get the located that owns this bindable | |
virtual uint32 | getPriority (void) const |
return priority for forces | |
float | getRadialViscosity (void) const |
virtual NLMISC::CVector | getScale (uint32 k) const |
const NLMISC::CMatrix & | getSysMat (void) const |
*************************************************************************************** | |
float | getTangentialViscosity (void) const |
const CPSLocated * | getTarget (uint32 index) const |
Return a const ptr on a target. Invalid range -> nlassert. | |
CPSLocated * | getTarget (uint32 index) |
Return a ptr on a target. Invalid range -> nlassert. | |
uint32 | getType (void) const |
return this bindable type | |
virtual bool | getUserMatrixUsageCount () const |
const NLMISC::CMatrix & | getViewMat (void) const |
shortcut to get the view matrix | |
virtual bool | hasEmitters (void) const |
tells wether there are alive emitters | |
virtual bool | hasParticles (void) const |
tells wether there are alive entities / particles | |
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)) |
virtual void | integrateSingle (float startDate, float deltaT, uint numStep, CPSLocated *src, uint32 indexInLocated, NLMISC::CVector *destPos, bool accumulate=false, uint posStride=sizeof(NLMISC::CVector)) |
bool | isActive () const |
virtual bool | isIntegrable (void) const |
check wether this force is integrable over time. The default is false | |
virtual void | motionTypeChanged (bool parametric) |
called when a located has switch between incrmental / parametric motion. The default does nothing | |
NLMISC_DECLARE_CLASS (CPSCylindricVortex) | |
virtual bool | onlyStoreNormal (void) const |
virtual void | performDynamic (TAnimationTime ellapsedTime) |
Compute the force on the targets. | |
virtual void | releaseAllRef () |
*************************************************************************************** | |
virtual void | releaseRefTo (const CParticleSystemProcess *other) |
*************************************************************************************** | |
void | releaseTargetRsc (CPSLocated *target) |
inherited from CPSLocatedBindableTarget | |
virtual void | serial (NLMISC::IStream &f) throw (NLMISC::EStream) |
Serial the force definition. MUST be called by deriver during their serialisation. | |
void | serialForceIntensity (NLMISC::IStream &f) throw (NLMISC::EStream) |
void | setActive (bool active) |
Activate / Deactivate this object. When not active, the owning system won't try to call the 'step' method. | |
void | setExternID (uint32 id) |
*************************************************************************************** | |
virtual void | setIntensity (float value) |
set a constant intensity for the force. this discard any previous call to setIntensityScheme | |
virtual void | setIntensityScheme (CPSAttribMaker< float > *scheme) |
set a non-constant intensity | |
void | setLOD (TPSLod lod) |
virtual void | setMatrix (uint32 index, const NLMISC::CMatrix &m) |
void | setName (const std::string &name) |
set the located bindable name (edition purpose) | |
virtual void | setNormal (uint32 index, NLMISC::CVector n) |
if the object only stores a normal, this set the normal of the object. Otherwise it has no effect | |
void | setRadialViscosity (float v) |
virtual void | setScale (uint32 index, const NLMISC::CVector &s) |
virtual void | setScale (uint32 k, float scale) |
void | setTangentialViscosity (float v) |
void | setupDriverModelMatrix (void) |
shortcut to setup the model matrix (system basis or world basis) | |
virtual void | setupFunctor (uint32 indexInLocated) |
virtual void | setZBias (float value) |
virtual void | show (TAnimationTime ellapsedTime) |
Show the force (edition mode). | |
virtual void | step (TPSProcessPass pass, TAnimationTime ellapsedTime, TAnimationTime realEllapsedTime) |
virtual bool | supportNonUniformScaling (void) const |
virtual bool | supportUniformScaling (void) const |
virtual void | systemDateChanged () |
Protected Types | |
typedef CPSVector< CPSLocated * >::V | TTargetCont |
Protected Member Functions | |
virtual void | basisChanged (TPSMatrixMode systemBasis) |
virtual void | bounceOccured (uint32 index) |
void | cancelIntegrable (void) |
if this force is not integrable anymore, it tells that to its targets | |
virtual void | deleteElement (uint32 index) |
void | deleteForceIntensityElement (uint32 index) |
void | displayIcon2d (const NLMISC::CVector tab[], uint nbSegs, float scale) |
*************************************************************************************** | |
virtual CPSLocated * | getForceIntensityOwner (void) |
inherited from CPSForceIntensity | |
virtual void | newElement (CPSLocated *emitterLocated, uint32 emitterIndex) |
void | newForceIntensityElement (CPSLocated *emitterLocated, uint32 emitterIndex) |
virtual void | notifyTargetRemoved (CPSLocated *ptr) |
*************************************************************************************** | |
void | registerToTargets (void) |
register integrable and non-integrable forces to the targets | |
void | renewIntegrable (void) |
if this force has become integrable again, this method tells it to the target | |
virtual void | resize (uint32 size) |
void | resizeForceIntensity (uint32 size) |
virtual void | setOwner (CPSLocated *psl) |
*************************************************************************************** | |
Protected Attributes | |
bool | _Active |
uint32 | _ExternID |
CPSAttribMaker< float > * | _IntensityScheme |
float | _K |
TPSLod | _LOD |
tells when this object must be dealt with | |
std::string | _Name |
CPSAttrib< NLMISC::CVector > | _Normal |
CPSLocated * | _Owner |
float | _RadialViscosity |
TPSAttribFloat | _Radius |
float | _TangentialViscosity |
TTargetCont | _Targets |
Friends | |
class | CPSForceIntensity |
class | CPSLocated |
|
Definition at line 1122 of file ps_located.h. |
|
Definition at line 739 of file ps_force.h. References _RadialViscosity, _TangentialViscosity, and NL3D::CPSForceIntensity::setIntensity().
00739 : _RadialViscosity(.1f), _TangentialViscosity(.1f) 00740 { 00741 setIntensity(intensity); 00742 if (CParticleSystem::getSerializeIdentifierFlag()) _Name = std::string("Cylindric Vortex"); 00743 } |
|
inherited from CPSLocatedBindableTarget, we use that to tell wether this force is integrable or not
Reimplemented from NL3D::CPSTargetLocatedBindable. Definition at line 94 of file ps_force.cpp. References NL3D::CPSLocated::addNonIntegrableForceRef(), NL3D::CPSForce::isIntegrable(), nlassert, and NL3D::CPSLocated::registerIntegrableForce().
00095 { 00096 nlassert(_Owner); 00097 CPSTargetLocatedBindable::attachTarget(ptr); 00098 // check wether we are integrable, and if so, add us to the list 00099 if (this->isIntegrable()) 00100 { 00101 ptr->registerIntegrableForce(this); 00102 } 00103 else 00104 { 00105 ptr->addNonIntegrableForceRef(); 00106 } 00107 } |
|
inherited from CPSLocatedBindable. When we deal with integrable forces, they must be in the same basis than their target. If this change, we must notify the target of it. Reimplemented from NL3D::CPSLocatedBindable. Definition at line 123 of file ps_force.cpp. References NL3D::CPSForce::isIntegrable().
00124 { 00125 if (!this->isIntegrable()) return; 00126 for (TTargetCont::iterator it = _Targets.begin(); it != _Targets.end(); ++it) 00127 { 00128 (*it)->integrableForceBasisChanged(matrixMode); 00129 } 00130 } |
|
a bounce occured, so some action could be done. The default behaviour does nothing
Reimplemented in NL3D::CPSEmitter. Definition at line 1011 of file ps_located.h.
01011 {} |
|
if this force is not integrable anymore, it tells that to its targets
Definition at line 133 of file ps_force.cpp. References NL3D::CParticleSystemProcess::getMatrixMode(), and nlassert. Referenced by NL3D::CPSBrownianForce::setIntensityScheme(), and NL3D::CPSGravity::setIntensityScheme().
00134 { 00135 nlassert(_Owner); 00136 for (TTargetCont::iterator it = _Targets.begin(); it != _Targets.end(); ++it) 00137 { 00138 if ((*it)->getMatrixMode() == _Owner->getMatrixMode()) 00139 { 00140 (*it)->unregisterIntegrableForce(this); 00141 (*it)->addNonIntegrableForceRef(); 00142 } 00143 } 00144 } |
|
Reimplemented in NL3D::CPSFanLight, NL3D::CPSQuad, and NL3D::CPSShockWave. Definition at line 884 of file ps_located.h.
00884 { return false ;} |
|
Compute a vector that will map to (1 0 0) after view and model transform. This allow to have object that always faces the user, whatever basis they are in Definition at line 931 of file ps_located.h. References NL3D::CPSLocated::computeI(). Referenced by NL3D::CPSLocatedBindable::displayIcon2d(), NL3D::CPSFanLightHelper::drawFanLight(), NL3D::CPSFaceLookAtHelper::drawLookAt(), NL3D::CPSFaceLookAtHelper::drawLookAtAlignOnMotion(), NL3D::CPSGravity::show(), and NL3D::CPSEmitter::showTool().
00931 { return _Owner->computeI(); } |
|
Compute a vector that will map to (0 1 0) after view and model transform. This allow to have object that always faces the user, whatever basis they are in Definition at line 936 of file ps_located.h. References NL3D::CPSLocated::computeJ(). Referenced by NL3D::CPSFaceLookAtHelper::drawLookAt().
00936 { return _Owner->computeJ(); } |
|
Compute a vector that will map to (0 0 1) after view and model transform. This allow to have object that always faces the user, whatever basis they are in Definition at line 940 of file ps_located.h. References NL3D::CPSLocated::computeK(). Referenced by NL3D::CPSLocatedBindable::displayIcon2d(), NL3D::CPSFanLightHelper::drawFanLight(), NL3D::CPSFaceLookAtHelper::drawLookAt(), NL3D::CPSFaceLookAtHelper::drawLookAtAlignOnMotion(), and NL3D::CPSEmitter::showTool().
00940 { return _Owner->computeK(); } |
|
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 958 of file ps_force.cpp. References _Normal, index, NL3D::CPSAttrib< float >::remove(), and uint32.
|
|
Definition at line 203 of file ps_force.h. References NL3D::CPSForceIntensity::_IntensityScheme, NL3D::CPSAttribMaker< float >::deleteElement(), NL3D::CPSAttribMaker< float >::hasMemory(), index, and uint32. Referenced by NL3D::CPSTurbul::deleteElement(), NL3D::CPSBrownianForce::deleteElement(), NL3D::CPSFluidFriction::deleteElement(), and NL3D::CPSForceIntensityHelper::deleteElement().
00204 { 00205 if (_IntensityScheme && _IntensityScheme->hasMemory()) _IntensityScheme->deleteElement(index); 00206 } |
|
remove a target
Definition at line 1076 of file ps_located.h. References NL3D::CPSTargetLocatedBindable::notifyTargetRemoved().
01077 { 01078 notifyTargetRemoved(ptr); 01079 } |
|
*************************************************************************************** show an drawing to represent the object, and in red if it is selected
Definition at line 2038 of file ps_located.cpp. References NL3D::CPSLocatedBindable::computeI(), NL3D::CPSLocatedBindable::computeK(), NL3D::CParticleSystem::getCurrentEditedElement(), NL3D::CPSLocatedBindable::getDriver(), NL3D::CParticleSystemProcess::getOwner(), NL3D::CPSLocated::getPos(), NL3D::CPSLocated::getSize(), index, NL3D::CMaterial::setBlend(), NL3D::CMaterial::setBlendFunc(), NL3D::CMaterial::setColor(), NL3D::CMaterial::setLighting(), NL3D::CPSLocatedBindable::setupDriverModelMatrix(), NL3D::CMaterial::setZFunc(), NL3D::CMaterial::setZWrite(), size, uint, uint32, NLMISC::CLine::V0, NLMISC::CLine::V1, NLMISC::CVector::x, and NLMISC::CVector::y. Referenced by NL3D::CPSSpring::show(), NL3D::CPSCentralGravity::show(), and NL3D::CPSParticle::showTool().
02039 { 02040 uint32 size = _Owner->getSize(); 02041 if (!size) return; 02042 setupDriverModelMatrix(); 02043 02044 const CVector I = computeI(); 02045 const CVector K = computeK(); 02046 02047 static std::vector<NLMISC::CLine> lines; 02048 02049 lines.clear(); 02050 02051 // ugly slow code, but not for runtime 02052 for (uint k = 0; k < size; ++k) 02053 { 02054 // center of the current particle 02055 const CVector p = _Owner->getPos()[k]; 02056 02057 02058 02059 for (uint l = 0; l < nbSegs; ++l) 02060 { 02061 NLMISC::CLine li; 02062 li.V0 = p + scale * (tab[l << 1].x * I + tab[l << 1].y * K); 02063 li.V1 = p + scale * (tab[(l << 1) + 1].x * I + tab[(l << 1) + 1].y * K); 02064 lines.push_back(li); 02065 } 02066 02067 CMaterial mat; 02068 02069 mat.setBlendFunc(CMaterial::one, CMaterial::one); 02070 mat.setZWrite(false); 02071 mat.setLighting(false); 02072 mat.setBlend(true); 02073 mat.setZFunc(CMaterial::less); 02074 02075 02076 02077 CPSLocated *loc; 02078 uint32 index; 02079 CPSLocatedBindable *lb; 02080 _Owner->getOwner()->getCurrentEditedElement(loc, index, lb); 02081 02082 mat.setColor((lb == NULL || this == lb) && loc == _Owner && index == k ? CRGBA::Red : CRGBA(127, 127, 127)); 02083 02084 02085 CDRU::drawLinesUnlit(lines, mat, *getDriver() ); 02086 } 02087 02088 } |
|
Override of CPSLocatedBindable::doesProduceBBox. forces usually are not part of the bbox.
Reimplemented from NL3D::CPSLocatedBindable. Definition at line 67 of file ps_force.h.
00067 { return false; } |
|
Reimplemented in NL3D::CPSFanLight, NL3D::CPSQuad, NL3D::CPSRibbon, NL3D::CPSRibbonLookAt, and NL3D::CPSShockWave. Definition at line 977 of file ps_located.h.
00977 {} |
|
***************************************************************************************
Release the collisionInfos we've querried. We can't do it in the dtor, as calls to releaseTargetRsc wouldn't be polymorphics for derived class! And the behaviour of releaseTergetRsc is implemented in derived class Reimplemented from NL3D::CPSLocatedBindable. Definition at line 2238 of file ps_located.cpp. References NL3D::CPSTargetLocatedBindable::_Targets, and NL3D::CPSTargetLocatedBindable::releaseTargetRsc().
02239 { 02243 for (TTargetCont::iterator it = _Targets.begin(); it != _Targets.end(); ++it) 02244 { 02245 releaseTargetRsc(*it); 02246 } 02247 CPSLocatedBindable::finalize(); 02248 } |
|
Implemented in NLAIAGENT::CNumericIndex, NLAIC::IPointerGestion, NLAIC::CIdentType, and CAutomataDesc. Referenced by NLMISC::CClassRegistry::checkObject(), and NL3D::GetTextureSize(). |
|
|
get the extern ID of this located bindable
Definition at line 964 of file ps_located.h. References NL3D::CPSLocatedBindable::_ExternID, and uint32. Referenced by NL3D::CPSLocated::bind(), and NL3D::CParticleSystem::unregisterLocatedBindableExternID().
00964 { return _ExternID; } |
|
Shortcut to get the font generator if one was set (const version).
Definition at line 904 of file ps_located.h. References NL3D::CParticleSystemProcess::getFontGenerator(), and nlassert.
|
|
Shortcut to get the font generator if one was set.
Definition at line 897 of file ps_located.h. References NL3D::CParticleSystemProcess::getFontGenerator(), and nlassert. Referenced by NL3D::CPSZoneRectangle::show(), NL3D::CPSZoneCylinder::show(), NL3D::CPSZoneDisc::show(), NL3D::CPSZonePlane::show(), show(), NL3D::CPSGravity::show(), and NL3D::CPSEmitterRectangle::showTool().
|
|
Shortcut to get the font manager if one was set (const version).
Definition at line 2099 of file ps_located.cpp. References NL3D::CParticleSystemProcess::getFontManager(), and nlassert.
|
|
***************************************************************************************
Definition at line 2091 of file ps_located.cpp. References NL3D::CParticleSystemProcess::getFontManager(), and nlassert. Referenced by NL3D::CPSZoneRectangle::show(), NL3D::CPSZoneCylinder::show(), NL3D::CPSZoneDisc::show(), NL3D::CPSZonePlane::show(), show(), NL3D::CPSGravity::show(), and NL3D::CPSEmitterRectangle::showTool().
|
|
inherited from CPSForceIntensity
Reimplemented from NL3D::CPSForceIntensityHelper. Definition at line 778 of file ps_force.h.
00778 { return _Owner; } |
|
get the constant intensity that was set for the force
Definition at line 173 of file ps_force.h. References NL3D::CPSForceIntensity::_K.
00173 { return _K; } |
|
Definition at line 186 of file ps_force.h. References NL3D::CPSForceIntensity::_IntensityScheme.
00186 { return _IntensityScheme; } |
|
get the attribute maker for a non constant intensity
Definition at line 185 of file ps_force.h. References NL3D::CPSForceIntensity::_IntensityScheme.
00185 { return _IntensityScheme; } |
|
shortcut to get the inverted matrix of the system
Definition at line 2116 of file ps_located.cpp. References NL3D::CParticleSystem::getInvertedSysMat(), NL3D::CParticleSystemProcess::getOwner(), and nlassert.
|
|
shortcut to get the inverted view matrix
Definition at line 2134 of file ps_located.cpp. References NL3D::CParticleSystem::getInvertedViewMat(), NL3D::CParticleSystemProcess::getOwner(), and nlassert.
|
|
Shortcut to get the local to world matrix.
Definition at line 1144 of file ps_located.h. References NL3D::CPSLocated::getLocalToWorldMatrix(), and nlassert. Referenced by NL3D::CPSRibbonLookAt::displayRibbons(), NL3D::CPSSound::newElement(), NL3D::CPSZoneRectangle::show(), NL3D::CPSZoneCylinder::show(), NL3D::CPSZoneDisc::show(), NL3D::CPSZonePlane::show(), NL3D::CPSLight::show(), NL3D::CPSGravity::show(), NL3D::CPSEmitterRectangle::showTool(), NL3D::CPSLight::step(), and NL3D::CPSMesh::updatePos().
|
|
get the valid lods for that object
Definition at line 954 of file ps_located.h. References NL3D::CPSLocatedBindable::_LOD, and NL3D::TPSLod.
00954 { return _LOD; } |
|
Implements NL3D::IPSMover. Definition at line 933 of file ps_force.cpp. References _Normal, NL3D::CPSLocated::getPos(), index, NLMISC::CMatrix::setPos(), and uint32.
|
|
get the located bindable name (edition purpose)
Definition at line 948 of file ps_located.h.
00948 { return _Name; } |
|
return the number of targets
Definition at line 1091 of file ps_located.h. References NL3D::CPSTargetLocatedBindable::_Targets, and uint32. Referenced by NL3D::CParticleSystem::getTargeters().
01091 { return _Targets.size(); } |
|
if the object only needs a normal, this return the normal. If not, is return (0, 0, 0)
Reimplemented from NL3D::IPSMover. Definition at line 751 of file ps_force.h. References _Normal, index, and uint32.
|
|
get the located that owns this bindable (const version)
Definition at line 944 of file ps_located.h.
00944 { return _Owner; } |
|
get the located that owns this bindable
Definition at line 942 of file ps_located.h. Referenced by NL3D::CPSLocated::deleteElement(), NL3D::CParticleSystemInstanceUser::emit(), NL3D::CPSFaceLookAt::CSecondSize::getSizeOwner(), NL3D::CPSSound::newElement(), NL3D::CPSLocated::registerIntegrableForce(), NL3D::CParticleSystem::registerLocatedBindableExternID(), NL3D::CParticleSystemInstanceUser::removeByID(), NL3D::CPSSound::resize(), NL3D::CPSLight::resize(), NL3D::CPSSound::step(), NL3D::CPSLocated::unregisterIntegrableForce(), and NL3D::CParticleSystem::unregisterLocatedBindableExternID().
00942 { return _Owner; } |
|
return priority for forces
Implements NL3D::CPSLocatedBindable. Definition at line 64 of file ps_force.h. References uint32.
00064 { return 4000; }
|
|
Definition at line 759 of file ps_force.h. References _RadialViscosity.
00759 { return _RadialViscosity; } |
|
Reimplemented from NL3D::IPSMover. Definition at line 749 of file ps_force.h. References uint32.
00749 { return NLMISC::CVector(_Radius[k], _Radius[k], _Radius[k]); } |
|
***************************************************************************************
Definition at line 2108 of file ps_located.cpp. References NL3D::CParticleSystemProcess::getOwner(), NL3D::CParticleSystem::getSysMat(), and nlassert.
|
|
Definition at line 762 of file ps_force.h. References _TangentialViscosity.
00762 { return _TangentialViscosity; } |
|
Return a const ptr on a target. Invalid range -> nlassert.
Definition at line 1099 of file ps_located.h. References NL3D::CPSTargetLocatedBindable::_Targets, index, nlassert, and uint32.
|
|
Return a ptr on a target. Invalid range -> nlassert.
Definition at line 1093 of file ps_located.h. References NL3D::CPSTargetLocatedBindable::_Targets, index, nlassert, and uint32. Referenced by NL3D::CParticleSystem::getTargeters().
|
|
return this bindable type
Implements NL3D::CPSLocatedBindable. Definition at line 59 of file ps_force.h. References NL3D::PSForce, and uint32.
00059 { return PSForce; } |
|
Reimplemented in NL3D::CPSEmitter. Definition at line 974 of file ps_located.h. Referenced by NL3D::CPSLocatedBindable::finalize(), and NL3D::CPSLocatedBindable::setOwner().
00974 { return 0; }
|
|
shortcut to get the view matrix
Definition at line 2125 of file ps_located.cpp. References NL3D::CParticleSystemProcess::getOwner(), NL3D::CParticleSystem::getViewMat(), and nlassert. Referenced by NL3D::CPSRibbonLookAt::displayRibbons(), and NL3D::CPSFaceLookAtHelper::drawLookAt().
|
|
tells wether there are alive emitters
Definition at line 958 of file ps_located.h.
00958 { return false; } |
|
tells wether there are alive entities / particles
Reimplemented in NL3D::CPSParticle. Definition at line 956 of file ps_located.h.
00956 { return false; } |
|
Integrate this force on the given located. If 'accumulate' is set to true, it just add the effect of this force on position otherwise, it must also integrate from the initial speed, and add this force effect. The first call to this must be done with 'accumulate' set to false. NB : works only with integrable forces Reimplemented in NL3D::CPSGravity, and NL3D::CPSBrownianForce. Definition at line 99 of file ps_force.h. References nlassert, src, uint, and uint32.
00103 { 00104 nlassert(0); // not an integrable force 00105 } |
|
Compute a trajectory on several steps for a single object, rather than a step for several object. If the start date is lower than the creation date, the initial position is used NB : works only with integrable forces Reimplemented in NL3D::CPSGravity, and NL3D::CPSBrownianForce. Definition at line 112 of file ps_force.h. References nlassert, uint, and uint32.
00117 { 00118 nlassert(0); // not an integrable force 00119 } |
|
Definition at line 844 of file ps_located.h. References NL3D::CPSLocatedBindable::_Active. Referenced by NL3D::CParticleSystem::hasActiveEmitters().
00844 { return _Active; } |
|
check wether this force is integrable over time. The default is false
Reimplemented in NL3D::CPSGravity. Definition at line 85 of file ps_force.h. Referenced by NL3D::CPSForce::attachTarget(), NL3D::CPSForce::basisChanged(), NL3D::CPSForce::registerToTargets(), and NL3D::CPSForce::releaseTargetRsc().
00085 { return false; } |
|
called when a located has switch between incrmental / parametric motion. The default does nothing
Reimplemented in NL3D::CPSRibbonBase. Definition at line 971 of file ps_located.h. Referenced by NL3D::CPSLocated::bind().
00971 {} |
|
Generate a new element for this bindable. They are generated according to the propertie of the class Reimplemented from NL3D::CPSForceIntensityHelper. Definition at line 952 of file ps_force.cpp. References _Normal, NL3D::CPSAttrib< float >::insert(), and uint32.
|
|
Definition at line 199 of file ps_force.h. References NL3D::CPSForceIntensity::_IntensityScheme, NL3D::CPSAttribMaker< float >::hasMemory(), NL3D::CPSAttribMaker< float >::newElement(), and uint32. Referenced by NL3D::CPSTurbul::newElement(), NL3D::CPSBrownianForce::newElement(), NL3D::CPSFluidFriction::newElement(), and NL3D::CPSForceIntensityHelper::newElement().
00200 { 00201 if (_IntensityScheme && _IntensityScheme->hasMemory()) _IntensityScheme->newElement(emitterLocated, emitterIndex); 00202 } |
|
|
|
*************************************************************************************** Inherited from CPSLocatedBindable. A target has been remove If not present -> assert This also call releaseTargetRsc for clean up Reimplemented from NL3D::CPSLocatedBindable. Definition at line 2223 of file ps_located.cpp. References NL3D::CPSTargetLocatedBindable::_Targets, nlassert, and NL3D::CPSTargetLocatedBindable::releaseTargetRsc(). Referenced by NL3D::CPSTargetLocatedBindable::detachTarget().
|
|
some object may not store a whole matrix (e.g planes) this return true if only a normal is needed to set the orientation of the object Reimplemented from NL3D::IPSMover. Definition at line 750 of file ps_force.h.
00750 { return true; } |
|
Compute the force on the targets.
Implements NL3D::CPSForce. Definition at line 824 of file ps_force.cpp. References _Normal, _RadialViscosity, _TangentialViscosity, NL3D::CPSAttribMaker< float >::get(), NL3D::CPSLocated::getPos(), NL3D::CPSLocated::getSize(), NLMISC::CMatrix::mulVector(), nlassert, size, NL3D::TAnimationTime, and uint32.
00825 { 00826 uint32 size = _Owner->getSize(); 00827 00828 for (uint32 k = 0; k < size; ++k) // for each vortex 00829 { 00830 00831 const float invR = 1.f / _Radius[k]; 00832 const float radius2 = _Radius[k] * _Radius[k]; 00833 00834 // intensity for this vortex 00835 nlassert(_Owner); 00836 float intensity = (_IntensityScheme ? _IntensityScheme->get(_Owner, k) : _K); 00837 00838 for (TTargetCont::iterator it = _Targets.begin(); it != _Targets.end(); ++it) 00839 { 00840 // express the vortex position and plane normal in the located basis 00841 const CMatrix &m = CPSLocated::getConversionMatrix(*it, this->_Owner); 00842 const CVector center = m * (_Owner->getPos()[k]); 00843 const CVector n = m.mulVector(_Normal[k]); 00844 00845 TPSAttribVector::iterator speedIt = (*it)->getSpeed().begin(), speedItEnd = (*it)->getSpeed().end(); 00846 TPSAttribFloat::const_iterator invMassIt = (*it)->getInvMass().begin(); 00847 TPSAttribVector::const_iterator posIt = (*it)->getPos().begin(); 00848 00849 00850 // projection of the current located pos on the vortex axis 00851 CVector p; 00852 // a vector that go from the vortex center to the point we're dealing with 00853 CVector v2p; 00854 00855 // the square of the dist of the projected pos 00856 float d2 , d; 00857 00858 CVector realTangentialSpeed; 00859 CVector tangentialSpeed; 00860 00861 00862 CVector radialSpeed; 00863 00864 00865 for (; speedIt != speedItEnd; ++speedIt, ++invMassIt, ++posIt) 00866 { 00867 v2p = *posIt - center; 00868 p = v2p - (v2p * n) * n; 00869 00870 d2 = p * p; 00871 00872 00873 00874 if (d2 < radius2) // not out of range ? 00875 { 00876 if (d2 > 10E-6) 00877 { 00878 d = sqrtf(d2); 00879 00880 p *= 1.f / d; 00881 // compute the speed vect that we should have (normalized) 00882 realTangentialSpeed = n ^ p; 00883 00884 tangentialSpeed = (*speedIt * realTangentialSpeed) * realTangentialSpeed; 00885 radialSpeed = (p * *speedIt) * p; 00886 00887 // update radial speed; 00888 *speedIt -= _RadialViscosity * ellapsedTime * radialSpeed; 00889 00890 // update tangential speed 00891 *speedIt -= _TangentialViscosity * intensity * ellapsedTime * (tangentialSpeed - (1.f - d * invR) * realTangentialSpeed); 00892 } 00893 } 00894 } 00895 } 00896 } 00897 } |
|
register integrable and non-integrable forces to the targets
Definition at line 62 of file ps_force.cpp. References NL3D::CPSForce::isIntegrable(). Referenced by NL3D::CPSTurbul::NLMISC_DECLARE_CLASS(), and NL3D::CPSFluidFriction::NLMISC_DECLARE_CLASS().
00063 { 00064 for (TTargetCont::iterator it = _Targets.begin(); it != _Targets.end(); ++it) 00065 { 00066 if (this->isIntegrable()) 00067 { 00068 (*it)->registerIntegrableForce(this); 00069 } 00070 else 00071 { 00072 (*it)->addNonIntegrableForceRef(); 00073 } 00074 } 00075 } |
|
*************************************************************************************** From CPSLocatedBindable Release any reference this obj may have to other process of the system For example, this is used when detaching a located bindable from a system. Reimplemented from NL3D::CPSLocatedBindable. Definition at line 2272 of file ps_located.cpp. References NL3D::CPSTargetLocatedBindable::_Targets, and NL3D::CPSTargetLocatedBindable::releaseTargetRsc().
02273 { 02274 for (TTargetCont::iterator it = _Targets.begin(); it != _Targets.end(); ++it) 02275 { 02276 releaseTargetRsc(*it); 02277 (*it)->unregisterDtorObserver(this); 02278 } 02279 _Targets.clear(); 02280 CPSLocatedBindable::releaseAllRef(); 02281 } |
|
*************************************************************************************** From CPSLocatedBindable. Release any reference this obj may have on the given process. For example, this is used when detaching a located of a system. Reimplemented from NL3D::CPSLocatedBindable. Definition at line 2261 of file ps_located.cpp. References NL3D::CPSTargetLocatedBindable::_Targets, nlassert, and NL3D::CPSTargetLocatedBindable::releaseTargetRsc().
02262 { 02263 TTargetCont::iterator it = std::find(_Targets.begin(), _Targets.end(), other); 02264 if (it == _Targets.end()) return; 02265 releaseTargetRsc(*it); 02266 (*it)->unregisterDtorObserver(this); 02267 _Targets.erase(it); 02268 nlassert(std::find(_Targets.begin(), _Targets.end(), other) == _Targets.end()); 02269 } |
|
inherited from CPSLocatedBindableTarget
Reimplemented from NL3D::CPSTargetLocatedBindable. Definition at line 109 of file ps_force.cpp. References NL3D::CPSForce::isIntegrable(), NL3D::CPSLocated::releaseNonIntegrableForceRef(), and NL3D::CPSLocated::unregisterIntegrableForce().
00110 { 00111 if (this->isIntegrable()) 00112 { 00113 target->unregisterIntegrableForce(this); 00114 } 00115 else 00116 { 00117 target->releaseNonIntegrableForceRef(); 00118 } 00119 } |
|
if this force has become integrable again, this method tells it to the target
Definition at line 147 of file ps_force.cpp. References NL3D::CParticleSystemProcess::getMatrixMode(), and nlassert. Referenced by NL3D::CPSBrownianForce::setIntensity(), and NL3D::CPSGravity::setIntensity().
00148 { 00149 nlassert(_Owner); 00150 for (TTargetCont::iterator it = _Targets.begin(); it != _Targets.end(); ++it) 00151 { 00152 if ((*it)->getMatrixMode() == _Owner->getMatrixMode()) 00153 { 00154 (*it)->registerIntegrableForce(this); 00155 (*it)->releaseNonIntegrableForceRef(); 00156 } 00157 } 00158 } |
|
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 964 of file ps_force.cpp. References _Normal, nlassert, NL3D::CPSAttrib< float >::resize(), size, and uint32.
|
|
Definition at line 207 of file ps_force.h. References NL3D::CPSForceIntensity::_IntensityScheme, NL3D::CPSForceIntensity::getForceIntensityOwner(), NL3D::CPSAttribMaker< float >::hasMemory(), NL3D::CPSAttribMaker< float >::resize(), size, and uint32. Referenced by NL3D::CPSTurbul::resize(), NL3D::CPSBrownianForce::resize(), NL3D::CPSFluidFriction::resize(), and NL3D::CPSForceIntensityHelper::resize().
00208 { 00209 if (_IntensityScheme && _IntensityScheme->hasMemory()) _IntensityScheme->resize(size, getForceIntensityOwner()->getSize()); 00210 } |
|
Serial the force definition. MUST be called by deriver during their serialisation.
Reimplemented from NL3D::CPSForceIntensityHelper. Definition at line 942 of file ps_force.cpp.
00943 { 00944 f.serialVersion(1); 00945 CPSForceIntensityHelper::serial(f); 00946 f.serial(_Normal); 00947 f.serial(_Radius); 00948 f.serial(_RadialViscosity); 00949 f.serial(_TangentialViscosity); 00950 } |
|
Definition at line 190 of file ps_force.cpp. Referenced by NL3D::CPSTurbul::NLMISC_DECLARE_CLASS(), and NL3D::CPSFluidFriction::NLMISC_DECLARE_CLASS().
00191 { 00192 f.serialVersion(1); 00193 if (!f.isReading()) 00194 { 00195 if (_IntensityScheme) 00196 { 00197 bool bFalse = false; 00198 f.serial(bFalse); 00199 f.serialPolyPtr(_IntensityScheme); 00200 } 00201 else 00202 { 00203 bool bTrue = true; 00204 f.serial(bTrue); 00205 f.serial(_K); 00206 } 00207 } 00208 else 00209 { 00210 bool constantIntensity; 00211 f.serial(constantIntensity); 00212 if (constantIntensity) 00213 { 00214 f.serial(_K); 00215 } 00216 else 00217 { 00218 f.serialPolyPtr(_IntensityScheme); 00219 } 00220 } 00221 } |
|
Activate / Deactivate this object. When not active, the owning system won't try to call the 'step' method.
Definition at line 843 of file ps_located.h. References NL3D::CPSLocatedBindable::_Active. Referenced by NL3D::CParticleSystem::activateEmitters(), and NL3D::CParticleSystemInstanceUser::setActive().
00843 { _Active = active; } |
|
*************************************************************************************** set the extern ID of this located bindable. 0 means no extern access. The map of ID-locatedBindable. Is in th particle system, so this located bindable must have been attached to a particle system, otherwise an assertion is raised Definition at line 2149 of file ps_located.cpp. References NL3D::CPSLocatedBindable::_ExternID, NL3D::CParticleSystemProcess::getOwner(), NL3D::CParticleSystem::registerLocatedBindableExternID(), uint32, and NL3D::CParticleSystem::unregisterLocatedBindableExternID().
02150 { 02151 if (id == _ExternID) return; 02152 CParticleSystem *ps = NULL; 02153 if (_Owner && _Owner->getOwner()) 02154 { 02155 ps = _Owner->getOwner(); 02156 } 02157 if (ps) 02158 { 02159 ps->unregisterLocatedBindableExternID(this); 02160 _ExternID = 0; 02161 } 02162 if (id != 0) 02163 { 02164 if (ps) ps->registerLocatedBindableExternID(id, this); 02165 _ExternID = id; 02166 } 02167 } |
|
set a constant intensity for the force. this discard any previous call to setIntensityScheme
Reimplemented in NL3D::CPSGravity, and NL3D::CPSBrownianForce. Definition at line 166 of file ps_force.cpp. References NL3D::CPSForceIntensity::_IntensityScheme, NL3D::CPSForceIntensity::_K, and value. Referenced by NL3D::CPSCentralGravity::CPSCentralGravity(), CPSCylindricVortex(), NL3D::CPSDirectionnalForce::CPSDirectionnalForce(), NL3D::CPSFluidFriction::CPSFluidFriction(), and NL3D::CPSSpring::CPSSpring().
00167 { 00168 if (_IntensityScheme) 00169 { 00170 delete _IntensityScheme; 00171 _IntensityScheme = NULL; 00172 } 00173 _K = value; 00174 00175 } |
|
set a non-constant intensity
Reimplemented in NL3D::CPSGravity, and NL3D::CPSBrownianForce. Definition at line 182 of file ps_force.cpp. References NL3D::CPSForceIntensity::_IntensityScheme, NL3D::CPSForceIntensity::getForceIntensityOwner(), nlassert, and NL3D::CPSAttribMaker< T >::resize().
00183 { 00184 nlassert(scheme); 00185 delete _IntensityScheme; 00186 _IntensityScheme = scheme; 00187 if (getForceIntensityOwner() && scheme->hasMemory()) scheme->resize(getForceIntensityOwner()->getMaxSize(), getForceIntensityOwner()->getSize()); 00188 } |
|
set the LODs that apply to that object (warning : it is based on the position of the system, and don't act on a per instance basis ...) To have per instance precision, you must use an attribute maker that has LOD as its input Definition at line 952 of file ps_located.h. References NL3D::CPSLocatedBindable::_LOD.
00952 { _LOD = lod; } |
|
Implements NL3D::IPSMover. Definition at line 926 of file ps_force.cpp. References _Normal, NLMISC::CMatrix::getK(), NLMISC::CMatrix::getPos(), NL3D::CPSLocated::getPos(), index, nlassert, and uint32.
|
|
set the located bindable name (edition purpose)
Definition at line 946 of file ps_located.h.
00946 { _Name = name; } |
|
if the object only stores a normal, this set the normal of the object. Otherwise it has no effect
Reimplemented from NL3D::IPSMover. Definition at line 752 of file ps_force.h. References _Normal, index, and uint32.
|
|
***************************************************************************************
Reimplemented in NL3D::CPSEmitter. Definition at line 1948 of file ps_located.cpp. References NL3D::CParticleSystem::addRefForUserSysCoordInfo(), NL3D::CPSLocatedBindable::deleteElement(), NL3D::CParticleSystemProcess::getOwner(), NL3D::CPSLocated::getSize(), NL3D::CPSLocatedBindable::getUserMatrixUsageCount(), NL3D::CPSLocatedBindable::releaseAllRef(), NL3D::CParticleSystem::releaseRefForUserSysCoordInfo(), and uint. Referenced by NL3D::CPSLocated::bind(), and NL3D::CPSLocated::unbind().
01949 { 01950 if (psl == _Owner) return; 01951 if (psl == NULL) 01952 { 01953 releaseAllRef(); 01954 if (_Owner) 01955 { 01956 // empty this located bindable. Need to be empty if it must be rebound to another located. 01957 for (uint k = 0; k < _Owner->getSize(); ++k) 01958 { 01959 deleteElement(0); 01960 } 01961 } 01962 } 01963 if (_Owner && _Owner->getOwner()) 01964 { 01965 _Owner->getOwner()->releaseRefForUserSysCoordInfo(getUserMatrixUsageCount()); 01966 } 01967 _Owner = psl; 01968 if (_Owner && _Owner->getOwner()) 01969 { 01970 _Owner->getOwner()->addRefForUserSysCoordInfo(getUserMatrixUsageCount()); 01971 } 01972 } |
|
Definition at line 758 of file ps_force.h. References _RadialViscosity, and v.
00758 { _RadialViscosity = v; } |
|
Reimplemented in NL3D::CPSEmitterRectangle, NL3D::CPSZoneCylinder, and NL3D::CPSZoneRectangle. Definition at line 78 of file ps_edit.h. References index, s, and uint32.
00078 {} |
|
Reimplemented from NL3D::IPSMover. Definition at line 748 of file ps_force.h. References uint32.
00748 { _Radius[k] = scale; } |
|
Definition at line 761 of file ps_force.h. References _TangentialViscosity, and v.
00761 { _TangentialViscosity = v; } |
|
|
Reimplemented in NL3D::CPSFluidFriction, and NL3D::CPSTurbul. Definition at line 182 of file ps_force.h. References uint32.
00182 { } |
|
Reimplemented in NL3D::CPSDot, NL3D::CPSFanLight, NL3D::CPSMesh, NL3D::CPSConstraintMesh, NL3D::CPSParticle, NL3D::CPSQuad, NL3D::CPSRibbon, NL3D::CPSRibbonLookAt, NL3D::CPSShockWave, and NL3D::CPSTailDot. Definition at line 980 of file ps_located.h. References value.
00980 {} |
|
Show the force (edition mode).
Implements NL3D::CPSForce. Definition at line 900 of file ps_force.cpp. References _Normal, NL3D::CParticleSystem::getCurrentEditedElement(), NL3D::CPSLocatedBindable::getDriver(), NL3D::CPSLocatedBindable::getFontGenerator(), NL3D::CPSLocatedBindable::getFontManager(), NL3D::CParticleSystemProcess::getOwner(), NL3D::CPSLocated::getPos(), NL3D::CPSLocated::getSize(), index, nlassert, NL3D::CPSLocatedBindable::setupDriverModelMatrix(), NL3D::TAnimationTime, uint, and uint32.
00901 { 00902 00903 CPSLocated *loc; 00904 uint32 index; 00905 CPSLocatedBindable *lb; 00906 _Owner->getOwner()->getCurrentEditedElement(loc, index, lb); 00907 00908 00909 // must have set this 00910 nlassert(getFontGenerator() && getFontGenerator()); 00911 setupDriverModelMatrix(); 00912 00913 for (uint k = 0; k < _Owner->getSize(); ++k) 00914 { 00915 const CRGBA col = ((lb == NULL || this == lb) && loc == _Owner && index == k ? CRGBA::Red : CRGBA(127, 127, 127)); 00916 CMatrix m; 00917 CPSUtil::buildSchmidtBasis(_Normal[k], m); 00918 CPSUtil::displayDisc(*getDriver(), _Radius[k], _Owner->getPos()[k], m, 32, col); 00919 CPSUtil::displayArrow(getDriver(), _Owner->getPos()[k], _Normal[k], 1.f, col, CRGBA(200, 0, 200)); 00920 // display a V letter at the center 00921 CPSUtil::print(getDriver(), std::string("v"), *getFontGenerator(), *getFontManager(), _Owner->getPos()[k], 80.f); 00922 } 00923 00924 } |
|
process one pass for the force Implements NL3D::CPSLocatedBindable. Definition at line 78 of file ps_force.cpp. References NL3D::CPSForce::performDynamic(), NL3D::PSMotion, NL3D::PSToolRender, NL3D::CPSForce::show(), and NL3D::TAnimationTime.
00079 { 00080 switch(pass) 00081 { 00082 case PSMotion: 00083 performDynamic(ellapsedTime); 00084 break; 00085 case PSToolRender: 00086 show(ellapsedTime); 00087 break; 00088 default: break; 00089 } 00090 } |
|
Send back true if non-uniform scaling can be applied If it sends false, non-uniform scaling leads to undefine results (default has no effect) Reimplemented from NL3D::IPSMover. Definition at line 747 of file ps_force.h.
00747 { return false; } |
|
Send back true if uniform scaling can be applied If it sends false, uniform scaling leads to undefine results Reimplemented from NL3D::IPSMover. Definition at line 746 of file ps_force.h.
00746 { return true; } |
|
PRIVATE USE : called by the system when its date has been manually changed. This his usually for object that expect time to be always increasing, so that they can reset their datas Reimplemented in NL3D::CPSRibbonBase. Definition at line 1038 of file ps_located.h.
01038 {} |
|
Definition at line 128 of file ps_force.h. |
|
Reimplemented from NL3D::CPSLocatedBindable. Definition at line 127 of file ps_force.h. |
|
Definition at line 1033 of file ps_located.h. Referenced by NL3D::CPSLocatedBindable::isActive(), and NL3D::CPSLocatedBindable::setActive(). |
|
Definition at line 1027 of file ps_located.h. Referenced by NL3D::CPSLocatedBindable::getExternID(), NL3D::CPSLocatedBindable::setExternID(), and NL3D::CPSLocatedBindable::~CPSLocatedBindable(). |
|
|
Definition at line 196 of file ps_force.h. Referenced by NL3D::CPSForceIntensity::getIntensity(), and NL3D::CPSForceIntensity::setIntensity(). |
|
tells when this object must be dealt with
Definition at line 1029 of file ps_located.h. Referenced by NL3D::CPSLocatedBindable::getLOD(), and NL3D::CPSLocatedBindable::setLOD(). |
|
Definition at line 1031 of file ps_located.h. |
|
Definition at line 781 of file ps_force.h. Referenced by deleteElement(), getMatrix(), getNormal(), newElement(), performDynamic(), resize(), setMatrix(), setNormal(), and show(). |
|
|
Definition at line 786 of file ps_force.h. Referenced by CPSCylindricVortex(), getRadialViscosity(), performDynamic(), and setRadialViscosity(). |
|
Definition at line 783 of file ps_force.h. |
|
Definition at line 789 of file ps_force.h. Referenced by CPSCylindricVortex(), getTangentialViscosity(), performDynamic(), and setTangentialViscosity(). |
|