TexTraitGeneric Struct Reference

Inheritance diagram for TexTraitGeneric:

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 void vertex (dataType &data)
static void vertex (dataType &data, UInt32, Real32 u, Real32 v)

Classes

struct  dataType


Detailed Description

Particle Texture Traits

Definition at line 911 of file OSGParticles.cpp.


Member Function Documentation

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

Definition at line 921 of file OSGParticles.cpp.

References osg::ParticlesBase::getMFTextureZs(), osg::ParticlesBase::getPositions(), TexTraitGeneric::dataType::perParticle, osg::MField< FieldTypeT, fieldNameSpace >::size(), TexTraitGeneric::dataType::texzs, and TexTraitGeneric::dataType::z.

00922     {
00923         data.texzs = part->getMFTextureZs();
00924         
00925         data.perParticle = false;
00926         
00927         if(data.texzs != NULL)
00928         {
00929             if(data.texzs->size() == 1)
00930             {
00931                 data.z = (*(data.texzs))[0];
00932              }
00933             else if(data.texzs->size() == part->getPositions()->size())
00934             {
00935                 data.perParticle = true;
00936             }
00937             else
00938             {
00939                 data.z = 0;
00940             }           
00941         }
00942         else
00943         {
00944             data.z = 0;
00945         }
00946     }

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

Definition at line 948 of file OSGParticles.cpp.

References TexTraitGeneric::dataType::perParticle, TexTraitGeneric::dataType::texzs, and TexTraitGeneric::dataType::z.

00949     {       
00950         if(data.perParticle)
00951         {
00952             data.z = (*(data.texzs))[particle];
00953         }
00954         return false;
00955     }

static void TexTraitGeneric::vertex ( dataType data  )  [inline, static]

Definition at line 957 of file OSGParticles.cpp.

References TexTraitGeneric::dataType::z.

00958     {
00959         glTexCoord1f(data.z);
00960     }

static void TexTraitGeneric::vertex ( dataType data,
UInt32  ,
Real32  u,
Real32  v 
) [inline, static]

Definition at line 962 of file OSGParticles.cpp.

References TexTraitGeneric::dataType::z.

00964     {
00965         glTexCoord3f(u, v, data.z);
00966     }


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