Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/trunk/src/world_entities/environment.cc @ 4695

Last change on this file since 4695 was 4682, checked in by patrick, 19 years ago

orxonox/trunk: now there is a possibility to render the bvtree through the world entities, the bvtree is a member of the worldentity

File size: 1.8 KB
Line 
1
2
3/*
4   orxonox - the future of 3D-vertical-scrollers
5
6   Copyright (C) 2004 orx
7
8   This program is free software; you can redistribute it and/or modify
9   it under the terms of the GNU General Public License as published by
10   the Free Software Foundation; either version 2, or (at your option)
11   any later version.
12
13   ### File Specific
14   main-programmer: Patrick Boenzli
15   co-programmer:
16*/
17
18
19#include "environment.h"
20#include "stdincl.h"
21#include "world_entity.h"
22#include "vector.h"
23#include "objModel.h"
24#include "obb_tree.h"
25
26using namespace std;
27
28
29/**
30   \brief creates an environment
31*/
32Environment::Environment () : WorldEntity()
33{
34  this->setClassID(CL_ENVIRONMENT, "Environment");
35  this->model = (Model*)ResourceManager::getInstance()->load("models/reaplow.obj", OBJ, RP_CAMPAIGN);
36
37  this->obbTree = new OBBTree(4, (sVec3D*)this->model->getVertexArray(), this->model->getVertexCount());
38}
39
40
41/**
42   \brief deletes an environment
43*/
44Environment::~Environment ()
45{
46
47}
48
49/**
50   \brief ticks the environment
51   \param time the time about which to tick
52*/
53void Environment::tick (float time) {}
54
55/**
56   \brief if a hit occures
57*/
58void Environment::hit (WorldEntity* weapon, Vector* loc) {}
59
60/**
61   \brief destroys an Environment
62*/
63void Environment::destroy () {}
64
65/**
66   \brief a collision with some ship
67*/
68void Environment::collide (WorldEntity* other,  Uint32 ownhitflags, Uint32 otherhitflags) {}
69
70/**
71   \brief draws the Environment
72*/
73void Environment::draw ()
74{
75  //this->getRelCoor().debug();
76
77  glMatrixMode(GL_MODELVIEW);
78  glPushMatrix();
79  float matrix[4][4];
80
81  glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z);
82  //rotate
83  this->getAbsDir().matrix (matrix);
84  glMultMatrixf((float*)matrix);
85
86  this->model->draw();
87
88  glPopMatrix();
89}
90
Note: See TracBrowser for help on using the repository browser.