offset to center wall
git-svn-id: svn://anubis/dwscr/trunk@94 5bef9df8-b654-44bb-925b-0ff18baa8f8c
This commit is contained in:
parent
6e86df5482
commit
8e0ed9b3f3
@ -15,6 +15,25 @@ using namespace std;
|
|||||||
#define STRIDE_MULTIPLIER 1.0;
|
#define STRIDE_MULTIPLIER 1.0;
|
||||||
#define ZOOM 10.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 */
|
/* construct screensaver mode and do some basic OpenGL setup */
|
||||||
LightBounce::LightBounce(SSMain * _SSMain) : SSMode(_SSMain)
|
LightBounce::LightBounce(SSMain * _SSMain) : SSMode(_SSMain)
|
||||||
{
|
{
|
||||||
@ -38,14 +57,9 @@ LightBounce::LightBounce(SSMain * _SSMain) : SSMode(_SSMain)
|
|||||||
float x = -half_size + box_stride / 2.0;
|
float x = -half_size + box_stride / 2.0;
|
||||||
for (int j = 0; j < SIZE; j++)
|
for (int j = 0; j < SIZE; j++)
|
||||||
{
|
{
|
||||||
LightBounce_Box * box = new LightBounce_Box;
|
LightBounceBox * box = new LightBounceBox(
|
||||||
box->logoBox = new LogoBox();
|
new LogoBox(), x, y, -half_size, 0, 0, rot ? 90.0 : 0
|
||||||
box->x = x;
|
);
|
||||||
box->y = y;
|
|
||||||
box->z = -half_size;
|
|
||||||
box->xr = 0;
|
|
||||||
box->yr = 0;
|
|
||||||
box->zr = rot ? 90.0 : 0;
|
|
||||||
m_boxes.push_back(box);
|
m_boxes.push_back(box);
|
||||||
x += box_stride;
|
x += box_stride;
|
||||||
rot = !rot;
|
rot = !rot;
|
||||||
|
@ -12,8 +12,13 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
using namespace std;
|
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;
|
LogoBox * logoBox;
|
||||||
float x;
|
float x;
|
||||||
float y;
|
float y;
|
||||||
@ -22,7 +27,7 @@ typedef struct
|
|||||||
float yr;
|
float yr;
|
||||||
float zr;
|
float zr;
|
||||||
float dist;
|
float dist;
|
||||||
} LightBounce_Box;
|
};
|
||||||
|
|
||||||
class LightBounce : public SSMode
|
class LightBounce : public SSMode
|
||||||
{
|
{
|
||||||
@ -30,7 +35,7 @@ public:
|
|||||||
LightBounce(SSMain * _SSMain);
|
LightBounce(SSMain * _SSMain);
|
||||||
void update();
|
void update();
|
||||||
protected:
|
protected:
|
||||||
vector<LightBounce_Box *> m_boxes;
|
vector<LightBounceBox *> m_boxes;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user