NL3D::CPSForce Class Reference

All forces in the system derive from this class It has a list with all located on which the force can apply. More...

#include <ps_force.h>

Inherits NL3D::CPSTargetLocatedBindable.

Inherited by NL3D::CIsotropicForceT< CPSFluidFrictionFunctor >, NL3D::CIsotropicForceT< CPSTurbulForceFunc >, NL3D::CIsotropicForceT< T >, and NL3D::CPSForceIntensityHelper.

List of all members.

Public Member Functions

 CPSForce ()
 Constructor.
uint32 getType (void) const
 return this bindable type
virtual uint32 getPriority (void) const
 return priority for forces
virtual bool doesProduceBBox (void) const
 Override of CPSLocatedBindable::doesProduceBBox. forces usually are not part of the bbox.
virtual void step (TPSProcessPass pass)
 process one pass for the force
virtual void computeForces (CPSLocated &target)=0
 Compute the force on the targets. To be called inside the sim loop.
virtual void show ()=0
 Show the force (edition mode).
virtual void serial (NLMISC::IStream &f) throw (NLMISC::EStream)
 Serial the force definition. MUST be called by deriver during their serialisation.
virtual bool isIntegrable (void) const
 check whether this force is integrable over time. The default is false
virtual void attachTarget (CPSLocated *ptr)
 inherited from CPSLocatedBindableTarget, we use that to tell whether this force is integrable or not
void releaseTargetRsc (CPSLocated *target)
 inherited from CPSLocatedBindableTarget
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
 Integrate this force on the given located.
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
 Compute a trajectory on several steps for a single object, rather than a step for several object.

Protected Member Functions

void registerToTargets (void)
 register integrable and non-integrable forces to the targets
void cancelIntegrable (void)
 if this force is not integrable anymore, it tells that to its targets
void renewIntegrable (void)
 if this force has become integrable again, this method tells it to the target
virtual void basisChanged (TPSMatrixMode systemBasis)
 inherited from CPSLocatedBindable.
virtual void newElement (const CPSEmitterInfo &info)=0
 Generate a new element for this bindable.
virtual void deleteElement (uint32 index)=0
 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)=0
 Resize the bindable attributes containers DERIVERS SHOULD CALL THEIR PARENT VERSION should not be called directly.

Friends

class CPSLocated
class CPSForceIntensity

Detailed Description

All forces in the system derive from this class It has a list with all located on which the force can apply.

Only the motion and toolRender passes are supported for a force. Not sharable accross systems.

Author:
Nicolas Vizerie
Nevrax France
Date:
2001

Definition at line 49 of file ps_force.h.


Constructor & Destructor Documentation

NL3D::CPSForce::CPSForce (  ) 

Constructor.

Definition at line 44 of file ps_force.cpp.

References NL_PS_FUNC.


Member Function Documentation

void NL3D::CPSForce::attachTarget ( CPSLocated ptr  )  [virtual]

inherited from CPSLocatedBindableTarget, we use that to tell whether this force is integrable or not

Reimplemented from NL3D::CPSTargetLocatedBindable.

Definition at line 91 of file ps_force.cpp.

References NL3D::CPSLocatedBindable::_Owner, NL3D::CPSLocated::addNonIntegrableForceRef(), isIntegrable(), NL_PS_FUNC, nlassert, and NL3D::CPSLocated::registerIntegrableForce().

void NL3D::CPSForce::basisChanged ( TPSMatrixMode  systemBasis  )  [protected, virtual]

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 122 of file ps_force.cpp.

References NL3D::CPSTargetLocatedBindable::_Targets, isIntegrable(), and NL_PS_FUNC.

