NL3D::CPSUtil Struct Reference

#include <ps_util.h>


Detailed Description

This struct contains utility functions used by the particle system.
Author:
Nicolas Vizerie

Nevrax France

Date:
2001

Definition at line 57 of file ps_util.h.

Static Public Member Functions

void addRadiusToAABBox (NLMISC::CAABBox &box, float radius)
 enlarge a bounding box by the specified radius

float buildPerlinNoise (NLMISC::CVector &pos, uint nbOctaves)
void buildSchmidtBasis (const NLMISC::CVector &v, NLMISC::CMatrix &dest)
void display3DQuad (NL3D::IDriver &driver, const NLMISC::CVector &c1, const NLMISC::CVector &c2,const NLMISC::CVector &c3, const NLMISC::CVector &c4, NLMISC::CRGBA color=NLMISC::CRGBA::White)
 display a 3d quad in wireline, by using the 4 gicen corners

void displayArrow (NL3D::IDriver *driver, const NLMISC::CVector &start, const NLMISC::CVector &v, float size, NLMISC::CRGBA col1, NLMISC::CRGBA col2)
void displayBasis (NL3D::IDriver *driver, const NLMISC::CMatrix &modelMat, const NLMISC::CMatrix &m, float size, CFontGenerator &fg, CFontManager &fm)
 display a basis using the given matrix. The model matrix must be restored after this call

void displayBBox (NL3D::IDriver *driver, const NLMISC::CAABBox &box, NLMISC::CRGBA col=NLMISC::CRGBA::White)
 this draw a bounding box

void displayCylinder (NL3D::IDriver &driver, const NLMISC::CVector &center, const NLMISC::CMatrix &mat, const NLMISC::CVector &dim, uint nbSubdiv=32, NLMISC::CRGBA color=NLMISC::CRGBA::White)
void displayDisc (NL3D::IDriver &driver, float radius, const NLMISC::CVector &center, const NLMISC::CMatrix &mat, uint nbSubdiv=32, NLMISC::CRGBA color=NLMISC::CRGBA::White)
void displaySphere (NL3D::IDriver &driver, float radius, const NLMISC::CVector &center, uint nbSubdiv=4, NLMISC::CRGBA color=NLMISC::CRGBA::White)
 draw a sphere

float getCos (sint32 angle)
float getSin (sint32 angle)
void initFastCosNSinTable (void)
void initPerlinNoiseTable (void)
void print (NL3D::IDriver *driver, const std::string &text, CFontGenerator &fg, CFontManager &fm, const NLMISC::CVector &pos, float size, NLMISC::CRGBA col=NLMISC::CRGBA::White)
 display a string at the given world position. The The model matrix must be restored after this call

void registerSerialParticleSystem (void)
 register the classes of the system mus be called when serializing


Static Private Member Functions

float getInterpolatedNoise (const NLMISC::CVector &pos)
float getPerlinNoise (uint x, uint y, uint z)
void registerAttribs ()
void registerEmitters ()
void registerForces ()
void registerParticles ()
void registerZones ()

Static Private Attributes

float _CosTable [256]
bool _CosTableInitialized = false
float _PerlinNoiseTab [1024]
bool _PerlinNoiseTableInitialized = false
float _SinTable [256]


Member Function Documentation

void NL3D::CPSUtil::addRadiusToAABBox NLMISC::CAABBox box,
float  radius
[inline, static]
 

enlarge a bounding box by the specified radius

Definition at line 179 of file ps_util.h.

References NLMISC::CAABBox::getHalfSize(), and NLMISC::CAABBox::setHalfSize().

00180 {
00181         box.setHalfSize(box.getHalfSize() + NLMISC::CVector(radius, radius, radius) );
00182 }

float NL3D::CPSUtil::buildPerlinNoise NLMISC::CVector pos,
uint  nbOctaves
[inline, static]
 

compute a perlin noise value, that will range from [0 to 1] The first octave has the unit size

See also:
initPerlinNoiseTable()

