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>
|
|
|
|
|
/// The DispVerts lump (Lump 33) contains the vertex data of the displacements.
|
|
|
|
|
/// vec is the normalized vector of the offset of each displacement vertex from
|
|
|
|
|
/// its original (flat) position; dist is the distance the offset has taken
|
|
|
|
|
/// place; and alpha is the alpha-blending of the texture at that vertex.
|
2025-10-30 21:21:56 -04:00
|
|
|
///
|
2025-09-26 10:57:15 -04:00
|
|
|
/// A displacement of power p references (2^p + 1)^2 dispverts in the array,
|
2025-10-30 21:21:56 -04:00
|
|
|
/// starting from the DispVertStart index.
|
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_(Source)"/>
|
2025-09-26 10:57:15 -04:00
|
|
|
[StructLayout(LayoutKind.Sequential)]
|
|
|
|
|
public sealed class DispVert
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Vector field defining displacement volume.
|
|
|
|
|
/// </summary>
|
2025-10-31 13:59:28 -04:00
|
|
|
public Vector3D Vec = new();
|
2025-09-26 10:57:15 -04:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Displacement distances.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public float Dist;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// "Per vertex" alpha values.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public float Alpha;
|
|
|
|
|
}
|
2025-10-30 21:21:56 -04:00
|
|
|
}
|