/
EugenyCh7
/
Puppet2D.Net
Обзор
Документация
Войти
/
EugenyCh7
/
Puppet2D.Net
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
Puppet2D.Engine/Geometry/Segment.cs
30 строк
715 B
Eugeny Chekmarev
Puppet2D.Engine.Geometry rotation fix
25 авг 2025, 13:22
25 авг 2025, 13:22
73b16ee
Код
Авторство
О чём код?
using Puppet2D.System; namespace Puppet2D.Engine.Geometry { /// <summary> /// A line segment with two-sided collision. /// </summary> public struct Segment { public float Angle; public Vector2 Point1; public Vector2 Point2; public Vector2 Center => (Point1 + Point2) * 0.5f; internal Segment(B2.Segment segment) { Point1 = segment.point1; Point2 = segment.point2; } internal B2.Segment CastToSegment() { return new B2.Segment { point1 = Point1.Rotate(Angle, Center), point2 = Point2.Rotate(Angle, Center) }; } } }