Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 21, 2005, 2:47:30 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: new control

Location:
branches/christmas_branche/src/world_entities/creatures
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/christmas_branche/src/world_entities/creatures/md2_creature.cc

    r6206 r6208  
    2323#include "md2Model.h"
    2424#include "resource_manager.h"
     25#include "state.h"
    2526
    2627#include "weapons/weapon_manager.h"
     
    122123  cycle = 0.0;
    123124
     125  this->cameraConnNode.addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT);
     126  this->cameraConnNode.setName("CameraConnectorNode");
     127  this->addChild(&this->cameraConnNode);
     128  this->cameraConnNode.addChild(State::getCameraTarget());
     129  State::getCameraTarget()->setRelCoor(10,0,0);
    124130
    125131  travelSpeed = 15.0;
     
    239245{
    240246  this->drawLODsafe();
     247
     248  this->cameraConnNode.debugDraw(0);
    241249}
    242250
     
    274282  }
    275283
     284
    276285  //orient the MD2Creature in direction of the mouse
    277286  this->setAbsDir( /*rotQuat*/ mouseDirX);
     287  this->cameraConnNode.setRelDir(mouseDirY);
    278288
    279289  this->getWeaponManager()->tick(time);
     
    377387    this->yMouse = event.yRel;
    378388    this->mouseDirX *= Quaternion(-M_PI/4*xMouse*mouseSensitivity, Vector(0,1,0));
    379     this->mouseDirY *= Quaternion(-M_PI/4*yMouse*mouseSensitivity, Vector(0,0,1));
     389    this->mouseDirY *= Quaternion(-M_PI/4*yMouse*mouseSensitivity, Vector(0,1,0));
    380390//     if( xMouse*xMouse < 0.9)
    381391//      this->setAbsDir(mouseDir);
  • branches/christmas_branche/src/world_entities/creatures/md2_creature.h

    r6206 r6208  
    6262    bool                  bJump;              //!< jump
    6363
     64    PNode                 cameraConnNode;     //!< The Node the camera is connected to.
     65
    6466    float                 xMouse;             //!< mouse moved in x-Direction
    6567    float                 yMouse;             //!< mouse moved in y-Direction
     
    7072    Quaternion            mouseDirX;           //!< the direction where the player wants to fly
    7173    Quaternion            mouseDirY;           //!< the direction where the player wants to fly
    72     Quaternion rotQuat;
    7374    float                 travelSpeed;        //!< the current speed of the player (to make soft movement)
    7475    float                 acceleration;       //!< the acceleration of the player.
Note: See TracChangeset for help on using the changeset viewer.