Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/preferences/src/subprojects/collision_detection/collision_test_entity.cc @ 6736

Last change on this file since 6736 was 5750, checked in by bensch, 19 years ago

orxonox/trunk: merged the WorldEntities into the Trunk.
Merged with command:
svn merge branches/world_entities/ trunk/ -r5516:HEAD

conflics from world_entities changed in favor of branches/world_entity
all other conflict in favor of the trunk

File size: 2.1 KB
Line 
1/*
2   orxonox - the future of 3D-vertical-scrollers
3
4   Copyright (C) 2004 orx
5
6   This program is free software; you can redistribute it and/or modify
7   it under the terms of the GNU General Public License as published by
8   the Free Software Foundation; either version 2, or (at your option)
9   any later version.
10
11   ### File Specific
12   main-programmer: Patrick Boenzli
13   co-programmer:
14*/
15#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
16
17
18#include "collision_test_entity.h"
19
20#include "resource_manager.h"
21
22#include "vector.h"
23#include "objModel.h"
24#include "obb_tree.h"
25#include "factory.h"
26
27using namespace std;
28CREATE_FACTORY(CollisionTestEntity, CL_ENVIRONMENT);
29
30/**
31 *  creates an environment
32*/
33CollisionTestEntity::CollisionTestEntity () : WorldEntity()
34{
35  this->init();
36  this->loadModel("models/ships/reaplow.obj");
37  //  this->loadModel("models/ships/figther.obj");
38
39  this->buildObbTree(10);
40}
41
42/**
43 * create an environment out of a XML-element
44 * @param root the XML-element to load the CollisionTestEntity from
45 */
46CollisionTestEntity::CollisionTestEntity(const TiXmlElement* root)
47{
48  this->init();
49  if (root != NULL)
50    this->loadParams(root);
51}
52
53/**
54 *  deletes an environment
55*/
56CollisionTestEntity::~CollisionTestEntity ()
57{}
58
59/**
60 * initialize an CollisionTestEntity
61 */
62void CollisionTestEntity::init()
63{
64  this->setClassID(CL_ENVIRONMENT, "CollisionTestEntity");
65}
66
67/**
68 * loads the Settings of an CollisionTestEntity from an XML-element.
69 * @param root the XML-element to load the ELements properties from
70 */
71void CollisionTestEntity::loadParams(const TiXmlElement* root)
72{
73  static_cast<WorldEntity*>(this)->loadParams(root);
74}
75
76
77/**
78 *  ticks the environment
79 * @param time the time about which to tick
80*/
81void CollisionTestEntity::tick (float time) {}
82
83
84/**
85 *  draws the CollisionTestEntity
86*/
87void CollisionTestEntity::draw ()
88{
89  glMatrixMode(GL_MODELVIEW);
90  glPushMatrix();
91  float matrix[4][4];
92
93  glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z);
94  //rotate
95  this->getAbsDir().matrix (matrix);
96  glMultMatrixf((float*)matrix);
97
98  this->model->draw();
99
100  glPopMatrix();
101}
102
Note: See TracBrowser for help on using the repository browser.