Changeset 12147
- Timestamp:
- Dec 5, 2018, 11:25:23 AM (6 years ago)
- Location:
- code/branches/OrxoKart_HS18
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/OrxoKart_HS18/data/levels/includes/weaponSettingsHover.oxi
r11495 r12147 7 7 <WeaponSet firemode=1 /> 8 8 </weaponsets> 9 < weaponpacks>9 <!--<weaponpacks> 10 10 <WeaponPack> 11 11 <links> … … 25 25 </links> 26 26 </WeaponPack> 27 </weaponpacks> 27 </weaponpacks> --> 28 28 <munition> 29 29 <IceMunition initialmagazines=1 maxmagazines=1 munitionpermagazine=10/> -
code/branches/OrxoKart_HS18/data/levels/templates/OrxoKartKart.oxt
r12079 r12147 3 3 <SpaceShip 4 4 hudtemplate = spaceshiporxokarthud 5 camerapositiontemplate = spaceship hovercameras5 camerapositiontemplate = spaceshipcameras 6 6 spawnparticlesource = "Orxonox/fairytwirl" 7 7 spawnparticleduration = 3 … … 22 22 auxilaryThrust = 300 23 23 rotationThrust = 50 24 25 jumpBoost = 3026 27 24 lift = 1; 28 25 stallSpeed = 500; 29 26 30 27 boostPower = 30 31 boostPowerRate = 1 28 boostPowerRate = 100 32 29 boostRate = 5 33 30 boostCooldownDuration = 10 … … 39 36 > 40 37 <engines> 41 <MultiStateEngine position=" 0, 0, 0" template=spaceship hoverengine />38 <MultiStateEngine position=" 0, 0, 0" template=spaceshipengine /> 42 39 </engines> 43 40 <attached> … … 66 63 </SpaceShip> 67 64 </Template> 68 69 <Template name=spaceship hovercameras defaults=0>65 66 <Template name=spaceshipcameras defaults=0> 70 67 <SpaceShip> 71 68 <camerapositions> 72 <CameraPosition position="0,8, 5" drag= true mouselook=true />73 <CameraPosition position="0,8,5" yaw="180" drag= true mouselook=true />69 <CameraPosition position="0,8, 5" drag=True mouselook=False /> 70 <CameraPosition position="0,8,5" yaw="180" drag=True mouselook=False /> 74 71 </camerapositions> 75 72 </SpaceShip> 76 73 </Template> 77 74 78 <Template name=spaceship hoverengine baseclass=Engine>75 <Template name=spaceshipengine baseclass=Engine> 79 76 <MultiStateEngine 80 77 boostfactor = 2 81 78 82 speedfront = 20079 speedfront = 300 83 80 speedback = 40 84 81 speedleftright = 40 85 82 speedupdown = 40 86 83 87 accelerationfront = 50088 accelerationbrake = 50 084 accelerationfront = 300 85 accelerationbrake = 50 89 86 accelerationback = 125 90 accelerationleftright = 12587 accelerationleftright = 0 91 88 accelerationupdown = 125 92 89 > -
code/branches/OrxoKart_HS18/src/modules/orxokart/CMakeLists.txt
r12144 r12147 7 7 ShroomHUD.cc 8 8 TimeHUD.cc 9 KartController.cc 9 10 ) 10 11 -
code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartKart.cc
r12066 r12147 33 33 #include "core/CoreIncludes.h" 34 34 #include "core/XMLPort.h" 35 36 35 #include <BulletCollision/NarrowPhaseCollision/btManifoldPoint.h> 36 #include "controllers/HumanController.h" 37 37 38 38 namespace orxonox … … 42 42 OrxoKartKart::OrxoKartKart(Context* context) : SpaceShip(context) 43 43 { 44 44 45 RegisterObject(OrxoKartKart); 45 46 enableCollisionCallback(); 46 isFloor_ = false;47 jumpBoost_ = 0;48 47 } 49 48 50 49 void OrxoKartKart::moveFrontBack(const Vector2& value) 51 50 { 52 this->steering_.z -= value.x; 53 orxout() << "mFB" << endl;51 this->steering_.z -= value.x; 52 54 53 } 55 54 56 55 void OrxoKartKart::moveRightLeft(const Vector2& value) 57 { 56 { 58 57 this->rotateYaw(value); 59 orxout() << "mRL" << endl;60 58 } 61 59 … … 63 61 { 64 62 this->steering_.y += value.x; 65 orxout() << "mUD" << endl;63 66 64 } 67 65 68 66 void OrxoKartKart::rotateYaw(const Vector2& value) 69 67 { 70 this->localAngularAcceleration_.setY(this->localAngularAcceleration_.y() - value.x); 71 //orxout() << value; 72 Pawn::rotateYaw(value); 68 this->localAngularAcceleration_.setY(this->localAngularAcceleration_.y() - value.x); 73 69 } 74 70 75 71 void OrxoKartKart::XMLPort(Element& xmlelement, XMLPort::Mode mode) 76 { 77 SUPER(OrxoKartKart, XMLPort, xmlelement, mode); 72 { 73 SUPER(OrxoKartKart, XMLPort, xmlelement, mode); 74 75 } 78 76 79 XMLPortParam(OrxoKartKart, "jumpBoost", setJumpBoost, getJumpBoost, xmlelement, mode);80 }81 77 82 78 /** … … 94 90 void OrxoKartKart::rotateRoll(const Vector2& value) { } 95 91 96 /**97 @brief98 Checks if the ship is touching the floor. The ship can only jump if there is contact with someting beneath it.99 */100 bool OrxoKartKart::collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint)101 {102 SpaceShip::collidesAgainst(otherObject, cs, contactPoint);103 //SUPER(OrxoKartKart, collidesAgainst, otherObject, cs, contactPoint);104 92 105 if (contactPoint.m_normalWorldOnB.y() > 0.6106 && this->getVelocity().y < 1) {107 this->isFloor_ = true;108 } else {109 this->isFloor_ = false;110 }111 112 return false;113 }114 115 /**116 @brief117 Makes the ship jump118 @param bBoost119 */120 void OrxoKartKart::boost(bool bBoost) {121 if (bBoost && this->isFloor_)122 {123 this->setVelocity(124 this->getVelocity().x,125 jumpBoost_,126 this->getVelocity().z127 );128 this->isFloor_ = false;129 }130 }131 93 } -
code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartKart.h
r12066 r12147 46 46 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 47 47 48 /// sets this ships jumpBoost49 inline void setJumpBoost(float jumpBoost)50 { this->jumpBoost_ = jumpBoost; }51 /// returns this ships jumpBoost52 inline float getJumpBoost() const53 { return this->jumpBoost_; }54 55 48 virtual void moveFrontBack(const Vector2& value) override; 56 49 … … 64 57 65 58 virtual void rotateRoll(const Vector2& value) override; 66 67 virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint) override;68 69 virtual void boost(bool bBoost) override;70 71 private:72 float jumpBoost_;73 bool isFloor_;74 59 }; 75 60 } -
code/branches/OrxoKart_HS18/src/orxonox/controllers/CMakeLists.txt
r12028 r12147 21 21 ArrowController.cc; 22 22 AutonomousDroneController.cc; 23 24 23 )
Note: See TracChangeset
for help on using the changeset viewer.