NL3D::CPSZoneCylinder Class Reference

#include <ps_zone.h>

Inheritance diagram for NL3D::CPSZoneCylinder:

NL3D::CPSZone NL3D::IPSMover NL3D::CPSTargetLocatedBindable NL3D::CPSLocatedBindable NLMISC::IStreamable NLMISC::IClassable

Detailed Description

a caped cylinder

Definition at line 291 of file ps_zone.h.

Public Types

enum  TCollisionBehaviour { bounce = 0, destroy = 1 }
 behaviour when a collision occurs More...


Public Member Functions

virtual void attachTarget (CPSLocated *ptr)
 Add a new type of located for this zone to apply on. nlassert if already present.

virtual void basisChanged (TPSMatrixMode systemBasis)
virtual bool completeBBox (NLMISC::CAABBox &box) const
NLMISC::CVector computeI (void) const
NLMISC::CVector computeJ (void) const
NLMISC::CVector computeK (void) const
 CPSZoneCylinder ()
void detachTarget (CPSLocated *ptr)
virtual bool doesProduceBBox (void) const
virtual void enumTexs (std::vector< NLMISC::CSmartPtr< ITexture > > &dest, IDriver &drv)
virtual void finalize (void)
 ***************************************************************************************

float getBounceFactor (void) const
 get the bounce factor. It has meaning only if the behaviour is set to bounce...

virtual std::string getClassName ()=0
TCollisionBehaviour getCollisionBehaviour (void) const
IDrivergetDriver () const
 shortcut to get an instance of the driver

uint32 getExternID (void) const
 get the extern ID of this located bindable

const CFontGeneratorgetFontGenerator (void) const
 Shortcut to get the font generator if one was set (const version).

CFontGeneratorgetFontGenerator (void)
 Shortcut to get the font generator if one was set.

const CFontManagergetFontManager (void) const
 Shortcut to get the font manager if one was set (const version).

CFontManagergetFontManager (void)
 ***************************************************************************************

const NLMISC::CMatrixgetInvertedSysMat (void) const
 shortcut to get the inverted matrix of the system

const NLMISC::CMatrixgetInvertedViewMat (void) const
 shortcut to get the inverted view matrix

const NLMISC::CMatrixgetLocalToWorldMatrix () 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 CPSLocatedgetOwner (void) const
 get the located that owns this bindable (const version)

CPSLocatedgetOwner (void)
 get the located that owns this bindable

virtual uint32 getPriority (void) const
virtual NLMISC::CVector getScale (uint32 k) const
const NLMISC::CMatrixgetSysMat (void) const
 ***************************************************************************************

const CPSLocatedgetTarget (uint32 index) const
 Return a const ptr on a target. Invalid range -> nlassert.

CPSLocatedgetTarget (uint32 index)
 Return a ptr on a target. Invalid range -> nlassert.

virtual uint32 getType (void) const
virtual bool getUserMatrixUsageCount () const
const NLMISC::CMatrixgetViewMat (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

bool isActive () const
virtual void motionTypeChanged (bool parametric)
 called when a located has switch between incrmental / parametric motion. The default does nothing

 NLMISC_DECLARE_CLASS (CPSZoneCylinder)
virtual bool onlyStoreNormal (void) const
virtual void performMotion (TAnimationTime ellapsedTime)
 This is usually called by the step method for the pass dedicated to zone.

virtual void releaseAllRef ()
 ***************************************************************************************

virtual void releaseRefTo (const CParticleSystemProcess *other)
 ***************************************************************************************

virtual void releaseTargetRsc (CPSLocated *target)
 inherit from CPSTargetLocatedBindable. Its called when one of the targets has been detroyed

virtual void serial (NLMISC::IStream &f) throw (NLMISC::EStream)
 serialization, DERIVER must override this, and call the parent version

void setActive (bool active)
 Activate / Deactivate this object. When not active, the owning system won't try to call the 'step' method.

void setBounceFactor (float bounceFactor)
 set the bounce factor. It has meaning only if the behaviour is set to bounce...

void setCollisionBehaviour (TCollisionBehaviour behaviour)
void setExternID (uint32 id)
 ***************************************************************************************

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

virtual void setScale (uint32 k, const NLMISC::CVector &s)
virtual void setScale (uint32 k, float scale)
void setupDriverModelMatrix (void)
 shortcut to setup the model matrix (system basis or world basis)

virtual void setZBias (float value)
virtual void show (TAnimationTime ellapsedTime)
 Show the zone (edition mode).

virtual void step (TPSProcessPass pass, TAnimationTime ellapsedTime, TAnimationTime realEt)
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 bounceOccured (uint32 index)
NLMISC::CMatrix buildBasis (uint32 index) const
virtual void deleteElement (uint32 index)
void displayIcon2d (const NLMISC::CVector tab[], uint nbSegs, float scale)
 ***************************************************************************************

virtual void newElement (CPSLocated *emitterLocated, uint32 emitterIndex)
virtual void notifyTargetRemoved (CPSLocated *ptr)
 ***************************************************************************************

virtual void resize (uint32 size)
virtual void setOwner (CPSLocated *psl)
 ***************************************************************************************


Protected Attributes

bool _Active
CPSAttrib< CPlaneBasis_Basis
float _BounceFactor
TCollisionBehaviour _CollisionBehaviour
TPSAttribVector _Dim
uint32 _ExternID
TPSLod _LOD
 tells when this object must be dealt with

std::string _Name
CPSLocated_Owner
TTargetCont _Targets

Friends

class CPSLocated


Member Typedef Documentation

typedef CPSVector<CPSLocated *>::V NL3D::CPSTargetLocatedBindable::TTargetCont [protected, inherited]
 

Definition at line 1122 of file ps_located.h.


Member Enumeration Documentation

enum NL3D::CPSZone::TCollisionBehaviour [inherited]
 

behaviour when a collision occurs

Enumeration values:
bounce 
destroy 

Definition at line 62 of file ps_zone.h.

Referenced by NL3D::CPSZone::getCollisionBehaviour().

00062 { bounce = 0, destroy = 1 };


Constructor & Destructor Documentation

NL3D::CPSZoneCylinder::CPSZoneCylinder  )  [inline]
 