Definition at line 238 of file ps_util.h.

References _PerlinNoiseTableInitialized, getInterpolatedNoise(), nlassert, and uint.

00239 {
00240         nlassert(_PerlinNoiseTableInitialized);
00241 
00242         float result = 0;
00243         float fact = .5f;
00244         float scale = 1.f;
00245 
00246         for (uint k = 0; k < numOctaves; k++)
00247         {
00248                 result += fact * getInterpolatedNoise(scale * pos);
00249                 fact *= .5f;
00250                 scale *= 1.2537f;
00251         }       
00252         return result;
00253 }

void NL3D::CPSUtil::buildSchmidtBasis const NLMISC::CVector v,
NLMISC::CMatrix dest
[static]
 

build a basis from a vector using Schmidt orthogonalization method

Parameters:
v K axis in the resulting basis
dest The matrix containing the result. Only the rotation part is modified

Definition at line 257 of file ps_util.cpp.

References NLMISC::CVector::normalize(), and NLMISC::CMatrix::setRot().

Referenced by displayArrow().

00258 {
00259         const float epsilon = 10E-4f;
00260 
00261 
00262         CVector k = k_;
00263         k.normalize();
00264         CVector i;
00265         if ((1.0f - fabsf(k * CVector::I)) > epsilon)
00266         {
00267                 i = k ^ CVector::I;
00268         }
00269         else
00270         if ((1.0f - fabs(k * CVector::J)) > epsilon)
00271         {
00272                 i = k ^ CVector::J;
00273         }
00274         else
00275         {
00276                 i = k ^ CVector::K;
00277         }
00278 
00279         i = i - (k * i) * k;
00280         i.normalize();
00281         result.setRot(i, k ^ i, k, true);       
00282 }

void NL3D::CPSUtil::display3DQuad NL3D::IDriver driver,
const NLMISC::CVector c1,
const NLMISC::CVector c2,
const NLMISC::CVector c3,
const NLMISC::CVector c4,
NLMISC::CRGBA  color = NLMISC::CRGBA::White
[static]
 

display a 3d quad in wireline, by using the 4 gicen corners

Definition at line 383 of file ps_util.cpp.

00385 {
00386         CDRU::drawLine(c1, c2, color, driver);
00387         CDRU::drawLine(c2, c3, color, driver);
00388         CDRU::drawLine(c3, c4, color, driver);
00389         CDRU::drawLine(c4, c1, color, driver);
00390 }

void NL3D::CPSUtil::displayArrow NL3D::IDriver driver,
const NLMISC::CVector start,
const NLMISC::CVector v,
float  size,
NLMISC::CRGBA  col1,
NLMISC::CRGBA  col2
[static]
 

display an arrow (the same that is used with displayBasis) The user must setup the model matrix himself

Parameters:
driver the driver used for rendering
start start point of the arrow
v direction of the arrow
size size of the arrow (will be drawn as size * v)
col1 color of the arrow start
col2 color of the arrow end

Definition at line 169 of file ps_util.cpp.

References NL3D::IDriver::activeVertexBuffer(), buildSchmidtBasis(), NL3D::IDriver::renderTriangles(), NL3D::CMaterial::setBlend(), NL3D::CMaterial::setBlendFunc(), NL3D::CMaterial::setColor(), NL3D::CMaterial::setDoubleSided(), NL3D::CMaterial::setLighting(), NL3D::CVertexBuffer::setNumVertices(), NL3D::CVertexBuffer::setVertexCoord(), NL3D::CVertexBuffer::setVertexFormat(), NL3D::CMaterial::setZWrite(), size, uint32, and v.

Referenced by displayBasis().

