NormalTraitGeneric Struct Reference

Inheritance diagram for NormalTraitGeneric:

ParticleTraits

List of all members.

Static Public Member Functions

static void init (Particles *part, DrawActionBase *, dataType &data)
static bool particle (dataType &data, UInt32 particle)
static Vec3fnormal (dataType &data)
static void normal (dataType &data, UInt32)

Classes

struct  dataType


Detailed Description

Normal Particle Traits

Definition at line 1058 of file OSGParticles.cpp.


Member Function Documentation

static void NormalTraitGeneric::init ( Particles part,
DrawActionBase ,
dataType data 
) [inline, static]

Definition at line 1068 of file OSGParticles.cpp.

References osg::ParticlesBase::getNormals(), osg::ParticlesBase::getPositions(), NormalTraitGeneric::dataType::n, NormalTraitGeneric::dataType::norms, osg::NullFC, and NormalTraitGeneric::dataType::perParticle.

01069     {
01070         data.norms = part->getNormals();
01071         
01072         data.perParticle = false;
01073         
01074         if(data.norms != NullFC)
01075         {
01076             if(data.norms->size() == 1)
01077             {
01078                 data.n = data.norms->getValue(0);
01079             }
01080             else if(data.norms->getSize() == part->getPositions()->getSize())
01081             {
01082                 data.perParticle = true;
01083             }
01084             else
01085             {
01086                 data.n.setValues(0,1,0);
01087             }           
01088         }
01089         else
01090         {
01091             data.n.setValues(0,1,0);
01092         }
01093     }

static bool NormalTraitGeneric::particle ( dataType data,
UInt32  particle 
) [inline, static]

Definition at line 1095 of file OSGParticles.cpp.

References NormalTraitGeneric::dataType::n, NormalTraitGeneric::dataType::norms, and NormalTraitGeneric::dataType::perParticle.

01096     {
01097         if(data.perParticle)
01098             data.norms->getValue(data.n, particle);
01099              
01100         return false;
01101     }

static Vec3f& NormalTraitGeneric::normal ( dataType data  )  [inline, static]

Definition at line 1103 of file OSGParticles.cpp.

References NormalTraitGeneric::dataType::n.

01104     {
01105         return data.n;
01106     }

static void NormalTraitGeneric::normal ( dataType data,
UInt32   
) [inline, static]

Definition at line 1108 of file OSGParticles.cpp.

References osg::PointInterface< ValueTypeT, StorageInterfaceT >::getValues(), and NormalTraitGeneric::dataType::n.

01109     {
01110         glNormal3fv( (GLfloat*) data.n.getValues() );            
01111     }


The documentation for this struct was generated from the following file:

Generated on Mon Mar 17 12:02:59 2008 for OpenSG by  doxygen 1.5.5