Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 11, 2019, 2:05:59 PM (5 years ago)
Author:
wiesep
Message:

Rolled back to r12201

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/modules/hover/HoverShip.cc

    r11495 r12290  
    3333#include "core/CoreIncludes.h"
    3434#include "core/XMLPort.h"
     35#include "graphics/Camera.h"
    3536
    3637#include <BulletCollision/NarrowPhaseCollision/btManifoldPoint.h>
     
    4546        enableCollisionCallback();
    4647        isFloor_ = false;
    47         jumpBoost_ = 0;
     48        jumpBoost_ = 0;   
    4849    }
    4950
    5051    void HoverShip::moveFrontBack(const Vector2& value)
    51         { this->steering_.z -= value.x; }
     52        { this->steering_.z -= value.x;
     53            Vector3 currentPosition = this->getPosition();
     54            currentPosition.y -= 2*value.y;
     55            this->setPosition(currentPosition);
     56        }
    5257
    5358    void HoverShip::moveRightLeft(const Vector2& value)
    54         { this->steering_.x += value.x; }
     59        {
     60            this->steering_.x += value.x;
     61            Vector3 currentPosition = this->getPosition();
     62            currentPosition.x -= 2*value.x;
     63            this->setPosition(currentPosition);
     64        }
    5565
    5666    void HoverShip::moveUpDown(const Vector2& value)
    57         { this->steering_.y += value.x; }
     67        {
     68            this->steering_.y += value.x;
     69            this->setPosition(Vector3(0, 0, 0));
     70        }
    5871
    5972    void HoverShip::rotateYaw(const Vector2& value)
     
    6982
    7083        XMLPortParam(HoverShip, "jumpBoost", setJumpBoost, getJumpBoost, xmlelement, mode);
     84    }
     85
     86    void HoverShip::tick(float dt)
     87    {
     88        SUPER(HoverShip, tick, dt);
     89                //Execute movement
     90        if (this->hasLocalController())
     91            {
     92             // Camera
     93            Camera* camera = this->getCamera();
     94            if (camera != nullptr)
     95            {
     96                camera->setPosition(0,1000,0);
     97                camera->setOrientation(Vector3::UNIT_X, Degree(-90));
     98
     99            }
     100        }
    71101    }
    72102
Note: See TracChangeset for help on using the changeset viewer.