dwscr/ss/LightBounce.h
josh 943e1dade3 transparency based on orb distance working, need new orb and light source
git-svn-id: svn://anubis/dwscr/trunk@110 5bef9df8-b654-44bb-925b-0ff18baa8f8c
2008-11-14 04:22:12 +00:00

66 lines
1.2 KiB
C++

/* Author: Josh Holtrop
* DornerWorks screensaver
*/
#ifndef LIGHTBOUNCE_H
#define LIGHTBOUNCE_H
#include "SSMain.h"
#include "SSMode.h"
#include "LogoBox.h"
#include <vector>
using namespace std;
class LightBounceBox
{
public:
LightBounceBox(LogoBox * lb,
float x, float y, float z,
float xr, float yr, float zr);
~LightBounceBox();
void draw() { glCallList(m_dl); }
void updateDist(float x, float y, float z);
float getDist() { return dist; }
float getX() { return x; }
float getY() { return y; }
float getZ() { return z; }
private:
float x;
float y;
float z;
float xr;
float yr;
float zr;
float dist;
GLuint m_dl;
};
class LightBounceBoxComparator
{
public:
bool operator()(LightBounceBox * l1, LightBounceBox * l2);
};
class LightBounce : public SSMode
{
public:
LightBounce(SSMain * _SSMain);
~LightBounce();
void update();
protected:
LightBounceBoxComparator m_comparator;
vector<LightBounceBox *> m_boxes;
LogoBox m_logoBox;
GLfloat m_orb_pos[3];
GLfloat m_orb_dir[3];
GLuint m_orb_dl;
float m_half_size;
Uint32 m_last_elapsed;
GLuint m_alpha_texture;
};
#endif