Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 5, 2014, 4:06:09 PM (9 years ago)
Author:
fvultier
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/pickupsFS14/src/modules/jump/JumpPlatformHMove.cc

    r10074 r10111  
    2121 *
    2222 *   Author:
    23  *      Fabian 'x3n' Landau
     23 *      Fabien Vultier
    2424 *   Co-authors:
    2525 *      ...
     
    2929/**
    3030    @file JumpPlatformHMove.cc
    31     @brief Implementation of the JumpPlatform class.
     31    @brief This platform can move horizontally.
    3232*/
    3333
    3434#include "JumpPlatformHMove.h"
    35 
    3635#include "core/CoreIncludes.h"
    3736#include "core/GameMode.h"
    38 
    3937#include "gametypes/Gametype.h"
    40 
    4138#include "JumpFigure.h"
    42 
    4339#include "sound/WorldSound.h"
    4440#include "core/XMLPort.h"
    45 
    46 #include "graphics/Backlight.h"
    4741
    4842namespace orxonox
     
    5044    RegisterClass(JumpPlatformHMove);
    5145
    52     /**
    53     @brief
    54         Constructor. Registers and initializes the object.
    55     */
    5646    JumpPlatformHMove::JumpPlatformHMove(Context* context) : JumpPlatform(context)
    5747    {
     
    6151    }
    6252
    63     /**
    64     @brief
    65         Destructor.
    66     */
    6753    JumpPlatformHMove::~JumpPlatformHMove()
    6854    {
     
    7056    }
    7157
    72     //xml port for loading sounds
    7358    void JumpPlatformHMove::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    7459    {
     
    7661    }
    7762
    78     /**
    79     @brief
    80         Is called every tick.
    81         Handles the movement of the ball and its interaction with the boundaries and bats.
    82     @param dt
    83         The time since the last tick.
    84     */
    8563    void JumpPlatformHMove::tick(float dt)
    8664    {
     
    8866
    8967        // Get the current position, velocity and acceleration of the ball.
    90         Vector3 position = this->getPosition();
    91         Vector3 velocity = this->getVelocity();
     68        Vector3 position = getPosition();
     69        Vector3 velocity = getVelocity();
    9270
    9371        if ((position.x < leftBoundary_ && velocity.x < 0) || (position.x > rightBoundary_ && velocity.x > 0))
    9472
    9573        {
    96                 //orxout() << "refelected platformHMove at " << position.x << endl;
    9774                velocity.x = -velocity.x;
    9875        }
    9976
    10077        // Set the position, velocity and acceleration of the ball, if they have changed.
    101         if (velocity != this->getVelocity())
    102             this->setVelocity(velocity);
     78        if (velocity != getVelocity())
     79        {
     80            setVelocity(velocity);
     81        }
    10382        if (position != this->getPosition())
    104             this->setPosition(position);
     83        {
     84            setPosition(position);
     85        }
    10586    }
    10687
     
    10990        leftBoundary_ = leftBoundary;
    11091        rightBoundary_ = rightBoundary;
    111 
    112         this->setVelocity(Vector3(speed,0,0));
    113 
     92        setVelocity(Vector3(speed,0,0));
    11493    }
    11594
Note: See TracChangeset for help on using the changeset viewer.