2
0

JointUtils.cpp 1.1 KB

1234567891011121314151617181920212223242526272829
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #include "JointUtils.h"
  9. #include <Source/EditorArticulationLinkComponent.h>
  10. #include <Source/EditorBallJointComponent.h>
  11. #include <Source/EditorHingeJointComponent.h>
  12. #include <Source/EditorPrismaticJointComponent.h>
  13. namespace ROS2Controllers::JointUtils
  14. {
  15. bool HasNonFixedJoints(const AZ::Entity* entity)
  16. {
  17. const auto* prismaticJoint = entity->FindComponent<PhysX::EditorPrismaticJointComponent>();
  18. const auto* ballJoint = entity->FindComponent<PhysX::EditorBallJointComponent>();
  19. const auto* hingeJoint = entity->FindComponent<PhysX::EditorHingeJointComponent>();
  20. const auto* articulation = entity->FindComponent<PhysX::EditorArticulationLinkComponent>();
  21. const bool hasJoints = prismaticJoint || ballJoint || hingeJoint || articulation;
  22. return hasJoints;
  23. }
  24. } // namespace ROS2Controllers::JointUtils