Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 15, 2007, 11:51:37 PM (18 years ago)
Author:
muellmic
Message:

changed camera handling for the vertical-scroller playmode. the top-down view in vertical scroller is now a proper camera-viewmode. also added a bool-state in the camera class to override the camera's event-listener and handle the camera-events (view buttons) in other classes. i used this to handle the camera parenting with the space-ship class, so other views as the top-down get useful and nice-looking again…. *taking-a-look-at-the-watch* oops damnit… i hope i won't forget the last tram ;-)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/playability/src/world_entities/space_ships/space_ship.cc

    r10235 r10237  
    5858#include "state.h"
    5959#include "player.h"
     60#include "camera.h"
    6061
    6162
     
    436437  this->toList( OM_GROUP_00);
    437438  State::getPlayer()->hud().setOverlayActive(false);
     439  State::getCamera()->setEventHandling(true);
    438440  //dynamic_cast<Element2D*>(this->secWeaponMan.getFixedTarget())->setVisibility( false);
    439441  //this->detachCamera();
     
    619621    this->previousWeaponConfig();
    620622
     623  if (!(State::getCamera()->getEventHandling()))
     624  {
     625    if( event.type == KeyMapper::PEV_VIEW0)
     626    {
     627      State::getCamera()->setViewMode(Camera::ViewNormal);
     628      State::getCameraTargetNode()->setParent(this);
     629      State::getCamera()->setParent(this);
     630    }
     631    else if( event.type == KeyMapper::PEV_VIEW1)
     632    {
     633      State::getCamera()->setViewMode(Camera::ViewBehind);
     634      State::getCameraTargetNode()->setParent(this);
     635      State::getCamera()->setParent(this);
     636    }
     637    else if( event.type == KeyMapper::PEV_VIEW2)
     638    {
     639      State::getCamera()->setViewMode(Camera::ViewFront);
     640      State::getCameraTargetNode()->setParent(this);
     641      State::getCamera()->setParent(this);
     642    }
     643    else if( event.type == KeyMapper::PEV_VIEW3)
     644    {
     645      State::getCamera()->setViewMode(Camera::ViewLeft);
     646      State::getCameraTargetNode()->setParent(this);
     647      State::getCamera()->setParent(this);
     648    }
     649    else if( event.type == KeyMapper::PEV_VIEW4)
     650    {
     651      State::getCamera()->setViewMode(Camera::ViewRight);
     652      State::getCameraTargetNode()->setParent(this);
     653      State::getCamera()->setParent(this);
     654    }
     655    else if( event.type == KeyMapper::PEV_VIEW5)
     656    {
     657      State::getCamera()->setViewMode(Camera::ViewTop);
     658      State::getCameraTargetNode()->setParent(this->travelNode);
     659      State::getCamera()->setParent(this->travelNode);
     660    }
     661  }
     662
    621663
    622664  /*
     
    837879        State::getCameraNode()->setParentSoft(this->travelNode);
    838880        //State::getCameraNode()->setParentSoft(this);
    839         State::getCameraNode()->setRelCoorSoft(-0.01, 40, 0);
     881        //State::getCameraNode()->setRelCoorSoft(-0.01, 40, 0);
    840882        State::getCameraTargetNode()->setParentSoft(this->travelNode);
    841883        //State::getCameraTargetNode()->setParentSoft(this);
    842         State::getCameraTargetNode()->setRelCoorSoft(0,0,0);
     884        //State::getCameraTargetNode()->setRelCoorSoft(0,0,0);
     885        this->setCameraMode(Camera::ViewTop);
     886        State::getCamera()->setEventHandling(false);
     887        registerEvent(KeyMapper::PEV_VIEW0);
     888        registerEvent(KeyMapper::PEV_VIEW1);
     889        registerEvent(KeyMapper::PEV_VIEW2);
     890        registerEvent(KeyMapper::PEV_VIEW3);
     891        registerEvent(KeyMapper::PEV_VIEW4);
     892        registerEvent(KeyMapper::PEV_VIEW5);
     893
     894        State::getCamera()->setParentMode(PNODE_MOVEMENT);
    843895
    844896        this->debugNode(1);
Note: See TracChangeset for help on using the changeset viewer.