WheelDynamicsData.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637
  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. #pragma once
  9. #include <AzCore/Component/ComponentBus.h>
  10. #include <AzCore/Component/EntityId.h>
  11. #include <PhysX/ArticulationTypes.h>
  12. namespace ROS2Controllers::VehicleDynamics
  13. {
  14. //! Data structure to pass wheel dynamics data for a single wheel entity.
  15. struct WheelDynamicsData
  16. {
  17. AZ::EntityId m_wheelEntity; //!< An entity which is expected to have a WheelControllerComponent.
  18. AZ::ComponentId m_wheelJoint{ AZ::InvalidComponentId }; //!< Joint responsible for the wheel.
  19. float m_wheelRadius{ 0.25f }; //!< Radius of the wheel in meters.
  20. bool m_isArticulation{ false }; //!< Whether the wheel is an articulation link or a classic joint.
  21. PhysX::ArticulationJointAxis m_axis =
  22. PhysX::ArticulationJointAxis::Twist; //!< The movement axis, in case the joint is an articulation.
  23. };
  24. //! Data structure to pass steering dynamics data for a single steering entity.
  25. struct SteeringDynamicsData
  26. {
  27. AZ::EntityId m_steeringEntity; //!< Steering entity needs to be connected (directly or indirectly) by a Joint with a wheelEntity.
  28. AZ::ComponentId m_steeringJoint{ AZ::InvalidComponentId }; //!< Joint responsible for steering.
  29. float m_steeringScale{ 1.0f }; //!< Scale for direction for the steering element to turn the attached wheel sideways.
  30. bool m_isArticulation{ false }; //!< Whether the steering is an articulation link or a classic joint.
  31. PhysX::ArticulationJointAxis m_axis =
  32. PhysX::ArticulationJointAxis::Twist; //!< The movement axis, in case the joint is an articulation.
  33. };
  34. } // namespace ROS2Controllers::VehicleDynamics