00170 {
00171 
00172         const float coneSize = size * 0.1f;
00173 
00174         uint32 vTab[] = { 1, 2, 4,
00175                                                   4, 2, 3,
00176                                                   1, 2, 0,
00177                                                   2, 3, 0,
00178                                                   3, 4, 0,
00179                                                   4, 1, 0 };
00180 
00181         CVector end = start + size * v;
00182         CDRU::drawLine(start, end, col1, *driver);
00183         CMatrix m;
00184         buildSchmidtBasis(v, m);
00185 
00186         CVertexBuffer vb;
00187         vb.setVertexFormat(CVertexBuffer::PositionFlag);
00188         vb.setNumVertices(5); 
00189         
00190         
00191 
00192         vb.setVertexCoord(0, end + m * CVector(0, 0, 3.0f * coneSize) );
00193         vb.setVertexCoord(1, end + m * CVector(-coneSize, -coneSize, 0) );
00194         vb.setVertexCoord(2, end + m * CVector(coneSize, -coneSize, 0) );
00195         vb.setVertexCoord(3, end + m * CVector(coneSize, coneSize, 0) );
00196         vb.setVertexCoord(4, end + m * CVector(-coneSize, coneSize, 0) );
00197 
00198         CMaterial material;
00199 
00200         material.setColor(col2);
00201         material.setLighting(false);
00202         material.setBlendFunc(CMaterial::one, CMaterial::one);
00203         material.setZWrite(false);
00204         material.setBlend(true);
00205         material.setDoubleSided(true);
00206 
00207         driver->activeVertexBuffer(vb, 0, 5);
00208         driver->renderTriangles(material,  vTab, 6);
00209 }

void NL3D::CPSUtil::displayBasis NL3D::IDriver driver,
const NLMISC::CMatrix modelMat,
const NLMISC::CMatrix m,
float  size,
CFontGenerator fg,
CFontManager fm
[static]
 

display a basis using the given matrix. The model matrix must be restored after this call

Definition at line 212 of file ps_util.cpp.

References displayArrow(), NLMISC::CMatrix::getI(), NLMISC::CMatrix::getJ(), NLMISC::CMatrix::getK(), NLMISC::CMatrix::getPos(), NL3D::IDriver::setupModelMatrix(), and size.

00213 {
00214         CMaterial material;
00215 
00216         driver->setupModelMatrix(modelMat);
00217         
00218 
00219 
00220         displayArrow(driver, m.getPos(), m.getI(), size, CRGBA(127, 127, 127), CRGBA(0, 0, 80));
00221         displayArrow(driver, m.getPos(), m.getJ(), size, CRGBA(127, 127, 127), CRGBA(0, 0, 80));
00222         displayArrow(driver, m.getPos(), m.getK(), size, CRGBA(127, 127, 127), CRGBA(200, 0, 80));
00223 
00224         
00225         // draw the letters
00226 
00227         CPSUtil::print(driver, std::string("x"), fg, fm, modelMat * m * CVector(1.4f * size, 0, 0), 15.0f * size);
00228         CPSUtil::print(driver, std::string("y"), fg, fm, modelMat * m * CVector(0, 1.4f  * size, 0), 15.0f * size);
00229         CPSUtil::print(driver, std::string("z"), fg, fm, modelMat * m * CVector(0, 0, 1.4f  * size), 15.0f * size);
00230 
00231 };

void NL3D::CPSUtil::displayBBox NL3D::IDriver driver,
const NLMISC::CAABBox box,
NLMISC::CRGBA  col = NLMISC::CRGBA::White
[static]
 

this draw a bounding box

Definition at line 118 of file ps_util.cpp.

References NL3D::IDriver::activeVertexBuffer(), NL3D::CPrimitiveBlock::addLine(), NLMISC::CAABBox::getMax(), NLMISC::CAABBox::getMin(), min, NL3D::IDriver::render(), NL3D::CPrimitiveBlock::reserveLine(), NL3D::CMaterial::setBlend(), NL3D::CMaterial::setBlendFunc(), NL3D::CMaterial::setColor(), NL3D::CMaterial::setLighting(), NL3D::CVertexBuffer::setNumVertices(), NL3D::CVertexBuffer::setVertexCoord(), NL3D::CVertexBuffer::setVertexFormat(), NL3D::CMaterial::setZWrite(), NLMISC::CVector::x, NLMISC::CVector::y, and NLMISC::CVector::z.

00119 {       
00120         CVector max = box.getMax()
00121                         ,min = box.getMin();
00122         CVertexBuffer vb;
00123         vb.setVertexFormat(CVertexBuffer::PositionFlag);
00124         vb.setNumVertices(8);
00125 
00126         vb.setVertexCoord(0, min);
00127         vb.setVertexCoord(1, CVector(max.x, min.y, min.z));
00128         vb.setVertexCoord(2, CVector(min.x, max.y, min.z));
00129         vb.setVertexCoord(3, CVector(max.x, max.y, min.z));
00130         vb.setVertexCoord(4, CVector(min.x, min.y, max.z));
00131         vb.setVertexCoord(5, CVector(max.x, min.y, max.z));
00132         vb.setVertexCoord(6, CVector(min.x, max.y, max.z));
00133         vb.setVertexCoord(7, max);
00134 
00135 
00136         CMaterial material;
00137 
00138         material.setColor(col);
00139         material.setLighting(false);
00140         material.setBlendFunc(CMaterial::one, CMaterial::one);
00141         material.setZWrite(false);
00142         material.setBlend(true);
00143 
00144 
00145 
00146         CPrimitiveBlock pb;
00147         pb.reserveLine(12);
00148         pb.addLine(0, 1); 
00149         pb.addLine(1, 5); 
00150         pb.addLine(5, 4); 
00151         pb.addLine(4, 0); 
00152         pb.addLine(0, 2); 
00153         pb.addLine(1, 3); 
00154         pb.addLine(4, 6); 
00155         pb.addLine(5, 7); 
00156         pb.addLine(6, 7); 
00157         pb.addLine(7, 3); 
00158         pb.addLine(3, 2); 
00159         pb.addLine(2, 6); 
00160 
00161 
00162 
00163         driver->activeVertexBuffer(vb);
00164         driver->render(pb, material);
00165 }

void NL3D::CPSUtil::displayCylinder NL3D::IDriver driver,
const NLMISC::CVector center,
const NLMISC::CMatrix mat,
const NLMISC::CVector dim,
uint  nbSubdiv = 32,
NLMISC::CRGBA  color = NLMISC::CRGBA::White
[static]
 

draw a cylinder (not filled)

Parameters:
dim dimension of the cylinder along each axis, packed in a vector

Definition at line 351 of file ps_util.cpp.

References NLMISC::CMatrix::getI(), NLMISC::CMatrix::getJ(), NLMISC::CMatrix::getK(), uint, NLMISC::CVector::x, NLMISC::CVector::y, and NLMISC::CVector::z.

00352 {
00353         // not optimized, but for edition only
00354         float thetaDelta = (float) NLMISC::Pi * 2.f / nbSubdiv;
00355         float theta = 0.f;
00356         const CVector &I = mat.getI();
00357         const CVector &J = mat.getJ();
00358         const CVector &K = mat.getK();
00359 
00360         for (uint k = 0; k < nbSubdiv; ++k)
00361         {
00362                 
00363                 CDRU::drawLine(center + dim.z * K + dim.x * cosf(theta) * I + dim.y * sinf(theta) * J
00364                                            , center + dim.z * K + dim.x * cosf(theta + thetaDelta) * I + dim.y * sinf(theta + thetaDelta) * J
00365                                            , color, driver);
00366 
00367                 CDRU::drawLine(center - dim.z * K + dim.x * cosf(theta) * I + dim.y * sinf(theta) * J
00368                                            , center - dim.z * K + dim.x * cosf(theta + thetaDelta) * I + dim.y * sinf(theta + thetaDelta) * J
00369                                            , color, driver);
00370 
00371                 CDRU::drawLine(center + dim.z * K + dim.x * cosf(theta) * I + dim.y * sinf(theta) * J
00372                                            , center - dim.z * K + dim.x * cosf(theta) * I + dim.y * sinf(theta) * J
00373                                            , color, driver);
00374 
00375 
00376                 
00377                 
00378                 theta += thetaDelta;
00379         }       
00380 }

