change IsAnyKeyDown to IsAnyButtonDown and add Float2.Normalized
This commit is contained in:
@@ -267,6 +267,19 @@ namespace FlaxEngine
|
||||
/// <remarks>This method may be preferred to <see cref="Float2.Length" /> when only a relative length is needed and speed is of the essence.</remarks>
|
||||
public float LengthSquared => X * X + Y * Y;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the normalized vector. Returned vector has length equal 1.
|
||||
/// </summary>
|
||||
public Float2 Normalized
|
||||
{
|
||||
get
|
||||
{
|
||||
Float2 result = this;
|
||||
result.Normalize();
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the vector into a unit vector.
|
||||
/// </summary>
|
||||
|
||||
@@ -31,7 +31,7 @@ void Gamepad::ResetState()
|
||||
_mappedPrevState.Clear();
|
||||
}
|
||||
|
||||
bool Gamepad::IsAnyKeyDown() const
|
||||
bool Gamepad::IsAnyButtonDown() const
|
||||
{
|
||||
// TODO: optimize with SIMD
|
||||
bool result = false;
|
||||
|
||||
@@ -167,7 +167,7 @@ public:
|
||||
/// <summary>
|
||||
/// Checks if any gamepad button is currently pressed.
|
||||
/// </summary>
|
||||
API_PROPERTY() bool IsAnyKeyDown() const;
|
||||
API_PROPERTY() bool IsAnyButtonDown() const;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the gamepad button up state (true if was released during the current frame).
|
||||
|
||||
@@ -183,7 +183,7 @@ void Mouse::OnMouseDown(const Float2& position, const MouseButton button, Window
|
||||
e.MouseData.Position = position;
|
||||
}
|
||||
|
||||
bool Mouse::IsAnyKeyDown() const
|
||||
bool Mouse::IsAnyButtonDown() const
|
||||
{
|
||||
// TODO: optimize with SIMD
|
||||
bool result = false;
|
||||
|
||||
@@ -65,9 +65,9 @@ public:
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks if any mouse key is currently pressed.
|
||||
/// Checks if any mouse button is currently pressed.
|
||||
/// </summary>
|
||||
API_PROPERTY() bool IsAnyKeyDown() const;
|
||||
API_PROPERTY() bool IsAnyButtonDown() const;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the delta position of the mouse in the screen-space coordinates.
|
||||
|
||||
Reference in New Issue
Block a user