Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3596 in orxonox.OLD


Ignore:
Timestamp:
Mar 17, 2005, 6:03:46 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: borders for the Player, so he cannot move out of the line

Location:
orxonox/trunk/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/defs/debug.h

    r3594 r3596  
    4747#define DEBUG_MODULE_ORXONOX            0
    4848#define DEBUG_MODULE_WORLD              0
    49 #define DEBUG_MODULE_PNODE              0
     49#define DEBUG_MODULE_PNODE              3
    5050#define DEBUG_MODULE_WORLD_ENTITY       0
    5151#define DEBUG_MODULE_COMMAND_NODE       0
  • orxonox/trunk/src/story_entities/world.cc

    r3590 r3596  
    239239            Vector* cameraOffset = new Vector (-10, 5, 0);
    240240            this->localCamera->setRelCoor (cameraOffset);
    241             trackManager->condition(2, NEAREST, this->localPlayer);
     241            trackManager->condition(2, LEFTRIGHT, this->localPlayer);
    242242
    243243            break;
  • orxonox/trunk/src/track_manager.cc

    r3595 r3596  
    4242  this->endTime = 1;
    4343  this->jumpTime = 0;
     44  this->width = TMAN_DEFAULT_WIDTH;
    4445  this->nodeCount = 0;
    4546  this->childCount = 0;
     
    760761
    761762/**
     763   \returns the current Width of the track
     764*/
     765float TrackManager::getWidth(void) const
     766{
     767  return this->currentTrackElem->width;
     768}
     769
     770/**
    762771   \brief Advances the local-time of the Track around dt
    763772   \param dt The time about which to advance.
  • orxonox/trunk/src/track_manager.h

    r3594 r3596  
    2222#define TMAN_DEFAULT_CURVETYPE BEZIERCURVE
    2323#define TMAN_DEFAULT_DURATION 10
    24 
     24#define TMAN_DEFAULT_WIDTH    10
    2525
    2626//! A Graph-Element, that holds the curve-structure of a Level.
     
    5454  float endTime;             //!< The time at which this Track ends.
    5555  float jumpTime;            //!< The Time this Track has to jump to its preceding Track (only >0 if Track isJoined==true)
     56  float width;               //!< Th width of the Path. This tells the Player(s), how far he(they) can go to the left/right.
    5657  int nodeCount;             //!< The count of points this TrackElement has.
    5758  Curve* curve;              //!< The Curve of this TrackElement
     
    166167  inline Vector calcPos(void) const;
    167168  inline Vector calcDir(void) const;
     169  float getWidth(void) const;
    168170  void tick(float dt);
    169171  void jumpTo(float time);
  • orxonox/trunk/src/world_entities/player.cc

    r3590 r3596  
    1919
    2020#include "player.h"
     21
    2122#include "stdincl.h"
    2223//#include "collision.h"
     
    2425#include "list.h"
    2526#include "weapon.h"
     27#include "track_manager.h"
    2628
    2729using namespace std;
     
    169171  //orthDirection = orthDirection.cross (direction);
    170172
    171   if( this->bUp) { accel = accel+(direction*acceleration); }
    172   if( this->bDown) { accel = accel-(direction*acceleration); }
    173   if( this->bLeft ) { accel = accel - (orthDirection*acceleration); }
    174   if( this->bRight ) { accel = accel + (orthDirection*acceleration); }
    175   if( this->bAscend ) { /* not yet implemented but just: (0,0,1)*acceleration */}
     173  if( this->bUp && this->getRelCoor().x < 20)
     174    accel = accel+(direction*acceleration);
     175  if( this->bDown && this->getRelCoor().x > -5)
     176    accel = accel-(direction*acceleration);
     177  if( this->bLeft &&  TrackManager::getInstance()->getWidth() > -this->getRelCoor().z*2)
     178    accel = accel - (orthDirection*acceleration);
     179  if( this->bRight &&  TrackManager::getInstance()->getWidth() > this->getRelCoor().z*2)
     180    accel = accel + (orthDirection*acceleration);
     181  if( this->bAscend )
    176182  if( this->bDescend) {/* FIXME */} /* \todo up and down player movement */
    177183
Note: See TracChangeset for help on using the changeset viewer.