added updateDist() function to LightBounceBox
git-svn-id: svn://anubis/dwscr/trunk@100 5bef9df8-b654-44bb-925b-0ff18baa8f8c
This commit is contained in:
parent
1c41d64a3a
commit
17d3b1e154
@ -44,6 +44,14 @@ LightBounceBox::~LightBounceBox()
|
|||||||
glDeleteLists(m_dl, 1);
|
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 */
|
/* construct screensaver mode and do some basic OpenGL setup */
|
||||||
LightBounce::LightBounce(SSMain * _SSMain) : SSMode(_SSMain)
|
LightBounce::LightBounce(SSMain * _SSMain) : SSMode(_SSMain)
|
||||||
{
|
{
|
||||||
|
@ -20,7 +20,7 @@ public:
|
|||||||
float xr, float yr, float zr);
|
float xr, float yr, float zr);
|
||||||
~LightBounceBox();
|
~LightBounceBox();
|
||||||
void draw() { glCallList(m_dl); }
|
void draw() { glCallList(m_dl); }
|
||||||
float dist;
|
void updateDist(float x, float y, float z);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
float x;
|
float x;
|
||||||
@ -29,6 +29,7 @@ private:
|
|||||||
float xr;
|
float xr;
|
||||||
float yr;
|
float yr;
|
||||||
float zr;
|
float zr;
|
||||||
|
float dist;
|
||||||
|
|
||||||
GLuint m_dl;
|
GLuint m_dl;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user