From 46625426753c41d0e090702c224ace69f3e43a06 Mon Sep 17 00:00:00 2001 From: ikpil Date: Fri, 21 Apr 2023 23:41:06 +0900 Subject: [PATCH] float[] -> Vector3f --- .../Tools/Gizmos/BoxGizmo.cs | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/DotRecast.Recast.Demo/Tools/Gizmos/BoxGizmo.cs b/src/DotRecast.Recast.Demo/Tools/Gizmos/BoxGizmo.cs index ce41d9d..84d6610 100644 --- a/src/DotRecast.Recast.Demo/Tools/Gizmos/BoxGizmo.cs +++ b/src/DotRecast.Recast.Demo/Tools/Gizmos/BoxGizmo.cs @@ -12,16 +12,16 @@ public class BoxGizmo : ColliderGizmo 2, 6, 7, 2, 7, 3, 4, 0, 3, 4, 3, 7 }; - private static readonly float[][] VERTS = + private static readonly Vector3f[] VERTS = { - new[] { -1f, -1f, -1f, }, - new[] { 1f, -1f, -1f, }, - new[] { 1f, -1f, 1f, }, - new[] { -1f, -1f, 1f, }, - new[] { -1f, 1f, -1f, }, - new[] { 1f, 1f, -1f, }, - new[] { 1f, 1f, 1f, }, - new[] { -1f, 1f, 1f, }, + Vector3f.Of( -1f, -1f, -1f), + Vector3f.Of( 1f, -1f, -1f), + Vector3f.Of( 1f, -1f, 1f), + Vector3f.Of( -1f, -1f, 1f), + Vector3f.Of( -1f, 1f, -1f), + Vector3f.Of( 1f, 1f, -1f), + Vector3f.Of( 1f, 1f, 1f), + Vector3f.Of( -1f, 1f, 1f), }; private readonly float[] vertices = new float[8 * 3]; @@ -50,9 +50,9 @@ public class BoxGizmo : ColliderGizmo public void render(RecastDebugDraw debugDraw) { - float[] trX = new float[] { halfEdges[0][0], halfEdges[1][0], halfEdges[2][0] }; - float[] trY = new float[] { halfEdges[0][1], halfEdges[1][1], halfEdges[2][1] }; - float[] trZ = new float[] { halfEdges[0][2], halfEdges[1][2], halfEdges[2][2] }; + var trX = Vector3f.Of(halfEdges[0][0], halfEdges[1][0], halfEdges[2][0]); + var trY = Vector3f.Of(halfEdges[0][1], halfEdges[1][1], halfEdges[2][1]); + var trZ = Vector3f.Of(halfEdges[0][2], halfEdges[1][2], halfEdges[2][2]); float[] vertices = new float[8 * 3]; for (int i = 0; i < 8; i++) {