Revision: 2565
          http://rigsofrods.svn.sourceforge.net/rigsofrods/?rev=2565&view=rev
Author:   ulteq
Date:     2012-05-14 20:20:49 +0000 (Mon, 14 May 2012)
Log Message:
-----------
-Codechange: CameraSystem WIP
added basic cinecam functionality

Modified Paths:
--------------
    trunk/source/main/gfx/camera/CameraBehavior.cpp
    trunk/source/main/gfx/camera/CameraBehaviorVehicleCineCam.cpp
    trunk/source/main/gfx/camera/CameraManager.h

Modified: trunk/source/main/gfx/camera/CameraBehavior.cpp
===================================================================
--- trunk/source/main/gfx/camera/CameraBehavior.cpp     2012-05-14 19:16:35 UTC 
(rev 2564)
+++ trunk/source/main/gfx/camera/CameraBehavior.cpp     2012-05-14 20:20:49 UTC 
(rev 2565)
@@ -43,7 +43,7 @@
 {
        if (INPUTENGINE.getEventBoolValueBounce(EV_CAMERA_LOOKBACK))
        {
-               if(camRotX > Degree(0))
+               if ( camRotX > Degree(0) )
                        camRotX = Degree(0);
                else
                        camRotX = Degree(180);
@@ -93,9 +93,9 @@
        }
        if (INPUTENGINE.getEventBoolValue(EV_CAMERA_RESET))
        {
-               camRotX = 0;
-               camRotY = CameraManager::DEFAULT_INTERNAL_CAM_PITCH;
-               camDist = 20;
+               camRotX =  0.0f;
+               camRotY =  0.0f;
+               camDist = 20.0f;
        }
 
        if ( minCamDist > 0.0f )

Modified: trunk/source/main/gfx/camera/CameraBehaviorVehicleCineCam.cpp
===================================================================
--- trunk/source/main/gfx/camera/CameraBehaviorVehicleCineCam.cpp       
2012-05-14 19:16:35 UTC (rev 2564)
+++ trunk/source/main/gfx/camera/CameraBehaviorVehicleCineCam.cpp       
2012-05-14 20:20:49 UTC (rev 2565)
@@ -21,6 +21,7 @@
 
 #include "Beam.h"
 #include "OverlayWrapper.h"
+#include "Settings.h"
 
 using namespace Ogre;
 
@@ -28,7 +29,9 @@
          CameraBehaviorVehicle()
 {
        camDist = 0.1f;
-       camRatio = 0.0f;
+       camRatio = 0.01f;
+       minCamDist = 0.0f;
+       maxCamDist = 0.5f;
 }
 
 void CameraBehaviorVehicleCineCam::update(const CameraManager::cameraContext_t 
&ctx)
@@ -37,7 +40,7 @@
                                 - 
ctx.mCurrTruck->nodes[ctx.mCurrTruck->cameranodedir[ctx.mCurrTruck->currentcamera]].smoothpos).normalisedCopy();
 
        targetDirection = -atan2(dir.dotProduct(Vector3::UNIT_X), 
dir.dotProduct(-Vector3::UNIT_Z));
-       targetPitch = 0.0f;
+       targetPitch     = 0.0f;
 
        if ( camPitching )
        {
@@ -51,9 +54,13 @@
 
 void CameraBehaviorVehicleCineCam::activate(const 
CameraManager::cameraContext_t &ctx)
 {
-       camRotX = 0;
-       camRotY = 
Degree(CameraManager::DEFAULT_INTERNAL_CAM_PITCH).valueRadians();
+       float fov = FSETTING("FOV Internal", 75);
 
+       ctx.mCamera->setFOVy(Degree(fov));
+
+       camRotX = 0.0f;
+       camRotY = 0.15f;
+
        ctx.mCurrTruck->prepareInside(true);
 
        if ( ctx.mOverlayWrapper )
@@ -70,6 +77,11 @@
 
 void CameraBehaviorVehicleCineCam::deactivate(const 
CameraManager::cameraContext_t &ctx)
 {
+       float fov = FSETTING("FOV External", 60);
+
+       ctx.mCamera->setFOVy(Degree(fov));
+       ctx.mCamera->roll(Radian(0));
+
        ctx.mCurrTruck->prepareInside(false);
 
        if ( ctx.mOverlayWrapper )

Modified: trunk/source/main/gfx/camera/CameraManager.h
===================================================================
--- trunk/source/main/gfx/camera/CameraManager.h        2012-05-14 19:16:35 UTC 
(rev 2564)
+++ trunk/source/main/gfx/camera/CameraManager.h        2012-05-14 20:20:49 UTC 
(rev 2565)
@@ -66,8 +66,6 @@
        Ogre::Camera *getCamera() { return ctx.mCamera; };
        int getCameraMode() { return currentBehaviorID; };
 
-       static const int DEFAULT_INTERNAL_CAM_PITCH = -15;
-
 protected:
 
        cameraContext_t ctx;

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Rigsofrods-devel mailing list
Rigsofrods-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rigsofrods-devel

Reply via email to