Definition at line 297 of file ps_zone.h.

00298                 {
00299                         if (CParticleSystem::getSerializeIdentifierFlag()) _Name = std::string("ZoneCylinder");
00300                 }


Member Function Documentation

void NL3D::CPSZone::attachTarget CPSLocated ptr  )  [virtual, inherited]
 

Add a new type of located for this zone to apply on. nlassert if already present.

Add a new type of located for this zone to apply on. We override this to queery the target to allocate the CollisionInfo attribute

Reimplemented from NL3D::CPSTargetLocatedBindable.

Definition at line 73 of file ps_zone.cpp.

References NL3D::CPSLocated::addNonIntegrableForceRef(), and NL3D::CPSLocated::queryCollisionInfo().

00074 {
00075                 
00076         CPSTargetLocatedBindable::attachTarget(ptr);
00077         ptr->queryCollisionInfo();
00078         ptr->addNonIntegrableForceRef();
00079 }

virtual void NL3D::CPSLocatedBindable::basisChanged TPSMatrixMode  systemBasis  )  [inline, virtual, inherited]
 

Called when the basis of the owner changed. the default behaviour does nothing

Parameters:
newBasis : True if in the system basis, false for the world basis.

Reimplemented in NL3D::CPSForce.

Definition at line 968 of file ps_located.h.

00968 {}

virtual void NL3D::CPSLocatedBindable::bounceOccured uint32  index  )  [inline, protected, virtual, inherited]
 

a bounce occured, so some action could be done. The default behaviour does nothing

Parameters:
index the index of the element that bounced

Reimplemented in NL3D::CPSEmitter.

Definition at line 1011 of file ps_located.h.

References index, and uint32.

01011 {}

NLMISC::CMatrix NL3D::CPSZoneCylinder::buildBasis uint32  index  )  const [protected]
 

virtual bool NL3D::CPSLocatedBindable::completeBBox NLMISC::CAABBox box  )  const [inline, virtual, inherited]
 

Reimplemented in NL3D::CPSFanLight, NL3D::CPSQuad, and NL3D::CPSShockWave.

Definition at line 884 of file ps_located.h.

00884 { return false ;}

NLMISC::CVector NL3D::CPSLocatedBindable::computeI void   )  const [inline, inherited]
 

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(); }

NLMISC::CVector NL3D::CPSLocatedBindable::computeJ void   )  const [inline, inherited]
 

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(); }

NLMISC::CVector NL3D::CPSLocatedBindable::computeK void   )  const [inline, inherited]
 

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(); }

void NL3D::CPSZoneCylinder::deleteElement uint32  index  )  [protected, virtual]
 

Delete an element given its index Attributes of the located that hold this bindable (pos etc...) are still accessible for the given index. index out of range -> nl_assert

Implements NL3D::CPSLocatedBindable.

Definition at line 1260 of file ps_zone.cpp.

References _Dim, index, NL3D::CPSAttrib< T >::remove(), NL3D::CPSAttrib< CPlaneBasis >::remove(), and uint32.

01261 {
01262         _Basis.remove(index);
01263         _Dim.remove(index);
01264 }

void NL3D::CPSTargetLocatedBindable::detachTarget CPSLocated ptr  )  [inline, inherited]
 

remove a target

See also:
attachTarget

Definition at line 1076 of file ps_located.h.

References NL3D::CPSTargetLocatedBindable::notifyTargetRemoved().

01077         {
01078                 notifyTargetRemoved(ptr);
01079         }

void NL3D::CPSLocatedBindable::displayIcon2d const NLMISC::CVector  tab[],
uint  nbSegs,
float  scale
[protected, inherited]
 

***************************************************************************************

show an drawing to represent the object, and in red if it is selected

Parameters:
tab : a table of 2 * nbSeg vector. only the x and y coordinates are used
nbSeg : the number of segment
scale : the scale to use for drawing

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 }

virtual bool NL3D::CPSLocatedBindable::doesProduceBBox void   )  const [inline, virtual, inherited]
 

Reimplemented in NL3D::CPSForce.

Definition at line 888 of file ps_located.h.

00888 { return true; }

virtual void NL3D::CPSLocatedBindable::enumTexs std::vector< NLMISC::CSmartPtr< ITexture > > &  dest,
IDriver drv
[inline, virtual, inherited]
 

Reimplemented in NL3D::CPSFanLight, NL3D::CPSQuad, NL3D::CPSRibbon, NL3D::CPSRibbonLookAt, and NL3D::CPSShockWave.

Definition at line 977 of file ps_located.h.

00977 {}

void NL3D::CPSTargetLocatedBindable::finalize void   )  [virtual, inherited]
 

***************************************************************************************

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 }

float NL3D::CPSZone::getBounceFactor void   )  const [inline, inherited]
 

get the bounce factor. It has meaning only if the behaviour is set to bounce...

Definition at line 111 of file ps_zone.h.

References NL3D::CPSZone::_BounceFactor.

00111 { return  _BounceFactor; }

virtual std::string NLMISC::IClassable::getClassName  )  [pure virtual, inherited]
 

Implemented in NLAIAGENT::CNumericIndex, NLAIC::IPointerGestion, NLAIC::CIdentType, and CAutomataDesc.

Referenced by NLMISC::CClassRegistry::checkObject(), and NL3D::GetTextureSize().

TCollisionBehaviour NL3D::CPSZone::getCollisionBehaviour void   )  const [inline, inherited]
 

Definition at line 116 of file ps_zone.h.

References NL3D::CPSZone::_CollisionBehaviour, and NL3D::CPSZone::TCollisionBehaviour.

00116 { return _CollisionBehaviour; }

