Files

32 lines
1.8 KiB
C#
Raw Permalink Normal View History

2026-10-21 20:45:23 +01:00
using UnityEngine.Scripting.APIUpdating;
namespace UnityEngine.XR.Interaction.Toolkit.Gaze
{
/// <summary>
/// An interface that allows for computing an altered projectile velocity to allow for assisted aiming.
/// This can be used to allow a user to throw a grab interactable to where they are looking.
/// </summary>
[MovedFrom("UnityEngine.XR.Interaction.Toolkit")]
public interface IXRAimAssist
{
/// <summary>
/// Takes a projectile's velocity and adjusts it to more closely hit a given target.
/// </summary>
/// <param name="source">The starting position of the projectile.</param>
/// <param name="velocity">The starting velocity of the projectile.</param>
/// <param name="gravity">How much gravity the projectile is experiencing.</param>
/// <returns>Returns a velocity based on the source, but adjusted to hit a given target.</returns>
Vector3 GetAssistedVelocity(in Vector3 source, in Vector3 velocity, float gravity);
/// <summary>
/// Takes a projectile's velocity and adjusts it to more closely hit a given target.
/// </summary>
/// <param name="source">The starting position of the projectile.</param>
/// <param name="velocity">The starting velocity of the projectile.</param>
/// <param name="gravity">How much gravity the projectile is experiencing.</param>
/// <param name="maxAngle">If the angle between the initial velocity and adjusted velocity is greater than this value, no adjustment will occur.</param>
/// <returns>Returns a velocity based on the source, but adjusted to hit a given target.</returns>
Vector3 GetAssistedVelocity(in Vector3 source, in Vector3 velocity, float gravity, float maxAngle);
}
}