Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with DynamicNavMesh Generation at Tile Boundaries #77

Open
OhJeongrok opened this issue Sep 3, 2024 · 3 comments
Open

Issue with DynamicNavMesh Generation at Tile Boundaries #77

OhJeongrok opened this issue Sep 3, 2024 · 3 comments

Comments

@OhJeongrok
Copy link

OhJeongrok commented Sep 3, 2024

Hello,

I’m encountering an issue with generating a DtDynamicNavMesh in DotRecast, particularly when placing colliders at the boundaries between tiles. I’ve been testing this using the RcDynamicUpdateTool.cs from the Recast.Demo project, specifically with the box collider generation function. Below is the code I’m using for the collider creation:

        public RcGizmo BoxCollider(RcVec3f p, float walkableClimb)
        {
            RcVec3f extent = new RcVec3f(
                25.0f * 2,
                25.0f * 2,
                25.0f * 2
            );
            RcVec3f forward = RcVec3f.UnitX;
            RcVec3f up = RcVec3f.UnitY;
            RcVec3f[] halfEdges = Detour.Dynamic.Colliders.DtBoxCollider.GetHalfEdges(up, forward, extent);
            var collider = new DtBoxCollider(p, halfEdges, SampleAreaModifications.SAMPLE_POLYAREA_TYPE_WATER, walkableClimb);
            var gizmo = RcGizmoFactory.Box(p, halfEdges);
            return new RcGizmo(collider, gizmo);
        }

I’m using the following settings:

    public class RcNavMeshBuildSettings
    {
        public float cellSize = 19.0f;
        public float cellHeight = 25.0f;

        public float agentHeight = 144.0f;
        public float agentRadius = 35.0f;
        public float agentMaxClimb = 49.0f;
        public float agentMaxSlope = 60.0f;

        public float agentMaxAcceleration = 800.0f;
        public float agentMaxSpeed = 600.0f;

        public int minRegionSize = 0;
        public int mergedRegionSize = 20;

        public int partitioning = RcPartitionType.WATERSHED.Value;

        public bool filterLowHangingObstacles = true;
        public bool filterLedgeSpans = true;
        public bool filterWalkableLowHeightSpans = true;

        public float edgeMaxLen = 12.0f;
        public float edgeMaxError = 1.3f;
        public int vertsPerPoly = 6;

        public float detailSampleDist = 6.0f;
        public float detailSampleMaxError = 1.0f;

        public bool tiled = true;
        public int tileSize = 150;
    }

When using these settings, the NavMesh fails to generate correctly at the tile boundaries where the box colliders are placed. The colliders on these boundaries are either not being processed correctly, resulting in gaps or incomplete navigation data at the borders. I’ve tried adjusting various parameters like tile size and collider extents, but the problem persists.

Could you provide guidance on how to resolve this issue so that colliders at tile boundaries are correctly integrated into the DtDynamicNavMesh generation?

Thank you for your help!

image
image

@ikpil
Copy link
Owner

ikpil commented Sep 5, 2024

Hello,
I’ve been busy with work recently, so my response is delayed.
I’m sorry about that.

I will check into this.

@ikpil
Copy link
Owner

ikpil commented Sep 20, 2024

image

@ikpil
Copy link
Owner

ikpil commented Sep 20, 2024

First, I apologize.
I've been busy and couldn't pay attention to this.
@ppiastucki from recast4j has made the correction, and I've ported it as is.
Thank you once again for reporting this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants