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

LogicalCamera plugin to detect nested models #2786

Closed
Dyst-0 opened this issue Feb 19, 2025 · 1 comment · Fixed by #2788
Closed

LogicalCamera plugin to detect nested models #2786

Dyst-0 opened this issue Feb 19, 2025 · 1 comment · Fixed by #2788
Labels
enhancement New feature or request

Comments

@Dyst-0
Copy link
Contributor

Dyst-0 commented Feb 19, 2025

Desired behavior

Logical camera to detect nested models. Currently, it only detects top level models

Alternatives considered

Implementation suggestion

Change from

_ecm.Each<components::Model, components::Name, components::Pose>(
      [&](const Entity &,
        const components::Model *,
        const components::Name *_name,
        const components::Pose *_pose)->bool
      {
        /// todo(anyone) We currently assume there are only top level models
        /// Update to retrieve world pose when nested models are supported.
        modelPoses[_name->Data()] = _pose->Data();
        return true;
      });

to

_ecm.Each<components::Model, components::Name, components::Pose>(
    [&](const Entity &_entity,
      const components::Model *,
      const components::Name *_name,
      const components::Pose *)->bool
    {
      math::Pose3d modelWorldPose = worldPose(_entity, _ecm);
      modelPoses[_name->Data()] = modelWorldPose;
      return true;
    });

in LogicalCamera.cc

Additional context

@Dyst-0 Dyst-0 added the enhancement New feature or request label Feb 19, 2025
@iche033
Copy link
Contributor

iche033 commented Feb 19, 2025

the fix makes sense, I think we can also remove the pose component in the Each call:

_ecm.Each<components::Model, components::Name>(
    [&](const Entity &_entity,
      const components::Model *,
      const components::Name *_name)->bool
    {
      math::Pose3d modelWorldPose = worldPose(_entity, _ecm);
      modelPoses[_name->Data()] = modelWorldPose;
      return true;
    });

do you want to create a pull request for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants