Code Monkey home page Code Monkey logo

Comments (4)

xissburg avatar xissburg commented on May 24, 2024

I think you should use EnTT at the v3.10.1 tag not the v3.10.x branch (there isn't a v3.10.1 branch).

It looks like the template function visit_component is causing confusion in some compilers. I have removed the version without a tuple since it's not being used. That's on the master branch though. It won't be picked up by Conan just yet.

from edyn.

danielytics avatar danielytics commented on May 24, 2024

I meant tag, sorry.

That’s ok, I will try out master a little later today, with the tagged version off EnTT and report back. Thanks for looking into it for me.

from edyn.

danielytics avatar danielytics commented on May 24, 2024

Hmm, I'm still getting the same compile error:

In file included from edyn/src/edyn/collision/raycast.cpp:13:
edyn/include/edyn/shapes/shapes.hpp:100:5: error: no matching function for call to 'visit_component'
    visit_component(shapes_tuple, index.value, entity, views_tuple, visitor);
    ^~~~~~~~~~~~~~~
edyn/src/edyn/collision/raycast.cpp:36:9: note: in instantiation of function template specialization 'edyn::visit_shape<(lambda at edyn/src/edyn/collision/raycast.cpp:36:56)>' requested here
        visit_shape(sh_idx, entity, shape_views_tuple, [&](auto &&shape) {
        ^
edyn/include/edyn/util/visit_component.hpp:132:6: note: candidate function template not viable: no known conversion from 'const edyn::tuple_of_shape_views_t' (aka 'const tuple<basic_view<entt::entity, type_list<edyn::sphere_shape>, type_list<>>, basic_view<entt::entity, type_list<edyn::cylinder_shape>, type_list<>>, basic_view<entt::entity, type_list<edyn::capsule_shape>, type_list<>>, basic_view<entt::entity, type_list<edyn::box_shape>, type_list<>>, basic_view<entt::entity, type_list<edyn::polyhedron_shape>, type_list<>>, basic_view<entt::entity, type_list<edyn::compound_shape>, type_list<>>, basic_view<entt::entity, type_list<edyn::plane_shape>, type_list<>>, basic_view<entt::entity, type_list<edyn::mesh_shape>, type_list<>>, basic_view<entt::entity, type_list<edyn::paged_mesh_shape>, type_list<>>>') to 'entt::registry &' (aka 'basic_registry<entt::entity> &') for 4th argument
void visit_component(std::tuple<Ts...>, IndexType index, entt::entity entity,
     ^
edyn/include/edyn/util/visit_component.hpp:68:6: note: candidate template ignored: deduced packs of different lengths for parameter 'Ts' (<edyn::sphere_shape, edyn::cylinder_shape, edyn::capsule_shape, edyn::box_shape, edyn::polyhedron_shape, edyn::compound_shape, edyn::plane_shape, edyn::mesh_shape, edyn::paged_mesh_shape> vs. <edyn::sphere_shape>)
void visit_component([[maybe_unused]] std::tuple<Ts...>, IndexType index, entt::entity entity,
     ^
edyn/include/edyn/util/visit_component.hpp:122:6: note: candidate function template not viable: requires 4 arguments, but 5 were provided
void visit_component(IndexType index, entt::entity entity,

So, its this overload that its trying to call (the 5 argument one):

template<typename... Ts, typename IndexType, typename VisitorType>
void visit_component([[maybe_unused]] std::tuple<Ts...>, IndexType index, entt::entity entity,
                     const std::tuple<entt::basic_view<entt::entity, entt::get_t<Ts>, entt::exclude_t<>>...> &views_tuple,
                     VisitorType visitor)

And the error is:

edyn/include/edyn/util/visit_component.hpp:68:6: note: candidate template ignored: deduced packs of different lengths for parameter 'Ts' (<edyn::sphere_shape, edyn::cylinder_shape, edyn::capsule_shape, edyn::box_shape, edyn::polyhedron_shape, edyn::compound_shape, edyn::plane_shape, edyn::mesh_shape, edyn::paged_mesh_shape> vs. <edyn::sphere_shape>)
void visit_component([[maybe_unused]] std::tuple<Ts...>, IndexType index, entt::entity entity,
     ^

So from the function call:

visit_component(shapes_tuple, index.value, entity, views_tuple, visitor);

it looks like shapes_tuple and views_tuple have a different number of elements (shapes_tuple has 9, views_tuple has 1), but as both use the Ts... template parameter, they should match.

That's as far as I'm able to look into it, since I don't understand the code.

❯ clang++ -v
Ubuntu clang version 14.0.0-1ubuntu1
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/10
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/11
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/9
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/11
Candidate multilib: .;@m64
Selected multilib: .;@m64

from edyn.

xissburg avatar xissburg commented on May 24, 2024

Yeah looks like your analysis is correct. The number of elements in shapes_tuple and views_tuple is not the same according to this error. I can't see why that'd be the case, since views_tuple is generated from the same shapes_tuple, i.e. it is a transformation from a tuple of shape types into a tuple of EnTT views of these shape types. I am on clang 13 here.

from edyn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.