//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
//**************** Copyright (c) 2016 Marko Pintera (marko.pintera@gmail.com). All rights reserved. **********************//
using BansheeEngine;
namespace BansheeEditor
{
/** @addtogroup Scene-Editor
* @{
*/
///
/// Options used by the scene camera.
///
internal class SceneCameraOptions
{
public static float[] ScrollSpeeds
{
get => new float[]
{
0.1f,
0.25f,
0.5f,
0.75f,
1f,
1.5f,
2f,
3f
};
}
public const float StartSpeed = 4.0f;
public const float TopSpeed = 12.0f;
public readonly Degree FieldOfView = (Degree)90.0f;
public float Acceleration { get; private set; }
public float FastModeMultiplier { get; private set; }
public float PanSpeed { get; private set; }
public float ScrollSpeed { get; private set; }
public float RotationalSpeed { get; private set; }
public SceneCameraOptions()
{
Acceleration = EditorSettings.GetFloat("SceneCameraOptions_Acceleration", 1.0f);
FastModeMultiplier = EditorSettings.GetFloat("SceneCameraOptions_FastModeMultiplier", 2.0f);
PanSpeed = EditorSettings.GetFloat("SceneCameraOptions_PanSpeed", 3.0f);
ScrollSpeed = EditorSettings.GetFloat("SceneCameraOptions_ScrollSpeed", 3.0f);
RotationalSpeed = EditorSettings.GetFloat("SceneCameraOptions_RotationalSpeed", 3.0f);
}
///
/// Sets the acceleration of the scene camera
///
/// The acceleration value.
public void SetAcceleration(float acceleration)
{
Acceleration = acceleration;
EditorSettings.SetFloat("SceneCameraOptions_Acceleration", acceleration);
}
///
/// Sets the fast mode multiplier of the scene camera
///
/// The fast mode multiplier value.
public void SetFastModeMultiplier(float fastModeMultiplier)
{
FastModeMultiplier = fastModeMultiplier;
EditorSettings.SetFloat("SceneCameraOptions_FastModeMultiplier", fastModeMultiplier);
}
///
/// Sets the pan speed of the scene camera
///
/// The pan speed value.
public void SetPanSpeed(float panSpeed)
{
PanSpeed = panSpeed;
EditorSettings.SetFloat("SceneCameraOptions_PanSpeed", panSpeed);
}
///
/// Sets the scroll speed of the scene camera
///
/// The scroll speed value.
public void SetScrollSpeed(float scrollSpeed)
{
ScrollSpeed = scrollSpeed;
EditorSettings.SetFloat("SceneCameraOptions_ScrollSpeed", scrollSpeed);
}
///
/// Sets the rotation speed of the scene camera
///
/// The rotation speed value.
public void SetRotationalSpeed(float rotationalSpeed)
{
RotationalSpeed = rotationalSpeed;
EditorSettings.SetFloat("SceneCameraOptions_RotationalSpeed", rotationalSpeed);
}
}
/** @} */
}