diff options
author | Stijn Buys <ingar@osirion.org> | 2008-03-09 11:04:35 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-03-09 11:04:35 +0000 |
commit | 912ebb62d5e8602a196a59887ef4d41cf0d6edbf (patch) | |
tree | 248fa306aa28762108e900de8d7c8b655a603fef /src/render/box.cc | |
parent | 07c0040f3433cc637fecbb712fb3b6f5ad1ab5de (diff) |
fixed sphere black hole, added basic HUD with speed and direction indicator, basic shaped entities readable from world.ini
Diffstat (limited to 'src/render/box.cc')
-rw-r--r-- | src/render/box.cc | 102 |
1 files changed, 0 insertions, 102 deletions
diff --git a/src/render/box.cc b/src/render/box.cc deleted file mode 100644 index d6f14b5..0000000 --- a/src/render/box.cc +++ /dev/null @@ -1,102 +0,0 @@ -/* - render/box.cc - This file is part of the Osirion project and is distributed under - the terms of the GNU General Public License version 2 -*/ - -#include "render/box.h" - -namespace render { - -using math::Vector3f; -using math::Color; - -Box::Box(Vector3f const & tl, Vector3f const &br) : - topleft(tl), bottomright(br) -{ - topcolor = Color::White(); - bottomcolor= Color::White() * 0.7f; - radius = 1.0f; -} - -Box::Box(const Box & other) -{ - (*this) = other; -} - -Box& Box::operator=(const Box &other) -{ - bottomcolor = other.bottomcolor; - topcolor = other.topcolor; - - topleft = other.topleft; - bottomright = other.bottomright; - return (*this); -} - -void Box::draw() -{ - using namespace gl; - - Vector3f v0(topleft.x, bottomright.y, bottomright.z); - Vector3f v1(topleft.x, topleft.y, bottomright.z); - Vector3f v2(topleft.x, topleft.y, topleft.z); - Vector3f v3(topleft.x, bottomright.y, topleft.z); - - Vector3f v4(bottomright.x, bottomright.y, bottomright.z); - Vector3f v5(bottomright.x, topleft.y, bottomright.z); - Vector3f v6(bottomright.x, topleft.y, topleft.z); - Vector3f v7(bottomright.x, bottomright.y, topleft.z); - - begin(Quads); - - // top - color(topcolor); - vertex(radius*v2); - vertex(radius*v1); - vertex(radius*v5); - vertex(radius*v6); - - // sides - color(bottomcolor); - vertex(radius*v0); - color(topcolor); - vertex(radius*v1); - vertex(radius*v2); - color(bottomcolor); - vertex(radius*v3); - - vertex(radius*v3); - color(topcolor); - vertex(radius*v2); - vertex(radius*v6); - color(bottomcolor); - vertex(radius*v7); - - vertex(radius*v4); - color(topcolor); - vertex(radius*v5); - vertex(radius*v1); - color(bottomcolor); - vertex(radius*v0); - - vertex(radius*v7); - color(topcolor); - vertex(radius*v6); - vertex(radius*v5); - color(bottomcolor); - vertex(radius*v4); - - // bottom - color(bottomcolor); - vertex(radius*v4); - vertex(radius*v0); - vertex(radius*v3); - vertex(radius*v7); - - end(); - -} - -} - |