added updateDist() function to LightBounceBox

git-svn-id: svn://anubis/dwscr/trunk@100 5bef9df8-b654-44bb-925b-0ff18baa8f8c
This commit is contained in:
josh 2008-11-13 16:17:32 +00:00
parent 1c41d64a3a
commit 17d3b1e154
2 changed files with 10 additions and 1 deletions

View File

@ -44,6 +44,14 @@ LightBounceBox::~LightBounceBox()
glDeleteLists(m_dl, 1);
}
void LightBounceBox::updateDist(float x, float y, float z)
{
float dx = x - this->x;
float dy = y - this->y;
float dz = z - this->z;
this->dist = (dx*dx) + (dy*dy) + (dz*dz);
}
/* construct screensaver mode and do some basic OpenGL setup */
LightBounce::LightBounce(SSMain * _SSMain) : SSMode(_SSMain)
{

View File

@ -20,7 +20,7 @@ public:
float xr, float yr, float zr);
~LightBounceBox();
void draw() { glCallList(m_dl); }
float dist;
void updateDist(float x, float y, float z);
private:
float x;
@ -29,6 +29,7 @@ private:
float xr;
float yr;
float zr;
float dist;
GLuint m_dl;
};