Changeset 8875 in orxonox.OLD for branches/single_player_map/src/world_entities
- Timestamp:
- Jun 28, 2006, 5:25:42 PM (18 years ago)
- Location:
- branches/single_player_map/src/world_entities
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/single_player_map/src/world_entities/door.cc
r8874 r8875 100 100 const std::list<BaseObject*>* list = ClassList::getList(CL_PLAYABLE); 101 101 WorldEntity* entity; 102 float distance; 102 103 103 104 if( list == NULL) … … 109 110 entity = dynamic_cast<WorldEntity*>(*it); 110 111 112 distance = fabs((this->getAbsCoor() - entity->getAbsCoor()).len()); 113 if( distance < this->actionRadius) 114 return true; 111 115 } 112 116 … … 117 121 for( it = list->begin(); it != list->end(); it++) 118 122 { 123 entity = dynamic_cast<WorldEntity*>(*it); 119 124 125 distance = fabs((this->getAbsCoor() - entity->getAbsCoor()).len()); 126 if( distance < this->actionRadius) 127 return true; 120 128 } 121 129 -
branches/single_player_map/src/world_entities/door.h
r8874 r8875 19 19 20 20 void setAnim(int animationIndex, int animPlaybackMode); 21 void setActionRadius(float radius) { this->actionRadius = radius; } 21 22 22 23 virtual void tick (float time); 24 25 void open(); 26 void close(); 23 27 24 28 private: … … 27 31 private: 28 32 bool bOpen; //!< true if the door is open 33 float actionRadius; //!< action radius 29 34 30 35 };
Note: See TracChangeset
for help on using the changeset viewer.