gl viewport

This commit is contained in:
bird_egop
2026-06-05 20:33:21 +03:00
parent 97dc14c36c
commit 195e6d71bd
13 changed files with 1140 additions and 0 deletions
@@ -0,0 +1,43 @@
using System.Numerics;
using NResUI.Rendering.Viewport.Meshes;
namespace NResUI.Rendering.Viewport;
public sealed class ViewportPiece
{
public int Id { get; }
public string Name { get; }
public GpuMesh Mesh { get; }
public Matrix4x4 LocalTransform { get; set; }
public Vector3 BoundsMin { get; }
public Vector3 BoundsMax { get; }
public ViewportPiece(
int id,
string name,
GpuMesh mesh,
Matrix4x4 localTransform,
Vector3 boundsMin,
Vector3 boundsMax)
{
Id = id;
Name = name;
Mesh = mesh;
LocalTransform = localTransform;
BoundsMin = boundsMin;
BoundsMax = boundsMax;
}
public static ViewportPiece CreateUnitCube(int id, string name, GpuMesh mesh)
{
return new ViewportPiece(
id,
name,
mesh,
Matrix4x4.Identity,
new Vector3(-1.0f, -1.0f, -1.0f),
new Vector3(1.0f, 1.0f, 1.0f));
}
}