Changeset 8890 in orxonox.OLD for branches/single_player_map/src/world_entities/door.cc
- Timestamp:
- Jun 28, 2006, 11:47:35 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/single_player_map/src/world_entities/door.cc
r8886 r8890 53 53 Door::Door(const TiXmlElement* root) 54 54 { 55 this->init(); 55 56 this->setClassID(CL_DOOR, "Door"); 57 this->scale = 1.0f; 56 58 57 59 if( root != NULL) 58 60 this->loadParams(root); 61 62 this->toList(OM_COMMON); 63 this->bLocked = false; 64 65 this->loadMD2Texture("maps/doors.jpg"); 66 this->loadModel("models/creatures/doors.md2", this->scale); 67 this->setAnimation(DOOR_CLOSE, MD2_ANIM_ONCE); 59 68 } 60 69 … … 64 73 65 74 66 67 void Door::init()68 {69 this->setClassID(CL_DOOR, "Door");70 this->toList(OM_COMMON);71 72 this->bLocked = false;73 74 75 this->loadMD2Texture("maps/doors.jpg");76 this->loadModel("models/creatures/doors.md2", 1.0);77 this->setAnimation(DOOR_CLOSE, MD2_ANIM_ONCE);78 }79 75 80 76 /** … … 86 82 WorldEntity::loadParams(root); 87 83 88 LoadParam(root, " ", this, Door, setActionRadius)84 LoadParam(root, "action-radius", this, Door, setActionRadius) 89 85 .describe("sets the action radius of the door") 90 86 .defaultValues(3.0); 87 LoadParam(root, "scale", this, Door, setScale) 88 .describe("sets the scale of the door") 89 .defaultValues(1.0); 91 90 } 92 91 … … 115 114 ((InteractiveModel*)this->getModel(0))->tick(time); 116 115 117 this->checkOpen(); 116 if( this->checkOpen() && !this->bOpen) 117 this->open(); 118 else if( bOpen) 119 this->close(); 120 118 121 } 119 122 … … 128 131 129 132 this->setAnimation(DOOR_OPEN, MD2_ANIM_ONCE); 130 133 this->bOpen = true; 131 134 } 132 135 … … 137 140 void Door::close() 138 141 { 139 142 this->setAnimation(DOOR_CLOSE, MD2_ANIM_ONCE); 143 this->bOpen = false; 140 144 } 141 145
Note: See TracChangeset
for help on using the changeset viewer.