Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
godotengine
GitHub Repository: godotengine/godot
Path: blob/master/thirdparty/jolt_physics/Jolt/Physics/Vehicle/VehicleAntiRollBar.cpp
9913 views
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
10
JPH_NAMESPACE_BEGIN
11
12
JPH_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
19
void VehicleAntiRollBar::SaveBinaryState(StreamOut &inStream) const
20
{
21
inStream.Write(mLeftWheel);
22
inStream.Write(mRightWheel);
23
inStream.Write(mStiffness);
24
}
25
26
void VehicleAntiRollBar::RestoreBinaryState(StreamIn &inStream)
27
{
28
inStream.Read(mLeftWheel);
29
inStream.Read(mRightWheel);
30
inStream.Read(mStiffness);
31
}
32
33
JPH_NAMESPACE_END
34
35