void NL3D::CPSUtil::displayDisc NL3D::IDriver driver,
float  radius,
const NLMISC::CVector center,
const NLMISC::CMatrix mat,
uint  nbSubdiv = 32,
NLMISC::CRGBA  color = NLMISC::CRGBA::White
[static]
 

draw a disc (not filled)

Parameters:
mat : a matrix, whose K vector is normal to the plane containing the disc

Definition at line 332 of file ps_util.cpp.

References NLMISC::CMatrix::getI(), NLMISC::CMatrix::getJ(), and uint.

00333 {
00334         // not optimized, but for edition only
00335         float thetaDelta = (float) NLMISC::Pi * 2.f / nbSubdiv;
00336         float theta = 0.f;
00337         const CVector &I = mat.getI();
00338         const CVector &J = mat.getJ();
00339         for (uint k = 0; k < nbSubdiv; ++k)
00340         {
00341                 
00342                 CDRU::drawLine(center + radius * ((float) cos(theta) * I + (float) sin(theta) * J)
00343                                            , center + radius * ((float) cos(theta + thetaDelta) * I + (float) sin(theta + thetaDelta) * J)
00344                                            , color, driver);
00345                 theta += thetaDelta;
00346         }
00347 
00348 }

void NL3D::CPSUtil::displaySphere NL3D::IDriver driver,
float  radius,
const NLMISC::CVector center,
uint  nbSubdiv = 4,
NLMISC::CRGBA  color = NLMISC::CRGBA::White
[static]
 

draw a sphere

Definition at line 286 of file ps_util.cpp.

References NLMISC::CVector::normalize(), uint, x, and y.

00287 {
00288         uint x, y, k;
00289         CVector p, p1, p2;
00290         
00291         static const CVector lK[] = { CVector::I, -CVector::I
00292                                                                 ,CVector::J, -CVector::J
00293                                                                 ,CVector::K, -CVector::K };
00294 
00295 /*      static const CVector lI = { CVector::J, -CVector::J
00296                                                                 ,CVector::K, -CVector::K
00297                                                                 ,CVector::I, -CVector::I };*/
00298 
00299 
00300 
00301         for (k = 0; k < 6; ++k)
00302         {
00303                 const CVector &I = lK[(k + 2) % 6];
00304                 const CVector &K = lK[k];
00305                 const CVector J = K ^ I;
00306 
00307                 for (x = 0; x < nbSubdiv; ++x)
00308                 {
00309                         for (y = 0; y < nbSubdiv; ++y)
00310                         {
00311                                 p = ((2.f * x / float(nbSubdiv) ) - 1.f) * I + ((2.f * y / float(nbSubdiv) ) - 1.f) * J + K;
00312                                 p1 = p + 2.f / float(nbSubdiv) * I;
00313                                 p2 = p + 2.f / float(nbSubdiv) * J;
00314 
00315                                 p.normalize(); 
00316                                 p1.normalize();
00317                                 p2.normalize();
00318 
00319                                 p = center + radius * p;
00320                                 p1 = center + radius * p1;
00321                                 p2 = center + radius * p2;
00322 
00323                                 CDRU::drawLine(p, p1, color, driver);
00324                                 CDRU::drawLine(p, p2, color, driver);
00325                         }
00326                 }
00327         }
00328 }

float NL3D::CPSUtil::getCos sint32  angle  )  [inline, static]
 

get a cosine from the fast cosine table (which must be have initialised with initFastCosNSinTable). 256 <=> 2 Pi

Definition at line 122 of file ps_util.h.

References _CosTable, _CosTableInitialized, nlassert, and sint32.

00123         { 
00124                 nlassert(_CosTableInitialized == true);
00125                 return _CosTable[angle & 0xff];
00126         }

float NL3D::CPSUtil::getInterpolatedNoise const NLMISC::CVector pos  )  [inline, static, private]
 

