0.2.0-dev Download ZIP
35 lines ·862 B Raw
| 1 | // Jolt Physics Library (https://github.com/jrouwe/JoltPhysics) |
| 2 | // SPDX-FileCopyrightText: 2023 Jorrit Rouwe |
| 3 | // SPDX-License-Identifier: MIT |
| 4 | |
| 5 | #include <Jolt/Jolt.h> |
| 6 | |
| 7 | #include <Jolt/Physics/Constraints/SpringSettings.h> |
| 8 | #include <Jolt/ObjectStream/TypeDeclarations.h> |
| 9 | #include <Jolt/Core/StreamIn.h> |
| 10 | #include <Jolt/Core/StreamOut.h> |
| 11 | |
| 12 | JPH_NAMESPACE_BEGIN |
| 13 | |
| 14 | JPH_IMPLEMENT_SERIALIZABLE_NON_VIRTUAL(SpringSettings) |
| 15 | { |
| 16 | JPH_ADD_ENUM_ATTRIBUTE(SpringSettings, mMode) |
| 17 | JPH_ADD_ATTRIBUTE(SpringSettings, mFrequency) |
| 18 | JPH_ADD_ATTRIBUTE(SpringSettings, mDamping) |
| 19 | } |
| 20 | |
| 21 | void SpringSettings::SaveBinaryState(StreamOut &inStream) const |
| 22 | { |
| 23 | inStream.Write(mMode); |
| 24 | inStream.Write(mFrequency); |
| 25 | inStream.Write(mDamping); |
| 26 | } |
| 27 | |
| 28 | void SpringSettings::RestoreBinaryState(StreamIn &inStream) |
| 29 | { |
| 30 | inStream.Read(mMode); |
| 31 | inStream.Read(mFrequency); |
| 32 | inStream.Read(mDamping); |
| 33 | } |
| 34 | |
| 35 | JPH_NAMESPACE_END |