Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 4, 2006, 4:38:53 AM (19 years ago)
Author:
patrick
Message:

bigger fps player (right height from model), collision reaction refinement. still there is a possibility to go through walls because of interference in the cr system. not 1st prio but later on fixed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/presentation/src/world_entities/creatures/fps_player.cc

    r9085 r9101  
    2727#include "weapons/cannon.h"
    2828#include "weapons/fps_sniper_rifle.h"
     29
     30#include "aabb.h"
    2931
    3032#include "key_mapper.h"
     
    124126
    125127  this->getWeaponManager().setSlotCount(2);
    126   this->getWeaponManager().setSlotPosition(0, Vector(1.5, -0.7, 1.1));
    127128//   this->getWeaponManager().setSlotDirection(0, Quaternion(M_PI_2, Vector(0,1,0)));
    128129  this->getWeaponManager().setSlotCapability(0, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
    129   this->getWeaponManager().setSlotPosition(1, Vector(5.0, 0.0, 0.0));
    130130  this->getWeaponManager().setSlotDirection(1, Quaternion(M_PI_4*.5, Vector(1,0,0)));
     131
     132
     133  AABB* box = this->getModelAABB();
     134  if( box != NULL)
     135  {
     136    this->getWeaponManager().setSlotPosition(0, Vector(1.5, box->halfLength[1] * 2.0f - 0.7, 1.1));
     137    this->getWeaponManager().setSlotPosition(1, Vector(5.0, box->halfLength[1] * 2.0f, 0.0));
     138  }
     139  else
     140  {
     141    this->getWeaponManager().setSlotPosition(0, Vector(1.5, -0.7, 1.1));
     142    this->getWeaponManager().setSlotPosition(1, Vector(5.0, 0.0, 0.0));
     143  }
     144
    131145
    132146  this->getWeaponManager().setParentNode(&this->cameraNode);
     
    191205
    192206
    193   State::getCameraNode()->setRelCoor(0,0,0);
    194   State::getCameraTargetNode()->setRelCoor(10,0,0);
     207  AABB* box = this->getModelAABB();
     208  if( box != NULL)
     209  {
     210    State::getCameraNode()->setRelCoor(0, box->halfLength[1] * 2.0f, 0);
     211    State::getCameraTargetNode()->setRelCoor(10, box->halfLength[1] * 2.0f, 0);
     212  }
    195213}
    196214
     
    209227void FPSPlayer::tick (float time)
    210228{
    211  
     229
    212230  if( this->bPosBut)
    213231  {
     
    215233    printf("mechanic:walkTo( %f, mheight, %f)\n",this->getAbsCoorX(),this->getAbsCoorZ());
    216234  }
    217  
     235
    218236  Playable::tick( time );
    219237
Note: See TracChangeset for help on using the changeset viewer.