From 0f9e61f51e94f00415e404dd63da245745b75108 Mon Sep 17 00:00:00 2001 From: ikpil Date: Sat, 6 May 2023 11:44:57 +0900 Subject: [PATCH] preventing name conflicts --- src/DotRecast.Core/FRand.cs | 10 +++++----- .../{AtomicBoolean.cs => RcAtomicBoolean.cs} | 2 +- .../{AtomicFloat.cs => RcAtomicFloat.cs} | 4 ++-- .../{AtomicInteger.cs => RcAtomicInteger.cs} | 6 +++--- .../{AtomicLong.cs => RcAtomicLong.cs} | 6 +++--- .../{FrequencyWatch.cs => RcFrequency.cs} | 2 +- src/DotRecast.Detour.Crowd/Crowd.cs | 2 +- src/DotRecast.Detour.Crowd/CrowdTelemetry.cs | 4 ++-- src/DotRecast.Detour.Dynamic/DynamicNavMesh.cs | 2 +- .../Jumplink/NavMeshGroundSampler.cs | 4 ++-- src/DotRecast.Detour/NavMeshQuery.cs | 14 +++++++------- src/DotRecast.Recast.Demo/RecastDemo.cs | 6 +++--- .../Tools/CrowdProfilingTool.cs | 10 +++++----- src/DotRecast.Recast.Demo/Tools/CrowdTool.cs | 4 ++-- .../Tools/DynamicUpdateTool.cs | 12 ++++++------ src/DotRecast.Recast/RecastBuilder.cs | 6 +++--- src/DotRecast.Recast/RecastMeshDetail.cs | 4 ++-- src/DotRecast.Recast/Telemetry.cs | 10 +++++----- test/DotRecast.Detour.Test/RandomPointTest.cs | 6 +++--- .../TileCacheTest.cs | 6 +++--- test/DotRecast.Recast.Test/RecastSoloMeshTest.cs | 6 +++--- test/DotRecast.Recast.Test/RecastTileMeshTest.cs | 6 +++--- 22 files changed, 66 insertions(+), 66 deletions(-) rename src/DotRecast.Core/{AtomicBoolean.cs => RcAtomicBoolean.cs} (90%) rename src/DotRecast.Core/{AtomicFloat.cs => RcAtomicFloat.cs} (87%) rename src/DotRecast.Core/{AtomicInteger.cs => RcAtomicInteger.cs} (91%) rename src/DotRecast.Core/{AtomicLong.cs => RcAtomicLong.cs} (90%) rename src/DotRecast.Core/{FrequencyWatch.cs => RcFrequency.cs} (87%) diff --git a/src/DotRecast.Core/FRand.cs b/src/DotRecast.Core/FRand.cs index 5c7c72d..3acee4c 100644 --- a/src/DotRecast.Core/FRand.cs +++ b/src/DotRecast.Core/FRand.cs @@ -4,21 +4,21 @@ namespace DotRecast.Core { public class FRand { - private readonly Random r; + private readonly Random _r; public FRand() { - r = new Random(); + _r = new Random(); } public FRand(long seed) { - r = new Random((int)seed); // TODO : 랜덤 시드 확인 필요 + _r = new Random((int)seed); // TODO : 랜덤 시드 확인 필요 } - public float Frand() + public float Next() { - return (float)r.NextDouble(); + return (float)_r.NextDouble(); } } } \ No newline at end of file diff --git a/src/DotRecast.Core/AtomicBoolean.cs b/src/DotRecast.Core/RcAtomicBoolean.cs similarity index 90% rename from src/DotRecast.Core/AtomicBoolean.cs rename to src/DotRecast.Core/RcAtomicBoolean.cs index 7770b67..a2bb9f3 100644 --- a/src/DotRecast.Core/AtomicBoolean.cs +++ b/src/DotRecast.Core/RcAtomicBoolean.cs @@ -2,7 +2,7 @@ namespace DotRecast.Core { - public class AtomicBoolean + public class RcAtomicBoolean { private volatile int _location; diff --git a/src/DotRecast.Core/AtomicFloat.cs b/src/DotRecast.Core/RcAtomicFloat.cs similarity index 87% rename from src/DotRecast.Core/AtomicFloat.cs rename to src/DotRecast.Core/RcAtomicFloat.cs index 7508a27..21e7886 100644 --- a/src/DotRecast.Core/AtomicFloat.cs +++ b/src/DotRecast.Core/RcAtomicFloat.cs @@ -2,11 +2,11 @@ namespace DotRecast.Core { - public class AtomicFloat + public class RcAtomicFloat { private volatile float _location; - public AtomicFloat(float location) + public RcAtomicFloat(float location) { _location = location; } diff --git a/src/DotRecast.Core/AtomicInteger.cs b/src/DotRecast.Core/RcAtomicInteger.cs similarity index 91% rename from src/DotRecast.Core/AtomicInteger.cs rename to src/DotRecast.Core/RcAtomicInteger.cs index 4c80650..46596ef 100644 --- a/src/DotRecast.Core/AtomicInteger.cs +++ b/src/DotRecast.Core/RcAtomicInteger.cs @@ -2,15 +2,15 @@ namespace DotRecast.Core { - public class AtomicInteger + public class RcAtomicInteger { private volatile int _location; - public AtomicInteger() : this(0) + public RcAtomicInteger() : this(0) { } - public AtomicInteger(int location) + public RcAtomicInteger(int location) { _location = location; } diff --git a/src/DotRecast.Core/AtomicLong.cs b/src/DotRecast.Core/RcAtomicLong.cs similarity index 90% rename from src/DotRecast.Core/AtomicLong.cs rename to src/DotRecast.Core/RcAtomicLong.cs index b02ed82..0ea3e01 100644 --- a/src/DotRecast.Core/AtomicLong.cs +++ b/src/DotRecast.Core/RcAtomicLong.cs @@ -2,15 +2,15 @@ namespace DotRecast.Core { - public class AtomicLong + public class RcAtomicLong { private long _location; - public AtomicLong() : this(0) + public RcAtomicLong() : this(0) { } - public AtomicLong(long location) + public RcAtomicLong(long location) { _location = location; } diff --git a/src/DotRecast.Core/FrequencyWatch.cs b/src/DotRecast.Core/RcFrequency.cs similarity index 87% rename from src/DotRecast.Core/FrequencyWatch.cs rename to src/DotRecast.Core/RcFrequency.cs index 539bb13..eae3a32 100644 --- a/src/DotRecast.Core/FrequencyWatch.cs +++ b/src/DotRecast.Core/RcFrequency.cs @@ -3,7 +3,7 @@ using System.Diagnostics; namespace DotRecast.Core { - public static class FrequencyWatch + public static class RcFrequency { public static readonly double Frequency = (double)TimeSpan.TicksPerSecond / Stopwatch.Frequency; public static long Ticks => unchecked((long)(Stopwatch.GetTimestamp() * Frequency)); diff --git a/src/DotRecast.Detour.Crowd/Crowd.cs b/src/DotRecast.Detour.Crowd/Crowd.cs index 88e63b5..5a8272e 100644 --- a/src/DotRecast.Detour.Crowd/Crowd.cs +++ b/src/DotRecast.Detour.Crowd/Crowd.cs @@ -142,7 +142,7 @@ namespace DotRecast.Detour.Crowd /// dtCrowdAgentParams::queryFilterType public const int DT_CROWD_MAX_QUERY_FILTER_TYPE = 16; - private readonly AtomicInteger _agentId = new AtomicInteger(); + private readonly RcAtomicInteger _agentId = new RcAtomicInteger(); private readonly List _agents; private readonly PathQueue _pathQ; private readonly ObstacleAvoidanceParams[] _obstacleQueryParams = new ObstacleAvoidanceParams[DT_CROWD_MAX_OBSTAVOIDANCE_PARAMS]; diff --git a/src/DotRecast.Detour.Crowd/CrowdTelemetry.cs b/src/DotRecast.Detour.Crowd/CrowdTelemetry.cs index d8e58ba..c4ef7a6 100644 --- a/src/DotRecast.Detour.Crowd/CrowdTelemetry.cs +++ b/src/DotRecast.Detour.Crowd/CrowdTelemetry.cs @@ -66,12 +66,12 @@ namespace DotRecast.Detour.Crowd public void Start(string name) { - _executionTimings.Add(name, FrequencyWatch.Ticks); + _executionTimings.Add(name, RcFrequency.Ticks); } public void Stop(string name) { - long duration = FrequencyWatch.Ticks - _executionTimings[name]; + long duration = RcFrequency.Ticks - _executionTimings[name]; if (!_executionTimingSamples.TryGetValue(name, out var s)) { s = new List(); diff --git a/src/DotRecast.Detour.Dynamic/DynamicNavMesh.cs b/src/DotRecast.Detour.Dynamic/DynamicNavMesh.cs index 91b2d10..48b71f9 100644 --- a/src/DotRecast.Detour.Dynamic/DynamicNavMesh.cs +++ b/src/DotRecast.Detour.Dynamic/DynamicNavMesh.cs @@ -38,7 +38,7 @@ namespace DotRecast.Detour.Dynamic private readonly Telemetry telemetry; private readonly NavMeshParams navMeshParams; private readonly BlockingCollection updateQueue = new BlockingCollection(); - private readonly AtomicLong currentColliderId = new AtomicLong(0); + private readonly RcAtomicLong currentColliderId = new RcAtomicLong(0); private NavMesh _navMesh; private bool dirty = true; diff --git a/src/DotRecast.Detour.Extras/Jumplink/NavMeshGroundSampler.cs b/src/DotRecast.Detour.Extras/Jumplink/NavMeshGroundSampler.cs index e3f667c..df7035f 100644 --- a/src/DotRecast.Detour.Extras/Jumplink/NavMeshGroundSampler.cs +++ b/src/DotRecast.Detour.Extras/Jumplink/NavMeshGroundSampler.cs @@ -74,8 +74,8 @@ namespace DotRecast.Detour.Extras.Jumplink { Vector3f halfExtents = new Vector3f { x = cs, y = heightRange, z = cs }; float maxHeight = pt.y + heightRange; - AtomicBoolean found = new AtomicBoolean(); - AtomicFloat minHeight = new AtomicFloat(pt.y); + RcAtomicBoolean found = new RcAtomicBoolean(); + RcAtomicFloat minHeight = new RcAtomicFloat(pt.y); navMeshQuery.QueryPolygons(pt, halfExtents, filter, new PolyQueryInvoker((tile, poly, refs) => { Result h = navMeshQuery.GetPolyHeight(refs, pt); diff --git a/src/DotRecast.Detour/NavMeshQuery.cs b/src/DotRecast.Detour/NavMeshQuery.cs index 8a8e556..39c55a8 100644 --- a/src/DotRecast.Detour/NavMeshQuery.cs +++ b/src/DotRecast.Detour/NavMeshQuery.cs @@ -104,7 +104,7 @@ namespace DotRecast.Detour // Choose random tile using reservoi sampling. float area = 1.0f; // Could be tile area too. tsum += area; - float u = frand.Frand(); + float u = frand.Next(); if (u * tsum <= area) { tile = mt; @@ -150,7 +150,7 @@ namespace DotRecast.Detour // Choose random polygon weighted by area, using reservoi sampling. areaSum += polyArea; - float u = frand.Frand(); + float u = frand.Next(); if (u * areaSum <= polyArea) { poly = p; @@ -172,8 +172,8 @@ namespace DotRecast.Detour Array.Copy(tile.data.verts, poly.verts[j] * 3, verts, j * 3, 3); } - float s = frand.Frand(); - float t = frand.Frand(); + float s = frand.Next(); + float t = frand.Next(); var pt = RandomPointInConvexPoly(verts, poly.vertCount, areas, s, t); ClosestPointOnPolyResult closest = ClosestPointOnPoly(polyRef, pt).result; @@ -297,7 +297,7 @@ namespace DotRecast.Detour // Choose random polygon weighted by area, using reservoi sampling. areaSum += polyArea; - float u = frand.Frand(); + float u = frand.Next(); if (u * areaSum <= polyArea) { randomPoly = bestPoly; @@ -398,8 +398,8 @@ namespace DotRecast.Detour } // Randomly pick point on polygon. - float s = frand.Frand(); - float t = frand.Frand(); + float s = frand.Next(); + float t = frand.Next(); float[] areas = new float[randomPolyVerts.Length / 3]; Vector3f pt = RandomPointInConvexPoly(randomPolyVerts, randomPolyVerts.Length / 3, areas, s, t); diff --git a/src/DotRecast.Recast.Demo/RecastDemo.cs b/src/DotRecast.Recast.Demo/RecastDemo.cs index a601584..a468f9b 100644 --- a/src/DotRecast.Recast.Demo/RecastDemo.cs +++ b/src/DotRecast.Recast.Demo/RecastDemo.cs @@ -459,7 +459,7 @@ public class RecastDemo cameraPos.y += (float)((_moveUp - _moveDown) * keySpeed * dt); - long time = FrequencyWatch.Ticks; + long time = RcFrequency.Ticks; prevFrameTime = time; // Update sample simulation. @@ -525,7 +525,7 @@ public class RecastDemo float m_detailSampleDist = settingsUI.GetDetailSampleDist(); float m_detailSampleMaxError = settingsUI.GetDetailSampleMaxError(); int m_tileSize = settingsUI.GetTileSize(); - long t = FrequencyWatch.Ticks; + long t = RcFrequency.Ticks; Logger.Information($"build"); @@ -549,7 +549,7 @@ public class RecastDemo sample.Update(sample.GetInputGeom(), buildResult.Item1, buildResult.Item2); sample.SetChanged(false); - settingsUI.SetBuildTime((FrequencyWatch.Ticks - t) / TimeSpan.TicksPerMillisecond); + settingsUI.SetBuildTime((RcFrequency.Ticks - t) / TimeSpan.TicksPerMillisecond); //settingsUI.SetBuildTelemetry(buildResult.Item1.Select(x => x.GetTelemetry()).ToList()); toolsUI.SetSample(sample); diff --git a/src/DotRecast.Recast.Demo/Tools/CrowdProfilingTool.cs b/src/DotRecast.Recast.Demo/Tools/CrowdProfilingTool.cs index 520ea28..59df8fd 100644 --- a/src/DotRecast.Recast.Demo/Tools/CrowdProfilingTool.cs +++ b/src/DotRecast.Recast.Demo/Tools/CrowdProfilingTool.cs @@ -86,12 +86,12 @@ public class CrowdProfilingTool IQueryFilter filter = new DefaultQueryFilter(); for (int i = 0; i < agents; i++) { - float tr = rnd.Frand(); + float tr = rnd.Next(); AgentType type = AgentType.MOB; float mobsPcnt = percentMobs / 100f; if (tr > mobsPcnt) { - tr = rnd.Frand(); + tr = rnd.Next(); float travellerPcnt = percentTravellers / 100f; if (tr > travellerPcnt) { @@ -161,7 +161,7 @@ public class CrowdProfilingTool { if (0 < zones.Count) { - int zone = (int)(rnd.Frand() * zones.Count); + int zone = (int)(rnd.Next() * zones.Count); Result result = navquery.FindRandomPointWithinCircle(zones[zone].GetRandomRef(), zones[zone].GetRandomPt(), zoneRadius, filter, rnd); if (result.Succeeded()) @@ -240,7 +240,7 @@ public class CrowdProfilingTool public void Update(float dt) { - long startTime = FrequencyWatch.Ticks; + long startTime = RcFrequency.Ticks; if (crowd != null) { crowd.Config().pathQueueSize = pathQueueSize; @@ -248,7 +248,7 @@ public class CrowdProfilingTool crowd.Update(dt, null); } - long endTime = FrequencyWatch.Ticks; + long endTime = RcFrequency.Ticks; if (crowd != null) { NavMeshQuery navquery = new NavMeshQuery(navMesh); diff --git a/src/DotRecast.Recast.Demo/Tools/CrowdTool.cs b/src/DotRecast.Recast.Demo/Tools/CrowdTool.cs index 9dfd0f8..b0aa74e 100644 --- a/src/DotRecast.Recast.Demo/Tools/CrowdTool.cs +++ b/src/DotRecast.Recast.Demo/Tools/CrowdTool.cs @@ -677,9 +677,9 @@ public class CrowdTool : Tool if (nav == null) return; - long startTime = FrequencyWatch.Ticks; + long startTime = RcFrequency.Ticks; crowd.Update(dt, m_agentDebug); - long endTime = FrequencyWatch.Ticks; + long endTime = RcFrequency.Ticks; // Update agent trails foreach (CrowdAgent ag in crowd.GetActiveAgents()) diff --git a/src/DotRecast.Recast.Demo/Tools/DynamicUpdateTool.cs b/src/DotRecast.Recast.Demo/Tools/DynamicUpdateTool.cs index 0510956..03708e2 100644 --- a/src/DotRecast.Recast.Demo/Tools/DynamicUpdateTool.cs +++ b/src/DotRecast.Recast.Demo/Tools/DynamicUpdateTool.cs @@ -205,9 +205,9 @@ public class DynamicUpdateTool : Tool { Vector3f sp = Vector3f.Of(spos.x, spos.y + 1.3f, spos.z); Vector3f ep = Vector3f.Of(epos.x, epos.y + 1.3f, epos.z); - long t1 = FrequencyWatch.Ticks; + long t1 = RcFrequency.Ticks; float? hitPos = dynaMesh.VoxelQuery().Raycast(sp, ep); - long t2 = FrequencyWatch.Ticks; + long t2 = RcFrequency.Ticks; raycastTime = (t2 - t1) / TimeSpan.TicksPerMillisecond; raycastHit = hitPos.HasValue; raycastHitPos = hitPos.HasValue @@ -499,13 +499,13 @@ public class DynamicUpdateTool : Tool private void UpdateDynaMesh() { - long t = FrequencyWatch.Ticks; + long t = RcFrequency.Ticks; try { bool updated = dynaMesh.Update(executor).Result; if (updated) { - buildTime = (FrequencyWatch.Ticks - t) / TimeSpan.TicksPerMillisecond; + buildTime = (RcFrequency.Ticks - t) / TimeSpan.TicksPerMillisecond; sample.Update(null, dynaMesh.RecastResults(), dynaMesh.NavMesh()); sample.SetChanged(false); } @@ -728,7 +728,7 @@ public class DynamicUpdateTool : Tool private void BuildDynaMesh() { ConfigDynaMesh(); - long t = FrequencyWatch.Ticks; + long t = RcFrequency.Ticks; try { var _ = dynaMesh.Build(executor).Result; @@ -738,7 +738,7 @@ public class DynamicUpdateTool : Tool Console.WriteLine(e); } - buildTime = (FrequencyWatch.Ticks - t) / TimeSpan.TicksPerMillisecond; + buildTime = (RcFrequency.Ticks - t) / TimeSpan.TicksPerMillisecond; sample.Update(null, dynaMesh.RecastResults(), dynaMesh.NavMesh()); } diff --git a/src/DotRecast.Recast/RecastBuilder.cs b/src/DotRecast.Recast/RecastBuilder.cs index 7382ac0..79c451f 100644 --- a/src/DotRecast.Recast/RecastBuilder.cs +++ b/src/DotRecast.Recast/RecastBuilder.cs @@ -90,7 +90,7 @@ namespace DotRecast.Recast private Task BuildSingleThreadAsync(IInputGeomProvider geom, RecastConfig cfg, Vector3f bmin, Vector3f bmax, int tw, int th, List results) { - AtomicInteger counter = new AtomicInteger(0); + RcAtomicInteger counter = new RcAtomicInteger(0); for (int y = 0; y < th; ++y) { for (int x = 0; x < tw; ++x) @@ -105,7 +105,7 @@ namespace DotRecast.Recast private Task BuildMultiThreadAsync(IInputGeomProvider geom, RecastConfig cfg, Vector3f bmin, Vector3f bmax, int tw, int th, List results, TaskFactory taskFactory, CancellationToken cancellationToken) { - AtomicInteger counter = new AtomicInteger(0); + RcAtomicInteger counter = new RcAtomicInteger(0); CountdownEvent latch = new CountdownEvent(tw * th); List tasks = new List(); @@ -153,7 +153,7 @@ namespace DotRecast.Recast } private RecastBuilderResult BuildTile(IInputGeomProvider geom, RecastConfig cfg, Vector3f bmin, Vector3f bmax, int tx, - int ty, AtomicInteger counter, int total) + int ty, RcAtomicInteger counter, int total) { RecastBuilderResult result = Build(geom, new RecastBuilderConfig(cfg, bmin, bmax, tx, ty)); if (progressListener != null) diff --git a/src/DotRecast.Recast/RecastMeshDetail.cs b/src/DotRecast.Recast/RecastMeshDetail.cs index eb4f563..284b78c 100644 --- a/src/DotRecast.Recast/RecastMeshDetail.cs +++ b/src/DotRecast.Recast/RecastMeshDetail.cs @@ -162,7 +162,7 @@ namespace DotRecast.Recast } - private static bool CircumCircle(float[] verts, int p1, int p2, int p3, ref Vector3f c, AtomicFloat r) + private static bool CircumCircle(float[] verts, int p1, int p2, int p3, ref Vector3f c, RcAtomicFloat r) { float EPS = 1e-6f; // Calculate the circle relative to p1, to avoid some precision issues. @@ -545,7 +545,7 @@ namespace DotRecast.Recast // Find best point on left of edge. int pt = npts; Vector3f c = new Vector3f(); - AtomicFloat r = new AtomicFloat(-1f); + RcAtomicFloat r = new RcAtomicFloat(-1f); for (int u = 0; u < npts; ++u) { if (u == s || u == t) diff --git a/src/DotRecast.Recast/Telemetry.cs b/src/DotRecast.Recast/Telemetry.cs index 2c1a7d3..8bc2981 100644 --- a/src/DotRecast.Recast/Telemetry.cs +++ b/src/DotRecast.Recast/Telemetry.cs @@ -28,19 +28,19 @@ namespace DotRecast.Recast { public class Telemetry { - private readonly ThreadLocal> timerStart = new ThreadLocal>(() => new Dictionary()); - private readonly ConcurrentDictionary timerAccum = new ConcurrentDictionary(); + private readonly ThreadLocal> timerStart = new ThreadLocal>(() => new Dictionary()); + private readonly ConcurrentDictionary timerAccum = new ConcurrentDictionary(); public void StartTimer(string name) { - timerStart.Value[name] = new AtomicLong(FrequencyWatch.Ticks); + timerStart.Value[name] = new RcAtomicLong(RcFrequency.Ticks); } public void StopTimer(string name) { timerAccum - .GetOrAdd(name, _ => new AtomicLong(0)) - .AddAndGet(FrequencyWatch.Ticks - timerStart.Value?[name].Read() ?? 0); + .GetOrAdd(name, _ => new RcAtomicLong(0)) + .AddAndGet(RcFrequency.Ticks - timerStart.Value?[name].Read() ?? 0); } public void Warn(string @string) diff --git a/test/DotRecast.Detour.Test/RandomPointTest.cs b/test/DotRecast.Detour.Test/RandomPointTest.cs index 989d417..a24c148 100644 --- a/test/DotRecast.Detour.Test/RandomPointTest.cs +++ b/test/DotRecast.Detour.Test/RandomPointTest.cs @@ -123,19 +123,19 @@ public class RandomPointTest : AbstractDetourTest query.FindRandomPointWithinCircle(point.GetRandomRef(), point.GetRandomPt(), radius, filter, f); } - long t1 = FrequencyWatch.Ticks; + long t1 = RcFrequency.Ticks; for (int i = 0; i < 10000; i++) { query.FindRandomPointAroundCircle(point.GetRandomRef(), point.GetRandomPt(), radius, filter, f); } - long t2 = FrequencyWatch.Ticks; + long t2 = RcFrequency.Ticks; for (int i = 0; i < 10000; i++) { query.FindRandomPointWithinCircle(point.GetRandomRef(), point.GetRandomPt(), radius, filter, f); } - long t3 = FrequencyWatch.Ticks; + long t3 = RcFrequency.Ticks; Console.WriteLine("Random point around circle: " + (t2 - t1) / TimeSpan.TicksPerMillisecond + "ms"); Console.WriteLine("Random point within circle: " + (t3 - t2) / TimeSpan.TicksPerMillisecond + "ms"); } diff --git a/test/DotRecast.Detour.TileCache.Test/TileCacheTest.cs b/test/DotRecast.Detour.TileCache.Test/TileCacheTest.cs index b6e6aa3..f21e1c2 100644 --- a/test/DotRecast.Detour.TileCache.Test/TileCacheTest.cs +++ b/test/DotRecast.Detour.TileCache.Test/TileCacheTest.cs @@ -189,20 +189,20 @@ public class TileCacheTest : AbstractTileCacheTest layerBuilder.Build(order, cCompatibility, threads); } - long t1 = FrequencyWatch.Ticks; + long t1 = RcFrequency.Ticks; List layers = null; for (int i = 0; i < 8; i++) { layers = layerBuilder.Build(order, cCompatibility, 1); } - long t2 = FrequencyWatch.Ticks; + long t2 = RcFrequency.Ticks; for (int i = 0; i < 8; i++) { layers = layerBuilder.Build(order, cCompatibility, threads); } - long t3 = FrequencyWatch.Ticks; + long t3 = RcFrequency.Ticks; Console.WriteLine(" Time ST : " + (t2 - t1) / TimeSpan.TicksPerMillisecond); Console.WriteLine(" Time MT : " + (t3 - t2) / TimeSpan.TicksPerMillisecond); TileCache tc = GetTileCache(geom, order, cCompatibility); diff --git a/test/DotRecast.Recast.Test/RecastSoloMeshTest.cs b/test/DotRecast.Recast.Test/RecastSoloMeshTest.cs index 574b75e..82f00dd 100644 --- a/test/DotRecast.Recast.Test/RecastSoloMeshTest.cs +++ b/test/DotRecast.Recast.Test/RecastSoloMeshTest.cs @@ -97,7 +97,7 @@ public class RecastSoloMeshTest { m_partitionType = partitionType; IInputGeomProvider geomProvider = ObjImporter.Load(Loader.ToBytes(filename)); - long time = FrequencyWatch.Ticks; + long time = RcFrequency.Ticks; Vector3f bmin = geomProvider.GetMeshBoundsMin(); Vector3f bmax = geomProvider.GetMeshBoundsMax(); Telemetry m_ctx = new Telemetry(); @@ -205,7 +205,7 @@ public class RecastSoloMeshTest // you use tiles) // * good choice to use for tiled navmesh with medium and small sized // tiles - long time3 = FrequencyWatch.Ticks; + long time3 = RcFrequency.Ticks; if (m_partitionType == PartitionType.WATERSHED) { @@ -257,7 +257,7 @@ public class RecastSoloMeshTest Assert.That(m_dmesh.nmeshes, Is.EqualTo(expDetMeshes), "Mesh Detail Meshes"); Assert.That(m_dmesh.nverts, Is.EqualTo(expDetVerts), "Mesh Detail Verts"); Assert.That(m_dmesh.ntris, Is.EqualTo(expDetTris), "Mesh Detail Tris"); - long time2 = FrequencyWatch.Ticks; + long time2 = RcFrequency.Ticks; Console.WriteLine(filename + " : " + partitionType + " " + (time2 - time) / TimeSpan.TicksPerMillisecond + " ms"); Console.WriteLine(" " + (time3 - time) / TimeSpan.TicksPerMillisecond + " ms"); SaveObj(filename.Substring(0, filename.LastIndexOf('.')) + "_" + partitionType + "_detail.obj", m_dmesh); diff --git a/test/DotRecast.Recast.Test/RecastTileMeshTest.cs b/test/DotRecast.Recast.Test/RecastTileMeshTest.cs index f0a5703..4cb8194 100644 --- a/test/DotRecast.Recast.Test/RecastTileMeshTest.cs +++ b/test/DotRecast.Recast.Test/RecastTileMeshTest.cs @@ -107,19 +107,19 @@ public class RecastTileMeshTest Build(geom, builder, cfg, 4, true); } - long t1 = FrequencyWatch.Ticks; + long t1 = RcFrequency.Ticks; for (int i = 0; i < 4; i++) { Build(geom, builder, cfg, 1, false); } - long t2 = FrequencyWatch.Ticks; + long t2 = RcFrequency.Ticks; for (int i = 0; i < 4; i++) { Build(geom, builder, cfg, 4, false); } - long t3 = FrequencyWatch.Ticks; + long t3 = RcFrequency.Ticks; Console.WriteLine(" Time ST : " + (t2 - t1) / TimeSpan.TicksPerMillisecond); Console.WriteLine(" Time MT : " + (t3 - t2) / TimeSpan.TicksPerMillisecond); }