IDriver* NL3D::CPSLocatedBindable::getDriver void   )  const [inline, inherited]
 

shortcut to get an instance of the driver

Definition at line 890 of file ps_located.h.

References NL3D::CPSLocated::getDriver(), and nlassert.

Referenced by NL3D::CPSLocatedBindable::displayIcon2d(), NL3D::CPSTailDot::displayRibbons(), NL3D::CPSRibbonLookAt::displayRibbons(), NL3D::CPSRibbon::displayRibbons(), NL3D::CPSDot::draw(), NL3D::CPSFaceHelper::drawFaces(), NL3D::CPSFanLightHelper::drawFanLight(), NL3D::CPSFaceLookAtHelper::drawLookAt(), NL3D::CPSFaceLookAtHelper::drawLookAtAlignOnMotion(), NL3D::CPSConstraintMeshHelper::drawMeshs(), NL3D::CPSConstraintMeshHelper::drawPrerotatedMeshs(), NL3D::CPSZoneRectangle::show(), show(), NL3D::CPSZoneDisc::show(), NL3D::CPSZoneSphere::show(), NL3D::CPSZonePlane::show(), NL3D::CPSLight::show(), NL3D::CPSCylindricVortex::show(), NL3D::CPSGravity::show(), NL3D::CPSDirectionnalForce::show(), NL3D::CPSSphericalEmitter::showTool(), NL3D::CPSEmitterRectangle::showTool(), and NL3D::CPSEmitter::showTool().

00891          { 
00892                  nlassert(_Owner);
00893                  nlassert(_Owner->getDriver());
00894                  return _Owner->getDriver();
00895          }              

uint32 NL3D::CPSLocatedBindable::getExternID void   )  const [inline, inherited]
 

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; }

const CFontGenerator* NL3D::CPSLocatedBindable::getFontGenerator void   )  const [inline, inherited]
 

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.

00905          {
00906                 nlassert(_Owner);
00907                 return _Owner->getFontGenerator();
00908          }

CFontGenerator* NL3D::CPSLocatedBindable::getFontGenerator void   )  [inline, inherited]
 

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(), show(), NL3D::CPSZoneDisc::show(), NL3D::CPSZonePlane::show(), NL3D::CPSCylindricVortex::show(), NL3D::CPSGravity::show(), and NL3D::CPSEmitterRectangle::showTool().

00898          {
00899                 nlassert(_Owner);
00900                 return _Owner->getFontGenerator();
00901          }

const CFontManager * NL3D::CPSLocatedBindable::getFontManager void   )  const [inherited]
 

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.

02100 {
02101         nlassert(_Owner);
02102         return _Owner->getFontManager();
02103 }

CFontManager * NL3D::CPSLocatedBindable::getFontManager void   )  [inherited]
 

***************************************************************************************

Definition at line 2091 of file ps_located.cpp.

References NL3D::CParticleSystemProcess::getFontManager(), and nlassert.

Referenced by NL3D::CPSZoneRectangle::show(), show(), NL3D::CPSZoneDisc::show(), NL3D::CPSZonePlane::show(), NL3D::CPSCylindricVortex::show(), NL3D::CPSGravity::show(), and NL3D::CPSEmitterRectangle::showTool().

02092 {
02093         nlassert(_Owner);
02094         return _Owner->getFontManager();
02095 }

const NLMISC::CMatrix & NL3D::CPSLocatedBindable::getInvertedSysMat void   )  const [inherited]
 

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.

02117 {
02118         nlassert(_Owner);
02119                 return _Owner->getOwner()->getInvertedSysMat();
02120 
02121 }

const NLMISC::CMatrix & NL3D::CPSLocatedBindable::getInvertedViewMat void   )  const [inherited]
 

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.

02135 {
02136         nlassert(_Owner);
02137         return _Owner->getOwner()->getInvertedViewMat();        
02138 }       

const NLMISC::CMatrix & NL3D::CPSLocatedBindable::getLocalToWorldMatrix  )  const [inline, inherited]
 

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(), show(), NL3D::CPSZoneDisc::show(), NL3D::CPSZonePlane::show(), NL3D::CPSLight::show(), NL3D::CPSGravity::show(), NL3D::CPSEmitterRectangle::showTool(), NL3D::CPSLight::step(), and NL3D::CPSMesh::updatePos().

01145 {
01146         nlassert(_Owner);
01147         return _Owner->getLocalToWorldMatrix();
01148 }

TPSLod NL3D::CPSLocatedBindable::getLOD void   )  const [inline, inherited]
 

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; }

CMatrix NL3D::CPSZoneCylinder::getMatrix uint32  index  )  const [virtual]
 

Implements NL3D::IPSMover.

Definition at line 1212 of file ps_zone.cpp.

References NL3D::CPSLocated::getPos(), index, NLMISC::CMatrix::setPos(), NLMISC::CMatrix::setRot(), and uint32.

01213 {
01214         CMatrix m;
01215         m.setRot(_Basis[index].X, _Basis[index].Y, _Basis[index].X ^_Basis[index].Y);
01216         m.setPos(_Owner->getPos()[index]);      
01217         return m;
01218 }

std::string NL3D::CPSLocatedBindable::getName void   )  const [inline, inherited]
 

get the located bindable name (edition purpose)

Definition at line 948 of file ps_located.h.

00948 { return _Name; }       

uint32 NL3D::CPSTargetLocatedBindable::getNbTargets void   )  const [inline, inherited]
 

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(); }

virtual NLMISC::CVector NL3D::IPSMover::getNormal uint32  index  )  [inline, virtual, inherited]
 

if the object only needs a normal, this return the normal. If not, is return (0, 0, 0)

Reimplemented in NL3D::CPSCylindricVortex, NL3D::CPSZonePlane, and NL3D::CPSZoneDisc.

Definition at line 89 of file ps_edit.h.

References index, and uint32.

00089 { return NLMISC::CVector::Null ; }

