Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 31, 2018, 11:23:24 AM (6 years ago)
Author:
emustafa
Message:

OrxoKartKart controls optimized

Location:
code/branches/OrxoKart_HS18
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/branches/OrxoKart_HS18/data/levels/templates/spaceshipHover.oxt

    r12056 r12066  
     1
    12<Template name=spaceshiphover>
    23  <SpaceShip
     
    1819   reloadwaittime      = 0.5
    1920
    20    primaryThrust     = 2000
     21   primaryThrust     = 600
    2122   auxilaryThrust    = 300
    22    rotationThrust    = 25
     23   rotationThrust    = 50
    2324
    24    jumpBoost = 90
     25   jumpBoost = 30
    2526
    2627   lift = 1;
  • code/branches/OrxoKart_HS18/src/modules/hover/HoverShip.cc

    r11495 r12066  
    4949
    5050    void HoverShip::moveFrontBack(const Vector2& value)
    51         { this->steering_.z -= value.x; }
     51        {
     52            this->steering_.z -= value.x;
     53            orxout() << "mFB" << endl;
     54        }
    5255
    5356    void HoverShip::moveRightLeft(const Vector2& value)
    54         { this->steering_.x += value.x; }
     57        {
     58            this->rotateYaw(value);
     59            orxout() << "mRL" << endl;
     60        }
    5561
    5662    void HoverShip::moveUpDown(const Vector2& value)
    57         { this->steering_.y += value.x; }
     63        {
     64            this->steering_.y += value.x;
     65            orxout() << "mUD" << endl;
     66        }
    5867
    5968    void HoverShip::rotateYaw(const Vector2& value)
    60     {
    61         this->localAngularAcceleration_.setY(this->localAngularAcceleration_.y() + value.x);
    62 
    63         Pawn::rotateYaw(value);
    64     }
     69        {
     70            this->localAngularAcceleration_.setY(this->localAngularAcceleration_.y() - value.x);
     71            //orxout() << value;
     72            Pawn::rotateYaw(value);
     73        }
    6574
    6675    void HoverShip::XMLPort(Element& xmlelement, XMLPort::Mode mode)
  • code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartKart.cc

    r12057 r12066  
    2626
    2727/**
    28     @file HoverShip.cc
    29     @brief Implementation of the HoverShip control
     28    @file OrxoKartKart.cc
     29    @brief Implementation of the OrxoKartKart control
    3030*/
    3131
    32 #include "HoverShip.h"
     32#include "OrxoKartKart.h"
    3333#include "core/CoreIncludes.h"
    3434#include "core/XMLPort.h"
     
    3838namespace orxonox
    3939{
    40     RegisterClass(HoverShip);
     40    RegisterClass(OrxoKartKart);
    4141
    42     HoverShip::HoverShip(Context* context) : SpaceShip(context)
     42    OrxoKartKart::OrxoKartKart(Context* context) : SpaceShip(context)
    4343    {
    44         RegisterObject(HoverShip);
     44        RegisterObject(OrxoKartKart);
    4545        enableCollisionCallback();
    4646        isFloor_ = false;
     
    4848    }
    4949
    50     void HoverShip::moveFrontBack(const Vector2& value)
    51         { this->steering_.z -= value.x; }
     50    void OrxoKartKart::moveFrontBack(const Vector2& value)
     51        {
     52            this->steering_.z -= value.x;
     53            orxout() << "mFB" << endl;
     54        }
    5255
    53     void HoverShip::moveRightLeft(const Vector2& value)
    54         { this->steering_.x += value.x; }
     56    void OrxoKartKart::moveRightLeft(const Vector2& value)
     57        {
     58            this->rotateYaw(value);
     59            orxout() << "mRL" << endl;
     60        }
    5561
    56     void HoverShip::moveUpDown(const Vector2& value)
    57         { this->steering_.y += value.x; }
     62    void OrxoKartKart::moveUpDown(const Vector2& value)
     63        {
     64            this->steering_.y += value.x;
     65            orxout() << "mUD" << endl;
     66        }
    5867
    59     void HoverShip::rotateYaw(const Vector2& value)
     68    void OrxoKartKart::rotateYaw(const Vector2& value)
     69        {
     70            this->localAngularAcceleration_.setY(this->localAngularAcceleration_.y() - value.x);
     71            //orxout() << value;
     72            Pawn::rotateYaw(value);
     73        }
     74
     75    void OrxoKartKart::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    6076    {
    61         this->localAngularAcceleration_.setY(this->localAngularAcceleration_.y() + value.x);
     77        SUPER(OrxoKartKart, XMLPort, xmlelement, mode);
    6278
    63         Pawn::rotateYaw(value);
    64     }
    65 
    66     void HoverShip::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    67     {
    68         SUPER(HoverShip, XMLPort, xmlelement, mode);
    69 
    70         XMLPortParam(HoverShip, "jumpBoost", setJumpBoost, getJumpBoost, xmlelement, mode);
     79        XMLPortParam(OrxoKartKart, "jumpBoost", setJumpBoost, getJumpBoost, xmlelement, mode);
    7180    }
    7281
     
    7685    @param value
    7786    */
    78     void HoverShip::rotatePitch(const Vector2& value) { }
     87    void OrxoKartKart::rotatePitch(const Vector2& value) { }
    7988
    8089    /**
     
    8392    @param value
    8493    */
    85     void HoverShip::rotateRoll(const Vector2& value) { }
     94    void OrxoKartKart::rotateRoll(const Vector2& value) { }
    8695
    8796    /**
     
    8998        Checks if the ship is touching the floor. The ship can only jump if there is contact with someting beneath it.
    9099    */
    91     bool HoverShip::collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint)
     100    bool OrxoKartKart::collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint)
    92101    {
    93102        SpaceShip::collidesAgainst(otherObject, cs, contactPoint);
    94         //SUPER(HoverShip, collidesAgainst, otherObject, cs, contactPoint);
     103        //SUPER(OrxoKartKart, collidesAgainst, otherObject, cs, contactPoint);
    95104
    96105        if (contactPoint.m_normalWorldOnB.y() > 0.6
     
    109118    @param bBoost
    110119    */
    111     void HoverShip::boost(bool bBoost) {
     120    void OrxoKartKart::boost(bool bBoost) {
    112121        if (bBoost && this->isFloor_)
    113122        {
  • code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartKart.h

    r12057 r12066  
    2626
    2727/**
    28     @file HoverShip.h
    29     @brief Declaration of the HoverShip class.
     28    @file OrxoKartKart.h
     29    @brief Declaration of the OrxoKartKart class.
    3030*/
    3131
    32 #ifndef _HoverShip_H__
    33 #define _HoverShip_H__
     32#ifndef _OrxoKartKart_H__
     33#define _OrxoKartKart_H__
    3434
    35 #include "HoverPrereqs.h"
     35#include "OrxoKartPrereqs.h"
    3636
    3737#include "worldentities/pawns/SpaceShip.h"
     
    3939namespace orxonox
    4040{
    41     class _HoverExport HoverShip : public SpaceShip
     41    class _OrxoKartExport OrxoKartKart : public SpaceShip
    4242    {
    4343        public:
    44             HoverShip(Context* context);
     44            OrxoKartKart(Context* context);
    4545
    4646            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
     
    7575}
    7676
    77 #endif /* _HoverShip_H__ */
     77#endif /* _OrxoKartKart_H__ */
Note: See TracChangeset for help on using the changeset viewer.