DotRecastNetSim/src/DotRecast.Core/SegmentVert.cs

29 lines
670 B
C#
Raw Normal View History

2023-04-22 07:43:24 +03:00
using System;
namespace DotRecast.Core
{
public struct SegmentVert
{
public Vector3f vmin;
public Vector3f vmax;
public float this[int index]
{
get => GetElement(index);
}
public float GetElement(int index)
{
switch (index)
{
case 0: return vmin.x;
case 1: return vmin.y;
case 2: return vmin.z;
case 3: return vmax.x;
case 4: return vmax.y;
case 5: return vmax.z;
default: throw new IndexOutOfRangeException($"{index}");
}
}
}
}