#include <ps_ribbon_base.h>
Inheritance diagram for NL3D::CPSRibbonBase:
Nevrax France
Definition at line 45 of file ps_ribbon_base.h.
Public Types | |
enum | TInterpolationMode { Linear = 0, Hermitte, InterpModeLast } |
enum | TRibbonMode { VariableSize = 0, FixedSize, RibbonModeLast } |
Public Member Functions | |
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 |
void | disableAutoLOD (bool disable=true) |
Force the Auto-LOD to be disbaled. When set to false, the default behaviour set in the system is used. | |
virtual bool | doesProduceBBox (void) const |
virtual void | draw (bool opaque) |
derivers draw the particles here | |
void | enableGlobalColorLighting (bool enabled) |
virtual void | enumTexs (std::vector< NLMISC::CSmartPtr< ITexture > > &dest, IDriver &drv) |
virtual std::string | getClassName ()=0 |
virtual bool | getColorFading (void) const=0 |
test wether color fading is activated | |
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) |
*************************************************************************************** | |
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 | |
float | getLODDegradation () const |
virtual uint32 | getMaxNumFaces (void) const=0 |
return the max number of faces needed for display. This is needed for LOD balancing | |
std::string | getName (void) const |
get the located bindable name (edition purpose) | |
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 | |
const NLMISC::CMatrix & | getSysMat (void) const |
*************************************************************************************** | |
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 | hasLightableFaces ()=0 |
virtual bool | hasOpaqueFaces (void)=0 |
return true if there are Opaque faces in the object | |
virtual bool | hasParticles (void) const |
return true if this located bindable derived class holds alive particles | |
virtual bool | hasTransparentFaces (void)=0 |
return true if there are transparent faces in the object | |
bool | isActive () const |
bool | isAutoLODDisabled () const |
Test wether Auto-LOD is disabled. | |
virtual bool | isInSystemBasis (void) const=0 |
return true if the tails are in the system basis | |
virtual void | notifyTargetRemoved (CPSLocated *ptr) |
*************************************************************************************** | |
virtual void | releaseAllRef () |
*************************************************************************************** | |
virtual void | releaseRefTo (const CParticleSystemProcess *other) |
void | setActive (bool active) |
Activate / Deactivate this object. When not active, the owning system won't try to call the 'step' method. | |
virtual void | setColorFading (bool onOff=true)=0 |
void | setExternID (uint32 id) |
*************************************************************************************** | |
void | setLOD (TPSLod lod) |
void | setLODDegradation (float percent) |
void | setName (const std::string &name) |
set the located bindable name (edition purpose) | |
virtual void | setSystemBasis (bool yes)=0 |
void | setupDriverModelMatrix (void) |
shortcut to setup the model matrix (system basis or world basis) | |
virtual void | setZBias (float value)=0 |
virtual void | showTool () |
draw the particles for edition mode. The default behaviour just draw a wireframe model | |
virtual void | step (TPSProcessPass pass, TAnimationTime ellapsedTime, TAnimationTime realEt) |
virtual bool | supportGlobalColorLighting () const=0 |
bool | usesGlobalColorLighting () |
Object | |
CPSRibbonBase () | |
virtual void | serial (NLMISC::IStream &f) throw (NLMISC::EStream) |
serialisation. Derivers must override this, and call their parent version | |
Protected Types | |
typedef CPSVector< float >::V | TFloatVect |
typedef CPSVector< NLMISC::CVector >::V | TPosVect |
Protected Member Functions | |
virtual void | bounceOccured (uint32 index) |
void | computeRibbon (uint index, NLMISC::CVector *dest, uint stride=sizeof(NLMISC::CVector)) |
void | computeSrcStep (uint32 &step, uint &numToProcess) |
virtual void | deleteElement (uint32 index) |
inherited from CPSLocatedBindable | |
void | displayIcon2d (const NLMISC::CVector tab[], uint nbSegs, float scale) |
*************************************************************************************** | |
uint32 | getRibbonIndex () const |
const TFloatVect & | getSamplingDate () const |
void | initDateVect () |
virtual void | motionTypeChanged (bool parametric) |
called when the motion type has changed, this allow us to draw smoother ribbons when parametric anim is used | |
virtual void | newElement (CPSLocated *emitterLocated, uint32 emitterIndex) |
inherited from CPSLocatedBindable | |
void | notifyOwnerMaxNumFacesChanged (void) const |
void | resetFromOwner () |
virtual void | resize (uint32 size) |
inherited from CPSLocatedBindable | |
virtual void | setOwner (CPSLocated *psl) |
*************************************************************************************** | |
void | updateGlobals (float realET) |
Called each time the time of the system change in order to update the ribbons positions. | |
void | updateLOD () |
must be called for the lod to apply (updates UsedNbSegs) | |
Protected Attributes | |
bool | _Active |
uint32 | _ExternID |
TPSLod | _LOD |
tells when this object must be dealt with | |
std::string | _Name |
uint32 | _NbSegs |
CPSLocated * | _Owner |
bool | _Parametric |
TAnimationTime | _SegDuration |
uint32 | _UsedNbSegs |
value to use after lod computation | |
TAnimationTime | _UsedSegDuration |
float | _UsedSegLength |
Private Member Functions | |
void | computeHermitteCstSizeRibbon (uint index, NLMISC::CVector *dest, uint stride=sizeof(NLMISC::CVector)) |
void | computeHermitteRibbon (uint index, NLMISC::CVector *dest, uint stride=sizeof(NLMISC::CVector)) |
Compute the ribbon points using hermitte splines between each sampling point. | |
void | computeLinearCstSizeRibbon (uint index, NLMISC::CVector *dest, uint stride=sizeof(NLMISC::CVector)) |
The same as compute linear ribbon but try to make its length constant. | |
void | computeLinearRibbon (uint index, NLMISC::CVector *dest, uint stride=sizeof(NLMISC::CVector)) |
Compute the ribbon points using linear interpolation between each sampling point. | |
void | dupRibbon (uint dest, uint src) |
copy datas from one ribbon to another | |
void | resetSingleRibbon (uint index, const NLMISC::CVector &pos) |
virtual void | systemDateChanged () |
Private Attributes | |
TInterpolationMode | _InterpolationMode |
TAnimationTime | _LastUpdateDate |
float | _LODDegradation |
uint | _RibbonIndex |
float | _RibbonLength |
TRibbonMode | _RibbonMode |
TPosVect | _Ribbons |
TFloatVect | _SamplingDate |
float | _SegLength |
Friends | |
class | CPSLocated |
|
Definition at line 99 of file ps_ribbon_base.h. Referenced by getSamplingDate(). |
|
Definition at line 98 of file ps_ribbon_base.h. |
|
Definition at line 49 of file ps_ribbon_base.h. Referenced by getInterpolationMode().
00049 { Linear = 0, Hermitte, InterpModeLast }; |
|
Definition at line 48 of file ps_ribbon_base.h. Referenced by getRibbonMode().
00048 { VariableSize = 0, FixedSize, RibbonModeLast }; |
|
Definition at line 79 of file ps_ribbon_base.cpp. References initDateVect().
00079 : _NbSegs(8), 00080 _SegDuration(0.02f), 00081 _Parametric(false), 00082 _RibbonIndex(0), 00083 _LastUpdateDate(0), 00084 _RibbonMode(VariableSize), 00085 _InterpolationMode(Hermitte), 00086 _RibbonLength(1), 00087 _SegLength(_RibbonLength / _NbSegs), 00088 _LODDegradation(1) 00089 00090 { 00091 initDateVect(); 00092 } |
|
Called when the basis of the owner changed. the default behaviour does nothing
Reimplemented in NL3D::CPSForce. Definition at line 968 of file ps_located.h.
00968 {} |
|
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 {} |
|
Reimplemented in NL3D::CPSFanLight, NL3D::CPSQuad, and NL3D::CPSShockWave. Definition at line 884 of file ps_located.h.
00884 { return false ;} |
|
Compute the ribbon points using hermitte splines between each sampling point, and make a rough approximation to get a constant lenght Our goal here is to match the length of the ribbon, But if it isn't moving fast enough, we must truncate it Having a constant speed over a hermite curve is expensive, so we make a (very) rough approximation... Definition at line 382 of file ps_ribbon_base.cpp. References _NbSegs, _Parametric, _RibbonIndex, _Ribbons, _UsedNbSegs, _UsedSegLength, NL3D::BuildHermiteVector(), NL3D::EndRibbonStorage, index, nlassert, stride, uint, and uint8. Referenced by computeRibbon().
00383 { 00384 nlassert(!_Parametric); 00385 NLMISC::CVector *startIt = &_Ribbons[(_NbSegs + 1 + EndRibbonStorage) * index]; 00386 NLMISC::CVector *endIt = startIt + (_NbSegs + 1 + EndRibbonStorage); 00387 NLMISC::CVector *currIt = startIt + _RibbonIndex; 00388 NLMISC::CVector *firstIt = currIt; 00389 NLMISC::CVector *nextIt = currIt + 1; 00390 if (nextIt == endIt) nextIt = startIt; 00391 NLMISC::CVector *nextNextIt = nextIt + 1; 00392 if (nextNextIt == endIt) nextNextIt = startIt; 00393 00394 NLMISC::CVector t0 = (*nextIt - *currIt); 00395 NLMISC::CVector t1 = 0.5f * (*nextNextIt - *currIt); 00396 00397 uint leftToDo = _UsedNbSegs + 1; 00398 00399 float lambda = 0.f; 00400 float lambdaStep = 1.f; 00401 00402 00405 for (;;) 00406 { 00408 const float sampleLength = (*nextIt - *currIt).norm(); 00409 if (sampleLength > 10E-6f) 00410 { 00412 float newLambdaStep = _UsedSegLength / sampleLength; 00413 // readapt lambda 00414 lambda *= newLambdaStep / lambdaStep; 00415 lambdaStep = newLambdaStep; 00416 00417 for(;;) 00418 { 00419 if (lambda >= 1.f) break; 00421 BuildHermiteVector(*currIt, *nextIt, t0, t1, *dest, lambda); 00422 dest = (NLMISC::CVector *) ((uint8 *) dest + stride); 00423 -- leftToDo; 00424 if (!leftToDo) return; 00425 lambda += lambdaStep; 00426 } 00427 lambda -= 1.f; 00428 } 00429 00431 currIt = nextIt; 00432 nextIt = nextNextIt; 00433 ++nextNextIt; 00434 if (nextNextIt == endIt) nextNextIt = startIt; 00435 if (nextNextIt == firstIt) 00436 { 00437 // The length of the sampling curve is too short 00438 // must truncate the ribbon. 00439 NLMISC::CVector &toDup = *nextIt; 00440 while (leftToDo --) 00441 { 00442 *dest = toDup; 00443 dest = (NLMISC::CVector *) ((uint8 *) dest + stride); 00444 } 00445 return; 00446 } 00448 t0 = t1; 00449 t1 = 0.5f * (*nextNextIt - *currIt); 00450 } 00451 } |
|
Compute the ribbon points using hermitte splines between each sampling point. compute a location Definition at line 175 of file ps_ribbon_base.cpp. References _NbSegs, _Parametric, _RibbonIndex, _Ribbons, _SamplingDate, _UsedNbSegs, _UsedSegDuration, NL3D::BuildHermiteVector(), NL3D::EndRibbonStorage, index, nlassert, stride, uint, and uint8. Referenced by computeRibbon().
00176 { 00177 nlassert(!_Parametric); 00178 NLMISC::CVector *startIt = &_Ribbons[(_NbSegs + 1 + EndRibbonStorage) * index]; 00179 NLMISC::CVector *endIt = startIt + (_NbSegs + 1 + EndRibbonStorage); 00180 NLMISC::CVector *currIt = startIt + _RibbonIndex; 00181 const NLMISC::CVector *firstIt = currIt; 00182 NLMISC::CVector *nextIt = currIt + 1; 00183 if (nextIt == endIt) nextIt = startIt; 00184 NLMISC::CVector *nextNextIt = nextIt + 1; 00185 if (nextNextIt == endIt) nextNextIt = startIt; 00186 float *date = &_SamplingDate[0]; 00187 00188 NLMISC::CVector t0 = (*nextIt - *currIt); 00189 NLMISC::CVector t1 = 0.5f * (*nextNextIt - *currIt); 00190 00191 uint leftToDo = _UsedNbSegs + 1; 00192 00193 float lambda = 0.f; 00194 float lambdaStep = 1.f; 00195 00196 00197 for (;;) 00198 { 00199 float dt = date[0] - date[1]; 00200 00201 if (dt < 10E-6f) // we reached the start of ribbon 00202 { 00203 00204 do 00205 { 00206 *dest = *currIt; 00207 dest = (NLMISC::CVector *) ((uint8 *) dest + stride); 00208 } 00209 while (--leftToDo); 00210 return; 00211 } 00212 00213 float newLambdaStep = _UsedSegDuration / dt; 00214 // readapt lambda 00215 lambda *= newLambdaStep / lambdaStep; 00216 lambdaStep = newLambdaStep; 00217 for(;;) 00218 { 00219 if (lambda >= 1.f) break; 00221 BuildHermiteVector(*currIt, *nextIt, t0, t1, *dest, lambda); 00222 dest = (NLMISC::CVector *) ((uint8 *) dest + stride); 00223 -- leftToDo; 00224 if (!leftToDo) return; 00225 lambda += lambdaStep; 00226 } 00227 00228 ++date; 00229 lambda -= 1.f; 00230 00231 // Start new segment and compute new tangents 00232 t0 = t1; 00233 currIt = nextIt; 00234 nextIt = nextNextIt; 00235 ++nextNextIt; 00236 if (nextNextIt == endIt) nextNextIt = startIt; 00237 if (nextNextIt == firstIt) 00238 { 00239 t1 = *nextIt - *currIt; 00240 } 00241 else 00242 { 00243 t1 = 0.5f * (*nextNextIt - *currIt); 00244 } 00245 } 00246 } |
|
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(); } |
|
The same as compute linear ribbon but try to make its length constant. Our goal here is to match the length of the ribbon, But if it isn't moving fast enough, we must truncate it compute length between the 2 sampling points compute lambda so that it match the length needed for each segment compute a location go to next sampling pos Definition at line 315 of file ps_ribbon_base.cpp. References _NbSegs, _Parametric, _RibbonIndex, _Ribbons, _UsedNbSegs, _UsedSegLength, NL3D::BuildLinearVector(), NL3D::EndRibbonStorage, index, nlassert, stride, uint, and uint8. Referenced by computeRibbon().
00316 { 00317 nlassert(!_Parametric); 00318 CVector *startIt = &_Ribbons[(_NbSegs + 1 + EndRibbonStorage) * index]; 00319 NLMISC::CVector *endIt = startIt + (_NbSegs + 1 + EndRibbonStorage); 00320 NLMISC::CVector *currIt = startIt + _RibbonIndex; 00321 NLMISC::CVector *firstIt = currIt; 00322 NLMISC::CVector *nextIt = currIt + 1; 00323 if (nextIt == endIt) nextIt = startIt; 00324 NLMISC::CVector *nextNextIt = nextIt + 1; 00325 if (nextNextIt == endIt) nextNextIt = startIt; 00326 00327 uint leftToDo = _UsedNbSegs + 1; 00328 00329 float lambda = 0.f; 00330 float lambdaStep = 1.f; 00331 00332 00334 for (;;) 00335 { 00337 const float sampleLength = (*nextIt - *currIt).norm(); 00338 if (sampleLength > 10E-6f) 00339 { 00341 float newLambdaStep = _UsedSegLength / sampleLength; 00342 // readapt lambda 00343 lambda *= newLambdaStep / lambdaStep; 00344 lambdaStep = newLambdaStep; 00345 00346 float oneMinusLambda = 1.f - lambda; 00347 for(;;) 00348 { 00349 if (lambda >= 1.f) break; 00351 BuildLinearVector(*currIt, *nextIt, *dest, lambda, oneMinusLambda); 00352 dest = (NLMISC::CVector *) ((uint8 *) dest + stride); 00353 -- leftToDo; 00354 if (!leftToDo) return; 00355 lambda += lambdaStep; 00356 oneMinusLambda -= lambdaStep; 00357 } 00358 lambda -= 1.f; 00359 } 00360 00362 currIt = nextIt; 00363 nextIt = nextNextIt; 00364 ++nextNextIt; 00365 if (nextNextIt == endIt) nextNextIt = startIt; 00366 if (nextNextIt == firstIt) 00367 { 00368 // The length of the sampling curve is too short 00369 // must truncate the ribbon. 00370 NLMISC::CVector &toDup = *nextIt; 00371 while (leftToDo --) 00372 { 00373 *dest = toDup; 00374 dest = (NLMISC::CVector *) ((uint8 *) dest + stride); 00375 } 00376 return; 00377 } 00378 } 00379 } |
|
Compute the ribbon points using linear interpolation between each sampling point. well we could avoid code duplication with computeHermitteRibbon, but this is simply easier than using templates for now... compute a location Definition at line 249 of file ps_ribbon_base.cpp. References _NbSegs, _Parametric, _RibbonIndex, _Ribbons, _SamplingDate, _UsedNbSegs, _UsedSegDuration, NL3D::BuildLinearVector(), NL3D::EndRibbonStorage, index, nlassert, stride, uint, and uint8. Referenced by computeRibbon().
00250 { 00252 nlassert(!_Parametric); 00253 NLMISC::CVector *startIt = &_Ribbons[(_NbSegs + 1 + EndRibbonStorage) * index]; 00254 NLMISC::CVector *endIt = startIt + (_NbSegs + 1 + EndRibbonStorage); 00255 NLMISC::CVector *currIt = startIt + _RibbonIndex; 00256 NLMISC::CVector *nextIt = currIt + 1; 00257 if (nextIt == endIt) nextIt = startIt; 00258 NLMISC::CVector *nextNextIt = nextIt + 1; 00259 if (nextNextIt == endIt) nextNextIt = startIt; 00260 float *date = &_SamplingDate[0]; 00261 00262 uint leftToDo = _UsedNbSegs + 1; 00263 00264 float lambda = 0.f; 00265 float lambdaStep = 1.f; 00266 00267 for (;;) 00268 { 00269 float dt = date[0] - date[1]; 00270 00271 if (dt < 10E-6f) // we reached the start of ribbon 00272 { 00273 do 00274 { 00275 *dest = *currIt; 00276 dest = (NLMISC::CVector *) ((uint8 *) dest + stride); 00277 } 00278 while (--leftToDo); 00279 return; 00280 } 00281 00282 00283 float newLambdaStep = _UsedSegDuration / dt; 00284 // readapt lambda 00285 lambda *= newLambdaStep / lambdaStep; 00286 lambdaStep = newLambdaStep; 00287 00288 float oneMinusLambda = 1.f - lambda; 00289 for(;;) 00290 { 00291 if (lambda >= 1.f) break; 00293 BuildLinearVector(*currIt, *nextIt, *dest, lambda, oneMinusLambda); 00294 dest = (NLMISC::CVector *) ((uint8 *) dest + stride); 00295 -- leftToDo; 00296 if (!leftToDo) return; 00297 lambda += lambdaStep; 00298 oneMinusLambda -= lambdaStep; 00299 } 00300 00301 ++date; 00302 lambda -= 1.f; 00303 00304 currIt = nextIt; 00305 nextIt = nextNextIt; 00306 ++nextNextIt; 00307 if (nextNextIt == endIt) nextNextIt = startIt; 00308 00309 } 00310 } |
|
Get position of the i-th ribbon and store them in a table of vector. It uses the interpolation setting of this object. The dest tab must have at least nbSegs + 1 entries. Definition at line 455 of file ps_ribbon_base.cpp. References _InterpolationMode, _RibbonMode, computeHermitteCstSizeRibbon(), computeHermitteRibbon(), computeLinearCstSizeRibbon(), computeLinearRibbon(), Hermitte, index, Linear, nlassert, stride, uint, and VariableSize. Referenced by NL3D::CPSTailDot::displayRibbons(), NL3D::CPSRibbonLookAt::displayRibbons(), and NL3D::CPSRibbon::displayRibbons().
00456 { 00457 switch (_InterpolationMode) 00458 { 00459 case Linear: 00460 if (_RibbonMode == VariableSize) 00461 { 00462 computeLinearRibbon(index, dest, stride); 00463 } 00464 else 00465 { 00466 computeLinearCstSizeRibbon(index, dest, stride); 00467 } 00468 break; 00469 case Hermitte: 00470 if (_RibbonMode == VariableSize) 00471 { 00472 computeHermitteRibbon(index, dest, stride); 00473 00474 } 00475 else 00476 { 00477 computeHermitteCstSizeRibbon(index, dest, stride); 00478 } 00479 break; 00480 default: 00481 nlassert(0); 00482 break; 00483 } 00484 00485 } |
|
System may have hand-tuned LOD, or auto LOD. This compute the number of particles that must really be displayed, and the src step that allow to go through the whole collection. The step in the source is in a fixed point 16:16 format Definition at line 82 of file ps_particle_basic.cpp. References NL3D::CPSParticle::_DisableAutoLOD, NLMISC::clamp(), NL3D::CParticleSystem::getAutoLODDegradationExponent(), NL3D::CParticleSystem::getAutoLODMode(), NL3D::CParticleSystem::getAutoLODStartDistPercent(), NL3D::CParticleSystem::getOneMinusCurrentLODRatio(), NL3D::CParticleSystemProcess::getOwner(), NL3D::CPSLocated::getSize(), NL3D::CParticleSystem::isAutoLODEnabled(), NL3D::CParticleSystem::isSharingEnabled(), nlassert, r, uint, and uint32. Referenced by NL3D::CPSShockWave::draw(), NL3D::CPSConstraintMesh::draw(), NL3D::CPSFanLight::draw(), NL3D::CPSFaceLookAt::draw(), NL3D::CPSDot::draw(), NL3D::CPSTailDot::step(), NL3D::CPSRibbonLookAt::step(), NL3D::CPSRibbon::step(), and NL3D::CPSFace::step().
00083 { 00084 nlassert(_Owner && _Owner->getOwner()); 00085 const CParticleSystem &ps = *(_Owner->getOwner()); 00086 if (_DisableAutoLOD || !ps.isAutoLODEnabled() || !ps.isSharingEnabled() || _Owner->getSize() == 0) // Should Auto-LOD be used ? 00087 { 00088 step = (1 << 16); 00089 numToProcess = _Owner->getSize(); 00090 } 00091 else 00092 { 00093 float oneMinusLODRatio = ps.getOneMinusCurrentLODRatio(); 00094 float LODRatio = 1.f - oneMinusLODRatio; 00095 if (LODRatio > ps.getAutoLODStartDistPercent()) 00096 { 00097 float factor = (LODRatio - 1.f) / (ps.getAutoLODStartDistPercent() - 1.f); 00098 NLMISC::clamp(factor, 0.f, 1.f); 00099 float r = factor; 00100 for (uint k = 1; k < ps.getAutoLODDegradationExponent(); ++k) 00101 { 00102 r *= factor; 00103 } 00104 numToProcess = (uint) (_Owner->getSize() * r); 00105 if (numToProcess < 1) { numToProcess = 1; } 00106 00107 step = ps.getAutoLODMode() ? // skip or limit number, depending on the mode 00108 (_Owner->getSize() << 16) / numToProcess : // skip particles 00109 (1 << 16); // just display less particles 00110 } 00111 else 00112 { 00113 step = (1 << 16); 00114 numToProcess = _Owner->getSize(); 00115 } 00116 } 00117 00118 } |
|
inherited from CPSLocatedBindable
Implements NL3D::CPSParticle. Reimplemented in NL3D::CPSRibbon, NL3D::CPSRibbonLookAt, and NL3D::CPSTailDot. Definition at line 509 of file ps_ribbon_base.cpp. References _Parametric, dupRibbon(), NL3D::CPSLocated::getSize(), index, size, and uint32.
|
|
Force the Auto-LOD to be disbaled. When set to false, the default behaviour set in the system is used.
Definition at line 137 of file ps_particle_basic.h. References NL3D::CPSParticle::_DisableAutoLOD.
00137 { _DisableAutoLOD = disable; } |
|
*************************************************************************************** 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 } |
|
Reimplemented in NL3D::CPSForce. Definition at line 888 of file ps_located.h.
00888 { return true; } |
|
derivers draw the particles here
Reimplemented in NL3D::CPSDot, NL3D::CPSFaceLookAt, NL3D::CPSFanLight, and NL3D::CPSShockWave. Definition at line 110 of file ps_particle_basic.h. Referenced by NL3D::CPSParticle::step().
00110 {} |
|
copy datas from one ribbon to another
Definition at line 489 of file ps_ribbon_base.cpp. References _NbSegs, _Parametric, _Ribbons, NL3D::EndRibbonStorage, NL3D::CPSLocated::getSize(), nlassert, size, src, and uint. Referenced by deleteElement().
00490 { 00491 nlassert(!_Parametric); 00492 nlassert(_Owner); 00493 const uint size = _Owner->getSize(); 00494 nlassert(dest < size && src < size); 00495 ::memcpy(&_Ribbons[dest * (_NbSegs + EndRibbonStorage + 1)], &_Ribbons[src * (_NbSegs + EndRibbonStorage + 1)], sizeof(NLMISC::CVector) * (_NbSegs + 1 + EndRibbonStorage)); 00496 } |
|
Definition at line 105 of file ps_particle_basic.h. References NL3D::CPSParticle::_UsesGlobalColorLighting.
00105 { _UsesGlobalColorLighting = enabled; } |
|
Reimplemented in NL3D::CPSFanLight, NL3D::CPSQuad, NL3D::CPSRibbon, NL3D::CPSRibbonLookAt, and NL3D::CPSShockWave. Definition at line 977 of file ps_located.h.
00977 {} |
|
*************************************************************************************** this should be called before to delete any bindable inserted in a system, but this is done by the system, so you should never need calling it. This has been introduced because calls in dtor are not polymorphic to derived class (which are already destroyed anyway), and some infos are needed in some dtor. The default behaviour does nothing Reimplemented in NL3D::CPSTargetLocatedBindable. Definition at line 1975 of file ps_located.cpp. References NL3D::CParticleSystemProcess::getOwner(), NL3D::CPSLocatedBindable::getUserMatrixUsageCount(), and NL3D::CParticleSystem::releaseRefForUserSysCoordInfo().
01976 { 01977 if (_Owner && _Owner->getOwner()) 01978 { 01979 _Owner->getOwner()->releaseRefForUserSysCoordInfo(getUserMatrixUsageCount()); 01980 } 01981 } |
|
Implemented in NLAIAGENT::CNumericIndex, NLAIC::IPointerGestion, NLAIC::CIdentType, and CAutomataDesc. Referenced by NLMISC::CClassRegistry::checkObject(), and NL3D::GetTextureSize(). |
|
test wether color fading is activated
Implemented in NL3D::CPSRibbon, NL3D::CPSRibbonLookAt, and NL3D::CPSTailDot. |
|
|
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(), NL3D::CPSCylindricVortex::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(), NL3D::CPSCylindricVortex::show(), NL3D::CPSGravity::show(), and NL3D::CPSEmitterRectangle::showTool().
|
|
Definition at line 64 of file ps_ribbon_base.h. References _InterpolationMode, and TInterpolationMode.
00064 { return _InterpolationMode; } |
|
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; } |
|
Definition at line 95 of file ps_ribbon_base.h.
00095 { return _LODDegradation; } |
|
return the max number of faces needed for display. This is needed for LOD balancing
Implemented in NL3D::CPSDot, NL3D::CPSFanLight, NL3D::CPSMesh, NL3D::CPSConstraintMesh, NL3D::CPSQuad, NL3D::CPSRibbon, NL3D::CPSRibbonLookAt, NL3D::CPSShockWave, and NL3D::CPSTailDot. |
|
get the located bindable name (edition purpose)
Definition at line 948 of file ps_located.h.
00948 { return _Name; } |
|
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
Implements NL3D::CPSLocatedBindable. Definition at line 66 of file ps_particle_basic.h. References uint32.
00066 { return 1000; }
|
|
Definition at line 131 of file ps_ribbon_base.h. References _RibbonIndex, and uint32.
00131 { return _RibbonIndex; } |
|
Definition at line 84 of file ps_ribbon_base.h. References _RibbonLength.
00084 { return _RibbonLength; } |
|
Definition at line 62 of file ps_ribbon_base.h. References _RibbonMode, and TRibbonMode.
00062 { return _RibbonMode; } |
|
Definition at line 133 of file ps_ribbon_base.h. References _SamplingDate, and TFloatVect.
00133 { return _SamplingDate; } |
|
Definition at line 77 of file ps_ribbon_base.h. References _SegDuration, and NL3D::TAnimationTime.
00077 { return _SegDuration; } |
|
***************************************************************************************
Definition at line 2108 of file ps_located.cpp. References NL3D::CParticleSystemProcess::getOwner(), NL3D::CParticleSystem::getSysMat(), and nlassert.
|
|
get the number of segments used with this particle
Implements NL3D::CPSTailParticle. Definition at line 72 of file ps_ribbon_base.h. References _NbSegs, and uint32.
00072 { return _NbSegs; } |
|
return this bindable type
Implements NL3D::CPSLocatedBindable. Definition at line 63 of file ps_particle_basic.h. References NL3D::PSParticle, and uint32.
00063 { return PSParticle; } |
|
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; } |
|
Returns true if there are lightable faces in the object Implemented in NL3D::CPSDot, NL3D::CPSFace, NL3D::CPSFaceLookAt, NL3D::CPSFanLight, NL3D::CPSMesh, NL3D::CPSConstraintMesh, NL3D::CPSRibbon, NL3D::CPSRibbonLookAt, NL3D::CPSShockWave, and NL3D::CPSTailDot. |
|
return true if there are Opaque faces in the object
Implemented in NL3D::CPSDot, NL3D::CPSFanLight, NL3D::CPSMesh, NL3D::CPSConstraintMesh, NL3D::CPSQuad, NL3D::CPSRibbon, NL3D::CPSRibbonLookAt, NL3D::CPSShockWave, and NL3D::CPSTailDot. Referenced by NL3D::CPSParticle::step(). |
|
return true if this located bindable derived class holds alive particles
Reimplemented from NL3D::CPSLocatedBindable. Definition at line 69 of file ps_particle_basic.h. References NL3D::CPSLocated::getSize(), and nlassert.
|
|
return true if there are transparent faces in the object
Implemented in NL3D::CPSDot, NL3D::CPSFanLight, NL3D::CPSMesh, NL3D::CPSConstraintMesh, NL3D::CPSQuad, NL3D::CPSRibbon, NL3D::CPSRibbonLookAt, NL3D::CPSShockWave, and NL3D::CPSTailDot. Referenced by NL3D::CPSParticle::step(). |
|
Definition at line 568 of file ps_ribbon_base.cpp. References _NbSegs, _SamplingDate, and NL3D::EndRibbonStorage. Referenced by CPSRibbonBase(), motionTypeChanged(), and setTailNbSeg().
00569 { 00570 _SamplingDate.resize( _NbSegs + 1 + EndRibbonStorage); 00571 std::fill(_SamplingDate.begin(), _SamplingDate.begin() + (_NbSegs + 1 + EndRibbonStorage), 0.f); 00572 } |
|
Definition at line 844 of file ps_located.h. References NL3D::CPSLocatedBindable::_Active. Referenced by NL3D::CParticleSystem::hasActiveEmitters().
00844 { return _Active; } |
|
Test wether Auto-LOD is disabled.
Definition at line 140 of file ps_particle_basic.h. References NL3D::CPSParticle::_DisableAutoLOD.
00140 { return _DisableAutoLOD; }
|
|
return true if the tails are in the system basis
Implemented in NL3D::CPSRibbon, NL3D::CPSRibbonLookAt, and NL3D::CPSTailDot. |
|
called when the motion type has changed, this allow us to draw smoother ribbons when parametric anim is used
Reimplemented from NL3D::CPSLocatedBindable. Definition at line 550 of file ps_ribbon_base.cpp. References _Parametric, _Ribbons, NLMISC::contReset(), NL3D::CPSLocated::getMaxSize(), initDateVect(), nlassert, resetFromOwner(), and resize().
00551 { 00552 _Parametric = parametric; 00553 if (parametric) 00554 { 00555 NLMISC::contReset(_Ribbons); // kill the vector 00556 } 00557 else 00558 { 00559 nlassert(_Owner); 00560 resize(_Owner->getMaxSize()); 00561 initDateVect(); 00562 resetFromOwner(); 00563 } 00564 } |
|
inherited from CPSLocatedBindable dump the same pos for all pos of the ribbon Implements NL3D::CPSParticle. Reimplemented in NL3D::CPSRibbon, NL3D::CPSRibbonLookAt, and NL3D::CPSTailDot. Definition at line 499 of file ps_ribbon_base.cpp. References _Parametric, NL3D::CPSLocated::getNewElementIndex(), NL3D::CPSLocated::getPos(), index, resetSingleRibbon(), uint, and uint32.
00500 { 00501 if (_Parametric) return; 00503 const uint index = _Owner->getNewElementIndex(); 00504 const NLMISC::CVector &pos = _Owner->getPos()[index]; // get the pos of the new element; 00505 resetSingleRibbon(index, pos); 00506 } |
|
Shortcut to notify that the max number of faces has changed This must be called when a geometric property of the particle has been modified This needn't to be called during CPSParticle::resize overrides Definition at line 151 of file ps_particle_basic.h. References NL3D::CPSLocated::notifyMaxNumFacesChanged(). Referenced by NL3D::CPSFanLight::setNbFans(), NL3D::CPSShockWave::setNbSegs(), and NL3D::CPSConstraintMesh::update().
|
|
*************************************************************************************** Can be used by located bindable that have located as targets (emitter, collision zone, forces) to be notified that one of their target has been removed. To do this : The object that focus the target must call registerDTorObserver on the target, with himself as a parameter When the target is removed, this target will call this method for all registered CPSLocated The default behaviour remove this object as an observer
Reimplemented in NL3D::CPSEmitter, and NL3D::CPSTargetLocatedBindable. Definition at line 1996 of file ps_located.cpp. References NL3D::CPSLocated::unregisterDtorObserver(). Referenced by NL3D::CPSLocated::releaseRefTo().
01997 {
01998 ptr->unregisterDtorObserver(this);
01999 }
|
|
*************************************************************************************** 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 in NL3D::CPSEmitter, NL3D::CPSLight, NL3D::CPSTargetLocatedBindable, and NL3D::CPSMesh. Definition at line 2170 of file ps_located.cpp. Referenced by NL3D::CPSLocatedBindable::setOwner().
02171 { 02172 } |
|
Release any reference this obj may have on the given process. For example, this is used when detaching a located bindable from a system. Reimplemented in NL3D::CPSEmitter, and NL3D::CPSTargetLocatedBindable. Definition at line 871 of file ps_located.h.
00871 {} |
|
Definition at line 538 of file ps_ribbon_base.cpp. References _Parametric, NL3D::CPSAttrib< T >::begin(), NL3D::CPSAttrib< T >::end(), NL3D::CPSLocated::getPos(), nlassert, resetSingleRibbon(), and uint. Referenced by motionTypeChanged(), and resize().
00539 { 00540 nlassert(!_Parametric); 00541 TPSAttribVector::iterator posIt = _Owner->getPos().begin(); 00542 TPSAttribVector::iterator endPosIt = _Owner->getPos().end(); 00543 for (uint k = 0; posIt != endPosIt; ++posIt, ++k) 00544 { 00545 resetSingleRibbon(k, *posIt); 00546 } 00547 } |
|
Definition at line 528 of file ps_ribbon_base.cpp. References _NbSegs, _Parametric, _Ribbons, NL3D::EndRibbonStorage, index, nlassert, and uint. Referenced by newElement(), and resetFromOwner().
00529 { 00530 nlassert(!_Parametric); 00531 NLMISC::CVector *it = &_Ribbons[(index * (_NbSegs + 1 + EndRibbonStorage))]; 00532 std::fill(it, it + (_NbSegs + 1 + EndRibbonStorage), pos); 00533 } |
|
inherited from CPSLocatedBindable
Implements NL3D::CPSParticle. Reimplemented in NL3D::CPSRibbon, NL3D::CPSRibbonLookAt, and NL3D::CPSTailDot. Definition at line 518 of file ps_ribbon_base.cpp. References _NbSegs, _Parametric, _Ribbons, NL3D::EndRibbonStorage, nlassert, resetFromOwner(), size, and uint32. Referenced by motionTypeChanged(), and setTailNbSeg().
00519 { 00520 nlassert(size < (1 << 16)); 00521 if (_Parametric) return; 00522 _Ribbons.resize(size * (_NbSegs + 1 + EndRibbonStorage)); 00523 resetFromOwner(); 00524 } |
|
serialisation. Derivers must override this, and call their parent version
Reimplemented from NL3D::CPSParticle. Reimplemented in NL3D::CPSRibbon, NL3D::CPSRibbonLookAt, and NL3D::CPSTailDot. Definition at line 576 of file ps_ribbon_base.cpp. References sint.
00577 { 00578 CPSParticle::serial(f); 00579 sint ver = f.serialVersion(1); 00580 f.serialEnum(_RibbonMode); 00581 f.serialEnum(_InterpolationMode); 00582 f.serial(_NbSegs, _SegDuration); 00583 if (_RibbonMode == FixedSize) 00584 { 00585 f.serial(_RibbonLength); 00586 if (f.isReading()) 00587 { 00588 _SegLength = _RibbonLength / _NbSegs; 00589 } 00590 } 00591 00592 if (f.isReading()) 00593 { 00594 if (_Owner) 00595 { 00596 resize(_Owner->getMaxSize()); 00597 initDateVect(); 00598 resetFromOwner(); 00599 } 00600 } 00601 00602 if (ver >= 1) 00603 { 00604 f.serial(_LODDegradation); 00605 } 00606 } |
|
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; } |
|
(de)activate color fading when its done, colors fades to black along the tail Implemented in NL3D::CPSRibbon, NL3D::CPSRibbonLookAt, and NL3D::CPSTailDot. |
|
*************************************************************************************** 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 } |
|
Definition at line 111 of file ps_ribbon_base.cpp. References _InterpolationMode, InterpModeLast, and nlassert. Referenced by NL3D::CPSRibbon::CPSRibbon(), and NL3D::CPSTailDot::CPSTailDot().
00112 { 00113 nlassert(mode < InterpModeLast); 00114 _InterpolationMode = mode; 00115 } |
|
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; } |
|
Allow degradation of ribbons with distance of the system (may not be suited when theit paths have wicked angles)
Definition at line 90 of file ps_ribbon_base.h. References nlassert.
00091 { 00092 nlassert(percent >= 0 && percent <= 1); 00093 _LODDegradation = percent; 00094 } |
|
set the located bindable name (edition purpose)
Definition at line 946 of file ps_located.h.
00946 { _Name = name; } |
|
***************************************************************************************
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 } |
|
The the length in meter of the ribbon. This is used only if the ribbon mode is set to FixedSize. These kind of ribbon are usually slower than variable size ribbons. The default is one metter. Definition at line 95 of file ps_ribbon_base.cpp. References _NbSegs, _RibbonLength, _SegLength, and nlassert.
00096 { 00097 nlassert(length > 0.f); 00098 _RibbonLength = length; 00099 _SegLength = length / _NbSegs; 00100 } |
|
NB : a fixed size isn't applied with parametric motion.
Definition at line 103 of file ps_ribbon_base.cpp. References _RibbonMode, nlassert, and RibbonModeLast.
00104 { 00105 nlassert(mode < RibbonModeLast); 00106 _RibbonMode = mode; 00107 } |
|
Set how many seconds need a seg to be traversed. Long times will create longer ribbons. Default is 0.02. It gives the sampling rate for each type of ribbon Definition at line 132 of file ps_ribbon_base.cpp. References _SegDuration, and NL3D::TAnimationTime. Referenced by NL3D::CPSRibbon::CPSRibbon(), and NL3D::CPSTailDot::CPSTailDot().
00133 { 00134 _SegDuration = ellapsedTime; 00135 00136 } |
|
tells in which basis is the tail It requires one transform per particle if it is not the same as the located that hold that particle The default is false. With that you can control if a rotation of the system will rotate the tail Implemented in NL3D::CPSRibbon, NL3D::CPSRibbonLookAt, and NL3D::CPSTailDot. |
|
set the number of segments used with this particle. In this case, it can't be lower than 2
Implements NL3D::CPSTailParticle. Definition at line 118 of file ps_ribbon_base.cpp. References _NbSegs, _RibbonIndex, NL3D::CPSLocated::getMaxSize(), initDateVect(), nlassert, resize(), and uint32.
00119 { 00120 nlassert(nbSegs >= 1); 00121 _NbSegs = nbSegs; 00122 _RibbonIndex = 0; 00123 if (_Owner) 00124 { 00125 resize(_Owner->getMaxSize()); 00126 } 00127 initDateVect(); 00128 } |
|
|
Reimplemented from NL3D::CPSLocatedBindable. Implemented in NL3D::CPSDot, NL3D::CPSFanLight, NL3D::CPSMesh, NL3D::CPSConstraintMesh, NL3D::CPSQuad, NL3D::CPSRibbon, NL3D::CPSRibbonLookAt, NL3D::CPSShockWave, and NL3D::CPSTailDot. |
|
draw the particles for edition mode. The default behaviour just draw a wireframe model
Definition at line 55 of file ps_particle_basic.cpp. References NL3D::CPSLocatedBindable::displayIcon2d(), PARTICLES_CHECK_MEM, and uint. Referenced by NL3D::CPSParticle::step(), NL3D::CPSConstraintMesh::step(), NL3D::CPSMesh::step(), and NL3D::CPSFace::step().
00056 { 00057 PARTICLES_CHECK_MEM; 00058 00059 CVector I = CVector::I; 00060 CVector J = CVector::J; 00061 00062 const CVector tab[] = { 2 * J, I + J 00063 , I + J, 2 * I + J 00064 , 2 * I + J, I 00065 , I, 2 * I - J 00066 , 2 * I - J, - .5f * J 00067 , - .5f * J, -2 * I - J 00068 , -2 * I - J, - I 00069 , - I, -2 * I + J 00070 , -2 * I + J, - I + J 00071 , - I + J, 2 * J 00072 }; 00073 const uint tabSize = sizeof(tab) / (2 * sizeof(CVector)); 00074 00075 const float sSize = 0.1f; 00076 displayIcon2d(tab, tabSize, sSize); 00077 00078 PARTICLES_CHECK_MEM; 00079 } |
|
process one pass for the particles. The default behaviour shows the particles Implements NL3D::CPSLocatedBindable. Reimplemented in NL3D::CPSFace, NL3D::CPSMesh, NL3D::CPSConstraintMesh, NL3D::CPSRibbon, NL3D::CPSRibbonLookAt, and NL3D::CPSTailDot. Definition at line 74 of file ps_particle_basic.h. References NL3D::CPSParticle::draw(), NL3D::CPSParticle::hasOpaqueFaces(), NL3D::CPSParticle::hasTransparentFaces(), NL3D::PSBlendRender, NL3D::PSSolidRender, NL3D::PSToolRender, NL3D::CPSParticle::showTool(), and NL3D::TAnimationTime.
00075 { 00076 if ( 00077 (pass == PSBlendRender && hasTransparentFaces()) 00078 || (pass == PSSolidRender && hasOpaqueFaces()) 00079 ) 00080 { 00081 draw(pass == PSSolidRender); 00082 } 00083 else 00084 if (pass == PSToolRender) // edition mode only 00085 { 00086 showTool(); 00087 } 00088 } |
|
Implemented in NL3D::CPSDot, NL3D::CPSFanLight, NL3D::CPSMesh, NL3D::CPSConstraintMesh, NL3D::CPSQuad, NL3D::CPSRibbon, NL3D::CPSRibbonLookAt, NL3D::CPSShockWave, and NL3D::CPSTailDot. |
|
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 from NL3D::CPSLocatedBindable. Definition at line 626 of file ps_ribbon_base.cpp. References _SamplingDate, NL3D::CParticleSystemProcess::getOwner(), NL3D::CParticleSystem::getSystemDate(), and nlassert.
00627 { 00628 nlassert(_Owner->getOwner()); 00629 _Owner->getOwner()->getSystemDate(); 00630 float date = _Owner->getOwner()->getSystemDate(); 00631 std::fill(_SamplingDate.begin(), _SamplingDate.end(), date); 00632 _LastUpdateDate = date; 00633 } |
|
Called each time the time of the system change in order to update the ribbons positions. decal date save current date updating ribbons positions Definition at line 139 of file ps_ribbon_base.cpp. References _NbSegs, _Parametric, _RibbonIndex, _Ribbons, _SamplingDate, _SegDuration, NL3D::CPSAttrib< T >::begin(), NL3D::EndRibbonStorage, NL3D::CParticleSystemProcess::getOwner(), NL3D::CPSLocated::getPos(), NL3D::CPSLocated::getSize(), NL3D::CParticleSystem::getSystemDate(), nlassert, size, NL3D::TAnimationTime, and uint. Referenced by NL3D::CPSTailDot::step(), NL3D::CPSRibbonLookAt::step(), and NL3D::CPSRibbon::step().
00140 { 00141 nlassert(!_Parametric); 00142 nlassert(_Owner); 00143 const uint size = _Owner->getSize(); 00144 if (!size) return; 00145 const TAnimationTime currDate = _Owner->getOwner()->getSystemDate() + realET; 00146 if (currDate - _LastUpdateDate >= _SegDuration) 00147 { 00148 if (_RibbonIndex == 0) _RibbonIndex = _NbSegs + EndRibbonStorage; 00149 else --_RibbonIndex; 00150 00152 ::memmove(&_SamplingDate[1], &_SamplingDate[0], sizeof(float) * (_NbSegs + EndRibbonStorage)); 00153 _LastUpdateDate = currDate; 00154 } 00155 00157 _SamplingDate[0] = currDate; 00158 00160 TPSAttribVector::iterator posIt = _Owner->getPos().begin(); 00161 NLMISC::CVector *currIt = &_Ribbons[_RibbonIndex]; 00162 uint k = size; 00163 for (;;) 00164 { 00165 *currIt = *posIt; 00166 --k; 00167 if (!k) break; 00168 ++posIt; 00169 currIt += (_NbSegs + 1 + EndRibbonStorage); 00170 } 00171 } |
|
must be called for the lod to apply (updates UsedNbSegs)
Definition at line 610 of file ps_ribbon_base.cpp. References _NbSegs, _SegDuration, _SegLength, _UsedNbSegs, _UsedSegDuration, _UsedSegLength, NLMISC::clamp(), NL3D::CParticleSystem::getOneMinusCurrentLODRatio(), NL3D::CParticleSystemProcess::getOwner(), nlassert, and uint.
00611 { 00612 nlassert(_Owner); 00613 float ratio = _Owner->getOwner()->getOneMinusCurrentLODRatio(); 00614 float squaredRatio = ratio * ratio; 00615 float lodRatio = _LODDegradation + (1.f - _LODDegradation ) * squaredRatio * squaredRatio * squaredRatio; 00616 00617 _UsedNbSegs = (uint) (_NbSegs * lodRatio); 00618 NLMISC::clamp(_UsedNbSegs, 0u, _NbSegs); 00619 const float epsilon = 10E-4f; 00620 _UsedSegDuration = _SegDuration / std::max(epsilon, lodRatio); 00621 _UsedSegLength = _SegLength / std::max(epsilon, lodRatio); 00622 00623 } |
|
Returns true if the object can use global lighting color. (example : 'lookat' particle do not have normals, so they use global lighting color instead Definition at line 103 of file ps_particle_basic.h. References NL3D::CPSParticle::_UsesGlobalColorLighting. Referenced by NL3D::CPSTailDot::displayRibbons(), NL3D::CPSRibbonLookAt::displayRibbons(), NL3D::CPSRibbon::displayRibbons(), NL3D::CPSShockWave::draw(), NL3D::CPSDot::draw(), NL3D::CPSTailDot::setupGlobalColor(), NL3D::CPSFanLight::setupMaterial(), NL3D::CPSRibbon::setupTexturedGlobalColor(), NL3D::CPSRibbon::setupUntexturedGlobalColor(), NL3D::CPSTailDot::step(), NL3D::CPSRibbonLookAt::step(), NL3D::CPSRibbon::step(), NL3D::CPSQuad::updateMatBeforeRendering(), NL3D::CPSTailDot::updateMaterial(), NL3D::CPSRibbon::updateTexturedMaterial(), and NL3D::CPSRibbon::updateUntexturedMaterial().
00103 { return _UsesGlobalColorLighting; }
|
|
Reimplemented in NL3D::CPSForce. Definition at line 986 of file ps_located.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 149 of file ps_ribbon_base.h. Referenced by computeRibbon(), getInterpolationMode(), and setInterpolationMode(). |
|
Definition at line 147 of file ps_ribbon_base.h. |
|
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 152 of file ps_ribbon_base.h. |
|
Definition at line 1031 of file ps_located.h. |
|
Definition at line 101 of file ps_ribbon_base.h. Referenced by computeHermitteCstSizeRibbon(), computeHermitteRibbon(), computeLinearCstSizeRibbon(), computeLinearRibbon(), dupRibbon(), getTailNbSeg(), initDateVect(), resetSingleRibbon(), resize(), setRibbonLength(), setTailNbSeg(), updateGlobals(), and updateLOD(). |
|
|
Definition at line 103 of file ps_ribbon_base.h. Referenced by computeHermitteCstSizeRibbon(), computeHermitteRibbon(), computeLinearCstSizeRibbon(), computeLinearRibbon(), deleteElement(), dupRibbon(), motionTypeChanged(), newElement(), resetFromOwner(), resetSingleRibbon(), resize(), and updateGlobals(). |
|
Definition at line 143 of file ps_ribbon_base.h. Referenced by computeHermitteCstSizeRibbon(), computeHermitteRibbon(), computeLinearCstSizeRibbon(), computeLinearRibbon(), getRibbonIndex(), setTailNbSeg(), and updateGlobals(). |
|
Definition at line 150 of file ps_ribbon_base.h. Referenced by getRibbonLength(), and setRibbonLength(). |
|
Definition at line 148 of file ps_ribbon_base.h. Referenced by computeRibbon(), getRibbonMode(), and setRibbonMode(). |
|
Definition at line 146 of file ps_ribbon_base.h. Referenced by computeHermitteCstSizeRibbon(), computeHermitteRibbon(), computeLinearCstSizeRibbon(), computeLinearRibbon(), dupRibbon(), motionTypeChanged(), resetSingleRibbon(), resize(), and updateGlobals(). |
|
Definition at line 142 of file ps_ribbon_base.h. Referenced by computeHermitteRibbon(), computeLinearRibbon(), getSamplingDate(), initDateVect(), systemDateChanged(), and updateGlobals(). |
|
Definition at line 102 of file ps_ribbon_base.h. Referenced by getSegDuration(), setSegDuration(), updateGlobals(), and updateLOD(). |
|
Definition at line 151 of file ps_ribbon_base.h. Referenced by setRibbonLength(), and updateLOD(). |
|
value to use after lod computation
Definition at line 136 of file ps_ribbon_base.h. Referenced by computeHermitteCstSizeRibbon(), computeHermitteRibbon(), computeLinearCstSizeRibbon(), computeLinearRibbon(), and updateLOD(). |
|
Definition at line 137 of file ps_ribbon_base.h. Referenced by computeHermitteRibbon(), computeLinearRibbon(), and updateLOD(). |
|
Definition at line 138 of file ps_ribbon_base.h. Referenced by computeHermitteCstSizeRibbon(), computeLinearCstSizeRibbon(), and updateLOD(). |