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/JumpPlatformVMove.cc

    r10074 r10111  
    2121 *
    2222 *   Author:
    23  *      Fabian 'x3n' Landau
     23 *      Fabien Vultier
    2424 *   Co-authors:
    2525 *      ...
     
    2929/**
    3030    @file JumpPlatformVMove.cc
    31     @brief Implementation of the JumpPlatform class.
     31    @brief This platform can move vertically.
    3232*/
    3333
    3434#include "JumpPlatformVMove.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"
     
    4844    RegisterClass(JumpPlatformVMove);
    4945
    50     /**
    51     @brief
    52         Constructor. Registers and initializes the object.
    53     */
    5446    JumpPlatformVMove::JumpPlatformVMove(Context* context) : JumpPlatform(context)
    5547    {
     
    5951    }
    6052
    61     /**
    62     @brief
    63         Destructor.
    64     */
    6553    JumpPlatformVMove::~JumpPlatformVMove()
    6654    {
     
    6856    }
    6957
    70     //xml port for loading sounds
    7158    void JumpPlatformVMove::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    7259    {
     
    7461    }
    7562
    76     /**
    77     @brief
    78         Is called every tick.
    79         Handles the movement of the ball and its interaction with the boundaries and bats.
    80     @param dt
    81         The time since the last tick.
    82     */
    8363    void JumpPlatformVMove::tick(float dt)
    8464    {
     
    8666
    8767        // Get the current position, velocity and acceleration of the ball.
    88         Vector3 position = this->getPosition();
    89         Vector3 velocity = this->getVelocity();
     68        Vector3 position = getPosition();
     69        Vector3 velocity = getVelocity();
    9070
    9171        if ((position.z < lowerBoundary_ && velocity.z < 0) || (position.z > upperBoundary_ && velocity.z > 0))
    9272        {
    93                 //orxout() << "refelected platformVMove at " << position.z << endl;
    9473                velocity.z = -velocity.z;
    9574        }
    9675
    9776        // Set the position, velocity and acceleration of the ball, if they have changed.
    98         if (velocity != this->getVelocity())
    99             this->setVelocity(velocity);
    100         if (position != this->getPosition())
    101             this->setPosition(position);
     77        if (velocity != getVelocity())
     78        {
     79            setVelocity(velocity);
     80        }
     81        if (position != getPosition())
     82        {
     83            setPosition(position);
     84        }
    10285    }
    10386
     
    10790        upperBoundary_ = upperBoundary;
    10891
    109         this->setVelocity(Vector3(0,0,speed));
     92        setVelocity(Vector3(0,0,speed));
    11093
    11194    }
Note: See TracChangeset for help on using the changeset viewer.