Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10497 in orxonox.OLD for trunk/src/world_entities


Ignore:
Timestamp:
Jan 30, 2007, 6:17:43 AM (18 years ago)
Author:
bknecht
Message:

added some more scriptable functions to cameraManager

Location:
trunk/src/world_entities
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/cameraman.cc

    r10495 r10497  
    4747                        //->addMethod("setViewMode", Executor2<CameraMan, lua_State*,const std::string&,const std::string&>(&CameraMan::setViewMode))
    4848                        ->addMethod("setRelCoor", Executor4<CameraMan, lua_State*,const std::string&,float,float,float>(&CameraMan::setRelCameraCoor))
     49                        ->addMethod("setRelCoorSoft", Executor5<CameraMan, lua_State*,const std::string&,float,float,float,float>(&CameraMan::setRelCameraCoorSoft))
    4950                       );
    5051
     
    9495{
    9596     BaseObject* newCam = ObjectListBase::getBaseObject("Camera", cameraName);
    96      switch (viewMode)
    97      {
    98          default:
    99          case "ViewNormal":
    100          {
    101              dynamic_cast<Camera*>(newCam)->setViewMode(Camera::ViewNormal);
    102              break;
    103          }
    104          case "ViewTop":
    105          {
    106               dynamic_cast<Camera*>(newCam)->setViewMode(Camera::ViewTop);
    107               break;
    108          }
    109          case "ViewBehind":
    110          {
    111               dynamic_cast<Camera*>(newCam)->setViewMode(Camera::ViewBehind);
    112               break;
    113          }
    114          case "ViewFront":
    115          {
    116               dynamic_cast<Camera*>(newCam)->setViewMode(Camera::ViewFront);
    117               break;
    118          }
    119          case "ViewLeft":
    120          {
    121               dynamic_cast<Camera*>(newCam)->setViewMode(Camera::ViewLeft);
    122               break;
    123          }
    124          case "ViewRight":
    125          {
    126               dynamic_cast<Camera*>(newCam)->setViewMode(Camera::ViewRight);
    127          }
     97     
     98     if (!strcmp(viewMode, "ViewNormal"))
     99     {
     100         dynamic_cast<Camera*>(newCam)->setViewMode(Camera::ViewNormal);
     101     }
     102     else if (!strcmp(viewMode, "ViewTop"))
     103     {
     104         dynamic_cast<Camera*>(newCam)->setViewMode(Camera::ViewTop);
     105     }
     106     else if (!strcmp(viewMode, "ViewBehind"))
     107     {
     108         dynamic_cast<Camera*>(newCam)->setViewMode(Camera::ViewBehind);
     109     }
     110     else if (!strcmp(viewMode, "ViewFront"))
     111     {
     112         dynamic_cast<Camera*>(newCam)->setViewMode(Camera::ViewFront);
     113     }
     114     else if (!strcmp(viewMode, "ViewLeft"))
     115     {
     116         dynamic_cast<Camera*>(newCam)->setViewMode(Camera::ViewLeft);
     117     }
     118     else if (!strcmp(viewMode, "ViewRight"))
     119     {
     120         dynamic_cast<Camera*>(newCam)->setViewMode(Camera::ViewRight);
    128121     }
    129122}*/
     
    136129}
    137130
     131void CameraMan::setRelCameraCoorSoft(const std::string& camName, float x, float y, float z, float bias)
     132{
     133     BaseObject* newCam = ObjectListBase::getBaseObject("Camera", camName);
     134     dynamic_cast<Camera*>(newCam)->setRelCoorSoft(x,y,z,bias);
     135     dynamic_cast<Camera*>(newCam)->target->setRelCoorSoft(0,0,0,bias);
     136}
    138137
    139138void CameraMan::setCam(unsigned int cameraNo)
     
    229228    fadeToBlack->toggleFade();
    230229}
     230
    231231
    232232void CameraMan::initFadeBlack()
  • trunk/src/world_entities/cameraman.h

    r10495 r10497  
    5656    void jumpCam(const std::string& cameraName, float x, float y, float z);
    5757    void setRelCameraCoor(const std::string& cameraName, float x, float y, float z);
     58    void setRelCameraCoorSoft(const std::string& cameraName, float x, float y, float z, float bias);
    5859    //void setViewMode(const std::string& camName, const std::string& viewMode);
    5960   
  • trunk/src/world_entities/space_ships/space_ship.cc

    r10496 r10497  
    367367  //this->travelDistancePlus = Vector2D(38.0, 43.0);
    368368  //this->travelDistanceMinus = Vector2D(-38.0, -43.0);
    369   this->travelDistancePlus = Vector2D(500,500);
    370   this->travelDistanceMinus = Vector2D(-500,-500);
     369  this->travelDistancePlus = Vector2D(50,50);
     370  this->travelDistanceMinus = Vector2D(-50,-50);
    371371  this->isTravelDistanceInit = true;
    372372  this->actionWidthPercentage = 1;
Note: See TracChangeset for help on using the changeset viewer.