const CPSLocated* NL3D::CPSLocatedBindable::getOwner void   )  const [inline, inherited]
 

get the located that owns this bindable (const version)

Definition at line 944 of file ps_located.h.

00944 { return _Owner; }              

CPSLocated* NL3D::CPSLocatedBindable::getOwner void   )  [inline, inherited]
 

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; }

virtual uint32 NL3D::CPSZone::getPriority void   )  const [inline, virtual, inherited]
 

Get the priority of the bindable The more high it is, the earlier it is dealt with

Implements NL3D::CPSLocatedBindable.

Definition at line 76 of file ps_zone.h.

References uint32.

00076 { return 3500; }

CVector NL3D::CPSZoneCylinder::getScale uint32  k  )  const [virtual]
 

Reimplemented from NL3D::IPSMover.

Definition at line 1226 of file ps_zone.cpp.

References _Dim, and uint32.

01227 {
01228         return _Dim[k];
01229 }

const NLMISC::CMatrix & NL3D::CPSLocatedBindable::getSysMat void   )  const [inherited]
 

***************************************************************************************

Definition at line 2108 of file ps_located.cpp.

References NL3D::CParticleSystemProcess::getOwner(), NL3D::CParticleSystem::getSysMat(), and nlassert.

02109 {
02110         nlassert(_Owner);               
02111         return _Owner->getOwner()->getSysMat();
02112 }

const CPSLocated* NL3D::CPSTargetLocatedBindable::getTarget uint32  index  )  const [inline, inherited]
 

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.

01100         {
01101                 nlassert(index < _Targets.size());
01102                 return _Targets[index];
01103         }               

CPSLocated* NL3D::CPSTargetLocatedBindable::getTarget uint32  index  )  [inline, inherited]
 

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().

01094         {
01095                 nlassert(index < _Targets.size());
01096                 return _Targets[index];
01097         }

virtual uint32 NL3D::CPSZone::getType void   )  const [inline, virtual, inherited]
 

Gives the type for this bindable.

Implements NL3D::CPSLocatedBindable.

Definition at line 70 of file ps_zone.h.

References NL3D::PSZone, and uint32.

00070 { return PSZone; }

virtual bool NL3D::CPSLocatedBindable::getUserMatrixUsageCount  )  const [inline, virtual, inherited]
 

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; }

const NLMISC::CMatrix & NL3D::CPSLocatedBindable::getViewMat void   )  const [inherited]
 

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().

02126 {
02127         nlassert(_Owner);
02128         return _Owner->getOwner()->getViewMat();        
02129 }       

virtual bool NL3D::CPSLocatedBindable::hasEmitters void   )  const [inline, virtual, inherited]
 

tells wether there are alive emitters

Definition at line 958 of file ps_located.h.

00958 { return false; }

virtual bool NL3D::CPSLocatedBindable::hasParticles void   )  const [inline, virtual, inherited]
 

tells wether there are alive entities / particles

Reimplemented in NL3D::CPSParticle.

Definition at line 956 of file ps_located.h.

00956 { return false; }

bool NL3D::CPSLocatedBindable::isActive  )  const [inline, inherited]
 

Definition at line 844 of file ps_located.h.

References NL3D::CPSLocatedBindable::_Active.

Referenced by NL3D::CParticleSystem::hasActiveEmitters().

00844 { return _Active; }                             

virtual void NL3D::CPSLocatedBindable::motionTypeChanged bool  parametric  )  [inline, virtual, inherited]
 

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 {}

void NL3D::CPSZoneCylinder::newElement CPSLocated emitterLocated,
uint32  emitterIndex
[protected, virtual]
 

Generate a new element for this bindable. They are generated according to the propertie of the class

Implements NL3D::CPSLocatedBindable.

Definition at line 1254 of file ps_zone.cpp.

References _Dim, NL3D::CPSAttrib< T >::insert(), NL3D::CPSAttrib< CPlaneBasis >::insert(), and uint32.

01255 {
01256         _Basis.insert(CPlaneBasis(CVector::K));
01257         _Dim.insert(CVector(1, 1, 1));
01258 }

NL3D::CPSZoneCylinder::NLMISC_DECLARE_CLASS CPSZoneCylinder   ) 
 

void NL3D::CPSTargetLocatedBindable::notifyTargetRemoved CPSLocated ptr  )  [protected, virtual, inherited]
 

***************************************************************************************

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().

02224 {       
02225         TTargetCont::iterator it = std::find(_Targets.begin(), _Targets.end(), ptr);
02226         nlassert(it != _Targets.end());
02227         releaseTargetRsc(*it);  
02228         _Targets.erase(it);
02229 
02230         CPSLocatedBindable::notifyTargetRemoved(ptr);   
02231 }

virtual bool NL3D::IPSMover::onlyStoreNormal void   )  const [inline, virtual, inherited]
 

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 in NL3D::CPSCylindricVortex, NL3D::CPSZonePlane, and NL3D::CPSZoneDisc.

Definition at line 86 of file ps_edit.h.

00086 { return false ; }

void NL3D::CPSZoneCylinder::performMotion TAnimationTime  ellapsedTime  )  [virtual]
 

This is usually called by the step method for the pass dedicated to zone.

Implements NL3D::CPSZone.

Definition at line 946 of file ps_zone.cpp.

References _Dim, NL3D::CPSAttrib< CPlaneBasis >::begin(), NL3D::CPSAttrib< T >::begin(), NL3D::CPSCollisionInfo::collisionZone, NL3D::CPSCollisionInfo::dist, NL3D::CPSAttrib< T >::end(), NL3D::CPSLocated::getPos(), MINI_TIMER, NLMISC::CMatrix::mulVector(), NL3D::CPSCollisionInfo::newPos, NL3D::CPSCollisionInfo::newSpeed, NLMISC::CVector::norm(), NLMISC::CVector::normalize(), NL3D::PSCollideEpsilon, NL3D::PSStatsZoneCylinder, NL3D::TAnimationTime, NL3D::TPSAttribVector, and uint32.

