Skip to content
0.2.0-dev Download ZIP
33 lines ·840 B Raw
1// Jolt Physics Library (https://github.com/jrouwe/JoltPhysics)
2// SPDX-FileCopyrightText: 2021 Jorrit Rouwe
3// SPDX-License-Identifier: MIT
4
5#include <Jolt/Jolt.h>
6
7#include <Jolt/Physics/Vehicle/VehicleAntiRollBar.h>
8#include <Jolt/ObjectStream/TypeDeclarations.h>
9
10JPH_NAMESPACE_BEGIN
11
12JPH_IMPLEMENT_SERIALIZABLE_NON_VIRTUAL(VehicleAntiRollBar)
13{
14 JPH_ADD_ATTRIBUTE(VehicleAntiRollBar, mLeftWheel)
15 JPH_ADD_ATTRIBUTE(VehicleAntiRollBar, mRightWheel)
16 JPH_ADD_ATTRIBUTE(VehicleAntiRollBar, mStiffness)
17}
18
19void VehicleAntiRollBar::SaveBinaryState(StreamOut &inStream) const
20{
21 inStream.Write(mLeftWheel);
22 inStream.Write(mRightWheel);
23 inStream.Write(mStiffness);
24}
25
26void VehicleAntiRollBar::RestoreBinaryState(StreamIn &inStream)
27{
28 inStream.Read(mLeftWheel);
29 inStream.Read(mRightWheel);
30 inStream.Read(mStiffness);
31}
32
33JPH_NAMESPACE_END