Definition at line 192 of file ps_util.h.

References getPerlinNoise(), uint, NLMISC::CVector::x, x, NLMISC::CVector::y, y, NLMISC::CVector::z, and z.

Referenced by buildPerlinNoise().

00193 {
00194         uint x = (uint) pos.x
00195                 , y = (uint) pos.y
00196                 , z = (uint) pos.z;
00197 
00198         // we want to avoid costly ctor call there...
00199         float fx = pos.x - x
00200                   , fy = pos.y - y
00201                   , fz = pos.z - z;
00202 
00203         // we use the following topology to get the value :
00204         //
00205         //
00206         //  z
00207         //  | 7-----6
00208         //   /     /
00209         //  4-----5 |
00210         //  |     | |
00211         //  |  3  | |2
00212         //  |     | /
00213         //  0_____1/__x
00214 
00215         
00216         const float v0 = getPerlinNoise(x, y, z)
00217                  ,v1 = getPerlinNoise(x + 1, y, z)
00218                  ,v2 = getPerlinNoise(x + 1, y + 1, z)
00219                  ,v3 = getPerlinNoise(x, y + 1, z)
00220                  ,v4 = getPerlinNoise(x, y, z + 1)
00221                  ,v5 = getPerlinNoise(x + 1, y, z + 1)
00222                  ,v6 = getPerlinNoise(x + 1, y + 1, z + 1)
00223                  ,v7 = getPerlinNoise(x, y + 1, z + 1);
00224 
00225         
00226         const float h1  = fx * v1 + (1.f - fx) * v0
00227                                 ,h2 = fx * v3 + (1.f - fx) * v2 
00228                                 ,h3  = fx * v5 + (1.f - fx) * v4
00229                                 ,h4 = fx * v7 + (1.f - fx )* v6; 
00230 
00231     const float c1  = fy * h2 + (1.f - fy) * h1
00232                        ,c2  = fy * h4 + (1.f - fy) * h3;
00233 
00234         return fz * c2 + (1.f - fz) * c1;
00235 }

float NL3D::CPSUtil::getPerlinNoise uint  x,
uint  y,
uint  z
[inline, static, private]
 

Definition at line 186 of file ps_util.h.

References _PerlinNoiseTab, uint, x, y, and z.

Referenced by getInterpolatedNoise().

00187 {
00188         return _PerlinNoiseTab[(x ^ y ^ z) & 1023];
00189 }

float NL3D::CPSUtil::getSin sint32  angle  )  [inline, static]
 

get a cosine from the fast cosine table (which must be have initialised with initFastCosNSinTable). 256 <=> 2 Pi

Definition at line 131 of file ps_util.h.

References _CosTableInitialized, _SinTable, nlassert, and sint32.

00132         { 
00133                 nlassert(_CosTableInitialized == true);
00134                 return _SinTable[angle & 0xff];
00135         }

void NL3D::CPSUtil::initFastCosNSinTable void   )  [static]
 

Init the table for cosine and sinus lookup

See also:
getCos(), getSin()

Definition at line 83 of file ps_util.cpp.

References _CosTable, _CosTableInitialized, _SinTable, and uint32.

Referenced by registerSerialParticleSystem().

00084 {
00085         for (uint32 k = 0; k < 256; k++)
00086         {
00087                 const float angle =  k / 256.0f * 2.0f * float(NLMISC::Pi); 
00088                 _CosTable[k] = (float) cos( angle );
00089                 _SinTable[k] = (float) sin( angle );
00090         }
00091         //#ifdef NL_DEBUG
00092                 _CosTableInitialized = true;
00093         //#endif
00094 }

void NL3D::CPSUtil::initPerlinNoiseTable void   )  [static]
 

init the table used by perlin noise. This must be used before any call to buildPerlinNoise

Definition at line 71 of file ps_util.cpp.

References _PerlinNoiseTab, _PerlinNoiseTableInitialized, and uint32.

Referenced by registerSerialParticleSystem().

