Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 4, 2006, 3:05:59 PM (18 years ago)
Author:
rennerc
Message:

fpsplayer weapon position, jump sync

File:
1 edited

Legend:

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

    r9136 r9139  
    148148  registerVar( new SynchronizeableBool( &bForward, &bForward, "bForward", PERMISSION_OWNER ) );
    149149  registerVar( new SynchronizeableBool( &bBackward, &bBackward, "bBackward", PERMISSION_OWNER ) );
     150  registerVar( new SynchronizeableBool( &bJump, &bJump, "bJump", PERMISSION_OWNER ) );
    150151  registerVar( new SynchronizeableFloat( &heading, &heading, "heading", PERMISSION_OWNER ) );
    151152  registerVar( new SynchronizeableFloat( &attitude, &attitude, "attitude", PERMISSION_OWNER ) );
     
    153154    //subscribe to collision reaction
    154155  this->subscribeReaction(CREngine::CR_PHYSICS_FULL_WALK, CL_BSP_ENTITY);
     156 
     157  this->initWeapon = false;
    155158}
    156159
     
    215218void FPSPlayer::tick (float time)
    216219{
     220  if ( !this->initWeapon )
     221  {
     222    this->initWeapon = true;
     223   
     224    AABB* box = this->getModelAABB();
     225    if( box != NULL)
     226    {
     227      float f = 1.3f;
     228      State::getCameraNode()->setRelCoor(0, box->halfLength[1] * f, 0);
     229      State::getCameraTargetNode()->setRelCoor(10, box->halfLength[1] * f, 0);
     230
     231      this->getWeaponManager().setSlotPosition(0, Vector(1.5, box->halfLength[1] * f - 0.7, 1.1));
     232      this->getWeaponManager().setSlotPosition(1, Vector(5.0, box->halfLength[1] * f, 0.0));
     233    }
     234  }
    217235
    218236  if( this->bJump)
     
    382400}
    383401
     402/*
    384403void FPSPlayer::respawn( )
    385404{
     
    397416  }
    398417}
    399 
    400 
    401 
    402 
     418*/
     419
     420
     421
Note: See TracChangeset for help on using the changeset viewer.