VehicleAntiRollBar.cpp 776 B

1234567891011121314151617181920212223242526272829303132
  1. // SPDX-FileCopyrightText: 2021 Jorrit Rouwe
  2. // SPDX-License-Identifier: MIT
  3. #include <Jolt/Jolt.h>
  4. #include <Jolt/Physics/Vehicle/VehicleAntiRollBar.h>
  5. #include <Jolt/ObjectStream/TypeDeclarations.h>
  6. JPH_NAMESPACE_BEGIN
  7. JPH_IMPLEMENT_SERIALIZABLE_NON_VIRTUAL(VehicleAntiRollBar)
  8. {
  9. JPH_ADD_ATTRIBUTE(VehicleAntiRollBar, mLeftWheel)
  10. JPH_ADD_ATTRIBUTE(VehicleAntiRollBar, mRightWheel)
  11. JPH_ADD_ATTRIBUTE(VehicleAntiRollBar, mStiffness)
  12. }
  13. void VehicleAntiRollBar::SaveBinaryState(StreamOut &inStream) const
  14. {
  15. inStream.Write(mLeftWheel);
  16. inStream.Write(mRightWheel);
  17. inStream.Write(mStiffness);
  18. }
  19. void VehicleAntiRollBar::RestoreBinaryState(StreamIn &inStream)
  20. {
  21. inStream.Read(mLeftWheel);
  22. inStream.Read(mRightWheel);
  23. inStream.Read(mStiffness);
  24. }
  25. JPH_NAMESPACE_END