Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/trunk/src/world_entities/bsp_entity.cc @ 8341

Last change on this file since 8341 was 8186, checked in by bensch, 18 years ago

trunk: merged the branche bsp_model back here

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: ...
13   co-programmer: ...
14*/
15
16#include "bsp_entity.h"
17#include "util/loading/resource_manager.h"
18
19CREATE_FACTORY(BSPEntity, CL_BSP_ENTITY);
20
21
22/**
23 * constructs and loads a BSPEntity from a XML-element
24 * @param root the XML-element to load from
25 */
26BSPEntity::BSPEntity(const TiXmlElement* root)
27{
28  this->init();
29  if (root != NULL)
30    this->loadParams(root);
31}
32
33
34/**
35 * standard deconstructor
36 */
37BSPEntity::~BSPEntity ()
38{
39
40}
41
42void BSPEntity::setName(const std::string& name)
43{
44  printf("+++++++++++ LOADING NAME %s\n", name.c_str());
45
46  this->bspManager->load(name.c_str(), 0.1f);
47}
48
49
50
51/**
52 * initializes the BSPEntity
53 * @todo change this to what you wish
54 */
55void BSPEntity::init()
56{
57  this->bspManager = new BspManager();
58  this->setClassID(CL_BSP_ENTITY, "BSPEntity");
59
60  this->toList(OM_ENVIRON);
61
62  /**
63   * @todo: Write CL_BSP_ENTITY INTO THE src/defs/class_id.h (your own definition)
64   */
65
66}
67
68
69/**
70 * loads a BSPEntity from a XML-element
71 * @param root the XML-element to load from
72 * @todo make the class Loadable
73 */
74void BSPEntity::loadParams(const TiXmlElement* root)
75{
76  // all the clases this Entity is directly derived from must be called in this way, to load all settings.
77 // WorldEntity::loadParam(root);
78
79  LoadParam(root, "Name", this, BSPEntity, setName)
80      .describe("Sets the of the BSP file.");
81
82/*  LoadParam(root, "Scale", this, BSpEntity, setScale)
83      .describe("Sets the scale factore of the bsp level.");
84*/
85
86  /**
87   * @todo: make the class Loadable
88   */
89}
90
91
92/**
93 * advances the BSPEntity about time seconds
94 * @param time the Time to step
95 */
96void BSPEntity::tick(float time)
97{
98
99}
100
101
102/**
103 * draws this worldEntity
104 */
105void BSPEntity::draw () const
106{
107  this->bspManager->draw();
108}
109
110
111/**
112 *
113 *
114 */
115void BSPEntity::collidesWith (WorldEntity* entity, const Vector& location)
116{
117
118}
Note: See TracBrowser for help on using the repository browser.