- Timestamp:
- May 24, 2018, 3:59:22 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/ScriptableController_FS18/src/orxonox/scriptablecontroller/scriptable_controller_api.cc
r11974 r11999 7 7 #include "infos/Bot.h" 8 8 #include "worldentities/pawns/ModularSpaceShip.h" 9 //#include "../modules/objects/collisionshapes/SphereCollisionShape.h" 10 #include "graphics/Model.h" 11 #include "worldentities/pawns/AAAAutonomousDrone.h" 12 9 13 10 14 namespace orxonox … … 268 272 } 269 273 270 //for (Level* level : ObjectList<Level>()) 271 // level->loadedNewXMLName(this); 272 273 274 275 276 277 /////!!!!!!!!!!!!!!!278 279 this->controller_->level_->addObject(orxonox_cast<Pawn*>(entity));280 281 274 275 276 ///////////////GOLD!!!!!!!!!!!!!!!//////////////////////// 277 Pawn* pawn = this->controller_->getPawnByID(id); 278 //Attach to pawn 279 AAAAutonomousDrone* drone = new AAAAutonomousDrone(pawn->getContext()); // this is neccessary because the projectiles fired need a valid creator for the particlespawner (when colliding against something) 280 281 drone->addTemplate("AAAAutonomousDroneTemplate"); //AAAAutonomousDroneTemplate spaceshipescort 282 283 Vector3 spawnPosition = pawn->getWorldPosition() + Vector3(30,0,-30); 284 drone->setPosition(spawnPosition); 285 //drone->moveFrontBack(1.0); 282 286 283 287 … … 494 498 { 495 499 MobileEntity *entity = this->controller_->getMobileEntityByID(id); 500 496 501 if(entity == nullptr) 497 502 { … … 499 504 return; 500 505 } 501 502 506 503 507 Identifier *identifier = ClassByString("ControllableEntity"); … … 505 509 ControllableEntity *controllable_entity; 506 510 507 508 511 if(identifier->isA(ClassIdentifier<ControllableEntity>::getIdentifier())) 509 512 { 513 orxout(user_info) << "Before final cast..."<< endl; 510 514 controllable_entity = orxonox_cast<ControllableEntity*>(entity); 515 orxout(user_info) << "After final cast..."<< endl; 511 516 //ATTACHED COLLISION SHAPE is MANDATORY in order to move the entity 512 517 controllable_entity->moveFrontBack(x); 513 518 controllable_entity->moveRightLeft(y); 514 519 controllable_entity->moveUpDown(z); 520 orxout(user_info) << "After move..."<< endl; 515 521 } 516 522
Note: See TracChangeset
for help on using the changeset viewer.