VehicleDifferential.h 1.2 KB

123456789101112131415161718192021222324252627282930
  1. // SPDX-FileCopyrightText: 2021 Jorrit Rouwe
  2. // SPDX-License-Identifier: MIT
  3. #pragma once
  4. #include <ObjectStream/SerializableObject.h>
  5. #include <Core/StreamIn.h>
  6. #include <Core/StreamOut.h>
  7. namespace JPH {
  8. class VehicleDifferentialSettings
  9. {
  10. public:
  11. JPH_DECLARE_SERIALIZABLE_NON_VIRTUAL(VehicleDifferentialSettings)
  12. /// Saves the contents in binary form to inStream.
  13. void SaveBinaryState(StreamOut &inStream) const;
  14. /// Restores the contents in binary form to inStream.
  15. void RestoreBinaryState(StreamIn &inStream);
  16. int mLeftWheel = -1; ///< Index (in mWheels) that represents the left wheel of this differential (can be -1 to indicate no wheel)
  17. int mRightWheel = -1; ///< Index (in mWheels) that represents the right wheel of this differential (can be -1 to indicate no wheel)
  18. float mDifferentialRatio = 3.42f; ///< Ratio between rotation speed of gear box and wheels
  19. float mLeftRightSplit = 0.5f; ///< Defines how the engine torque is split across the left and right wheel (0 = left, 0.5 = center, 1 = right)
  20. float mEngineTorqueRatio = 1.0f; ///< How much of the engines torque is applied to this differential (0 = none, 1 = full), make sure the sum of all differentials is 1.
  21. };
  22. } // JPH