VehicleAntiRollBar.cpp 840 B

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