Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 12147


Ignore:
Timestamp:
Dec 5, 2018, 11:25:23 AM (5 years ago)
Author:
emustafa
Message:

controlls tweaks

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  
    77  <WeaponSet firemode=1 />
    88</weaponsets>
    9 <weaponpacks>
     9<!--<weaponpacks>
    1010  <WeaponPack>
    1111    <links>
     
    2525    </links>
    2626  </WeaponPack>
    27 </weaponpacks>
     27</weaponpacks> -->
    2828<munition>
    2929  <IceMunition initialmagazines=1 maxmagazines=1 munitionpermagazine=10/>
  • code/branches/OrxoKart_HS18/data/levels/templates/OrxoKartKart.oxt

    r12079 r12147  
    33  <SpaceShip
    44   hudtemplate            = spaceshiporxokarthud
    5    camerapositiontemplate = spaceshiphovercameras
     5   camerapositiontemplate = spaceshipcameras
    66   spawnparticlesource    = "Orxonox/fairytwirl"
    77   spawnparticleduration  = 3
     
    2222   auxilaryThrust    = 300
    2323   rotationThrust    = 50
    24 
    25    jumpBoost = 30
    26 
    2724   lift = 1;
    2825   stallSpeed = 500;
    2926
    3027   boostPower            = 30
    31    boostPowerRate        = 1
     28   boostPowerRate        = 100
    3229   boostRate             = 5
    3330   boostCooldownDuration = 10
     
    3936  >
    4037    <engines>
    41       <MultiStateEngine position=" 0, 0, 0" template=spaceshiphoverengine />
     38      <MultiStateEngine position=" 0, 0, 0" template=spaceshipengine />
    4239    </engines>
    4340    <attached>
     
    6663  </SpaceShip>
    6764</Template>
    68 
    69 <Template name=spaceshiphovercameras defaults=0>
     65 
     66<Template name=spaceshipcameras defaults=0>
    7067  <SpaceShip>
    7168    <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 />
    7471    </camerapositions>
    7572  </SpaceShip>
    7673</Template>
    7774
    78 <Template name=spaceshiphoverengine baseclass=Engine>
     75<Template name=spaceshipengine baseclass=Engine>
    7976  <MultiStateEngine
    8077   boostfactor    = 2
    8178
    82    speedfront     = 200
     79   speedfront     = 300
    8380   speedback      =  40
    8481   speedleftright =  40
    8582   speedupdown    =  40
    8683
    87    accelerationfront     = 500
    88    accelerationbrake     = 500
     84   accelerationfront     = 300
     85   accelerationbrake     = 50
    8986   accelerationback      =  125
    90    accelerationleftright =  125
     87   accelerationleftright =  0
    9188   accelerationupdown    =  125
    9289  >
  • code/branches/OrxoKart_HS18/src/modules/orxokart/CMakeLists.txt

    r12144 r12147  
    77  ShroomHUD.cc
    88  TimeHUD.cc
     9  KartController.cc
    910)
    1011
  • code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartKart.cc

    r12066 r12147  
    3333#include "core/CoreIncludes.h"
    3434#include "core/XMLPort.h"
    35 
    3635#include <BulletCollision/NarrowPhaseCollision/btManifoldPoint.h>
     36#include "controllers/HumanController.h"
    3737
    3838namespace orxonox
     
    4242    OrxoKartKart::OrxoKartKart(Context* context) : SpaceShip(context)
    4343    {
     44
    4445        RegisterObject(OrxoKartKart);
    4546        enableCollisionCallback();
    46         isFloor_ = false;
    47         jumpBoost_ = 0;
    4847    }
    4948
    5049    void OrxoKartKart::moveFrontBack(const Vector2& value)
    5150        {
    52             this->steering_.z -= value.x; 
    53             orxout() << "mFB" << endl;
     51            this->steering_.z -= value.x;
     52           
    5453        }
    5554
    5655    void OrxoKartKart::moveRightLeft(const Vector2& value)
    57         {
     56        {  
    5857            this->rotateYaw(value);
    59             orxout() << "mRL" << endl;
    6058        }
    6159
     
    6361        {
    6462            this->steering_.y += value.x;
    65             orxout() << "mUD" << endl;
     63           
    6664        }
    6765
    6866    void OrxoKartKart::rotateYaw(const Vector2& value)
    6967        {
    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); 
    7369        }
    7470
    7571    void OrxoKartKart::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    76     {
    77         SUPER(OrxoKartKart, XMLPort, xmlelement, mode);
     72        {
     73            SUPER(OrxoKartKart, XMLPort, xmlelement, mode);
     74           
     75        }
    7876
    79         XMLPortParam(OrxoKartKart, "jumpBoost", setJumpBoost, getJumpBoost, xmlelement, mode);
    80     }
    8177
    8278    /**
     
    9490    void OrxoKartKart::rotateRoll(const Vector2& value) { }
    9591
    96     /**
    97     @brief
    98         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);
    10492
    105         if (contactPoint.m_normalWorldOnB.y() > 0.6
    106             && this->getVelocity().y < 1) {
    107             this->isFloor_ = true;
    108         } else {
    109             this->isFloor_ = false;
    110         }
    111 
    112         return false;
    113     }
    114 
    115     /**
    116     @brief
    117         Makes the ship jump
    118     @param bBoost
    119     */
    120     void OrxoKartKart::boost(bool bBoost) {
    121         if (bBoost && this->isFloor_)
    122         {
    123             this->setVelocity(
    124                 this->getVelocity().x,
    125                 jumpBoost_,
    126                 this->getVelocity().z
    127                 );
    128             this->isFloor_ = false;
    129         }
    130     }
    13193}
  • code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartKart.h

    r12066 r12147  
    4646            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
    4747
    48             /// sets this ships jumpBoost
    49             inline void setJumpBoost(float jumpBoost)
    50                 { this->jumpBoost_ = jumpBoost; }
    51             /// returns this ships jumpBoost
    52             inline float getJumpBoost() const
    53                 { return this->jumpBoost_; }
    54 
    5548            virtual void moveFrontBack(const Vector2& value) override;
    5649
     
    6457
    6558            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_;
    7459    };
    7560}
  • code/branches/OrxoKart_HS18/src/orxonox/controllers/CMakeLists.txt

    r12028 r12147  
    2121  ArrowController.cc;
    2222  AutonomousDroneController.cc;
    23        
    2423)
Note: See TracChangeset for help on using the changeset viewer.