mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/PCK-Studio.git
synced 2026-06-04 15:15:01 +00:00
CubeMesh - Remove 'SetName' and add constructor with 'name' parameter
This commit is contained in:
@@ -55,7 +55,11 @@ namespace PckStudio.Rendering
|
||||
|
||||
internal static VertexBufferLayout VertexBufferLayout { get; } = new VertexBufferLayout().Add(ShaderDataType.Float3).Add(ShaderDataType.Float2);
|
||||
|
||||
public CubeMesh(Cube cube) : this(nameof(CubeMesh), cube, true)
|
||||
public CubeMesh(Cube cube) : this(nameof(CubeMesh), cube)
|
||||
{
|
||||
}
|
||||
|
||||
public CubeMesh(string name, Cube cube) : this(name, cube, true)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -65,12 +69,6 @@ namespace PckStudio.Rendering
|
||||
_cube = cube;
|
||||
}
|
||||
|
||||
public CubeMesh SetName(string name)
|
||||
{
|
||||
_ = name ?? throw new ArgumentNullException(nameof(name));
|
||||
return new CubeMesh(name, _cube, Visible);
|
||||
}
|
||||
|
||||
public CubeMesh SetCube(Cube cube)
|
||||
{
|
||||
_ = cube ?? throw new ArgumentNullException(nameof(cube));
|
||||
@@ -83,7 +81,7 @@ namespace PckStudio.Rendering
|
||||
|
||||
public override BoundingBox GetBounds(Matrix4 transform)
|
||||
{
|
||||
return _cube.GetBoundingBox(transform);
|
||||
return _cube.GetBoundingBox(Transform * transform);
|
||||
}
|
||||
|
||||
internal override IEnumerable<TextureVertex> GetVertices()
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace PckStudio.Rendering
|
||||
internal static void AddSkinBox(this CubeMeshCollection cubeMeshes, SkinBOX skinBox, float inflate = 0f)
|
||||
{
|
||||
var cube = skinBox.ToCube(inflate, cubeMeshes.FlipZMapping);
|
||||
cubeMeshes.Add(new CubeMesh(cube).SetName(skinBox.Type));
|
||||
cubeMeshes.Add(new CubeMesh(skinBox.Type, cube));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ namespace PckStudio.Rendering
|
||||
internal void AddNamed(string name, Vector3 position, Vector3 size, Vector2 uv, float inflate = 0f, bool mirrorTexture = false)
|
||||
{
|
||||
var cube = new Cube(position, size, uv, inflate, mirrorTexture, FlipZMapping);
|
||||
Add(new CubeMesh(cube).SetName(name));
|
||||
Add(new CubeMesh(name, cube));
|
||||
}
|
||||
|
||||
internal void AddSubCollection(string name, Vector3 translation, Vector3 pivot, Vector3 rotation = default)
|
||||
|
||||
Reference in New Issue
Block a user