Files
RobustToolbox/Robust.Shared/Physics/RayCastResults.cs
Silver 25926a17b7 Renames SS14.* to Robust.* (#793)
RobustToolbox projects should be named Robust.* 

This PR changes the RobustToolbox projects from SS14.* to Robust.*

Updates SS14.* prefixes/namespaces to Robust.*
Updates SpaceStation14.sln to RobustToolbox.sln
Updates MSBUILD/SS14.* to MSBUILD/Robust.*
Updates CSProject and MSBuild references for the above
Updates git_helper.py
Removes Runserver and Runclient as they are unusable
2019-04-15 20:24:59 -06:00

36 lines
1.1 KiB
C#

using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Maths;
namespace Robust.Shared.Physics
{
public readonly struct RayCastResults
{
/// <summary>
/// True if an object was indeed hit. False otherwise.
/// </summary>
public bool DidHitObject => HitEntity != null;
/// <summary>
/// The entity that was hit. <see langword="null" /> if no entity was hit.
/// </summary>
public IEntity HitEntity { get; }
/// <summary>
/// The point of contact where the entity was hit. Defaults to <see cref="Vector2.Zero"/> if no entity was hit.
/// </summary>
public Vector2 HitPos { get; }
/// <summary>
/// The distance from point of origin to the context point. 0.0f if nothing was hit.
/// </summary>
public float Distance { get; }
public RayCastResults(float distance, Vector2 hitPos, IEntity hitEntity)
{
Distance = distance;
HitPos = hitPos;
HitEntity = hitEntity;
}
}
}