| 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/Collision/PhysicsMaterialSimple.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_VIRTUAL(PhysicsMaterialSimple) |
| 15 | { |
| 16 | JPH_ADD_BASE_CLASS(PhysicsMaterialSimple, PhysicsMaterial) |
| 17 | |
| 18 | JPH_ADD_ATTRIBUTE(PhysicsMaterialSimple, mDebugName) |
| 19 | JPH_ADD_ATTRIBUTE(PhysicsMaterialSimple, mDebugColor) |
| 20 | } |
| 21 | |
| 22 | void PhysicsMaterialSimple::SaveBinaryState(StreamOut &inStream) const |
| 23 | { |
| 24 | PhysicsMaterial::SaveBinaryState(inStream); |
| 25 | |
| 26 | inStream.Write(mDebugName); |
| 27 | inStream.Write(mDebugColor); |
| 28 | } |
| 29 | |
| 30 | void PhysicsMaterialSimple::RestoreBinaryState(StreamIn &inStream) |
| 31 | { |
| 32 | PhysicsMaterial::RestoreBinaryState(inStream); |
| 33 | |
| 34 | inStream.Read(mDebugName); |
| 35 | inStream.Read(mDebugColor); |
| 36 | } |
| 37 | |
| 38 | JPH_NAMESPACE_END |