mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 13:59:19 +02:00
Merge pull request #116 from dos1/external-cam-speed
Allow to speed up external camera movement with Ctrl key
This commit is contained in:
@@ -84,8 +84,8 @@ TCamera::OnCommand( command_data const &Command ) {
|
|||||||
// if( movespeed == 0.0 ) { break; } // enable to fix external cameras in place
|
// if( movespeed == 0.0 ) { break; } // enable to fix external cameras in place
|
||||||
|
|
||||||
auto const speedmultiplier = (
|
auto const speedmultiplier = (
|
||||||
( ( m_owner == nullptr ) && ( Command.command == user_command::movehorizontalfast ) ) ?
|
( ( true == FreeFlyModeFlag ) && ( Command.command == user_command::movehorizontalfast ) ) ?
|
||||||
30.0 :
|
( m_owner == nullptr ) ? 30.0 : 5.0 :
|
||||||
1.0 );
|
1.0 );
|
||||||
|
|
||||||
// left-right
|
// left-right
|
||||||
@@ -107,8 +107,8 @@ TCamera::OnCommand( command_data const &Command ) {
|
|||||||
// if( movespeed == 0.0 ) { break; } // enable to fix external cameras in place
|
// if( movespeed == 0.0 ) { break; } // enable to fix external cameras in place
|
||||||
|
|
||||||
auto const speedmultiplier = (
|
auto const speedmultiplier = (
|
||||||
( ( m_owner == nullptr ) && ( Command.command == user_command::moveverticalfast ) ) ?
|
( ( true == FreeFlyModeFlag ) && ( Command.command == user_command::moveverticalfast ) ) ?
|
||||||
10.0 :
|
( m_owner == nullptr ) ? 10.0 : 3.0 :
|
||||||
1.0 );
|
1.0 );
|
||||||
// up-down
|
// up-down
|
||||||
m_moverate.y = ComputeAxisSpeed(Command.param1, walkspeed, movespeed, stickthreshold) * speedmultiplier;
|
m_moverate.y = ComputeAxisSpeed(Command.param1, walkspeed, movespeed, stickthreshold) * speedmultiplier;
|
||||||
@@ -160,6 +160,7 @@ void TCamera::Update()
|
|||||||
|
|
||||||
// update position
|
// update position
|
||||||
if( ( m_owner == nullptr )
|
if( ( m_owner == nullptr )
|
||||||
|
|| ( true == FreeFlyModeFlag )
|
||||||
|| ( false == Global.ctrlState )
|
|| ( false == Global.ctrlState )
|
||||||
|| ( true == DebugCameraFlag ) ) {
|
|| ( true == DebugCameraFlag ) ) {
|
||||||
// ctrl is used for mirror view, so we ignore the controls when in vehicle if ctrl is pressed
|
// ctrl is used for mirror view, so we ignore the controls when in vehicle if ctrl is pressed
|
||||||
|
|||||||
Reference in New Issue
Block a user