Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6208 in orxonox.OLD


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

orxonox/trunk: new control

Location:
branches/christmas_branche/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/christmas_branche/src/story_entities/world.cc

    r6187 r6208  
    347347//  tn->addChild(this->localCamera);
    348348  localCamera->setClipRegion(1, 10000.0);
    349   localCamera->lookAt(playable);
     349//  localCamera->lookAt(playable);
    350350//  this->localPlayer->setParentMode(PNODE_ALL);
    351351  if (sky != NULL)
     
    355355  }
    356356
     357  this->localCamera->getTarget()->getParent()->debugNode(0);
    357358  SoundEngine::getInstance()->setListener(this->localCamera);
    358359
  • branches/christmas_branche/src/util/state.cc

    r6142 r6208  
    2626
    2727
    28 const PNode* State::camera = NULL;
    29 const PNode* State::cameraTarget = NULL;
     28PNode* State::camera = NULL;
     29PNode* State::cameraTarget = NULL;
    3030
    3131ObjectManager* State::objectManager = NULL;
     
    3434 *  sets camera and target of the current Camera
    3535*/
    36 void State::setCamera(const PNode* camera, const PNode* cameraTarget)
     36void State::setCamera(PNode* camera, PNode* cameraTarget)
    3737{
    3838  State::camera = camera;
  • branches/christmas_branche/src/util/state.h

    r6142 r6208  
    2525   //////////////
    2626  /** @param camera the PNode to the Camera, @param cameraTarget the PNode to the Camera's target */
    27   static void setCamera(const PNode* camera, const PNode* cameraTarget);
     27  static void setCamera(PNode* camera, PNode* cameraTarget);
    2828  /** @returns a Pointer to the PNode of the Camera */
    29   static inline const PNode* getCamera() { return State::camera; };
     29  static inline PNode* getCamera() { return State::camera; };
    3030  /** @returns a Pointer to the CameraTarget */
    31   static inline const PNode* getCameraTarget() { return State::cameraTarget; };
     31  static inline PNode* getCameraTarget() { return State::cameraTarget; };
    3232
    3333  //////////////////////
     
    4646  State();
    4747
    48   static const PNode*           camera;             //!< A reference to the camera
    49   static const PNode*           cameraTarget;       //!< A reference to the cameraTarget
     48  static PNode*                 camera;             //!< A reference to the camera
     49  static PNode*                 cameraTarget;       //!< A reference to the cameraTarget
    5050  static PNode*                 nullParent;         //!< A reference to the Null-PNode.
    5151  static ObjectManager*         objectManager;      //!< A referenct to the current ObjectManager
  • branches/christmas_branche/src/world_entities/camera.cc

    r6034 r6208  
    119119    case VIEW_NORMAL:
    120120      this->toFovy = 60.0;
    121       this->setParentSoft("TrackNode");
    122       this->target->setParentSoft("TrackNode");
     121/*      this->setParentSoft("TrackNode");
     122      this->target->setParentSoft("TrackNode"); */
    123123      this->setRelCoorSoft(-10, 5, 0);
    124124      this->target->setRelCoorSoft(0,0,0);
     
    129129  //    this->target->setRelCoorSoft(Vector(10,0,0));
    130130
    131       if (!strcmp(this->target->getParent()->getName(), "Player"))
    132         this->target->setParentSoft("TrackNode");
    133       else
    134         this->target->setParentSoft("Player");
    135       this->getParent()->debugNode(0);
     131//       if (!strcmp(this->target->getParent()->getName(), "Player"))
     132//         this->target->setParentSoft("TrackNode");
     133//       else
     134//         this->target->setParentSoft("Player");
     135//       this->getParent()->debugNode(0);
    136136
    137137//      this->setParent("main-Turret");
     
    142142    case VIEW_FRONT:
    143143      this->toFovy = 120.0;
    144        this->setParentSoft("Player");
    145        this->target->setParentSoft("Player");
     144/*       this->setParentSoft("Player");
     145       this->target->setParentSoft("Player");*/
    146146       this->setRelCoorSoft(4, 0, 0, 5);
    147147       this->target->setRelCoorSoft(Vector(10,0,0), 5);
     
    150150    case VIEW_LEFT:
    151151      this->toFovy = 90;
    152       this->setParentSoft("TrackNode");
    153       this->target->setParentSoft("TrackNode");
     152/*      this->setParentSoft("TrackNode");
     153      this->target->setParentSoft("TrackNode");*/
    154154      this->setRelCoorSoft(0, 1, -10, .5);
    155155      this->target->setRelCoorSoft(0,0,0);
     
    157157    case VIEW_RIGHT:
    158158      this->toFovy = 90;
    159       this->setParentSoft("TrackNode");
    160       this->target->setParentSoft("TrackNode");
     159/*      this->setParentSoft("TrackNode");
     160      this->target->setParentSoft("TrackNode");*/
    161161      this->setRelCoorSoft(Vector(0, 1, 10));
    162162      this->target->setRelCoorSoft(0,0,0);
     
    164164    case VIEW_TOP:
    165165      this->toFovy= 120;
    166       this->setParentSoft("TrackNode");
    167       this->target->setParentSoft("TrackNode");
     166/*      this->setParentSoft("TrackNode");
     167      this->target->setParentSoft("TrackNode");*/
    168168      this->setRelCoorSoft(Vector(30, 50, 0));
    169169      this->target->setRelCoorSoft(35,0,0);
  • 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.