Files

29 lines
953 B
C#
Raw Permalink Normal View History

2025-09-26 10:57:15 -04:00
using System.Runtime.InteropServices;
2025-09-26 13:06:18 -04:00
namespace SabreTools.Data.Models.BSP
2025-09-26 10:57:15 -04:00
{
/// <summary>
/// This lump contains the so-called clipnodes, which build a second
/// BSP tree used only for collision detection.
2025-10-30 21:21:56 -04:00
///
2025-09-26 10:57:15 -04:00
/// This structure is a reduced form of the BSPNODE struct from the
/// nodes lump. Also the BSP tree built by the clipnodes is simpler
2025-10-30 21:21:56 -04:00
/// than the one described by the BSPNODEs to accelerate collision calculations.
2025-09-26 10:57:15 -04:00
/// </summary>
2025-10-30 21:21:56 -04:00
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
2025-09-26 10:57:15 -04:00
[StructLayout(LayoutKind.Sequential)]
public sealed class Clipnode
{
/// <summary>
/// Index into planes
/// </summary>
public int PlaneIndex;
/// <summary>
/// Negative numbers are contents
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)]
2025-10-30 21:21:56 -04:00
public short[] ChildrenIndices = new short[2];
2025-09-26 10:57:15 -04:00
}
2025-10-30 21:21:56 -04:00
}