00947 {
00948         MINI_TIMER(PSStatsZoneCylinder)
00949         TPSAttribVector::const_iterator dimIt;
00950         CPSAttrib<CPlaneBasis>::const_iterator basisIt;
00951         TPSAttribVector::const_iterator cylinderPosIt, cylinderPosEnd, targetPosIt, targetPosEnd;
00952         CVector dest;
00953         CPSCollisionInfo ci;
00954         uint32 k;
00955         const TPSAttribVector *speedAttr;
00956 
00957 
00958 
00959         for (TTargetCont::iterator it = _Targets.begin(); it != _Targets.end(); ++it)
00960         {
00961 
00962                 speedAttr = &((*it)->getSpeed());
00963 
00964 
00965                 // cycle through the cylinders
00966 
00967                 cylinderPosEnd = _Owner->getPos().end();
00968                 for (cylinderPosIt = _Owner->getPos().begin(), basisIt = _Basis.begin(),  dimIt = _Dim.begin()
00969                                 ; cylinderPosIt != cylinderPosEnd
00970                                 ; ++cylinderPosIt, ++dimIt, ++basisIt)
00971                 {
00972                         
00973                         // we must setup the cylinder in the good basis
00974 
00975                         const CMatrix &m = CPSLocated::getConversionMatrix(*it, this->_Owner);
00976 
00977                         
00978 
00979                         // compute the new center pos
00980                         CVector center = m * *cylinderPosIt;
00981 
00982                         // compute a basis for the cylinder
00983                         CVector I = m.mulVector(basisIt->X);
00984                         CVector J = m.mulVector(basisIt->Y);
00985                         CVector K = m.mulVector(basisIt->X ^ basisIt->Y);
00986 
00987                                                 
00988                         // the pos projected (and scale) over the plane basis of the cylinder, the pos minus the center
00989                         CVector projectedPos, tPos;
00990 
00991                         // the same, but with the final position
00992                         CVector destProjectedPos, destTPos;
00993 
00994 
00995                         // deals with each particle
00996                         targetPosEnd = (*it)->getPos().end();
00997                         TPSAttribCollisionInfo::const_iterator ciIt = (*it)->getCollisionInfo().begin();
00998                         for (targetPosIt = (*it)->getPos().begin(), k = 0; targetPosIt != targetPosEnd; ++targetPosIt, ++k, ++ciIt)
00999                         {       
01000                                 const CVector &speed = (*speedAttr)[k];
01001                                 const CVector &pos = *targetPosIt;
01002 
01003                                 
01004                                 
01005                                 // check wether current pos was outside the cylinder
01006 
01007 
01008                                 tPos = pos - center;
01009                                 projectedPos = (1 / dimIt->x) * (I * tPos) * I + (1 / dimIt->y)  * (J * tPos) * J;
01010                                 
01011                                 if (!
01012                                          (
01013                                                 ((tPos * K) < dimIt->z)
01014                                                 && ((tPos * K) > -dimIt->z)
01015                                                 && (projectedPos * projectedPos < 1.f) 
01016                                          )
01017                                    )
01018                                 {
01019                                         dest = pos + ellapsedTime *  speed * ciIt->TimeSliceRatio;
01020                                         destTPos = dest - center;
01021                                         destProjectedPos = (1.f / dimIt->x) * (I * destTPos) * I + (1.f / dimIt->y)  * (J * destTPos) * J;
01022 
01023                                         // test wether the new position is inside the cylinder
01024 
01025                                         
01026                                         if (
01027                                                  (
01028                                                         ((destTPos * K) < dimIt->z)
01029                                                         && ((destTPos * K) > -dimIt->z)
01030                                                         && (destProjectedPos * destProjectedPos < 1.f) 
01031                                                  )
01032                                            )
01033                                         {
01034                                                 // now, detect the closest hit point (the smallest alpha, with alpha, the percent of the move vector
01035                                                 // to reach the hit point)
01036 
01037                                                 const float epsilon = 10E-3f;
01038 
01039                                                 float alphaTop, alphaBottom, alphaCyl;
01040 
01041                                                 const float denum = (dest - pos) * K;
01042 
01043                                                 // top plane
01044 
01045                                                 if (fabs(denum) < epsilon)
01046                                                 {
01047                                                         alphaTop = (dimIt->z - (tPos * K)) / denum;
01048                                                         if (alphaTop < 0.f) alphaTop = 1.f;
01049                                                 }
01050                                                 else
01051                                                 {
01052                                                         alphaTop = 1.f;
01053                                                 }
01054 
01055                                                 // bottom plane
01056 
01057                                                 if (fabs(denum) < epsilon)
01058                                                 {
01059                                                         alphaBottom = (- dimIt->z - (tPos * K)) / denum;
01060                                                         if (alphaBottom < 0.f) alphaBottom = 1.f;
01061                                                 }
01062                                                 else
01063                                                 {
01064                                                         alphaBottom = 1.f;
01065                                                 }
01066 
01067                                                 // cylinder
01068 
01069                                                 //expressed the src and dest positions in the cylinder basis
01070 
01071                                                 const float ox = tPos * I, oy = tPos * J, dx = (destTPos - tPos) * I, dy = (destTPos - tPos) * J;
01072 
01073                                                 // coefficients of the equation : a * alpha ^ 2 + b * alpha + c = 0
01074                                                 const float a = (dx * dx) / (dimIt->x * dimIt->x)
01075                                                                   + (dy * dy) / (dimIt->y * dimIt->y);
01076                                                 const float b = 2.f * ((ox * dx) / (dimIt->x * dimIt->x)
01077                                                                   + (oy * dy) / (dimIt->y * dimIt->y));
01078                                                 const float c = (ox * ox) / (dimIt->x * dimIt->x) + (oy * oy) / (dimIt->y * dimIt->y)  - 1;
01079 
01080                                                 // discriminant
01081                                                 const float delta = b * b - 4.f * a * c;
01082 
01083                                                 if (delta < epsilon)
01084                                                 {
01085                                                         alphaCyl = 1.f;
01086                                                 }
01087                                                 else
01088                                                 {
01089                                                         const float deltaRoot = sqrtf(delta);
01090                                                         const float r1 = (- b + 2.f * deltaRoot) / (2.f * a);
01091                                                         const float r2 = (- b - 2.f * deltaRoot) / (2.f * a);
01092 
01093                                                         if (r1 < 0.f) alphaCyl = r2;
01094                                                                 else if (r2 < 0.f) alphaCyl = r1;
01095                                                                         else alphaCyl = r1 < r2 ? r1 : r2;
01096 
01097                                                                         if (alphaCyl < 0.f) alphaCyl = 1.f;
01098                                                 }
01099 
01100 
01101                                                 // now, choose the minimum positive dist
01102 
01103                                         
01104                                                 
01105                                                 if (alphaTop < alphaBottom && alphaTop < alphaCyl)
01106                                                 {
01107                                                         // collision with the top plane
01108                                                         CVector startEnd = alphaTop * (dest - pos);
01109                                                         ci.newPos = pos + startEnd + PSCollideEpsilon * K;
01110                                                         ci.dist = startEnd.norm();
01111                                                         ci.newSpeed = (-2.f * (speed * K)) * K + speed;
01112                                                         ci.collisionZone = this;
01113                                                         
01114                                                         (*it)->collisionUpdate(ci, k);
01115                                                 }
01116                                                 else
01117                                                         if (alphaBottom < alphaCyl)
01118                                                         {       
01119                                                                 // collision with the bottom plane
01120                                                                 CVector startEnd = alphaBottom * (dest - pos);
01121                                                                 ci.newPos = pos + startEnd - PSCollideEpsilon * K;
01122                                                                 ci.dist = startEnd.norm();
01123                                                                 ci.newSpeed = (-2.f * (speed * K)) * K + speed;
01124                                                                 ci.collisionZone = this;
01125                                                 
01126                                                                 
01127                                                                 (*it)->collisionUpdate(ci, k);
01128                                                         }
01129                                                         else
01130                                                         {
01131                                                                 // collision with the cylinder
01132 
01133                                                                 CVector startEnd = alphaCyl * (dest - pos);
01134 
01135                                                                 // normal at the hit point. It is the gradient of the implicit equation x^2 / a^2 + y^2 / b^2 - R^ 2=  0
01136                                                                 // so we got unormalized n =  (2 x / a ^ 2, 2 y / b ^ 2, 0) in the basis of the cylinder
01137                                                                 // As we'll normalize it, we don't need  the 2 factor
01138                                                                 
01139                                                                 float px = ox + alphaCyl * dx;
01140                                                                 float py = oy + alphaCyl * dy;
01141 
01142                                                                 CVector normal = px / (dimIt->x * dimIt->x) * I + py / (dimIt->y * dimIt->y) * J;
01143                                                                 normal.normalize();
01144 
01145                                                                 ci.newPos = pos + startEnd + PSCollideEpsilon * normal;
01146                                                                 ci.dist = startEnd.norm();
01147                                                                 ci.newSpeed = (-2.f * (speed * normal)) * normal + speed;
01148                                                                 ci.collisionZone = this;
01149 
01150                                                                 (*it)->collisionUpdate(ci, k);
01151                                                         }                                               
01152 
01153                                         }
01154                                 }                                                                       
01155                         }
01156                 }
01157         }
01158 }

