mirror of
https://github.com/Facepunch/sbox-public.git
synced 2026-04-20 06:19:05 -04:00
https://files.facepunch.com/antopilo/1b0311b1/sbox-dev_Ghn3TRf8eM.mp4 https://files.facepunch.com/antopilo/1b0311b1/sbox-dev_yALD2nMaPw.mp4
40 lines
767 B
C#
40 lines
767 B
C#
namespace Sandbox.Clutter;
|
|
|
|
/// <summary>
|
|
/// Groups multiple instances of the same model for efficient batch rendering.
|
|
/// </summary>
|
|
struct ClutterModelBatch
|
|
{
|
|
/// <summary>
|
|
/// The model being rendered in this batch.
|
|
/// </summary>
|
|
public Model Model { get; set; }
|
|
|
|
/// <summary>
|
|
/// List of transforms for each instance.
|
|
/// </summary>
|
|
public List<Transform> Transforms { get; set; } = [];
|
|
|
|
public ClutterModelBatch( Model model )
|
|
{
|
|
Model = model;
|
|
Transforms = [];
|
|
}
|
|
|
|
/// <summary>
|
|
/// Adds an instance to this batch.
|
|
/// </summary>
|
|
public void AddInstance( Transform transform )
|
|
{
|
|
Transforms.Add( transform );
|
|
}
|
|
|
|
/// <summary>
|
|
/// Clears all instances from this batch.
|
|
/// </summary>
|
|
public void Clear()
|
|
{
|
|
Transforms.Clear();
|
|
}
|
|
}
|