mirror of
https://github.com/SabreTools/SabreTools.Models.git
synced 2026-09-24 07:37:10 +00:00
Add VBSP lump 29
This commit is contained in:
11
SabreTools.Models/BSP/PhysCollideLump.cs
Normal file
11
SabreTools.Models/BSP/PhysCollideLump.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
namespace SabreTools.Models.BSP
|
||||
{
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)"/>
|
||||
public sealed class PhysCollideLump : Lump
|
||||
{
|
||||
/// <summary>
|
||||
/// Models
|
||||
/// </summary>
|
||||
public PhysModel[]? Models { get; set; }
|
||||
}
|
||||
}
|
||||
42
SabreTools.Models/BSP/PhysModel.cs
Normal file
42
SabreTools.Models/BSP/PhysModel.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SabreTools.Models.BSP
|
||||
{
|
||||
/// <summary>
|
||||
/// The physcollide lump (Lump 29) contains physics data for the world.
|
||||
/// </summary>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)"/>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public sealed class PhysModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Perhaps the index of the model to which this physics model applies?
|
||||
/// </summary>
|
||||
public int ModelIndex;
|
||||
|
||||
/// <summary>
|
||||
/// Total size of the collision data sections
|
||||
/// </summary>
|
||||
public int DataSize;
|
||||
|
||||
/// <summary>
|
||||
/// Size of the text section
|
||||
/// </summary>
|
||||
public int KeydataSize;
|
||||
|
||||
/// <summary>
|
||||
/// Number of collision data sections
|
||||
/// </summary>
|
||||
public int SolidCount;
|
||||
|
||||
/// <summary>
|
||||
/// Collision data of length <see cref="SolidCount"/>
|
||||
/// </summary>
|
||||
public PhysSolid[]? Solids;
|
||||
|
||||
/// <summary>
|
||||
/// Key data of size <see cref="KeydataSize"/>
|
||||
/// </summary>
|
||||
public byte[]? TextData;
|
||||
}
|
||||
}
|
||||
25
SabreTools.Models/BSP/PhysSolid.cs
Normal file
25
SabreTools.Models/BSP/PhysSolid.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SabreTools.Models.BSP
|
||||
{
|
||||
/// <summary>
|
||||
/// The last two parts appear to be identical to the PHY file format,
|
||||
/// which means their exact contents are unknown. Note that the
|
||||
/// compactsurfaceheader_t structure contains the data size of each
|
||||
/// collision data section (including the rest of the header)
|
||||
/// </summary>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)"/>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public sealed class PhysSolid
|
||||
{
|
||||
/// <summary>
|
||||
/// Size of the collision data
|
||||
/// </summary>
|
||||
public int Size;
|
||||
|
||||
/// <summary>
|
||||
/// Collision data of length <see cref="Size"/>
|
||||
/// </summary>
|
||||
public byte[]? CollisionData;
|
||||
}
|
||||
}
|
||||
@@ -166,8 +166,10 @@ namespace SabreTools.Models.BSP
|
||||
/// TODO: Find definition and implement
|
||||
// public PhysDispLump? PhysDispLump { get; set; }
|
||||
|
||||
// TODO: Implement Lump 29
|
||||
// https://developer.valvesoftware.com/wiki/BSP_(Source)#Physics
|
||||
/// <summary>
|
||||
/// LUMP_PHYSCOLLIDE [29]
|
||||
/// </summary>
|
||||
public PhysCollideLump? PhysCollideLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_VERTNORMALS [30]
|
||||
|
||||
Reference in New Issue
Block a user