From f97242faea52523d9dfbfa5bf7f8805408b72313 Mon Sep 17 00:00:00 2001 From: ikpil Date: Tue, 28 Mar 2023 23:08:24 +0900 Subject: [PATCH] vector element --- src/DotRecast.Core/Vector3f.cs | 9 ++++----- src/DotRecast.Recast/RecastVoxelization.cs | 9 +++------ 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/DotRecast.Core/Vector3f.cs b/src/DotRecast.Core/Vector3f.cs index 57db9df..aaeecff 100644 --- a/src/DotRecast.Core/Vector3f.cs +++ b/src/DotRecast.Core/Vector3f.cs @@ -17,15 +17,14 @@ freely, subject to the following restrictions: */ using System; -using System.Numerics; namespace DotRecast.Core { public struct Vector3f { - public float x { get; set; } - public float y { get; set; } - public float z { get; set; } + public float x; + public float y; + public float z; public Vector3f(float x, float y, float z) { @@ -64,7 +63,7 @@ namespace DotRecast.Core case 2: z = value; break; - + default: throw new IndexOutOfRangeException($"{index}-{value}"); } } diff --git a/src/DotRecast.Recast/RecastVoxelization.cs b/src/DotRecast.Recast/RecastVoxelization.cs index 8fb04bd..1eb869f 100644 --- a/src/DotRecast.Recast/RecastVoxelization.cs +++ b/src/DotRecast.Recast/RecastVoxelization.cs @@ -29,8 +29,7 @@ namespace DotRecast.Recast RecastConfig cfg = builderCfg.cfg; // Allocate voxel heightfield where we rasterize our input data to. - Heightfield solid = new Heightfield(builderCfg.width, builderCfg.height, builderCfg.bmin, builderCfg.bmax, cfg.cs, - cfg.ch, cfg.borderSize); + Heightfield solid = new Heightfield(builderCfg.width, builderCfg.height, builderCfg.bmin, builderCfg.bmax, cfg.cs, cfg.ch, cfg.borderSize); // Allocate array that can hold triangle area types. // If you have multiple meshes you need to process, allocate @@ -58,8 +57,7 @@ namespace DotRecast.Recast { int[] tris = node.tris; int ntris = tris.Length / 3; - int[] m_triareas = Recast.markWalkableTriangles(ctx, cfg.walkableSlopeAngle, verts, tris, ntris, - cfg.walkableAreaMod); + int[] m_triareas = Recast.markWalkableTriangles(ctx, cfg.walkableSlopeAngle, verts, tris, ntris, cfg.walkableAreaMod); RecastRasterization.rasterizeTriangles(solid, verts, tris, m_triareas, ntris, cfg.walkableClimb, ctx); } } @@ -67,8 +65,7 @@ namespace DotRecast.Recast { int[] tris = geom.getTris(); int ntris = tris.Length / 3; - int[] m_triareas = Recast.markWalkableTriangles(ctx, cfg.walkableSlopeAngle, verts, tris, ntris, - cfg.walkableAreaMod); + int[] m_triareas = Recast.markWalkableTriangles(ctx, cfg.walkableSlopeAngle, verts, tris, ntris, cfg.walkableAreaMod); RecastRasterization.rasterizeTriangles(solid, verts, tris, m_triareas, ntris, cfg.walkableClimb, ctx); } }