Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10495 in orxonox.OLD for trunk


Ignore:
Timestamp:
Jan 30, 2007, 1:54:25 AM (18 years ago)
Author:
bknecht
Message:

new cameraMan function to have more control over camera

Location:
trunk/src/world_entities
Files:
3 edited

Legend:

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

    r10478 r10495  
    2626#include "state.h"
    2727
     28#include "debug.h"
     29
    2830
    2931ObjectListDefinition(Camera);
     
    103105   {
    104106    this->setParent(this->entityTrack->getTrackNode());
    105     this->setRelCoor(0,0,0);
     107    //this->setRelCoor(0,0,0);
    106108   }
    107109}
     
    215217  this->viewVector = (this->target->getAbsCoor() - this->getAbsCoor()).getNormalized();
    216218  this->frustumPlane = Plane(this->viewVector, this->getAbsCoor() + this->viewVector * 0.1);
    217   this->upVector =  this->getAbsDirV();
     219  this->upVector = this->getAbsDirV();
    218220
    219221  // iteration for fovy
     
    223225
    224226  if(this->entityTrack)
     227  {
     228    //PRINTF(0)("tickytackytucky\n");
    225229    this->entityTrack->tick(dt);
    226 
     230    //this->setAbsCoor(this->entityTrack->getTrackNode()->getAbsCoor());
     231  }
    227232
    228233
  • trunk/src/world_entities/cameraman.cc

    r10483 r10495  
    4545                        ->addMethod("jumpCurrCam", Executor3<CameraMan, lua_State*,float,float,float>(&CameraMan::jumpCurrCam))
    4646                        ->addMethod("jumpCam", Executor4<CameraMan, lua_State*,const std::string&,float,float,float>(&CameraMan::jumpCam))
     47                        //->addMethod("setViewMode", Executor2<CameraMan, lua_State*,const std::string&,const std::string&>(&CameraMan::setViewMode))
     48                        ->addMethod("setRelCoor", Executor4<CameraMan, lua_State*,const std::string&,float,float,float>(&CameraMan::setRelCameraCoor))
    4749                       );
    4850
     
    8991}
    9092
    91 
     93/*void CameraMan::setViewMode(const std::string& cameraName, const std::string& viewMode)
     94{
     95     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         }
     128     }
     129}*/
     130
     131void CameraMan::setRelCameraCoor(const std::string& camName, float x, float y, float z)
     132{
     133     BaseObject* newCam = ObjectListBase::getBaseObject("Camera", camName);
     134     dynamic_cast<Camera*>(newCam)->setRelCoor(x,y,z);
     135     dynamic_cast<Camera*>(newCam)->target->setRelCoor(0,0,0);
     136}
    92137
    93138
  • trunk/src/world_entities/cameraman.h

    r10483 r10495  
    5555    void jumpCam(int x, int y, int z, int camNo);
    5656    void jumpCam(const std::string& cameraName, float x, float y, float z);
     57    void setRelCameraCoor(const std::string& cameraName, float x, float y, float z);
     58    //void setViewMode(const std::string& camName, const std::string& viewMode);
    5759   
    5860    void changeSpeed(float speed);
Note: See TracChangeset for help on using the changeset viewer.