offset to center wall

git-svn-id: svn://anubis/dwscr/trunk@94 5bef9df8-b654-44bb-925b-0ff18baa8f8c
This commit is contained in:
josh 2008-11-13 04:28:16 +00:00
parent 6e86df5482
commit 8e0ed9b3f3
2 changed files with 30 additions and 11 deletions

View File

@ -15,6 +15,25 @@ using namespace std;
#define STRIDE_MULTIPLIER 1.0;
#define ZOOM 10.0
LightBounceBox::LightBounceBox(LogoBox * lb,
float x, float y, float z,
float xr, float yr, float zr)
{
this->logoBox = lb;
this->x = x;
this->y = y;
this->z = z;
this->xr = xr;
this->yr = yr;
this->zr = zr;
this->dist = 0.0;
}
LightBounceBox::~LightBounceBox()
{
delete this->logoBox;
}
/* construct screensaver mode and do some basic OpenGL setup */
LightBounce::LightBounce(SSMain * _SSMain) : SSMode(_SSMain)
{
@ -38,14 +57,9 @@ LightBounce::LightBounce(SSMain * _SSMain) : SSMode(_SSMain)
float x = -half_size + box_stride / 2.0;
for (int j = 0; j < SIZE; j++)
{
LightBounce_Box * box = new LightBounce_Box;
box->logoBox = new LogoBox();
box->x = x;
box->y = y;
box->z = -half_size;
box->xr = 0;
box->yr = 0;
box->zr = rot ? 90.0 : 0;
LightBounceBox * box = new LightBounceBox(
new LogoBox(), x, y, -half_size, 0, 0, rot ? 90.0 : 0
);
m_boxes.push_back(box);
x += box_stride;
rot = !rot;

View File

@ -12,8 +12,13 @@
#include <vector>
using namespace std;
typedef struct
class LightBounceBox
{
public:
LightBounceBox(LogoBox * lb,
float x, float y, float z,
float xr, float yr, float zr);
~LightBounceBox();
LogoBox * logoBox;
float x;
float y;
@ -22,7 +27,7 @@ typedef struct
float yr;
float zr;
float dist;
} LightBounce_Box;
};
class LightBounce : public SSMode
{
@ -30,7 +35,7 @@ public:
LightBounce(SSMain * _SSMain);
void update();
protected:
vector<LightBounce_Box *> m_boxes;
vector<LightBounceBox *> m_boxes;
};
#endif