Revision: 2584
http://rigsofrods.svn.sourceforge.net/rigsofrods/?rev=2584&view=rev
Author: ulteq
Date: 2012-05-17 13:57:42 +0000 (Thu, 17 May 2012)
Log Message:
-----------
-Codechange: CameraSystem WIP
correct camDistMin and camDist for VehicleOrbit camera
Modified Paths:
--------------
trunk/source/main/gfx/camera/CameraBehaviorVehicle.cpp
trunk/source/main/gfx/camera/CameraBehaviorVehicle.h
Modified: trunk/source/main/gfx/camera/CameraBehaviorVehicle.cpp
===================================================================
--- trunk/source/main/gfx/camera/CameraBehaviorVehicle.cpp 2012-05-17
13:36:41 UTC (rev 2583)
+++ trunk/source/main/gfx/camera/CameraBehaviorVehicle.cpp 2012-05-17
13:57:42 UTC (rev 2584)
@@ -29,7 +29,6 @@
, camPitching(true)
{
camRotY = 0.5f;
- camDistMin = 8.0f;
if ( SSETTING("External Camera Mode", "Pitching") == "Static" )
camPitching = false;
@@ -48,6 +47,8 @@
targetPitch = -asin(dir.dotProduct(Vector3::UNIT_Y));
}
+ camIntertia = 1.0f / (ctx.mDt * 4.0f);
+
camLookAt = ctx.mCurrTruck->getPosition();
CameraBehavior::update(ctx);
@@ -55,5 +56,6 @@
void CameraBehaviorVehicle::activate(const CameraManager::cameraContext_t &ctx)
{
- // initialize camDistMin based on the vehicle bounding box
+ camDistMin = ctx.mCurrTruck->getMinimalCameraRadius() * 2.0f;
+ camDist = camDistMin * 1.5f;
}
Modified: trunk/source/main/gfx/camera/CameraBehaviorVehicle.h
===================================================================
--- trunk/source/main/gfx/camera/CameraBehaviorVehicle.h 2012-05-17
13:36:41 UTC (rev 2583)
+++ trunk/source/main/gfx/camera/CameraBehaviorVehicle.h 2012-05-17
13:57:42 UTC (rev 2584)
@@ -32,7 +32,7 @@
void update(const CameraManager::cameraContext_t &ctx);
- void activate(const CameraManager::cameraContext_t &ctx);
+ void CameraBehaviorVehicle::activate(const
CameraManager::cameraContext_t &ctx);
bool switchBehavior(const CameraManager::cameraContext_t &ctx) { return
true; };
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/rigsofrods-devel