From 7484edc18a945ea1e95caf32444ca1866b0f49e0 Mon Sep 17 00:00:00 2001
From: MrScautHD <65916181+MrScautHD@users.noreply.github.com>
Date: Sat, 22 Feb 2025 21:14:44 +0100
Subject: [PATCH] Added DrawKnotWires
---
src/Bliss.Test/Game.cs | 3 +
.../Rendering/Renderers/ImmediateRenderer.cs | 73 ++++++++++++++++++-
2 files changed, 74 insertions(+), 2 deletions(-)
diff --git a/src/Bliss.Test/Game.cs b/src/Bliss.Test/Game.cs
index 17ded6f..864cf29 100644
--- a/src/Bliss.Test/Game.cs
+++ b/src/Bliss.Test/Game.cs
@@ -296,6 +296,9 @@ protected virtual void Draw(GraphicsDevice graphicsDevice, CommandList commandLi
this._immediateRenderer.SetTexture(this._customMeshTexture);
this._immediateRenderer.DrawKnot(new Transform() { Translation = new Vector3(46, 0, 6) }, 1, 1, 40, 40);
+ this._immediateRenderer.SetTexture(null);
+ this._immediateRenderer.DrawKnotWires(new Transform() { Translation = new Vector3(48, 0, 6) }, 1, 1, 40, 40, Color.Green);
+
this._immediateRenderer.End();
this._customPoly.Draw(commandList, new Transform() { Translation = new Vector3(9, 0, 0)}, this.FullScreenTexture.Framebuffer.OutputDescription);
diff --git a/src/Bliss/CSharp/Graphics/Rendering/Renderers/ImmediateRenderer.cs b/src/Bliss/CSharp/Graphics/Rendering/Renderers/ImmediateRenderer.cs
index ee7d778..e096488 100644
--- a/src/Bliss/CSharp/Graphics/Rendering/Renderers/ImmediateRenderer.cs
+++ b/src/Bliss/CSharp/Graphics/Rendering/Renderers/ImmediateRenderer.cs
@@ -1531,8 +1531,77 @@ public void DrawKnot(Transform transform, float radius, float tubeRadius, int ra
this.DrawVertices(transform, this._tempVertices, this._tempIndices, PrimitiveTopology.TriangleList);
}
- public void DrawKnotWires() {
-
+
+ ///
+ /// Renders the wireframe of a knot shape using the specified transformation, radii, and segments.
+ ///
+ /// The transformation applied to the knot wireframe.
+ /// The radius of the knot.
+ /// The radius of the tube comprising the knot's wireframe.
+ /// The number of radial segments making up the knot. Minimum value is 3.
+ /// The number of sides for the tube cross-section. Minimum value is 3.
+ /// An optional color to use for the wireframe; if null, the default is white.