Changeset 10512 in orxonox.OLD for trunk/src/world_entities
- Timestamp:
- Jan 30, 2007, 8:01:19 PM (18 years ago)
- Location:
- trunk/src/world_entities
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/npcs/npc.cc
r10511 r10512 65 65 ->addMethod("fire", Executor0<NPC, lua_State*>(&NPC::fire)) 66 66 ->addMethod("pause", Executor1<WorldEntity, lua_State*, bool>(&WorldEntity::pauseTrack)) 67 ->addMethod("setAI", Executor1<NPC, lua_State*, bool>(&NPC::setAI)) 67 68 ->addMethod("setVisibility", Executor1<WorldEntity, lua_State*, bool>(&WorldEntity::setVisibility)) 68 69 ); … … 234 235 // LoadParamXML(root, "Weapons", this, NPC, addWeapons) 235 236 // .describe("creates and adds weapons"); 237 } 238 239 void NPC::setAI(bool activate) 240 { 241 if(activate) AIEngine::getInstance()->addAI(teamNumber,swarmNumber,(WorldEntity*)this,maxSpeed,attackDistance); 242 else AIEngine::getInstance()->removeAI(teamNumber,swarmNumber,(WorldEntity*)this); 236 243 } 237 244 -
trunk/src/world_entities/npcs/npc.h
r10499 r10512 33 33 inline int getTeam() { return teamNumber; } 34 34 inline void fire(){ this->bFire=true;} 35 35 void setAI(bool activate); 36 36 inline void enableAI(int flag) { this->bAIEnabled = (bool)flag; } 37 37 -
trunk/src/world_entities/space_ships/space_ship.cc
r10503 r10512 60 60 #include "player.h" 61 61 #include "camera.h" 62 #include "cameraman.h" 62 63 63 64 … … 1148 1149 void SpaceShip::updateTravelDistance() 1149 1150 { 1150 float x = 1.25 * this->actionWidthPercentage * fabsf(State::getCamera()->getAbsCoor().y) * tan(State::getCamera()->getFovy()*M_PI /360.0); 1151 float y = x / State::getCamera()->getAspectRatio() / this->actionWidthPercentage; 1151 CameraMan* cm = State::getCameraman(); 1152 Camera* c = cm->getCurrentCam(); 1153 1154 1155 float x = 1.25 * this->actionWidthPercentage * fabsf(c->getAbsCoor().y) * tan(c->getFovy()*M_PI /360.0); 1156 float y = x / c->getAspectRatio() / this->actionWidthPercentage; 1152 1157 //State::getCamera()->setAbsCoor(-5, 1000, 0); 1153 1158
Note: See TracChangeset
for help on using the changeset viewer.