[4679] | 1 | /* |
---|
[4245] | 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 |
---|
[9927] | 12 | main-programmer: |
---|
[4679] | 13 | co-programmer: |
---|
[4245] | 14 | */ |
---|
[5357] | 15 | #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY |
---|
[4245] | 16 | |
---|
| 17 | |
---|
[6222] | 18 | #include "executor/executor.h" |
---|
[7193] | 19 | #include "util/loading/factory.h" |
---|
| 20 | #include "util/loading/load_param.h" |
---|
[6222] | 21 | |
---|
[7488] | 22 | |
---|
[4245] | 23 | #include "test_entity.h" |
---|
[9869] | 24 | #include "debug.h" |
---|
[5087] | 25 | #include "state.h" |
---|
[10238] | 26 | #include "shell_command.h" |
---|
| 27 | #include "game_world_data.h" |
---|
[4245] | 28 | |
---|
[9869] | 29 | #include "class_id_DEPRECATED.h" |
---|
| 30 | ObjectListDefinition(TestEntity); |
---|
| 31 | CREATE_FACTORY(TestEntity); |
---|
[9406] | 32 | |
---|
[6222] | 33 | |
---|
[10236] | 34 | |
---|
[9927] | 35 | /** |
---|
| 36 | * |
---|
| 37 | */ |
---|
[4762] | 38 | TestEntity::TestEntity () |
---|
[4679] | 39 | { |
---|
[6222] | 40 | this->init(); |
---|
| 41 | } |
---|
[4245] | 42 | |
---|
[4714] | 43 | |
---|
[10238] | 44 | SHELL_COMMAND(test, TestEntity,test); |
---|
| 45 | SHELL_COMMAND(t2, TestEntity,t2); |
---|
| 46 | SHELL_COMMAND(t3, TestEntity,t3); |
---|
| 47 | SHELL_COMMAND(t4, TestEntity, t4); |
---|
| 48 | SHELL_COMMAND(t5, TestEntity,t5); |
---|
| 49 | |
---|
[9927] | 50 | /** |
---|
| 51 | * |
---|
| 52 | */ |
---|
[6222] | 53 | TestEntity::TestEntity(const TiXmlElement* root) |
---|
| 54 | { |
---|
| 55 | this->init(); |
---|
[9927] | 56 | |
---|
| 57 | if( root != NULL) |
---|
[6222] | 58 | this->loadParams(root); |
---|
[4245] | 59 | } |
---|
| 60 | |
---|
| 61 | |
---|
[9927] | 62 | /** |
---|
| 63 | * |
---|
| 64 | */ |
---|
[4679] | 65 | TestEntity::~TestEntity () |
---|
[6222] | 66 | {} |
---|
| 67 | |
---|
| 68 | |
---|
[9927] | 69 | /** |
---|
| 70 | * |
---|
| 71 | */ |
---|
[6222] | 72 | void TestEntity::init() |
---|
[4462] | 73 | { |
---|
[9869] | 74 | this->registerObject(this, TestEntity::_objectList); |
---|
[7078] | 75 | this->toList(OM_GROUP_00); |
---|
[10238] | 76 | |
---|
[10236] | 77 | } |
---|
[10065] | 78 | |
---|
[10236] | 79 | void TestEntity::test() |
---|
| 80 | { |
---|
[10272] | 81 | CM= State::getCameraman(); |
---|
[10352] | 82 | CM->changeCurrTarget( "WorldEntity", "Ebene"); |
---|
[4462] | 83 | } |
---|
[4245] | 84 | |
---|
[10238] | 85 | void TestEntity::t2() |
---|
| 86 | { |
---|
[10330] | 87 | CM= State::getCameraman(); |
---|
[10338] | 88 | CM->createCam(); |
---|
| 89 | CM->setCam(1); |
---|
[10352] | 90 | CM->moveCurrCam(100, 0, 200); |
---|
[10238] | 91 | } |
---|
[10236] | 92 | |
---|
[10238] | 93 | void TestEntity::t3() |
---|
| 94 | { |
---|
[10330] | 95 | CM= State::getCameraman(); |
---|
[10338] | 96 | CM->moveCurrCam(-300, 0, 0); |
---|
[10238] | 97 | } |
---|
| 98 | |
---|
| 99 | void TestEntity::t4() |
---|
| 100 | { |
---|
[10330] | 101 | CM= State::getCameraman(); |
---|
[10272] | 102 | |
---|
[10330] | 103 | CM->togglFade(); |
---|
[10238] | 104 | } |
---|
| 105 | |
---|
| 106 | void TestEntity::t5() |
---|
| 107 | { |
---|
[10330] | 108 | CM= State::getCameraman(); |
---|
| 109 | |
---|
[10238] | 110 | CM->setCam(0); |
---|
| 111 | } |
---|
| 112 | |
---|
| 113 | |
---|
| 114 | |
---|
[6222] | 115 | /** |
---|
| 116 | * loads the Settings of a MD2Creature from an XML-element. |
---|
| 117 | * @param root the XML-element to load the MD2Creature's properties from |
---|
| 118 | */ |
---|
| 119 | void TestEntity::loadParams(const TiXmlElement* root) |
---|
| 120 | { |
---|
[6512] | 121 | WorldEntity::loadParams(root); |
---|
[6222] | 122 | } |
---|
| 123 | |
---|
[10018] | 124 | void TestEntity::draw() const |
---|
| 125 | { |
---|
[6222] | 126 | |
---|
[10348] | 127 | |
---|
| 128 | glColor4f(0,0,0,0); |
---|
| 129 | glBegin(GL_QUADS); |
---|
| 130 | glVertex3f(50.,-100.0f,-100.0f); |
---|
| 131 | glVertex3f(50., -100.0f,100.0f); |
---|
| 132 | glVertex3f(50., 100.0f,100.0f); |
---|
| 133 | glVertex3f(50., 100.0f,-100.0f); |
---|
| 134 | |
---|
| 135 | glEnd(); |
---|
| 136 | |
---|
[4245] | 137 | } |
---|
| 138 | |
---|
[9927] | 139 | /** |
---|
| 140 | * |
---|
| 141 | */ |
---|
[10018] | 142 | void TestEntity::tick (float time) |
---|
[7071] | 143 | { |
---|
[10236] | 144 | |
---|
[10065] | 145 | } |
---|
[7488] | 146 | |
---|
[5087] | 147 | |
---|
[10065] | 148 | void TestEntity::changeState (bool sta) |
---|
| 149 | { |
---|
[10236] | 150 | |
---|
[10018] | 151 | } |
---|