/
EugenyCh7
/
Puppet2D.Net
Обзор
Документация
Войти
/
EugenyCh7
/
Puppet2D.Net
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
Puppet2D.Engine/Common/ShapeCastInput.cs
55 строк
2 KB
EugenyCh7
+ Puppet2D.Engine.Geometry.Shapes
24 авг 2025, 21:42
24 авг 2025, 21:42
f8e0a86
Код
Авторство
О чём код?
using Puppet2D.Engine.Geometry; using Puppet2D.System; namespace Puppet2D.Engine.Common { /// <summary> /// Low level shape cast input in generic form. /// This allows casting an arbitrary point cloud wrap with a radius. /// For example, a circle is a single point with a non-zero radius. /// A capsule is two points with a non-zero radius. /// A box is four points with a zero radius. /// </summary> public struct ShapeCastInput { /// <summary> /// Allow shape cast to encroach when initially touching. /// This only works if the radius is greater than zero. /// </summary> public bool CanEncroach { get; set; } /// <summary> /// The maximum fraction of the translation to consider, typically 1. /// </summary> public float MaxFraction { get; set; } /// <summary> /// A generic shape. /// </summary> public Polygon Shape { get; set; } /// <summary> /// The translation of the shape cast. /// </summary> public Vector2 Translation { get; set; } internal ShapeCastInput(B2.ShapeCastInput shapeCastInput) { CanEncroach = shapeCastInput.canEncroach; MaxFraction = shapeCastInput.maxFraction; Shape = new Polygon(shapeCastInput.proxy); Translation = shapeCastInput.translation; } internal B2.ShapeCastInput Cast() { return new B2.ShapeCastInput { canEncroach = CanEncroach, maxFraction = MaxFraction, proxy = Shape.CastToShapeProxy(), translation = Translation }; } } }