6 private bool m_bSpeedBoostUpEnabled;
9 private bool m_bHoldBoostUpEnabled;
12 private bool m_bDisableOnSprint;
15 private float m_iHeightMax;
18 private float m_HeightMultiplier;
21 private float m_fHoldSpeedMultiplier;
24 private float m_fHoldBoostMax;
26 private float m_HoldMultiplier = 0;
28 private bool m_bDebugEnabled;
33 m_bDebugEnabled = DiagMenu.GetBool(
SCR_DebugMenuID.DEBUGUI_MANUAL_CAMERA_SPEED_BOOST_UP);
35 if (!m_bDebugEnabled && param.velocityOriginal[1] <= 0)
40 if (!param.isManualInputEnabled)
44 float surfaceY = param.world.GetSurfaceY(pos[0], pos[2]);
46 surfaceY = Math.Max(surfaceY, 0);
47 float height = pos[1] - surfaceY;
49 float multiplierVertical = 0;
51 InputManager inputManager =
GetGame().GetInputManager();
53 if (m_bHoldBoostUpEnabled && height < m_iHeightMax && inputManager.GetActionValue(
"ManualCameraMoveVertical") > 0)
54 m_HoldMultiplier = Math.Min( m_HoldMultiplier + (param.timeSlice * m_fHoldSpeedMultiplier), m_fHoldBoostMax);
58 if (height < m_iHeightMax && param.velocityOriginal[1] > 0)
59 multiplierVertical = (1 - (height / m_iHeightMax)) * m_HeightMultiplier;
61 if (m_bHoldBoostUpEnabled)
62 multiplierVertical *= m_HoldMultiplier;
66 if (!m_bSpeedBoostUpEnabled || (m_bDisableOnSprint && inputManager.GetActionValue(
"ManualCameraSpeedBoost") > 0))
72 param.multiplier[1] = param.multiplier[1] * (1 + multiplierVertical);
74 DrawDebug4(param, multiplierVertical);
78 override bool EOnCameraInit()
80 DiagMenu.RegisterBool(
SCR_DebugMenuID.DEBUGUI_MANUAL_CAMERA_SPEED_BOOST_UP,
"",
"Speed boost up debug",
"Manual Camera",
false);
89 DbgUI.Begin(
"Camera speed boost up debug", 0, 0);
91 DbgUI.Check(
"Enable ground up boost", m_bSpeedBoostUpEnabled);
92 DbgUI.Check(
"Enable hold delay+boost", m_bHoldBoostUpEnabled);
93 DbgUI.Check(
"Disable boost up on sprint", m_bDisableOnSprint);
95 DbgUI.SliderFloat(
"HeigthMax", m_iHeightMax, 10, 100);
97 DbgUI.Text(m_iHeightMax.ToString());
99 DbgUI.SliderFloat(
"HeigtMultiplier", m_HeightMultiplier, 0, 10);
101 DbgUI.Text(m_HeightMultiplier.ToString());
103 if (m_bHoldBoostUpEnabled)
105 DbgUI.SliderFloat(
"HoldBoostMax", m_fHoldBoostMax, 1, 10);
107 DbgUI.Text(m_fHoldBoostMax.ToString());
109 DbgUI.SliderFloat(
"HoldSpeedupMultiplier", m_fHoldSpeedMultiplier, 1, 10);
111 DbgUI.Text(m_fHoldSpeedMultiplier.ToString());
114 DbgUI.Text(
"VelY: " + param.velocityOriginal[1]);
115 DbgUI.PlotLive(
"VelY", 200, 100, param.velocityOriginal[1], 100, 100);
120 private void DrawDebug2(
float height)
124 DbgUI.Text(
"Height: " + height);
125 DbgUI.PlotLive(
"Height", 200, 100, height, 100, 100);
134 DbgUI.Text(
"Param.MultiplierHorizontal: " + param.multiplier[0]);
135 DbgUI.Text(
"Param.MultiplierVertical: " + param.multiplier[1]);
136 DbgUI.PlotLive(
"Param.MultiplierHorizontal", 200, 100, param.multiplier[0], 100, 100);
138 DbgUI.PlotLive(
"Param.MultiplierVertical", 200, 100, param.multiplier[1], 100, 100);
149 DbgUI.Text(
"Param.MultiplierHorizontal: " + param.multiplier[0]);
150 DbgUI.Text(
"Param.MultiplierVertical: " + param.multiplier[1]);
151 DbgUI.PlotLive(
"Param.MultiplierHorizontal", 200, 100, param.multiplier[0], 100, 100);
153 DbgUI.PlotLive(
"Param.MultiplierVertical", 200, 100, param.multiplier[1], 100, 100);
155 DbgUI.Text(
"NultiplierVertical: " + (1 + multiplierVertical));
156 DbgUI.PlotLive(
"NultiplierVertical", 200, 100, (1 + multiplierVertical), 100, 100);
158 if (m_bHoldBoostUpEnabled)
160 DbgUI.Text(
"HoldMultplier: " + (1 + m_HoldMultiplier));
161 DbgUI.PlotLive(
"HoldMultplier", 200, 100, (1 + m_HoldMultiplier), 100, 100);