Changeset 10531 in orxonox.OLD for trunk/src/world_entities/space_ships
- Timestamp:
- Jan 31, 2007, 1:27:36 AM (18 years ago)
- Location:
- trunk/src/world_entities/space_ships
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/space_ships/space_ship.cc
r10526 r10531 93 93 //->addMethod("setCameraSpeed", Executor1<SpaceShip, lua_State*, float>(&SpaceShip::setCameraSpeed)) 94 94 ->addMethod("pause", Executor1<WorldEntity, lua_State*, bool>(&WorldEntity::pauseTrack)) 95 ->addMethod("setCameraDist", Executor1<SpaceShip, lua_State*, float>(&SpaceShip::setCameraDistance)) 95 96 ); 96 97 … … 616 617 { 617 618 this->bRight = event.bPressed; 619 printf("ShipCoors: %f , %f, %f \n", this->getAbsCoor().x, this->getAbsCoor().y, this->getAbsCoor().z); 618 620 } 619 621 else if( event.type == KeyMapper::PEV_FORWARD) 620 622 { 621 623 this->bForward = event.bPressed; //this->shiftCoor(0,.1,0); 624 622 625 } 623 626 else if( event.type == KeyMapper::PEV_BACKWARD) … … 1141 1144 void SpaceShip::setCameraDistance(float dist) 1142 1145 { 1143 State::getCamera()->setViewTopDistance(dist); 1146 1147 CameraMan* cm = State::getCameraman(); 1148 Camera* c = cm->getCurrentCam(); 1149 c->setViewTopDistance(dist); 1150 1151 if (this->hasPlayer()) 1152 this->isTravelDistanceInit = false; 1144 1153 } 1145 1154 1146 1155 void SpaceShip::setCameraFovy(float fovy) 1147 1156 { 1148 State::getCamera()->setViewTopFovy(fovy); 1157 1158 CameraMan* cm = State::getCameraman(); 1159 Camera* c = cm->getCurrentCam(); 1160 c->setViewTopFovy(fovy); 1161 1162 if (this->hasPlayer()) 1163 this->isTravelDistanceInit = false; 1149 1164 } 1150 1165 … … 1153 1168 CameraMan* cm = State::getCameraman(); 1154 1169 Camera* c = cm->getCurrentCam(); 1155 1156 1170 1171 1157 1172 float x = 1.25 * this->actionWidthPercentage * fabsf(c->getAbsCoor().y) * tan(c->getFovy()*M_PI /360.0); 1158 1173 float y = x / c->getAspectRatio() / this->actionWidthPercentage; -
trunk/src/world_entities/space_ships/space_ship.h
r10516 r10531 92 92 93 93 virtual void hit(float damage, WorldEntity* killer); 94 95 void setCameraDistance(float dist); 94 96 95 97 private: … … 188 190 float cameraSpeed; 189 191 190 void setCameraDistance(float dist); 192 191 193 void setCameraFovy(float fovy); 192 194
Note: See TracChangeset
for help on using the changeset viewer.