source: nanovis/trunk/ParticleAdvectionShader.h @ 5704

Last change on this file since 5704 was 4895, checked in by ldelgass, 5 years ago

Merge some fixes from release branch

  • Property svn:eol-style set to native
File size: 1.0 KB
Line 
1/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2/*
3 * Copyright (c) 2004-2013  HUBzero Foundation, LLC
4 *
5 */
6#ifndef NV_PARTICLE_ADVECTION_SHADER_H
7#define NV_PARTICLE_ADVECTION_SHADER_H
8
9#include <vrmath/Vector3f.h>
10
11#include "Shader.h"
12
13namespace nv {
14
15class ParticleAdvectionShader : public Shader
16{
17public:
18    ParticleAdvectionShader();
19
20    virtual ~ParticleAdvectionShader();
21
22    virtual void bind(unsigned int texID, unsigned int initPosTexID, bool init);
23
24    virtual void unbind();
25
26    void setScale(const vrmath::Vector3f& scale)
27    {
28        _scale = scale;
29    }
30
31    void setVelocityVolume(unsigned int texID, float max)
32    {
33        _velocityVolumeID = texID;
34        _max = max;
35        // FIXME: Is this needed?
36        if (_max > 100.f)
37            _max = 100.0f;
38    }
39
40    void setTimeStep(float timeStep)
41    {
42        _timeStep = timeStep;
43    }
44
45private:
46    void init();
47
48    unsigned int _velocityVolumeID;
49    vrmath::Vector3f _scale;
50    float _max;
51    float _timeStep;
52};
53
54}
55
56#endif
Note: See TracBrowser for help on using the repository browser.