Last change
on this file since 6211 was
6207,
checked in by patrick, 19 years ago
|
christmas: test_entity is now also loadable and heavily used in the christmas branche
|
File size:
1.6 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 | #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY |
---|
18 | |
---|
19 | |
---|
20 | #include "executor/executor.h" |
---|
21 | #include "factory.h" |
---|
22 | |
---|
23 | #include "test_entity.h" |
---|
24 | #include "stdincl.h" |
---|
25 | #include "model.h" |
---|
26 | #include "md2Model.h" |
---|
27 | #include "obb_tree.h" |
---|
28 | #include "state.h" |
---|
29 | |
---|
30 | using namespace std; |
---|
31 | |
---|
32 | |
---|
33 | CREATE_FACTORY(TestEntity, CL_TEST_ENTITY); |
---|
34 | |
---|
35 | |
---|
36 | TestEntity::TestEntity () |
---|
37 | { |
---|
38 | this->init(); |
---|
39 | } |
---|
40 | |
---|
41 | |
---|
42 | |
---|
43 | TestEntity::TestEntity(const TiXmlElement* root) |
---|
44 | { |
---|
45 | this->init(); |
---|
46 | if (root != NULL) |
---|
47 | this->loadParams(root); |
---|
48 | |
---|
49 | this->init(); |
---|
50 | } |
---|
51 | |
---|
52 | |
---|
53 | TestEntity::~TestEntity () |
---|
54 | {} |
---|
55 | |
---|
56 | |
---|
57 | |
---|
58 | void TestEntity::init() |
---|
59 | { |
---|
60 | this->setClassID(CL_TEST_ENTITY, "TestEntity"); |
---|
61 | this->toList(OM_COMMON); |
---|
62 | } |
---|
63 | |
---|
64 | /** |
---|
65 | * loads the Settings of a MD2Creature from an XML-element. |
---|
66 | * @param root the XML-element to load the MD2Creature's properties from |
---|
67 | */ |
---|
68 | void TestEntity::loadParams(const TiXmlElement* root) |
---|
69 | { |
---|
70 | static_cast<WorldEntity*>(this)->loadParams(root); |
---|
71 | } |
---|
72 | |
---|
73 | |
---|
74 | void TestEntity::setAnim(int animationIndex) |
---|
75 | {} |
---|
76 | |
---|
77 | |
---|
78 | void TestEntity::tick (float time) |
---|
79 | { |
---|
80 | if( likely(this->getModel(0) != NULL)) |
---|
81 | ((MD2Model*)this->getModel(0))->tick(time); |
---|
82 | |
---|
83 | } |
---|
84 | |
---|
85 | |
---|
86 | void TestEntity::collidesWith(WorldEntity* entity, const Vector& location) |
---|
87 | {} |
---|
88 | |
---|
89 | |
---|
90 | |
---|
91 | void TestEntity::draw () const |
---|
92 | { |
---|
93 | this->drawLODsafe(); |
---|
94 | } |
---|
95 | |
---|
Note: See
TracBrowser
for help on using the repository browser.