Ignore:
Timestamp:
Apr 3, 2013 2:31:10 AM (11 years ago)
Author:
ldelgass
Message:

Some fixes for particle system compile (still doesn't work).

Location:
trunk/packages/vizservers/nanovis
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/vizservers/nanovis/Makefile.in

    r3612 r3618  
    22USE_THREADS             = yes
    33USE_POINTSET_RENDERER   = #yes
     4USE_PARTICLE_SYSTEM     = #yes
    45
    56SHELL = /bin/sh
     
    180181                $(srcdir)/shaders/zincblende_volume.cg
    181182
    182 ifdef NOTDEF
     183ifdef USE_PARTICLE_SYSTEM
    183184OBJS +=         ParticleEmitter.o \
    184185                ParticleSystem.o \
     
    298299ParticleEmitter.o: ParticleEmitter.cpp ParticleEmitter.h
    299300ParticleRenderer.o: ParticleRenderer.cpp ParticleRenderer.h
    300 ParticleSystem.o: ParticleSystem.cpp ParticleSystem.h DataLoader.h
     301ParticleSystem.o: ParticleSystem.cpp ParticleSystem.h
    301302ParticleSystemFactory.o: ParticleSystemFactory.cpp ParticleSystemFactory.h
    302303PCASplit.o: PCASplit.cpp PCASplit.h
  • trunk/packages/vizservers/nanovis/ParticleEmitter.cpp

    r3502 r3618  
    55 */
    66#include "ParticleEmitter.h"
     7
     8using namespace nv;
    79
    810ParticleEmitter::ParticleEmitter() :
  • trunk/packages/vizservers/nanovis/ParticleEmitter.h

    r3613 r3618  
    1616{
    1717public:
    18    ParticleEmitter();
     18    ParticleEmitter();
    1919
    2020    void setName(const std::string& name);
  • trunk/packages/vizservers/nanovis/ParticleSystem.cpp

    r3612 r3618  
    2727#include "ParticleSystem.h"
    2828#include "ParticleEmitter.h"
    29 #include "DataLoader.h"
    3029#include "Texture2D.h"
    3130#include "Texture3D.h"
     
    3332#include "Trace.h"
    3433
     34using namespace nv;
    3535using namespace nv::util;
    3636
     
    987987
    988988        glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, _atlas_fbo);
    989         _streamVertices->Read(_atlasWidth, _atlasHeight);
     989        _streamVertices->read(_atlasWidth, _atlasHeight);
    990990        glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
    991991        _currentStreamlineIndex++;
     
    10961096
    10971097            glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, psys_fbo[_destPosIndex]);
    1098             _vertices->Read(_width, _height);
     1098            _vertices->read(_width, _height);
    10991099            glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
    11001100        } else {
    11011101            glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, psys_fbo[_currentPosIndex]);
    1102             _vertices->Read(_width, _height);
     1102            _vertices->read(_width, _height);
    11031103            glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
    11041104        }
     
    11101110            for (unsigned int k = 0; k < numOfNewParticles; ++k) {
    11111111                vrmath::Vector3f position = _emitters[i]->_position;
    1112                 position += _emitters[i]->_maxPositionOffset *
    1113                     vrmath::Vector3f(randomRange(-1.0f, 1.0f), randomRange(-1.0f, 1.0f), randomRange(-1.0f, 1.0f));
    1114 
     1112                position +=
     1113                    _emitters[i]->_maxPositionOffset.scale(vrmath::Vector3f(randomRange(-1.0f, 1.0f),
     1114                                                                            randomRange(-1.0f, 1.0f),
     1115                                                                            randomRange(-1.0f, 1.0f)));
    11151116                float lifetime = randomRange(_emitters[i]->_minLifeTime, _emitters[i]->_maxLifeTime);
    11161117
     
    15811582        //glEnableClientState(GL_COLOR_ARRAY);
    15821583
    1583         _streamVertices->SetPointer(0);
     1584        _streamVertices->setPointer(0);
    15841585        //glColorPointer(4, GL_FLOAT, 0, 0);
    15851586
     
    16531654            glEnableClientState(GL_VERTEX_ARRAY);
    16541655            //glEnableClientState(GL_COLOR_ARRAY);
    1655             _vertices->SetPointer(0);
     1656            _vertices->setPointer(0);
    16561657            //glBindBufferARB(GL_ARRAY_BUFFER, _colorBufferID);
    16571658            //glColorPointer(4, GL_FLOAT, 0, 0);
     
    16911692            glEnableClientState(GL_VERTEX_ARRAY);
    16921693            //glEnableClientState(GL_COLOR_ARRAY);
    1693             _vertices->SetPointer(0);
     1694            _vertices->setPointer(0);
    16941695            //glBindBufferARB(GL_ARRAY_BUFFER, _colorBufferID);
    16951696            //glColorPointer(4, GL_FLOAT, 0, 0);
     
    17181719            //glEnableClientState(GL_COLOR_ARRAY);
    17191720            glPointSize(10);
    1720             _vertices->SetPointer(0);
     1721            _vertices->setPointer(0);
    17211722            //glBindBufferARB(GL_ARRAY_BUFFER, _colorBufferID);
    17221723            //glColorPointer(4, GL_FLOAT, 0, 0);
     
    17251726
    17261727            glPointSize(1);
    1727             _vertices->SetPointer(0);
     1728            _vertices->setPointer(0);
    17281729            //glBindBufferARB(GL_ARRAY_BUFFER, _colorBufferID);
    17291730            //glColorPointer(4, GL_FLOAT, 0, 0);
  • trunk/packages/vizservers/nanovis/ParticleSystem.h

    r3613 r3618  
    4949};
    5050
    51 namespace std
    52 {
    53     template <>
    54     struct greater<ActiveParticle> {
    55         bool operator() (const ActiveParticle& left, const ActiveParticle& right)
    56         {
    57             return left.timeOfDeath > right.timeOfDeath;
    58         }
    59     };
    60 }
     51struct particle_greater {
     52    bool operator() (const ActiveParticle& left, const ActiveParticle& right)
     53    {
     54        return (left.timeOfDeath > right.timeOfDeath);
     55    }
     56};
    6157
    6258struct color4 {
     
    173169
    174170    priority_queue_vector<int, std::greater<int> > _availableIndices;
    175     priority_queue_vector<ActiveParticle, std::greater<ActiveParticle> > _activeParticles;
     171    priority_queue_vector<ActiveParticle, particle_greater > _activeParticles;
    176172    std::vector<NewParticle> _newParticles;
    177173
  • trunk/packages/vizservers/nanovis/ParticleSystemFactory.cpp

    r3502 r3618  
    1515#include "Trace.h"
    1616
     17using namespace nv;
    1718using namespace nv::util;
    1819
  • trunk/packages/vizservers/nanovis/vrmath/include/vrmath/Vector3f.h

    r3567 r3618  
    4848    Vector3f normalize() const;
    4949
    50     Vector3f scale(Vector3f& sc) const;
     50    Vector3f scale(const Vector3f& sc) const;
    5151
    5252    Vector3f scale(float scale) const;
     
    236236}
    237237
    238 inline Vector3f Vector3f::scale(Vector3f& sc) const
     238inline Vector3f Vector3f::scale(const Vector3f& sc) const
    239239{
    240240    return Vector3f(x * sc.x, y * sc.y, z * sc.z);
Note: See TracChangeset for help on using the changeset viewer.