diff --git a/src/DotRecast.Recast.Toolset/Geom/DemoInputGeomProvider.cs b/src/DotRecast.Recast.Toolset/Geom/DemoInputGeomProvider.cs index 3b32921..4062544 100644 --- a/src/DotRecast.Recast.Toolset/Geom/DemoInputGeomProvider.cs +++ b/src/DotRecast.Recast.Toolset/Geom/DemoInputGeomProvider.cs @@ -32,7 +32,7 @@ namespace DotRecast.Recast.Toolset.Geom public readonly float[] normals; private readonly RcVec3f bmin; private readonly RcVec3f bmax; - + private readonly List _convexVolumes = new List(); private readonly List _offMeshConnections = new List(); private readonly RcTriMesh _mesh; @@ -61,6 +61,11 @@ namespace DotRecast.Recast.Toolset.Geom _mesh = new RcTriMesh(vertices, faces); } + public RcTriMesh GetMesh() + { + return _mesh; + } + public RcVec3f GetMeshBoundsMin() { return bmin; @@ -129,7 +134,7 @@ namespace DotRecast.Recast.Toolset.Geom public bool RaycastMesh(RcVec3f src, RcVec3f dst, out float tmin) { tmin = 1.0f; - + // Prune hit ray. if (!Intersections.IsectSegAABB(src, dst, bmin, bmax, out var btmin, out var btmax)) { @@ -196,7 +201,7 @@ namespace DotRecast.Recast.Toolset.Geom volume.areaMod = areaMod; AddConvexVolume(volume); } - + public void AddConvexVolume(RcConvexVolume volume) { _convexVolumes.Add(volume); @@ -206,7 +211,7 @@ namespace DotRecast.Recast.Toolset.Geom { _convexVolumes.Clear(); } - + private static int[] MapFaces(List meshFaces) { int[] faces = new int[meshFaces.Count]; diff --git a/src/DotRecast.Recast/Geom/IInputGeomProvider.cs b/src/DotRecast.Recast/Geom/IInputGeomProvider.cs index ff206fb..5abe5b3 100644 --- a/src/DotRecast.Recast/Geom/IInputGeomProvider.cs +++ b/src/DotRecast.Recast/Geom/IInputGeomProvider.cs @@ -26,6 +26,7 @@ namespace DotRecast.Recast.Geom { public interface IInputGeomProvider { + RcTriMesh GetMesh(); RcVec3f GetMeshBoundsMin(); RcVec3f GetMeshBoundsMax(); diff --git a/src/DotRecast.Recast/Geom/SimpleInputGeomProvider.cs b/src/DotRecast.Recast/Geom/SimpleInputGeomProvider.cs index 1404d98..0eff052 100644 --- a/src/DotRecast.Recast/Geom/SimpleInputGeomProvider.cs +++ b/src/DotRecast.Recast/Geom/SimpleInputGeomProvider.cs @@ -81,6 +81,11 @@ namespace DotRecast.Recast.Geom _mesh = new RcTriMesh(vertices, faces); } + public RcTriMesh GetMesh() + { + return _mesh; + } + public RcVec3f GetMeshBoundsMin() { return bmin;