00072 {
00073         for (uint32 k = 0; k < 1024; ++k)
00074         {
00075                 _PerlinNoiseTab[k] = (rand() % 30000) / 30000.f; 
00076         }
00077         //#ifdef NL_DEBUG
00078                 _PerlinNoiseTableInitialized = true;
00079         //#endif
00080 }

void NL3D::CPSUtil::print NL3D::IDriver driver,
const std::string &  text,
CFontGenerator fg,
CFontManager fm,
const NLMISC::CVector pos,
float  size,
NLMISC::CRGBA  col = NLMISC::CRGBA::White
[static]
 

display a string at the given world position. The The model matrix must be restored after this call

Definition at line 235 of file ps_util.cpp.

References NL3D::IDriver::getViewMatrix(), nlassert, NL3D::CComputedString::render3D(), NLMISC::CMatrix::scale(), NLMISC::CMatrix::setPos(), size, and NLMISC::CMatrix::transpose().

00236 {
00237         nlassert((&fg) && (&fm));       
00238         CComputedString cptedString;    
00239         fm.computeString ( text,
00240                                                 &fg, 
00241                                                 col,
00242                                                 16, 
00243                                                 driver,
00244                                                 cptedString);
00245                         
00246                 
00247         CMatrix mat = driver->getViewMatrix();  
00248         mat.setPos(CVector::Null);      
00249         mat.scale(CVector(size, size, size));           
00250         mat.transpose();
00251         mat.setPos(pos);         
00252         cptedString.render3D(*driver, mat);
00253 }

void NL3D::CPSUtil::registerAttribs  )  [static, private]
 

Definition at line 40 of file ps_register_attribs.cpp.

References NL3D::PSRegisterColorAttribs(), NL3D::PSRegisterFloatAttribs(), NL3D::PSRegisterIntAttribs(), and NL3D::PSRegisterPlaneBasisAttribs().

Referenced by registerSerialParticleSystem().

void NL3D::CPSUtil::registerEmitters  )  [static, private]
 

Definition at line 35 of file ps_register_emitters.cpp.

References NLMISC_REGISTER_CLASS.

Referenced by registerSerialParticleSystem().

00036         {
00037                 NLMISC_REGISTER_CLASS(CPSEmitterOmni);
00038                 NLMISC_REGISTER_CLASS(CPSEmitterDirectionnal);
00039                 NLMISC_REGISTER_CLASS(CPSEmitterRectangle);
00040                 NLMISC_REGISTER_CLASS(CPSEmitterConic);
00041                 NLMISC_REGISTER_CLASS(CPSSphericalEmitter);
00042                 NLMISC_REGISTER_CLASS(CPSRadialEmitter);
00043                 
00044         }

void NL3D::CPSUtil::registerForces  )  [static, private]
 

Definition at line 35 of file ps_register_forces.cpp.

References NLMISC_REGISTER_CLASS.

Referenced by registerSerialParticleSystem().

00036         {
00037                         NLMISC_REGISTER_CLASS(CPSSpring);
00038                 NLMISC_REGISTER_CLASS(CPSDirectionnalForce); 
00039                 NLMISC_REGISTER_CLASS(CPSGravity); 
00040                 NLMISC_REGISTER_CLASS(CPSBrownianForce);
00041                 NLMISC_REGISTER_CLASS(CPSCentralGravity); 
00042                 NLMISC_REGISTER_CLASS(CPSFluidFriction);
00043                 NLMISC_REGISTER_CLASS(CPSTurbul);
00044                 NLMISC_REGISTER_CLASS(CPSCylindricVortex);
00045                 NLMISC_REGISTER_CLASS(CPSMagneticForce);
00046                 CPSBrownianForce::initPrecalc();
00047         }

void NL3D::CPSUtil::registerParticles  )  [static, private]
 

Definition at line 36 of file ps_register_particles.cpp.

References NLMISC_REGISTER_CLASS.

Referenced by registerSerialParticleSystem().

