Changeset 10662 in orxonox.OLD for branches/vs-enhencements/src/world_entities/space_ships/space_ship.cc
- Timestamp:
- May 24, 2007, 3:54:26 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/vs-enhencements/src/world_entities/space_ships/space_ship.cc
r10661 r10662 69 69 70 70 #include "track/track.h" 71 #include "track/action_box.h" 71 72 72 73 … … 345 346 LoadParam(root, "actionWidthPercentage", this, SpaceShip, setActionWidthPercentage); 346 347 347 State::getCamera()->setViewMode(Camera::ViewTop); 348 State::getCamera()->setViewMode(Camera::ViewNormal); 349 State::getCameraTargetNode()->setParent(this); 350 State::getCamera()->setParent(this); 348 351 349 352 LoadParam(root, "reactor", this, SpaceShip, setReactor); … … 828 831 break; 829 832 833 834 case Playable::Vertical: 835 { 836 this->travelNode->setAbsCoor(this->getAbsCoor()); 837 this->travelNode->updateNode(0.01f); 838 839 this->isTravelDistanceInit = false; 840 841 if(this->entityTrack) 842 this->travelNode->setParent(this->entityTrack->getTrackNode()); 843 844 this->setParent(this->travelNode); 845 this->setRelCoor(0,0,0); 846 847 State::getCameraNode()->setParentSoft(this->travelNode); 848 //State::getCameraNode()->setParentSoft(this); 849 //State::getCameraNode()->setRelCoorSoft(-0.01, 40, 0); 850 State::getCameraTargetNode()->setParentSoft(this->travelNode); 851 //State::getCameraTargetNode()->setParentSoft(this); 852 //State::getCameraTargetNode()->setRelCoorSoft(0,0,0); 853 this->setCameraMode(Camera::ViewNormal); 854 State::getCamera()->setEventHandling(false); 855 registerEvent(KeyMapper::PEV_VIEW0); 856 registerEvent(KeyMapper::PEV_VIEW1); 857 registerEvent(KeyMapper::PEV_VIEW2); 858 registerEvent(KeyMapper::PEV_VIEW3); 859 registerEvent(KeyMapper::PEV_VIEW4); 860 registerEvent(KeyMapper::PEV_VIEW5); 861 862 State::getCamera()->setParentMode(PNODE_ALL); 863 864 break; 865 } 866 830 867 default: 831 868 PRINTF(2)("Playmode %s Not Implemented in %s\n", Playable::playmodeToString(this->getPlaymode()).c_str(), this->getClassCName()); … … 990 1027 } 991 1028 case Playable::Vertical: 1029 { 1030 if ( !entityTrack || !entityTrack->getActionBox() ) 1031 { 1032 break; 1033 } 1034 ActionBox * box = entityTrack->getActionBox(); 1035 1036 this->travelVelocity = Vector(0, 0, 0); 1037 float ssss = 50; 1038 if ( this->bForward ) 1039 { 1040 this->travelVelocity += Vector( 0, ssss, 0 ); 1041 } 1042 if ( this->bBackward ) 1043 { 1044 this->travelVelocity += Vector( 0, -ssss, 0 ); 1045 } 1046 if ( this->bLeft ) 1047 { 1048 this->travelVelocity += Vector( 0, 0, -ssss ); 1049 } 1050 if ( this->bRight ) 1051 { 1052 this->travelVelocity += Vector( 0, 0, ssss ); 1053 } 1054 1055 Vector ds = this->travelVelocity*dt; 1056 Vector newPos = this->getRelCoor() + ds; 1057 if ( newPos.y < -(box->getHeight_2()) || newPos.y > box->getHeight_2() ) 1058 { 1059 this->travelVelocity.y = 0; 1060 } 1061 if ( newPos.z > box->getWidth_2() || newPos.z < -(box->getWidth_2()) ) 1062 { 1063 this->travelVelocity.z = 0; 1064 } 1065 } 992 1066 break; 993 1067 default:
Note: See TracChangeset
for help on using the changeset viewer.