From 4a1b430ee6ae5379bf051179f5d2dabdc8362eb9 Mon Sep 17 00:00:00 2001 From: "i.semenov" Date: Fri, 25 Oct 2024 14:51:31 +0300 Subject: [PATCH] Added: allow set userId for offmesh connections --- .../Geom/DemoDtTileCacheMeshProcess.cs | 2 +- src/DotRecast.Recast/Geom/RcOffMeshConnection.cs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/DotRecast.Recast.Toolset/Geom/DemoDtTileCacheMeshProcess.cs b/src/DotRecast.Recast.Toolset/Geom/DemoDtTileCacheMeshProcess.cs index 619a5b0..f738a97 100644 --- a/src/DotRecast.Recast.Toolset/Geom/DemoDtTileCacheMeshProcess.cs +++ b/src/DotRecast.Recast.Toolset/Geom/DemoDtTileCacheMeshProcess.cs @@ -65,7 +65,7 @@ namespace DotRecast.Recast.Toolset.Geom option.offMeshConDir[i] = offMeshCon.bidir ? 1 : 0; option.offMeshConAreas[i] = offMeshCon.area; option.offMeshConFlags[i] = offMeshCon.flags; - // option.offMeshConUserID[i] = offMeshCon.userId; + option.offMeshConUserID[i] = offMeshCon.userId; } } } diff --git a/src/DotRecast.Recast/Geom/RcOffMeshConnection.cs b/src/DotRecast.Recast/Geom/RcOffMeshConnection.cs index 599c53a..1ef5060 100644 --- a/src/DotRecast.Recast/Geom/RcOffMeshConnection.cs +++ b/src/DotRecast.Recast/Geom/RcOffMeshConnection.cs @@ -33,7 +33,7 @@ namespace DotRecast.Recast.Geom public readonly int flags; public readonly int userId; - public RcOffMeshConnection(RcVec3f start, RcVec3f end, float radius, bool bidir, int area, int flags) + public RcOffMeshConnection(RcVec3f start, RcVec3f end, float radius, bool bidir, int area, int flags, int userId = 0) { verts = new float[6]; verts[0] = start.X; @@ -46,6 +46,7 @@ namespace DotRecast.Recast.Geom this.bidir = bidir; this.area = area; this.flags = flags; + this.userId = userId; } } } \ No newline at end of file