00037         {
00038                 NLMISC_REGISTER_CLASS(CPSFanLight);
00039                 NLMISC_REGISTER_CLASS(CPSTailDot);
00040                 NLMISC_REGISTER_CLASS(CPSRibbon);
00041                 NLMISC_REGISTER_CLASS(CPSRibbonLookAt);
00042                 NLMISC_REGISTER_CLASS(CPSShockWave);
00043                 NLMISC_REGISTER_CLASS(CPSFace);
00044                 NLMISC_REGISTER_CLASS(CPSMesh);
00045                 NLMISC_REGISTER_CLASS(CPSConstraintMesh);
00046                 NLMISC_REGISTER_CLASS(CPSDot);
00047                 NLMISC_REGISTER_CLASS(CPSFaceLookAt);
00048 
00049                 CPSRotated2DParticle::initRotTable(); // init the precalc rot table for face lookat
00050                 CPSFanLight::initFanLightPrecalc();
00051                 CPSDot::initVertexBuffers();
00052                 CPSQuad::initVertexBuffers();
00053                 CPSConstraintMesh::initPrerotVB();
00054         }

void NL3D::CPSUtil::registerSerialParticleSystem void   )  [static]
 

register the classes of the system mus be called when serializing

Definition at line 97 of file ps_util.cpp.

References initFastCosNSinTable(), initPerlinNoiseTable(), NLMISC_REGISTER_CLASS, registerAttribs(), registerEmitters(), registerForces(), registerParticles(), and registerZones().

00098 {                               
00099                 NLMISC_REGISTER_CLASS(CPSLocated);                                                                              
00100                 NLMISC_REGISTER_CLASS(CParticleSystemShape);            
00101                 NLMISC_REGISTER_CLASS(CPSSound);
00102                 NLMISC_REGISTER_CLASS(CPSLight);
00103 
00104 
00105                 registerParticles();
00106                 registerForces();
00107                 registerEmitters();
00108                 registerZones();
00109                 registerAttribs();
00110 
00111 
00112                 // while we are here, we perform some important inits           
00113                 initFastCosNSinTable(); // init fast cosine lookup table
00114                 initPerlinNoiseTable(); // init perlin noise table                              
00115 }

void NL3D::CPSUtil::registerZones  )  [static, private]
 

Definition at line 35 of file ps_register_zones.cpp.

References NLMISC_REGISTER_CLASS.

Referenced by registerSerialParticleSystem().

00036         {
00037                 NLMISC_REGISTER_CLASS(CPSZonePlane);
00038                 NLMISC_REGISTER_CLASS(CPSZoneSphere);
00039                 NLMISC_REGISTER_CLASS(CPSZoneDisc);
00040                 NLMISC_REGISTER_CLASS(CPSZoneRectangle);
00041                 NLMISC_REGISTER_CLASS(CPSZoneCylinder);
00042         }


Field Documentation

float NL3D::CPSUtil::_CosTable [static, private]
 

Definition at line 63 of file ps_util.cpp.

Referenced by getCos(), and initFastCosNSinTable().

bool NL3D::CPSUtil::_CosTableInitialized = false [static, private]
 

Definition at line 59 of file ps_util.cpp.

Referenced by getCos(), getSin(), and initFastCosNSinTable().

float NL3D::CPSUtil::_PerlinNoiseTab [static, private]
 

Definition at line 65 of file ps_util.cpp.

Referenced by getPerlinNoise(), and initPerlinNoiseTable().

bool NL3D::CPSUtil::_PerlinNoiseTableInitialized = false [static, private]
 

Definition at line 60 of file ps_util.cpp.

Referenced by buildPerlinNoise(), and initPerlinNoiseTable().

float NL3D::CPSUtil::_SinTable [static, private]
 

Definition at line 64 of file ps_util.cpp.

Referenced by getSin(), and initFastCosNSinTable().


The documentation for this struct was generated from the following files:
Generated on Tue Mar 16 07:29:53 2004 for NeL by doxygen 1.3.6