diff --git a/src/DotRecast.Recast.Demo/Tools/DynamicUpdateSampleTool.cs b/src/DotRecast.Recast.Demo/Tools/DynamicUpdateSampleTool.cs index 930acf3..98856d5 100644 --- a/src/DotRecast.Recast.Demo/Tools/DynamicUpdateSampleTool.cs +++ b/src/DotRecast.Recast.Demo/Tools/DynamicUpdateSampleTool.cs @@ -29,7 +29,7 @@ using DotRecast.Detour.Dynamic.Io; using DotRecast.Recast.Toolset.Builder; using DotRecast.Recast.Demo.Draw; using DotRecast.Recast.Toolset.Geom; -using DotRecast.Recast.Toolset.Tools.Gizmos; +using DotRecast.Recast.Toolset.Gizmos; using DotRecast.Recast.Demo.UI; using DotRecast.Recast.Toolset; using DotRecast.Recast.Toolset.Tools; @@ -75,7 +75,7 @@ public class DynamicUpdateSampleTool : ISampleTool private DynamicNavMesh dynaMesh; private readonly TaskFactory executor; - private readonly Dictionary colliderGizmos = new(); + private readonly Dictionary colliderGizmos = new(); private readonly Random random = Random.Shared; private readonly DemoInputGeomProvider bridgeGeom; private readonly DemoInputGeomProvider houseGeom; @@ -281,7 +281,7 @@ public class DynamicUpdateSampleTool : ISampleTool { colliderGizmos.Values.ForEach(g => { - g.Render(renderer.GetDebugDraw()); + GizmoRenderer.Render(renderer.GetDebugDraw(), g.Gizmo); }); } } @@ -359,7 +359,7 @@ public class DynamicUpdateSampleTool : ISampleTool { if (!shift) { - ColliderWithGizmo colliderWithGizmo = null; + RcGizmo colliderWithGizmo = null; if (dynaMesh != null) { if (colliderShape == DynamicColliderShape.SPHERE) @@ -433,16 +433,16 @@ public class DynamicUpdateSampleTool : ISampleTool } } - private ColliderWithGizmo SphereCollider(RcVec3f p) + private RcGizmo SphereCollider(RcVec3f p) { float radius = 1 + (float)random.NextDouble() * 10; var collider = new SphereCollider(p, radius, SampleAreaModifications.SAMPLE_POLYAREA_TYPE_WATER, dynaMesh.config.walkableClimb); var gizmo = GizmoFactory.Sphere(p, radius); - return new ColliderWithGizmo(collider, gizmo); + return new RcGizmo(collider, gizmo); } - private ColliderWithGizmo CapsuleCollider(RcVec3f p) + private RcGizmo CapsuleCollider(RcVec3f p) { float radius = 0.4f + (float)random.NextDouble() * 4f; RcVec3f a = RcVec3f.Of( @@ -459,10 +459,10 @@ public class DynamicUpdateSampleTool : ISampleTool RcVec3f end = RcVec3f.Of(p.x + a.x, p.y + a.y, p.z + a.z); var collider = new CapsuleCollider(start, end, radius, SampleAreaModifications.SAMPLE_POLYAREA_TYPE_WATER, dynaMesh.config.walkableClimb); var gizmo = GizmoFactory.Capsule(start, end, radius); - return new ColliderWithGizmo(collider, gizmo); + return new RcGizmo(collider, gizmo); } - private ColliderWithGizmo BoxCollider(RcVec3f p) + private RcGizmo BoxCollider(RcVec3f p) { RcVec3f extent = RcVec3f.Of( 0.5f + (float)random.NextDouble() * 6f, @@ -474,10 +474,10 @@ public class DynamicUpdateSampleTool : ISampleTool RcVec3f[] halfEdges = Detour.Dynamic.Colliders.BoxCollider.GetHalfEdges(up, forward, extent); var collider = new BoxCollider(p, halfEdges, SampleAreaModifications.SAMPLE_POLYAREA_TYPE_WATER, dynaMesh.config.walkableClimb); var gizmo = GizmoFactory.Box(p, halfEdges); - return new ColliderWithGizmo(collider, gizmo); + return new RcGizmo(collider, gizmo); } - private ColliderWithGizmo CylinderCollider(RcVec3f p) + private RcGizmo CylinderCollider(RcVec3f p) { float radius = 0.7f + (float)random.NextDouble() * 4f; RcVec3f a = RcVec3f.Of(1f - 2 * (float)random.NextDouble(), 0.01f + (float)random.NextDouble(), 1f - 2 * (float)random.NextDouble()); @@ -491,10 +491,10 @@ public class DynamicUpdateSampleTool : ISampleTool var collider = new CylinderCollider(start, end, radius, SampleAreaModifications.SAMPLE_POLYAREA_TYPE_WATER, dynaMesh.config.walkableClimb); var gizmo = GizmoFactory.Cylinder(start, end, radius); - return new ColliderWithGizmo(collider, gizmo); + return new RcGizmo(collider, gizmo); } - private ColliderWithGizmo CompositeCollider(RcVec3f p) + private RcGizmo CompositeCollider(RcVec3f p) { RcVec3f baseExtent = RcVec3f.Of(5, 3, 8); RcVec3f baseCenter = RcVec3f.Of(p.x, p.y + 3, p.z); @@ -531,36 +531,36 @@ public class DynamicUpdateSampleTool : ISampleTool IRcGizmoMeshFilter trunkGizmo = GizmoFactory.Capsule(trunkStart, trunkEnd, 0.5f); IRcGizmoMeshFilter crownGizmo = GizmoFactory.Sphere(crownCenter, 4f); IRcGizmoMeshFilter gizmo = GizmoFactory.Composite(baseGizmo, roofGizmo, trunkGizmo, crownGizmo); - return new ColliderWithGizmo(collider, gizmo); + return new RcGizmo(collider, gizmo); } - private ColliderWithGizmo TrimeshBridge(RcVec3f p) + private RcGizmo TrimeshBridge(RcVec3f p) { return TrimeshCollider(p, bridgeGeom); } - private ColliderWithGizmo TrimeshHouse(RcVec3f p) + private RcGizmo TrimeshHouse(RcVec3f p) { return TrimeshCollider(p, houseGeom); } - private ColliderWithGizmo ConvexTrimesh(RcVec3f p) + private RcGizmo ConvexTrimesh(RcVec3f p) { float[] verts = TransformVertices(p, convexGeom, 360); var collider = new ConvexTrimeshCollider(verts, convexGeom.faces, SampleAreaModifications.SAMPLE_POLYAREA_TYPE_ROAD, dynaMesh.config.walkableClimb * 10); var gizmo = GizmoFactory.Trimesh(verts, convexGeom.faces); - return new ColliderWithGizmo(collider, gizmo); + return new RcGizmo(collider, gizmo); } - private ColliderWithGizmo TrimeshCollider(RcVec3f p, DemoInputGeomProvider geom) + private RcGizmo TrimeshCollider(RcVec3f p, DemoInputGeomProvider geom) { float[] verts = TransformVertices(p, geom, 0); var collider = new TrimeshCollider(verts, geom.faces, SampleAreaModifications.SAMPLE_POLYAREA_TYPE_ROAD, dynaMesh.config.walkableClimb * 10); var gizmo = GizmoFactory.Trimesh(verts, geom.faces); - return new ColliderWithGizmo(collider, gizmo); + return new RcGizmo(collider, gizmo); } private float[] TransformVertices(RcVec3f p, DemoInputGeomProvider geom, float ax) diff --git a/src/DotRecast.Recast.Demo/Tools/ColliderWithGizmo.cs b/src/DotRecast.Recast.Demo/Tools/GizmoRenderer.cs similarity index 81% rename from src/DotRecast.Recast.Demo/Tools/ColliderWithGizmo.cs rename to src/DotRecast.Recast.Demo/Tools/GizmoRenderer.cs index 3deb051..c42f034 100644 --- a/src/DotRecast.Recast.Demo/Tools/ColliderWithGizmo.cs +++ b/src/DotRecast.Recast.Demo/Tools/GizmoRenderer.cs @@ -1,50 +1,35 @@ using DotRecast.Core; -using DotRecast.Detour.Dynamic.Colliders; -using DotRecast.Recast.Toolset.Tools.Gizmos; using DotRecast.Recast.Demo.Draw; +using DotRecast.Recast.Toolset.Gizmos; using static DotRecast.Core.RcMath; namespace DotRecast.Recast.Demo.Tools; -public class ColliderWithGizmo +public static class GizmoRenderer { - public readonly IRcGizmoMeshFilter Gizmo; - public readonly ICollider Collider; - - public ColliderWithGizmo(ICollider collider, IRcGizmoMeshFilter gizmo) - { - Collider = collider; - Gizmo = gizmo; - } - - public void Render(RecastDebugDraw dd) - { - Render(dd, Gizmo); - } - public static void Render(RecastDebugDraw dd, IRcGizmoMeshFilter gizmo) { - if (gizmo is BoxGizmo box) + if (gizmo is RcBoxGizmo box) { RenderBox(dd, box); } - else if (gizmo is CapsuleGizmo capsule) + else if (gizmo is RcCapsuleGizmo capsule) { RenderCapsule(dd, capsule); } - else if (gizmo is TrimeshGizmo trimesh) + else if (gizmo is RcTrimeshGizmo trimesh) { RenderTrimesh(dd, trimesh); } - else if (gizmo is CylinderGizmo cylinder) + else if (gizmo is RcCylinderGizmo cylinder) { RenderCylinder(dd, cylinder); } - else if (gizmo is SphereGizmo sphere) + else if (gizmo is RcSphereGizmo sphere) { RenderSphere(dd, sphere); } - else if (gizmo is CompositeGizmo composite) + else if (gizmo is RcCompositeGizmo composite) { RenderComposite(dd, composite); } @@ -74,7 +59,7 @@ public class ColliderWithGizmo return col; } - public static void RenderBox(RecastDebugDraw debugDraw, BoxGizmo box) + public static void RenderBox(RecastDebugDraw debugDraw, RcBoxGizmo box) { var trX = RcVec3f.Of(box.halfEdges[0].x, box.halfEdges[1].x, box.halfEdges[2].x); var trY = RcVec3f.Of(box.halfEdges[0].y, box.halfEdges[1].y, box.halfEdges[2].y); @@ -82,9 +67,9 @@ public class ColliderWithGizmo float[] vertices = new float[8 * 3]; for (int i = 0; i < 8; i++) { - vertices[i * 3 + 0] = RcVec3f.Dot(BoxGizmo.VERTS[i], trX) + box.center.x; - vertices[i * 3 + 1] = RcVec3f.Dot(BoxGizmo.VERTS[i], trY) + box.center.y; - vertices[i * 3 + 2] = RcVec3f.Dot(BoxGizmo.VERTS[i], trZ) + box.center.z; + vertices[i * 3 + 0] = RcVec3f.Dot(RcBoxGizmo.VERTS[i], trX) + box.center.x; + vertices[i * 3 + 1] = RcVec3f.Dot(RcBoxGizmo.VERTS[i], trY) + box.center.y; + vertices[i * 3 + 2] = RcVec3f.Dot(RcBoxGizmo.VERTS[i], trZ) + box.center.z; } debugDraw.Begin(DebugDrawPrimitives.TRIS); @@ -102,7 +87,7 @@ public class ColliderWithGizmo for (int j = 0; j < 3; j++) { - int v = BoxGizmo.TRIANLGES[i * 3 + j] * 3; + int v = RcBoxGizmo.TRIANLGES[i * 3 + j] * 3; debugDraw.Vertex(vertices[v], vertices[v + 1], vertices[v + 2], col); } } @@ -110,7 +95,7 @@ public class ColliderWithGizmo debugDraw.End(); } - public static void RenderCapsule(RecastDebugDraw debugDraw, CapsuleGizmo capsule) + public static void RenderCapsule(RecastDebugDraw debugDraw, RcCapsuleGizmo capsule) { debugDraw.Begin(DebugDrawPrimitives.TRIS); for (int i = 0; i < capsule.triangles.Length; i += 3) @@ -128,7 +113,7 @@ public class ColliderWithGizmo debugDraw.End(); } - public static void RenderCylinder(RecastDebugDraw debugDraw, CylinderGizmo cylinder) + public static void RenderCylinder(RecastDebugDraw debugDraw, RcCylinderGizmo cylinder) { debugDraw.Begin(DebugDrawPrimitives.TRIS); for (int i = 0; i < cylinder.triangles.Length; i += 3) @@ -146,7 +131,7 @@ public class ColliderWithGizmo debugDraw.End(); } - public static void RenderSphere(RecastDebugDraw debugDraw, SphereGizmo sphere) + public static void RenderSphere(RecastDebugDraw debugDraw, RcSphereGizmo sphere) { debugDraw.Begin(DebugDrawPrimitives.TRIS); for (int i = 0; i < sphere.triangles.Length; i += 3) @@ -169,7 +154,7 @@ public class ColliderWithGizmo debugDraw.End(); } - public static void RenderTrimesh(RecastDebugDraw debugDraw, TrimeshGizmo trimesh) + public static void RenderTrimesh(RecastDebugDraw debugDraw, RcTrimeshGizmo trimesh) { debugDraw.Begin(DebugDrawPrimitives.TRIS); for (int i = 0; i < trimesh.triangles.Length; i += 3) @@ -186,7 +171,7 @@ public class ColliderWithGizmo debugDraw.End(); } - public static void RenderComposite(RecastDebugDraw debugDraw, CompositeGizmo composite) + public static void RenderComposite(RecastDebugDraw debugDraw, RcCompositeGizmo composite) { composite.gizmoMeshes.ForEach(g => Render(debugDraw, g)); } diff --git a/src/DotRecast.Recast.Toolset/Gizmos/GizmoFactory.cs b/src/DotRecast.Recast.Toolset/Gizmos/GizmoFactory.cs new file mode 100644 index 0000000..f58a06c --- /dev/null +++ b/src/DotRecast.Recast.Toolset/Gizmos/GizmoFactory.cs @@ -0,0 +1,37 @@ +using DotRecast.Core; + +namespace DotRecast.Recast.Toolset.Gizmos +{ + public static class GizmoFactory + { + public static RcBoxGizmo Box(RcVec3f center, RcVec3f[] halfEdges) + { + return new RcBoxGizmo(center, halfEdges); + } + + public static RcSphereGizmo Sphere(RcVec3f center, float radius) + { + return new RcSphereGizmo(center, radius); + } + + public static RcCapsuleGizmo Capsule(RcVec3f start, RcVec3f end, float radius) + { + return new RcCapsuleGizmo(start, end, radius); + } + + public static RcCylinderGizmo Cylinder(RcVec3f start, RcVec3f end, float radius) + { + return new RcCylinderGizmo(start, end, radius); + } + + public static RcTrimeshGizmo Trimesh(float[] verts, int[] faces) + { + return new RcTrimeshGizmo(verts, faces); + } + + public static RcCompositeGizmo Composite(params IRcGizmoMeshFilter[] gizmos) + { + return new RcCompositeGizmo(gizmos); + } + } +} \ No newline at end of file diff --git a/src/DotRecast.Recast.Toolset/Tools/Gizmos/GizmoHelper.cs b/src/DotRecast.Recast.Toolset/Gizmos/GizmoHelper.cs similarity index 99% rename from src/DotRecast.Recast.Toolset/Tools/Gizmos/GizmoHelper.cs rename to src/DotRecast.Recast.Toolset/Gizmos/GizmoHelper.cs index 4d7f070..2cfcb0e 100644 --- a/src/DotRecast.Recast.Toolset/Tools/Gizmos/GizmoHelper.cs +++ b/src/DotRecast.Recast.Toolset/Gizmos/GizmoHelper.cs @@ -1,6 +1,6 @@ using System; -namespace DotRecast.Recast.Toolset.Tools.Gizmos +namespace DotRecast.Recast.Toolset.Gizmos { public static class GizmoHelper { diff --git a/src/DotRecast.Recast.Toolset/Tools/Gizmos/IRcGizmoMeshFilter.cs b/src/DotRecast.Recast.Toolset/Gizmos/IRcGizmoMeshFilter.cs similarity index 74% rename from src/DotRecast.Recast.Toolset/Tools/Gizmos/IRcGizmoMeshFilter.cs rename to src/DotRecast.Recast.Toolset/Gizmos/IRcGizmoMeshFilter.cs index 066d3ef..e0ea4a6 100644 --- a/src/DotRecast.Recast.Toolset/Tools/Gizmos/IRcGizmoMeshFilter.cs +++ b/src/DotRecast.Recast.Toolset/Gizmos/IRcGizmoMeshFilter.cs @@ -1,6 +1,6 @@ //using DotRecast.Recast.Demo.Draw; -namespace DotRecast.Recast.Toolset.Tools.Gizmos +namespace DotRecast.Recast.Toolset.Gizmos { public interface IRcGizmoMeshFilter { diff --git a/src/DotRecast.Recast.Toolset/Tools/Gizmos/BoxGizmo.cs b/src/DotRecast.Recast.Toolset/Gizmos/RcBoxGizmo.cs similarity index 86% rename from src/DotRecast.Recast.Toolset/Tools/Gizmos/BoxGizmo.cs rename to src/DotRecast.Recast.Toolset/Gizmos/RcBoxGizmo.cs index fa0725e..9cf173f 100644 --- a/src/DotRecast.Recast.Toolset/Tools/Gizmos/BoxGizmo.cs +++ b/src/DotRecast.Recast.Toolset/Gizmos/RcBoxGizmo.cs @@ -1,9 +1,9 @@ using DotRecast.Core; using DotRecast.Detour.Dynamic.Colliders; -namespace DotRecast.Recast.Toolset.Tools.Gizmos +namespace DotRecast.Recast.Toolset.Gizmos { - public class BoxGizmo : IRcGizmoMeshFilter + public class RcBoxGizmo : IRcGizmoMeshFilter { public static readonly int[] TRIANLGES = { @@ -27,12 +27,12 @@ namespace DotRecast.Recast.Toolset.Tools.Gizmos public readonly RcVec3f center; public readonly RcVec3f[] halfEdges; - public BoxGizmo(RcVec3f center, RcVec3f extent, RcVec3f forward, RcVec3f up) : + public RcBoxGizmo(RcVec3f center, RcVec3f extent, RcVec3f forward, RcVec3f up) : this(center, BoxCollider.GetHalfEdges(up, forward, extent)) { } - public BoxGizmo(RcVec3f center, RcVec3f[] halfEdges) + public RcBoxGizmo(RcVec3f center, RcVec3f[] halfEdges) { this.center = center; this.halfEdges = halfEdges; diff --git a/src/DotRecast.Recast.Toolset/Tools/Gizmos/CapsuleGizmo.cs b/src/DotRecast.Recast.Toolset/Gizmos/RcCapsuleGizmo.cs similarity index 92% rename from src/DotRecast.Recast.Toolset/Tools/Gizmos/CapsuleGizmo.cs rename to src/DotRecast.Recast.Toolset/Gizmos/RcCapsuleGizmo.cs index a33ba22..41a2ce6 100644 --- a/src/DotRecast.Recast.Toolset/Tools/Gizmos/CapsuleGizmo.cs +++ b/src/DotRecast.Recast.Toolset/Gizmos/RcCapsuleGizmo.cs @@ -1,17 +1,17 @@ using DotRecast.Core; using static DotRecast.Core.RcMath; -using static DotRecast.Recast.Toolset.Tools.Gizmos.GizmoHelper; +using static DotRecast.Recast.Toolset.Gizmos.GizmoHelper; -namespace DotRecast.Recast.Toolset.Tools.Gizmos +namespace DotRecast.Recast.Toolset.Gizmos { - public class CapsuleGizmo : IRcGizmoMeshFilter + public class RcCapsuleGizmo : IRcGizmoMeshFilter { public readonly float[] vertices; public readonly int[] triangles; public readonly float[] center; public readonly float[] gradient; - public CapsuleGizmo(RcVec3f start, RcVec3f end, float radius) + public RcCapsuleGizmo(RcVec3f start, RcVec3f end, float radius) { center = new float[] { diff --git a/src/DotRecast.Recast.Toolset/Gizmos/RcCompositeGizmo.cs b/src/DotRecast.Recast.Toolset/Gizmos/RcCompositeGizmo.cs new file mode 100644 index 0000000..525d38c --- /dev/null +++ b/src/DotRecast.Recast.Toolset/Gizmos/RcCompositeGizmo.cs @@ -0,0 +1,12 @@ +namespace DotRecast.Recast.Toolset.Gizmos +{ + public class RcCompositeGizmo : IRcGizmoMeshFilter + { + public readonly IRcGizmoMeshFilter[] gizmoMeshes; + + public RcCompositeGizmo(params IRcGizmoMeshFilter[] gizmoMeshes) + { + this.gizmoMeshes = gizmoMeshes; + } + } +} \ No newline at end of file diff --git a/src/DotRecast.Recast.Toolset/Tools/Gizmos/CylinderGizmo.cs b/src/DotRecast.Recast.Toolset/Gizmos/RcCylinderGizmo.cs similarity index 92% rename from src/DotRecast.Recast.Toolset/Tools/Gizmos/CylinderGizmo.cs rename to src/DotRecast.Recast.Toolset/Gizmos/RcCylinderGizmo.cs index aa72e2f..bbafda0 100644 --- a/src/DotRecast.Recast.Toolset/Tools/Gizmos/CylinderGizmo.cs +++ b/src/DotRecast.Recast.Toolset/Gizmos/RcCylinderGizmo.cs @@ -1,18 +1,18 @@ using DotRecast.Core; using static DotRecast.Core.RcMath; -using static DotRecast.Recast.Toolset.Tools.Gizmos.GizmoHelper; +using static DotRecast.Recast.Toolset.Gizmos.GizmoHelper; -namespace DotRecast.Recast.Toolset.Tools.Gizmos +namespace DotRecast.Recast.Toolset.Gizmos { - public class CylinderGizmo : IRcGizmoMeshFilter + public class RcCylinderGizmo : IRcGizmoMeshFilter { public readonly float[] vertices; public readonly int[] triangles; public readonly RcVec3f center; public readonly float[] gradient; - public CylinderGizmo(RcVec3f start, RcVec3f end, float radius) + public RcCylinderGizmo(RcVec3f start, RcVec3f end, float radius) { center = RcVec3f.Of( 0.5f * (start.x + end.x), 0.5f * (start.y + end.y), diff --git a/src/DotRecast.Recast.Toolset/Gizmos/RcGizmo.cs b/src/DotRecast.Recast.Toolset/Gizmos/RcGizmo.cs new file mode 100644 index 0000000..34cd98e --- /dev/null +++ b/src/DotRecast.Recast.Toolset/Gizmos/RcGizmo.cs @@ -0,0 +1,17 @@ +using DotRecast.Detour.Dynamic.Colliders; +using DotRecast.Recast.Toolset.Gizmos; + +namespace DotRecast.Recast.Toolset.Gizmos +{ + public class RcGizmo + { + public readonly IRcGizmoMeshFilter Gizmo; + public readonly ICollider Collider; + + public RcGizmo(ICollider collider, IRcGizmoMeshFilter gizmo) + { + Collider = collider; + Gizmo = gizmo; + } + } +} \ No newline at end of file diff --git a/src/DotRecast.Recast.Toolset/Tools/Gizmos/SphereGizmo.cs b/src/DotRecast.Recast.Toolset/Gizmos/RcSphereGizmo.cs similarity index 64% rename from src/DotRecast.Recast.Toolset/Tools/Gizmos/SphereGizmo.cs rename to src/DotRecast.Recast.Toolset/Gizmos/RcSphereGizmo.cs index af9e8dd..1ee8608 100644 --- a/src/DotRecast.Recast.Toolset/Tools/Gizmos/SphereGizmo.cs +++ b/src/DotRecast.Recast.Toolset/Gizmos/RcSphereGizmo.cs @@ -1,17 +1,17 @@ using DotRecast.Core; -using static DotRecast.Recast.Toolset.Tools.Gizmos.GizmoHelper; +using static DotRecast.Recast.Toolset.Gizmos.GizmoHelper; -namespace DotRecast.Recast.Toolset.Tools.Gizmos +namespace DotRecast.Recast.Toolset.Gizmos { - public class SphereGizmo : IRcGizmoMeshFilter + public class RcSphereGizmo : IRcGizmoMeshFilter { public readonly float[] vertices; public readonly int[] triangles; public readonly float radius; public readonly RcVec3f center; - public SphereGizmo(RcVec3f center, float radius) + public RcSphereGizmo(RcVec3f center, float radius) { this.center = center; this.radius = radius; diff --git a/src/DotRecast.Recast.Toolset/Tools/Gizmos/TrimeshGizmo.cs b/src/DotRecast.Recast.Toolset/Gizmos/RcTrimeshGizmo.cs similarity index 54% rename from src/DotRecast.Recast.Toolset/Tools/Gizmos/TrimeshGizmo.cs rename to src/DotRecast.Recast.Toolset/Gizmos/RcTrimeshGizmo.cs index e07aae6..4860e96 100644 --- a/src/DotRecast.Recast.Toolset/Tools/Gizmos/TrimeshGizmo.cs +++ b/src/DotRecast.Recast.Toolset/Gizmos/RcTrimeshGizmo.cs @@ -1,11 +1,11 @@ -namespace DotRecast.Recast.Toolset.Tools.Gizmos +namespace DotRecast.Recast.Toolset.Gizmos { - public class TrimeshGizmo : IRcGizmoMeshFilter + public class RcTrimeshGizmo : IRcGizmoMeshFilter { public readonly float[] vertices; public readonly int[] triangles; - public TrimeshGizmo(float[] vertices, int[] triangles) + public RcTrimeshGizmo(float[] vertices, int[] triangles) { this.vertices = vertices; this.triangles = triangles; diff --git a/src/DotRecast.Recast.Toolset/Tools/Gizmos/CompositeGizmo.cs b/src/DotRecast.Recast.Toolset/Tools/Gizmos/CompositeGizmo.cs deleted file mode 100644 index 96bad17..0000000 --- a/src/DotRecast.Recast.Toolset/Tools/Gizmos/CompositeGizmo.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace DotRecast.Recast.Toolset.Tools.Gizmos -{ - public class CompositeGizmo : IRcGizmoMeshFilter - { - public readonly IRcGizmoMeshFilter[] gizmoMeshes; - - public CompositeGizmo(params IRcGizmoMeshFilter[] gizmoMeshes) - { - this.gizmoMeshes = gizmoMeshes; - } - } -} \ No newline at end of file diff --git a/src/DotRecast.Recast.Toolset/Tools/Gizmos/GizmoFactory.cs b/src/DotRecast.Recast.Toolset/Tools/Gizmos/GizmoFactory.cs deleted file mode 100644 index d48cfc2..0000000 --- a/src/DotRecast.Recast.Toolset/Tools/Gizmos/GizmoFactory.cs +++ /dev/null @@ -1,37 +0,0 @@ -using DotRecast.Core; - -namespace DotRecast.Recast.Toolset.Tools.Gizmos -{ - public static class GizmoFactory - { - public static BoxGizmo Box(RcVec3f center, RcVec3f[] halfEdges) - { - return new BoxGizmo(center, halfEdges); - } - - public static SphereGizmo Sphere(RcVec3f center, float radius) - { - return new SphereGizmo(center, radius); - } - - public static CapsuleGizmo Capsule(RcVec3f start, RcVec3f end, float radius) - { - return new CapsuleGizmo(start, end, radius); - } - - public static CylinderGizmo Cylinder(RcVec3f start, RcVec3f end, float radius) - { - return new CylinderGizmo(start, end, radius); - } - - public static TrimeshGizmo Trimesh(float[] verts, int[] faces) - { - return new TrimeshGizmo(verts, faces); - } - - public static CompositeGizmo Composite(params IRcGizmoMeshFilter[] gizmos) - { - return new CompositeGizmo(gizmos); - } - } -} \ No newline at end of file