Changeset 9705 in orxonox.OLD for branches/new_class_id/src/world_entities
- Timestamp:
- Aug 25, 2006, 9:44:53 PM (18 years ago)
- Location:
- branches/new_class_id/src/world_entities
- Files:
-
- 29 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/new_class_id/src/world_entities/camera.cc
r9406 r9705 19 19 #include "glincl.h" 20 20 21 NewObjectListDefinition(Camera); 22 21 23 /** 22 24 * creates a Camera … … 24 26 Camera::Camera() 25 27 { 26 this-> setClassID(CL_CAMERA, "Camera");28 this->registerObject(this, Camera::_objectList); 27 29 this->setName("camera"); 28 30 this->target = new CameraTarget(); … … 221 223 /////////////////// 222 224 223 225 NewObjectListDefinition(CameraTarget); 224 226 CameraTarget::CameraTarget() 225 227 { 226 this-> setClassID(CL_CAMERA_TARGET, "CameraTarget");228 this->registerObject(this, CameraTarget::_objectList); 227 229 // this->setParentMode(PNODE_MOVEMENT); 228 230 } -
branches/new_class_id/src/world_entities/camera.h
r7347 r9705 22 22 class Camera : public PNode, public EventListener 23 23 { 24 NewObjectListDeclaration(Camera); 24 25 public: 25 26 //! an enumerator for different types of view … … 84 85 { 85 86 friend class Camera; //! The CameraTarget is a friend of Camera. noone else needs a CameraTarget, so noone else can create it. 87 NewObjectListDeclaration(CameraTarget); 86 88 87 89 private: -
branches/new_class_id/src/world_entities/npcs/npc.cc
r9235 r9705 20 20 #include "npc.h" 21 21 22 NewObjectListDefinition(NPC); 22 23 23 24 NPC::NPC(const TiXmlElement* root) 24 25 { 25 this-> setClassID(CL_NPC, "NPC");26 this->registerObject(this, NPC::_objectList); 26 27 27 28 this->toList(OM_GROUP_00); -
branches/new_class_id/src/world_entities/npcs/npc.h
r8724 r9705 8 8 9 9 class NPC : public WorldEntity { 10 10 NewObjectListDeclaration(NPC); 11 11 public: 12 12 NPC (const TiXmlElement* root); -
branches/new_class_id/src/world_entities/npcs/npc_test1.cc
r9235 r9705 25 25 #include "power_ups/laser_power_up.h" 26 26 27 NewObjectListDefinition(NPCTest1); 27 28 28 29 NPCTest1::NPCTest1() 29 30 : NPC(NULL) 30 31 { 31 this-> setClassID(CL_NPC_TEST1, "NPCTest1");32 this->registerObject(this, NPCTest1::_objectList); 32 33 33 34 if ((float)rand()/RAND_MAX > .5f) -
branches/new_class_id/src/world_entities/npcs/npc_test1.h
r6981 r9705 8 8 9 9 class NPCTest1 : public NPC { 10 10 NewObjectListDeclaration(NPCTest1); 11 11 public: 12 12 NPCTest1 (); -
branches/new_class_id/src/world_entities/playable.cc
r9691 r9705 41 41 SHELL_COMMAND_STATIC(orxoWeapon, Playable, Playable::addSomeWeapons_CHEAT) 42 42 ->setAlias("orxoWeapon"); 43 NewObjectListDefinition(Playable) 43 NewObjectListDefinition(Playable); 44 44 45 45 Playable::Playable() … … 48 48 playmode(Playable::Full3D) 49 49 { 50 this->registerObject(this, Playable::_ classID);50 this->registerObject(this, Playable::_objectList); 51 51 PRINTF(4)("PLAYABLE INIT\n"); 52 52 … … 109 109 bool Playable::pickup(PowerUp* powerUp) 110 110 { 111 if(powerUp->isA(CL_WEAPON_POWER_UP)) 112 { 113 return dynamic_cast<WeaponPowerUp*>(powerUp)->process(&this->getWeaponManager()); 114 } 115 else if(powerUp->isA(CL_PARAM_POWER_UP)) 116 { 117 ParamPowerUp* ppu = dynamic_cast<ParamPowerUp*>(powerUp); 111 /// FIXME TOTALLY 112 if(powerUp->isA(WeaponPowerUp::classID())) 113 { 114 return static_cast<WeaponPowerUp*>(powerUp)->process(&this->getWeaponManager()); 115 } 116 else if(powerUp->isA(ParamPowerUp::classID())) 117 { 118 ParamPowerUp* ppu = static_cast<ParamPowerUp*>(powerUp); 118 119 switch(ppu->getType()) 119 120 { … … 213 214 { 214 215 PRINTF(2)("ADDING WEAPONS - you cheater\n"); 215 playable->addWeapon(Weapon::createWeapon( CL_HYPERBLASTER));216 playable->addWeapon(Weapon::createWeapon( CL_TURRET));217 playable->addWeapon(Weapon::createWeapon( CL_AIMING_TURRET));218 playable->addWeapon(Weapon::createWeapon( CL_CANNON));219 playable->addWeapon(Weapon::createWeapon( CL_TARGETING_TURRET));216 playable->addWeapon(Weapon::createWeapon("Hyperblaster")); 217 playable->addWeapon(Weapon::createWeapon("Turret")); 218 playable->addWeapon(Weapon::createWeapon("AimingTurret")); 219 playable->addWeapon(Weapon::createWeapon("Cannon")); 220 playable->addWeapon(Weapon::createWeapon("TargetingTurret")); 220 221 PRINTF(2)("ADDING WEAPONS FINISHED\n"); 221 222 } -
branches/new_class_id/src/world_entities/player.cc
r9062 r9705 19 19 #include "event_handler.h" 20 20 21 22 #include "class_list.h"23 21 #include "state.h" 24 22 #include "util/hud.h" … … 26 24 #include "debug.h" 27 25 28 26 NewObjectListDefinition(Player); 29 27 /** 30 28 * creates a new Player … … 33 31 { 34 32 // this->setRelDir(Quaternion(M_PI, Vector(1,0,0))); 35 this-> setClassID(CL_PLAYER, "Player");33 this->registerObject(this, Player::_objectList); 36 34 37 35 PRINTF(4)("PLAYER INIT\n"); … … 94 92 95 93 96 97 98 99 94 void Player::weaponConfigChanged() 95 { 96 this->_hud.updateWeaponManager(); 97 } 100 98 101 99 … … 103 101 { 104 102 /// FIXME this should be in the ObjectManager 105 const std::list<BaseObject*>* objectList = ClassList::getList(CL_PLAYABLE); 106 if (objectList != NULL) 103 for (NewObjectList<Playable>::const_iterator node = Playable::objectList().begin(); 104 node != Playable::objectList().end(); 105 ++node) 107 106 { 108 std::list<BaseObject*>::const_iterator node; 109 for (node = objectList->begin(); node != objectList->end(); node++) 110 if (this->playable != (*node) && 111 (dynamic_cast<PNode*>(*node)->getAbsCoor() - this->playable->getAbsCoor()).len() < (dynamic_cast<Playable*>(*node)->getEnterRadius())) 112 { 107 if (this->playable != (*node) && 108 ((*node)->getAbsCoor() - this->playable->getAbsCoor()).len() < ((*node)->getEnterRadius())) 109 { 113 110 114 this->setPlayable(dynamic_cast<Playable*>(*node));111 this->setPlayable(*(node)); 115 112 116 117 113 break; 114 } 118 115 } 119 116 } -
branches/new_class_id/src/world_entities/player.h
r9061 r9705 23 23 class Player : public EventListener 24 24 { 25 NewObjectListDeclaration(Player); 25 26 26 27 public: … … 31 32 bool eject(); 32 33 inline Playable* getPlayable() const { return this->playable; }; 33 34 34 35 35 36 inline Hud& hud() { return this->_hud; }; -
branches/new_class_id/src/world_entities/power_ups/param_power_up.cc
r9656 r9705 27 27 28 28 29 29 #include "class_id.h" 30 30 CREATE_FACTORY(ParamPowerUp, CL_PARAM_POWER_UP); 31 NewObjectListDefinitionID(ParamPowerUp, CL_PARAM_POWER_UP); 31 32 32 33 const char* ParamPowerUp::paramTypes[] = { … … 58 59 void ParamPowerUp::init() 59 60 { 60 this-> setClassID(CL_PARAM_POWER_UP, "ParamPowerUp");61 this->registerObject(this, ParamPowerUp::_objectList); 61 62 this->value = 0; 62 63 this->max_value = 0; -
branches/new_class_id/src/world_entities/power_ups/param_power_up.h
r7954 r9705 20 20 21 21 class ParamPowerUp : public PowerUp { 22 NewObjectListDeclaration(ParamPowerUp); 22 23 23 24 public: -
branches/new_class_id/src/world_entities/power_ups/power_up.cc
r9406 r9705 25 25 26 26 27 NewObjectListDefinition(PowerUp); 27 28 28 29 PowerUp::PowerUp(float r, float g, float b) 29 30 { 30 this-> setClassID(CL_POWER_UP, "PowerUp");31 this->registerObject(this, PowerUp::_objectList); 31 32 32 33 this->respawnType = RESPAWN_TIME; … … 120 121 void PowerUp::collidesWith (WorldEntity* entity, const Vector& location) 121 122 { 122 if(this->collider != entity && entity->isA( CL_EXTENDABLE))123 if(this->collider != entity && entity->isA(Extendable::classID())) 123 124 { 124 125 this->collider = entity; -
branches/new_class_id/src/world_entities/power_ups/power_up.h
r7954 r9705 21 21 22 22 class PowerUp : public WorldEntity { 23 NewObjectListDeclaration(PowerUp); 23 24 24 25 public: -
branches/new_class_id/src/world_entities/power_ups/weapon_power_up.cc
r9406 r9705 27 27 28 28 29 29 #include "class_id.h" 30 30 CREATE_FACTORY(WeaponPowerUp, CL_WEAPON_POWER_UP); 31 NewObjectListDefinitionID(WeaponPowerUp, CL_WEAPON_POWER_UP); 31 32 32 33 WeaponPowerUp::WeaponPowerUp(const TiXmlElement* root) : PowerUp(1.0, 1.0, 0.0) … … 45 46 void WeaponPowerUp::init() 46 47 { 47 this-> setClassID(CL_WEAPON_POWER_UP, "WeaponPowerUp");48 this->registerObject(this, WeaponPowerUp::_objectList); 48 49 this->loadPickupSound("sound/powerups/whats this2.wav"); 49 50 -
branches/new_class_id/src/world_entities/power_ups/weapon_power_up.h
r7954 r9705 14 14 15 15 class WeaponPowerUp : public PowerUp { 16 16 NewObjectListDeclaration(WeaponPowerUp); 17 17 public: 18 18 WeaponPowerUp(const TiXmlElement* root = NULL); -
branches/new_class_id/src/world_entities/projectiles/projectile.cc
r9656 r9705 26 26 #include "debug.h" 27 27 28 NewObjectListDefinition(Projectile); 28 29 29 30 /** … … 32 33 Projectile::Projectile () : WorldEntity() 33 34 { 34 this-> setClassID(CL_PROJECTILE, "Projectile");35 this->registerObject(this, Projectile::_objectList); 35 36 36 37 this->lifeCycle = 0.0; -
branches/new_class_id/src/world_entities/projectiles/projectile.h
r9235 r9705 18 18 class Projectile : public WorldEntity 19 19 { 20 NewObjectListDeclaration(Projectile); 20 21 public: 21 22 Projectile (); -
branches/new_class_id/src/world_entities/spawning_point.cc
r9656 r9705 21 21 22 22 #include "world_entity.h" 23 24 #include "class_list.h"25 23 26 24 #include "compiler.h" -
branches/new_class_id/src/world_entities/spawning_point.h
r9656 r9705 42 42 */ 43 43 class SpawningPoint : public WorldEntity { 44 44 NewObjectListDeclaration(SpawningPoint); 45 45 public: 46 46 SpawningPoint(const TiXmlElement* root = NULL); -
branches/new_class_id/src/world_entities/weapons/ammo_container.cc
r9406 r9705 23 23 24 24 25 25 NewObjectListDefinition(AmmoContainer); 26 26 /** 27 27 * standard constructor 28 28 * @todo this constructor is not jet implemented - do it 29 29 */ 30 AmmoContainer::AmmoContainer ( ClassIDprojectileType, float maxEnergy)30 AmmoContainer::AmmoContainer (const NewClassID& projectileType, float maxEnergy) 31 31 { 32 this->setClassID(CL_AMMO_CONTAINER, "AmmoContainer");32 this->registerObject(this, AmmoContainer::_objectList); 33 33 34 35 34 this->projectileType = projectileType; 35 this->maxEnergy = maxEnergy; 36 36 37 37 this->energy = 0.0; 38 38 } 39 39 -
branches/new_class_id/src/world_entities/weapons/ammo_container.h
r9685 r9705 17 17 //! A class for Storing energy of Projectiles. 18 18 class AmmoContainer : public BaseObject { 19 NewObjectListDeclaration(AmmoContainer); 19 20 20 21 public: 21 AmmoContainer( NewClassIDid, float maxEnergy = DEFAULT_MAX_ENERGY);22 AmmoContainer(const NewClassID& id, float maxEnergy = DEFAULT_MAX_ENERGY); 22 23 virtual ~AmmoContainer(); 23 24 -
branches/new_class_id/src/world_entities/weapons/crosshair.cc
r9406 r9705 26 26 27 27 28 28 NewObjectListDefinition(Crosshair); 29 29 /** 30 30 * standart constructor … … 54 54 void Crosshair::init() 55 55 { 56 this-> setClassID(CL_CROSSHAIR, "Crosshair");56 this->registerObject(this, Crosshair::_objectList); 57 57 this->setName("Crosshair"); 58 58 -
branches/new_class_id/src/world_entities/weapons/crosshair.h
r7221 r9705 22 22 //! A class that enables the 23 23 class Crosshair : public PNode, public Element2D, public EventListener { 24 24 NewObjectListDeclaration(Crosshair); 25 25 public: 26 26 Crosshair(const TiXmlElement* root = NULL); -
branches/new_class_id/src/world_entities/weapons/weapon.cc
r9406 r9705 25 25 26 26 #include "util/loading/resource_manager.h" 27 #include "class_list.h"28 27 #include "util/loading/factory.h" 29 28 #include "util/loading/load_param.h" … … 36 35 #include "elements/glgui_energywidget.h" 37 36 38 37 NewObjectListDefinition(Weapon); 39 38 40 39 //////////////////// … … 58 57 { 59 58 for (int i = 0; i < WS_STATE_COUNT; i++) 60 if (this->animation[i] && ClassList::exists(animation[i], CL_ANIMATION)) //!< @todo this should check animation3D59 if (this->animation[i] && Animation::objectList().exists(animation[i])) //!< @todo this should check animation3D 61 60 delete this->animation[i]; 62 61 for (int i = 0; i < WA_ACTION_COUNT; i++) 63 if (this->soundBuffers[i] != NULL && ClassList::exists(this->soundBuffers[i], CL_SOUND_BUFFER))62 if (this->soundBuffers[i] != NULL && OrxSound::SoundBuffer::objectList().exists(this->soundBuffers[i])) 64 63 ResourceManager::getInstance()->unload(this->soundBuffers[i]); 65 64 66 if ( ClassList::exists(this->soundSource, CL_SOUND_SOURCE))65 if (OrxSound::SoundSource::objectList().exists(this->soundSource)) 67 66 delete this->soundSource; 68 67 } … … 73 72 * @returns the newly created Weapon. 74 73 */ 75 Weapon* Weapon::createWeapon( ClassIDweaponID)74 Weapon* Weapon::createWeapon(const NewClassID& weaponID) 76 75 { 77 76 BaseObject* createdObject = Factory::fabricate(weaponID); 78 77 if (createdObject != NULL) 79 78 { 80 if (createdObject->isA( CL_WEAPON))79 if (createdObject->isA(Weapon::classID())) 81 80 return dynamic_cast<Weapon*>(createdObject); 82 81 else … … 89 88 } 90 89 90 Weapon* Weapon::createWeapon(const std::string& weaponName) 91 { 92 BaseObject* createdObject = Factory::fabricate(weaponName); 93 if (createdObject != NULL) 94 { 95 if (createdObject->isA(Weapon::classID())) 96 return dynamic_cast<Weapon*>(createdObject); 97 else 98 { 99 delete createdObject; 100 return NULL; 101 } 102 } 103 return NULL; 104 } 105 106 91 107 /** 92 108 * initializes the Weapon with ALL default values … … 96 112 void Weapon::init() 97 113 { 98 this-> setClassID(CL_WEAPON, "Weapon");114 this->registerObject(this, Weapon::_objectList); 99 115 this->currentState = WS_INACTIVE; //< Normaly the Weapon is Inactive 100 116 this->requestedAction = WA_NONE; //< No action is requested by default … … 115 131 this->defaultTarget = NULL; //< Nothing is Targeted by default. 116 132 117 this->projectile = CL_NULL;//< No Projectile Class is Connected to this weapon133 this->projectile = NullClass::classID(); //< No Projectile Class is Connected to this weapon 118 134 this->projectileFactory = NULL; //< No Factory generating Projectiles is selected. 119 135 … … 163 179 * What it does, is telling the Weapon what Projectiles it can Emit. 164 180 */ 165 void Weapon::setProjectileType(ClassID projectile) 166 { 167 if (projectile == CL_NULL) 168 return; 181 void Weapon::setProjectileType(const NewClassID& projectile) 182 { 169 183 this->projectile = projectile; 170 184 this->projectileFactory = FastFactory::searchFastFactory(projectile); -
branches/new_class_id/src/world_entities/weapons/weapon.h
r9685 r9705 83 83 class Weapon : public WorldEntity 84 84 { 85 NewObjectListDeclaration(Weapon); 86 85 87 public: 86 88 // INITIALISATION // 87 89 Weapon (); 88 90 virtual ~Weapon (); 89 static Weapon* createWeapon(NewClassID weaponID); 91 static Weapon* createWeapon(const NewClassID& weaponID); 92 static Weapon* createWeapon(const std::string& weaponName); 90 93 91 94 void init(); … … 110 113 /** @returns the Capabilities of this Weapon */ 111 114 inline long getCapability() const { return this->capability; }; 112 void setProjectileType( NewClassIDprojectile);115 void setProjectileType(const NewClassID& projectile); 113 116 void setProjectileTypeC(const std::string& projectile); 114 117 /** @returns The projectile's classID */ -
branches/new_class_id/src/world_entities/weapons/weapon_manager.cc
r9406 r9705 22 22 #include "weapon.h" 23 23 #include "crosshair.h" 24 #include "class_list.h"25 24 26 25 #include "playable.h" … … 32 31 33 32 33 NewObjectListDefinition(WeaponManager); 34 34 /** 35 35 * @brief this initializes the weaponManager for a given nnumber of weapon slots … … 57 57 // crosshair being a PNode it must not be deleted (this is because PNodes delete themselves.) 58 58 // rennerc: crosshair seems not to delete itselve 59 if (C lassList::exists(this->crosshair, CL_CROSSHAIR))59 if (Crosshair::objectList().exists(this->crosshair)) 60 60 delete this->crosshair; 61 61 } … … 66 66 void WeaponManager::init() 67 67 { 68 this-> setClassID(CL_WEAPON_MANAGER, "WeaponManager");68 this->registerObject(this, WeaponManager::_objectList); 69 69 70 70 this->parentNode = NULL; … … 298 298 { 299 299 this->parentNode->addChild(weapon); 300 if (this->parentEntity->isA( CL_PLAYABLE))300 if (this->parentEntity->isA(Playable::classID())) 301 301 dynamic_cast<Playable*>(this->parentEntity)->weaponConfigChanged(); 302 302 weapon->setDefaultTarget(this->crosshair); … … 311 311 * @param ammo the ammo to increase 312 312 */ 313 float WeaponManager::increaseAmmunition( ClassIDprojectileType, float ammo)313 float WeaponManager::increaseAmmunition(const NewClassID& projectileType, float ammo) 314 314 { 315 315 return this->getAmmoContainer(projectileType)->increaseEnergy(ammo); … … 324 324 { 325 325 assert (weapon != NULL); 326 return this->increaseAmmunition(weapon->get LeafClassID(), ammo);326 return this->increaseAmmunition(weapon->getClassID(), ammo); 327 327 328 328 } … … 468 468 else 469 469 this->currentSlotConfig[i].position.deactivateNode(); 470 if (this->parentEntity != NULL && this->parentEntity->isA( CL_PLAYABLE))470 if (this->parentEntity != NULL && this->parentEntity->isA(Playable::classID())) 471 471 dynamic_cast<Playable*>(this->parentEntity)->weaponConfigChanged(); 472 472 } … … 523 523 } 524 524 525 CountPointer<AmmoContainer>& WeaponManager::getAmmoContainer( ClassIDprojectileType)525 CountPointer<AmmoContainer>& WeaponManager::getAmmoContainer(const NewClassID& projectileType) 526 526 { 527 527 for (unsigned int i = 0; i < this->ammo.size(); i++) … … 537 537 { 538 538 assert (weapon != NULL); 539 return (this->getAmmoContainer(weapon->get LeafClassID()));539 return (this->getAmmoContainer(weapon->getClassID())); 540 540 } 541 541 -
branches/new_class_id/src/world_entities/weapons/weapon_manager.h
r9685 r9705 39 39 */ 40 40 class WeaponManager : public BaseObject { 41 NewObjectListDeclaration(WeaponManager); 41 42 42 43 //! an enumerator defining a Slot, where a Weapon can be stored inside. … … 89 90 void changeWeaponConfig(int weaponConfig); 90 91 91 float increaseAmmunition( NewClassIDprojectileType, float ammo);92 float increaseAmmunition(const NewClassID& projectileType, float ammo); 92 93 float inclreaseAmmunition(const Weapon* weapon, float ammo); 93 94 … … 106 107 // private: 107 108 int getNextFreeSlot(int configID, long capability = WTYPE_ALL); 108 CountPointer<AmmoContainer>& getAmmoContainer( NewClassIDprojectileType);109 CountPointer<AmmoContainer>& getAmmoContainer(const NewClassID& projectileType); 109 110 CountPointer<AmmoContainer>& getAmmoContainer(const Weapon* weapon); 110 111 -
branches/new_class_id/src/world_entities/world_entity.cc
r9656 r9705 47 47 SHELL_COMMAND(debugEntity, WorldEntity, debugWE); 48 48 49 50 NewObjectListDefinition(WorldEntity); 49 51 /** 50 52 * Loads the WordEntity-specific Part of any derived Class … … 56 58 : Synchronizeable() 57 59 { 58 this-> setClassID(CL_WORLD_ENTITY, "WorldEntity");60 this->registerObject(this, WorldEntity::_objectList); 59 61 60 62 this->obbTree = NULL; … … 81 83 82 84 // registering default reactions: 83 this->subscribeReaction(CREngine::CR_OBJECT_DAMAGE, /*CL_WORLD_ENTITY*/ CL_PROJECTILE);85 /// FIXME this->subscribeReaction(CREngine::CR_OBJECT_DAMAGE, /*CL_WORLD_ENTITY*/ CL_PROJECTILE); 84 86 85 87 this->toList(OM_NULL); … … 197 199 PRINTF(1)("OBJ-File %s not found.\n", fileName.c_str()); 198 200 199 if( modelNumber == 0 && !this->isA(CL_WEAPON))201 if( modelNumber == 0 /* FIXME && !this->isA(CL_WEAPON) */) 200 202 this->buildObbTree(obbTreeDepth); 201 203 } … … 300 302 * @param target1 a filter target (classID) 301 303 */ 302 void WorldEntity::subscribeReaction(CREngine::CRType type, longtarget1)304 void WorldEntity::subscribeReaction(CREngine::CRType type, const NewClassID& target1) 303 305 { 304 306 this->subscribeReaction(type); … … 314 316 * @param target1 a filter target (classID) 315 317 */ 316 void WorldEntity::subscribeReaction(CREngine::CRType type, long target1, longtarget2)318 void WorldEntity::subscribeReaction(CREngine::CRType type, const NewClassID& target1, const NewClassID& target2) 317 319 { 318 320 this->subscribeReaction(type); … … 329 331 * @param target1 a filter target (classID) 330 332 */ 331 void WorldEntity::subscribeReaction(CREngine::CRType type, long target1, long target2, longtarget3)333 void WorldEntity::subscribeReaction(CREngine::CRType type, const NewClassID& target1, const NewClassID& target2, const NewClassID& target3) 332 334 { 333 335 this->subscribeReaction(type); … … 345 347 * @param target1 a filter target (classID) 346 348 */ 347 void WorldEntity::subscribeReaction(CREngine::CRType type, long target1, long target2, long target3, longtarget4)349 void WorldEntity::subscribeReaction(CREngine::CRType type, const NewClassID& target1, const NewClassID& target2, const NewClassID& target3, const NewClassID& target4) 348 350 { 349 351 this->subscribeReaction(type); -
branches/new_class_id/src/world_entities/world_entity.h
r9656 r9705 37 37 38 38 39 39 40 //! Basis-class all interactive stuff in the world is derived from 40 41 class WorldEntity : public PNode 41 42 { 43 NewObjectListDeclaration(WorldEntity); 42 44 public: 43 45 WorldEntity(); … … 49 51 void loadModel2(const std::string& fileN, float scal = 1.0f){this->loadModel(fileN,scal,0,4);} 50 52 void setModel(Model* model, unsigned int modelNumber = 0); 51 53 Model* getModel(unsigned int modelNumber = 0) const { return (this->models.size() > modelNumber)? this->models[modelNumber] : NULL; }; 52 54 53 55 inline void loadMD2Texture(const std::string& fileName) { this->md2TextureFileName = fileName; } … … 73 75 74 76 75 /** @returns a reference to the obb tree of this worldentity */77 /** @returns a reference to the obb tree of this worldentity */ 76 78 inline BVTree* getOBBTree() const { return this->obbTree; }; 77 79 inline void setOBBTree(OBBTree* tree) { /*if( this->obbTree != NULL) delete this->obbTree;*/ this->obbTree = (BVTree*)tree; } … … 81 83 /* --- Collision Reaction Block --- */ 82 84 void subscribeReaction(CREngine::CRType type); 83 void subscribeReaction(CREngine::CRType type, longtarget1);84 void subscribeReaction(CREngine::CRType type, long target1, longtarget2);85 void subscribeReaction(CREngine::CRType type, long target1, long target2, longtarget3);86 void subscribeReaction(CREngine::CRType type, long target1, long target2, long target3, longtarget4);85 void subscribeReaction(CREngine::CRType type, const NewClassID& target1); 86 void subscribeReaction(CREngine::CRType type, const NewClassID& target1, const NewClassID& target2); 87 void subscribeReaction(CREngine::CRType type, const NewClassID& target1, const NewClassID& target2, const NewClassID& target3); 88 void subscribeReaction(CREngine::CRType type, const NewClassID& target1, const NewClassID& target2, const NewClassID& target3, const NewClassID& target4); 87 89 88 90 void unsubscribeReaction(CREngine::CRType type); … … 126 128 127 129 void hide() { if( this->objectListNumber != OM_DEAD) this->lastObjectListNumber = this->objectListNumber; this->toList(OM_DEAD); } 128 130 void unhide() { if( this->objectListNumber != this->lastObjectListNumber) this->toList(this->lastObjectListNumber); } 129 131 130 132 131 133 /* --- Character Attribute Block --- */ 132 134 /** @returns the scaling of the model */ 133 135 float getScaling(){return this->scaling;} 134 136 /** @returns the damage dealt by this world entity */ 135 137 float getDamage() const { return this->damage; } … … 216 218 bool bOnGround; //!< true if this entity is standing on the ground 217 219 218 220 protected: 219 221 Vector velocity; //!< speed of the entity 220 222
Note: See TracChangeset
for help on using the changeset viewer.