void NL3D::CPSForce::cancelIntegrable ( void   )  [protected]
virtual void NL3D::CPSForce::computeForces ( CPSLocated target  )  [pure virtual]
virtual void NL3D::CPSForce::deleteElement ( uint32  index  )  [protected, pure 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.

Implements NL3D::CPSLocatedBindable.

Implemented in NL3D::CPSForceIntensityHelper, NL3D::CIsotropicForceT< T >, NL3D::CPSFluidFriction, NL3D::CPSBrownianForce, NL3D::CPSTurbul, NL3D::CPSCylindricVortex, NL3D::CIsotropicForceT< CPSTurbulForceFunc >, and NL3D::CIsotropicForceT< CPSFluidFrictionFunctor >.

virtual bool NL3D::CPSForce::doesProduceBBox ( void   )  const [inline, virtual]

Override of CPSLocatedBindable::doesProduceBBox. forces usually are not part of the bbox.

Reimplemented from NL3D::CPSLocatedBindable.

Definition at line 65 of file ps_force.h.

virtual uint32 NL3D::CPSForce::getPriority ( void   )  const [inline, virtual]

return priority for forces

Implements NL3D::CPSLocatedBindable.

Definition at line 62 of file ps_force.h.

uint32 NL3D::CPSForce::getType ( void   )  const [inline, virtual]

return this bindable type

Implements NL3D::CPSLocatedBindable.

Definition at line 57 of file ps_force.h.

References NL3D::PSForce.

virtual void NL3D::CPSForce::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 [inline, virtual]

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 97 of file ps_force.h.

References nlassert.

virtual void NL3D::CPSForce::integrateSingle ( float  startDate,
float  deltaT,
uint  numStep,
const CPSLocated src,
uint32  indexInLocated,
NLMISC::CVector destPos,
bool  accumulate = false,
uint  posStride = sizeof(NLMISC::CVector) 
) const [inline, virtual]

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 110 of file ps_force.h.

References nlassert.

virtual bool NL3D::CPSForce::isIntegrable ( void   )  const [inline, virtual]

check whether this force is integrable over time. The default is false

Reimplemented in NL3D::CPSGravity, and NL3D::CPSBrownianForce.

Definition at line 83 of file ps_force.h.

Referenced by attachTarget(), basisChanged(), registerToTargets(), and releaseTargetRsc().

virtual void NL3D::CPSForce::newElement ( const CPSEmitterInfo info  )  [protected, pure virtual]
void NL3D::CPSForce::registerToTargets ( void   )  [protected]

register integrable and non-integrable forces to the targets

Definition at line 60 of file ps_force.cpp.

References NL3D::CPSTargetLocatedBindable::_Targets, isIntegrable(), and NL_PS_FUNC.

Referenced by NL3D::CPSTurbul::serial(), and NL3D::CPSFluidFriction::serial().

void NL3D::CPSForce::releaseTargetRsc ( CPSLocated target  )  [virtual]

inherited from CPSLocatedBindableTarget

Reimplemented from NL3D::CPSTargetLocatedBindable.

Definition at line 107 of file ps_force.cpp.

References isIntegrable(), NL_PS_FUNC, NL3D::CPSLocated::releaseNonIntegrableForceRef(), and NL3D::CPSLocated::unregisterIntegrableForce().

void NL3D::CPSForce::renewIntegrable ( void   )  [protected]

if this force has become integrable again, this method tells it to the target

Definition at line 148 of file ps_force.cpp.

References NL3D::CPSLocatedBindable::_Owner, NL3D::CPSTargetLocatedBindable::_Targets, NL3D::CParticleSystemProcess::getMatrixMode(), NL_PS_FUNC, and nlassert.

Referenced by NL3D::CPSBrownianForce::setIntensity(), and NL3D::CPSGravity::setIntensity().

virtual void NL3D::CPSForce::resize ( uint32  size  )  [protected, pure virtual]

Resize the bindable attributes containers DERIVERS SHOULD CALL THEIR PARENT VERSION should not be called directly.

Call CPSLOcated::resize instead

Implements NL3D::CPSLocatedBindable.

Implemented in NL3D::CPSForceIntensityHelper, NL3D::CIsotropicForceT< T >, NL3D::CPSFluidFriction, NL3D::CPSBrownianForce, NL3D::CPSTurbul, NL3D::CPSCylindricVortex, NL3D::CIsotropicForceT< CPSTurbulForceFunc >, and NL3D::CIsotropicForceT< CPSFluidFrictionFunctor >.

void NL3D::CPSForce::serial ( NLMISC::IStream f  )  throw (NLMISC::EStream) [virtual]
virtual void NL3D::CPSForce::show (  )  [pure virtual]
void NL3D::CPSForce::step ( TPSProcessPass  pass  )  [virtual]

process one pass for the force

Implements NL3D::CPSLocatedBindable.

Definition at line 77 of file ps_force.cpp.

References NL_PS_FUNC, NL3D::PSToolRender, and show().


Friends And Related Function Documentation

friend class CPSForceIntensity [friend]

Definition at line 126 of file ps_force.h.

friend class CPSLocated [friend]

Reimplemented from NL3D::CPSTargetLocatedBindable.

Definition at line 125 of file ps_force.h.


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

Generated on Thu Jan 7 08:30:08 2010 for NeL by  doxygen 1.6.1