0.2.0-dev Download ZIP
35 lines ·949 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/Collision/PhysicsMaterial.h> |
| 8 | #include <Jolt/Physics/Collision/PhysicsMaterialSimple.h> |
| 9 | #include <Jolt/Core/StreamUtils.h> |
| 10 | |
| 11 | JPH_NAMESPACE_BEGIN |
| 12 | |
| 13 | RefConst<PhysicsMaterial> PhysicsMaterial::sDefault; |
| 14 | |
| 15 | JPH_IMPLEMENT_SERIALIZABLE_VIRTUAL(PhysicsMaterial) |
| 16 | { |
| 17 | JPH_ADD_BASE_CLASS(PhysicsMaterial, SerializableObject) |
| 18 | } |
| 19 | |
| 20 | void PhysicsMaterial::SaveBinaryState(StreamOut &inStream) const |
| 21 | { |
| 22 | inStream.Write(GetRTTI()->GetHash()); |
| 23 | } |
| 24 | |
| 25 | void PhysicsMaterial::RestoreBinaryState(StreamIn &inStream) |
| 26 | { |
| 27 | // RTTI hash is read in sRestoreFromBinaryState |
| 28 | } |
| 29 | |
| 30 | PhysicsMaterial::PhysicsMaterialResult PhysicsMaterial::sRestoreFromBinaryState(StreamIn &inStream) |
| 31 | { |
| 32 | return StreamUtils::RestoreObject<PhysicsMaterial>(inStream, &PhysicsMaterial::RestoreBinaryState); |
| 33 | } |
| 34 | |
| 35 | JPH_NAMESPACE_END |