void NL3D::CPSTargetLocatedBindable::releaseAllRef  )  [virtual, inherited]
 

***************************************************************************************

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 }

void NL3D::CPSTargetLocatedBindable::releaseRefTo const CParticleSystemProcess other  )  [virtual, inherited]
 

***************************************************************************************

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 }

void NL3D::CPSZone::releaseTargetRsc CPSLocated target  )  [virtual, inherited]
 

inherit from CPSTargetLocatedBindable. Its called when one of the targets has been detroyed

Inherited from CPSTargetLocatedBindable. It's called when one of the targets has been detroyed or detached The default behaviour, release collision infos from the located

Reimplemented from NL3D::CPSTargetLocatedBindable.

Definition at line 86 of file ps_zone.cpp.

References NL3D::CPSLocated::releaseCollisionInfo(), and NL3D::CPSLocated::releaseNonIntegrableForceRef().

00087 {
00088         // tell the target that we were using collision infos and that we won't use them anymore
00089         target->releaseCollisionInfo();
00090         target->releaseNonIntegrableForceRef();
00091 }

void NL3D::CPSZoneCylinder::resize uint32  size  )  [protected, virtual]
 

Resize the bindable attributes containers should not be called directly. Call CPSLocated::resize instead

Implements NL3D::CPSLocatedBindable.

Definition at line 1247 of file ps_zone.cpp.

References _Dim, nlassert, NL3D::CPSAttrib< T >::resize(), NL3D::CPSAttrib< CPlaneBasis >::resize(), size, and uint32.

01248 {
01249         nlassert(size < (1 << 16));
01250         _Basis.resize(size);
01251         _Dim.resize(size);
01252 }

void NL3D::CPSZoneCylinder::serial NLMISC::IStream f  )  throw (NLMISC::EStream) [virtual]
 

serialization, DERIVER must override this, and call the parent version

Reimplemented from NL3D::CPSZone.

Definition at line 1237 of file ps_zone.cpp.

01238 {
01239         f.serialVersion(1);
01240         CPSZone::serial(f);
01241         f.serial(_Basis);               
01242         f.serial(_Dim);
01243 }

void NL3D::CPSLocatedBindable::setActive bool  active  )  [inline, inherited]
 

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; }

void NL3D::CPSZone::setBounceFactor float  bounceFactor  )  [inline, inherited]
 

