ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/OniSplit/Akira/PolygonEdge.cs
Revision: 1114
Committed: Wed Jan 22 14:08:57 2020 UTC (5 years, 8 months ago) by iritscen
File size: 887 byte(s)
Log Message:
Adding OniSplit source code (v0.9.99.0). Many thanks to Neo for all his work over the years.

File Contents

# Content
1 using System;
2
3 namespace Oni.Akira
4 {
5 internal class PolygonEdge
6 {
7 private static readonly PolygonEdge[] emptyEdges = new PolygonEdge[0];
8 private readonly Polygon polygon;
9 private readonly int index;
10 private PolygonEdge[] adjacency = emptyEdges;
11
12 public PolygonEdge(Polygon polygon, int index)
13 {
14 this.polygon = polygon;
15 this.index = index;
16 }
17
18 public Polygon Polygon => polygon;
19
20 public int Index => index;
21 public int EndIndex => (index + 1) % polygon.Edges.Length;
22
23 public int Point0Index => polygon.PointIndices[index];
24 public int Point1Index => polygon.PointIndices[EndIndex];
25
26 public PolygonEdge[] Adjancency
27 {
28 get { return adjacency; }
29 set { adjacency = value; }
30 }
31 }
32 }