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

Segfaulting on ecs_octreen_findn #4

Open
retroswan opened this issue Jan 13, 2022 · 0 comments
Open

Segfaulting on ecs_octreen_findn #4

retroswan opened this issue Jan 13, 2022 · 0 comments

Comments

@retroswan
Copy link

Reproduction:
https://github.com/retroswan/flecs-physics-bug

Creating a system with this signature:

ECS_SYSTEM(world, CollisionsSystem, EcsPreUpdate, EcsPosition3, (EcsSpatialQuery, AABB), (EcsSpatialQueryResult, AABB));

With this code:

void CollisionsSystem(ecs_iter_t* it)
{
    EcsPosition3* p = ecs_term(it, EcsPosition3, 1);
    EcsSpatialQuery* q = ecs_term(it, EcsSpatialQuery, 2);
    EcsSpatialQueryResult* r = ecs_term(it, EcsSpatialQueryResult, 3);
    
    for(int i = 0; i < it->count; i++)
    {
        ecs_octree_findn(q[i].query, &p[i], 4, &r[i].results);
        for(int j = 0; j < r[i].results->count; j++)
        {
            //
        }
    }
}

Will result in a segfault when calling ecs_octree_findn.

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

1 participant