set the bounce factor. It has meaning only if the behaviour is set to bounce...

Definition at line 108 of file ps_zone.h.

References NL3D::CPSZone::_BounceFactor.

00108 { _BounceFactor = bounceFactor; }

void NL3D::CPSZone::setCollisionBehaviour TCollisionBehaviour  behaviour  )  [inline, inherited]
 

Definition at line 114 of file ps_zone.h.

References NL3D::CPSZone::_CollisionBehaviour.

00114 { _CollisionBehaviour = behaviour; }

void NL3D::CPSLocatedBindable::setExternID uint32  id  )  [inherited]
 

***************************************************************************************

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 }

void NL3D::CPSLocatedBindable::setLOD TPSLod  lod  )  [inline, inherited]
 

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; }

void NL3D::CPSZoneCylinder::setMatrix uint32  index,
const NLMISC::CMatrix m
[virtual]
 

Implements NL3D::IPSMover.

Definition at line 1198 of file ps_zone.cpp.

References NLMISC::CMatrix::getI(), NLMISC::CMatrix::getJ(), NLMISC::CMatrix::getPos(), NL3D::CPSLocated::getPos(), index, and uint32.

01199 {
01200         // transform the basis  
01201         _Basis[index].X = m.getI();     
01202         _Basis[index].Y = m.getJ();     
01203 
01204         // compute new pos
01205         _Owner->getPos()[index] = m.getPos();
01206         
01207                                  
01208 }

void NL3D::CPSLocatedBindable::setName const std::string &  name  )  [inline, inherited]
 

set the located bindable name (edition purpose)

Definition at line 946 of file ps_located.h.

00946 { _Name = name; }

virtual void NL3D::IPSMover::setNormal uint32  index,
NLMISC::CVector  n
[inline, virtual, inherited]
 

if the object only stores a normal, this set the normal of the object. Otherwise it has no effect

Reimplemented in NL3D::CPSCylindricVortex, NL3D::CPSZonePlane, and NL3D::CPSZoneDisc.

Definition at line 92 of file ps_edit.h.

References index, and uint32.

00092 { }

void NL3D::CPSLocatedBindable::setOwner CPSLocated psl  )  [protected, virtual, inherited]
 

***************************************************************************************

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 }

void NL3D::CPSZoneCylinder::setScale uint32  k,
const NLMISC::CVector s
[virtual]
 

Reimplemented from NL3D::IPSMover.

Definition at line 1231 of file ps_zone.cpp.

References _Dim, index, s, and uint32.

01232 {
01233         _Dim[index] = s;
01234 }

void NL3D::CPSZoneCylinder::setScale uint32  k,
float  scale
[virtual]
 

Reimplemented from NL3D::IPSMover.

Definition at line 1221 of file ps_zone.cpp.

References _Dim, and uint32.

01222 {
01223         _Dim[k] = CVector(scale, scale, scale);
01224 }

void NL3D::CPSLocatedBindable::setupDriverModelMatrix void   )  [inherited]
 

shortcut to setup the model matrix (system basis or world basis)

Definition at line 2142 of file ps_located.cpp.

References nlassert, and NL3D::CPSLocated::setupDriverModelMatrix().

Referenced by NL3D::CPSLocatedBindable::displayIcon2d(), NL3D::CPSTailDot::displayRibbons(), NL3D::CPSRibbonLookAt::displayRibbons(), NL3D::CPSRibbon::displayRibbons(), NL3D::CPSDot::draw(), NL3D::CPSFaceHelper::drawFaces(), NL3D::CPSFanLightHelper::drawFanLight(), NL3D::CPSFaceLookAtHelper::drawLookAt(), NL3D::CPSFaceLookAtHelper::drawLookAtAlignOnMotion(), NL3D::CPSConstraintMeshHelper::drawMeshs(), NL3D::CPSConstraintMeshHelper::drawPrerotatedMeshs(), NL3D::CPSZoneRectangle::show(), show(), NL3D::CPSZoneDisc::show(), NL3D::CPSZoneSphere::show(), NL3D::CPSZonePlane::show(), NL3D::CPSCylindricVortex::show(), NL3D::CPSDirectionnalForce::show(), NL3D::CPSSphericalEmitter::showTool(), NL3D::CPSEmitterRectangle::showTool(), and NL3D::CPSEmitter::showTool().

02143 {
02144         nlassert(_Owner);
02145         _Owner->setupDriverModelMatrix();
02146 }

virtual void NL3D::CPSLocatedBindable::setZBias float  value  )  [inline, virtual, inherited]
 

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 {}

void NL3D::CPSZoneCylinder::show TAnimationTime  ellapsedTime  )  [virtual]
 

Show the zone (edition mode).

Implements NL3D::CPSZone.

Definition at line 1160 of file ps_zone.cpp.

References _Dim, NL3D::CPSAttrib< CPlaneBasis >::begin(), NL3D::CPSAttrib< T >::begin(), NL3D::CPSAttrib< T >::end(), NL3D::CParticleSystem::getCurrentEditedElement(), NL3D::CPSLocatedBindable::getDriver(), NL3D::CPSLocatedBindable::getFontGenerator(), NL3D::CPSLocatedBindable::getFontManager(), NL3D::CPSLocatedBindable::getLocalToWorldMatrix(), NL3D::CParticleSystemProcess::getOwner(), NL3D::CPSLocated::getPos(), index, NLMISC::CMatrix::setPos(), NLMISC::CMatrix::setRot(), NL3D::CPSLocatedBindable::setupDriverModelMatrix(), NL3D::TAnimationTime, and uint32.

01161 {
01162         TPSAttribVector::const_iterator dimIt = _Dim.begin()
01163                                                                         ,posIt = _Owner->getPos().begin()
01164                                                                         , endPosIt = _Owner->getPos().end();
01165 
01166         CPSAttrib<CPlaneBasis>::const_iterator basisIt = _Basis.begin();
01167                                                                         
01168         setupDriverModelMatrix();       
01169         CMatrix mat;
01170 
01171 
01172                 
01173         CPSLocated *loc;
01174         uint32 index;
01175         CPSLocatedBindable *lb;
01176         _Owner->getOwner()->getCurrentEditedElement(loc, index, lb);
01177 
01178 
01179         for (uint32 k = 0; posIt != endPosIt; ++posIt, ++dimIt, ++basisIt, ++k) 
01180         {                       
01181                 mat.setRot(basisIt->X, basisIt->Y, basisIt->X ^ basisIt->Y);
01182                 mat.setPos(CVector::Null);
01183 
01184                 const CRGBA col = ((lb == NULL || this == lb) && loc == _Owner && index == k  ? CRGBA::Red : CRGBA(127, 127, 127));
01185 
01186                 
01187                 CPSUtil::displayCylinder(*getDriver(), *posIt, mat, *dimIt, 32, col); 
01188 
01189                 mat.setPos(*posIt);
01190                 CPSUtil::displayBasis(getDriver() ,getLocalToWorldMatrix(), mat, 1.f, *getFontGenerator(), *getFontManager());                          
01191                 setupDriverModelMatrix();       
01192         
01193         }
01194 }

void NL3D::CPSZone::step TPSProcessPass  pass,
TAnimationTime  ellapsedTime,
TAnimationTime  realEt
[virtual, inherited]
 

Process one pass for the zone The default behaviour call performMotion or show depending on the pass being processed

Implements NL3D::CPSLocatedBindable.

Definition at line 95 of file ps_zone.cpp.

References NL3D::CPSZone::performMotion(), NL3D::PSCollision, NL3D::PSToolRender, NL3D::CPSZone::show(), and NL3D::TAnimationTime.

00096 {
00097         // for zone, the PSCollision pass and the PSToolRenderPass are processed
00098         switch(pass)
00099         {
00100                 case PSCollision:
00101                         performMotion(ellapsedTime);
00102                         break;
00103                 case PSToolRender:
00104                         show(ellapsedTime);
00105                         break;
00106                 default: break;
00107         }
00108 }

virtual bool NL3D::CPSZoneCylinder::supportNonUniformScaling void   )  const [inline, virtual]
 

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 306 of file ps_zone.h.

00306 { return true; }        

virtual bool NL3D::CPSZoneCylinder::supportUniformScaling void   )  const [inline, virtual]
 

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 305 of file ps_zone.h.

00305 { return true; }

virtual void NL3D::CPSLocatedBindable::systemDateChanged  )  [inline, virtual, inherited]
 

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 {}


Friends And Related Function Documentation

friend class CPSLocated [friend, inherited]
 

Reimplemented in NL3D::CPSForce.

Definition at line 986 of file ps_located.h.


Field Documentation

bool NL3D::CPSLocatedBindable::_Active [protected, inherited]
 

Definition at line 1033 of file ps_located.h.

Referenced by NL3D::CPSLocatedBindable::isActive(), and NL3D::CPSLocatedBindable::setActive().

CPSAttrib<CPlaneBasis> NL3D::CPSZoneCylinder::_Basis [protected]
 

Definition at line 323 of file ps_zone.h.

float NL3D::CPSZone::_BounceFactor [protected, inherited]
 

Definition at line 123 of file ps_zone.h.

Referenced by NL3D::CPSZone::getBounceFactor(), and NL3D::CPSZone::setBounceFactor().

TCollisionBehaviour NL3D::CPSZone::_CollisionBehaviour [protected, inherited]
 

Definition at line 126 of file ps_zone.h.

Referenced by NL3D::CPSZone::getCollisionBehaviour(), and NL3D::CPSZone::setCollisionBehaviour().

TPSAttribVector NL3D::CPSZoneCylinder::_Dim [protected]
 

Definition at line 326 of file ps_zone.h.

Referenced by deleteElement(), getScale(), newElement(), performMotion(), resize(), setScale(), and show().

uint32 NL3D::CPSLocatedBindable::_ExternID [protected, inherited]
 

Definition at line 1027 of file ps_located.h.

Referenced by NL3D::CPSLocatedBindable::getExternID(), NL3D::CPSLocatedBindable::setExternID(), and NL3D::CPSLocatedBindable::~CPSLocatedBindable().

TPSLod NL3D::CPSLocatedBindable::_LOD [protected, inherited]
 

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().

std::string NL3D::CPSLocatedBindable::_Name [protected, inherited]
 

Definition at line 1031 of file ps_located.h.

CPSLocated* NL3D::CPSLocatedBindable::_Owner [protected, inherited]
 

Definition at line 1026 of file ps_located.h.

Referenced by NL3D::CPSFaceHelper::drawFaces(), NL3D::CPSFanLightHelper::drawFanLight(), NL3D::CPSFaceLookAtHelper::drawLookAt(), NL3D::CPSFaceLookAtHelper::drawLookAtAlignOnMotion(), NL3D::CPSConstraintMeshHelper::drawMeshs(), and NL3D::CPSConstraintMeshHelper::drawPrerotatedMeshs().

TTargetCont NL3D::CPSTargetLocatedBindable::_Targets [protected, inherited]
 

Definition at line 1123 of file ps_located.h.

Referenced by NL3D::CPSTargetLocatedBindable::attachTarget(), NL3D::CPSTargetLocatedBindable::finalize(), NL3D::CPSTargetLocatedBindable::getNbTargets(), NL3D::CPSTargetLocatedBindable::getTarget(), NL3D::CPSTargetLocatedBindable::notifyTargetRemoved(), NL3D::CPSTargetLocatedBindable::releaseAllRef(), NL3D::CPSTargetLocatedBindable::releaseRefTo(), and NL3D::CPSTargetLocatedBindable::~CPSTargetLocatedBindable().


The documentation for this class was generated from the following files:
Generated on Tue Mar 16 07:31:28 2004 for NeL by doxygen 1.3.6