| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
#pragma once |
| 6 |
|
| 7 |
#include <Jolt/Core/Reference.h> |
| 8 |
#include <Jolt/Core/Color.h> |
| 9 |
#include <Jolt/Core/Result.h> |
| 10 |
#include <Jolt/ObjectStream/SerializableObject.h> |
| 11 |
|
| 12 |
JPH_NAMESPACE_BEGIN |
| 13 |
|
| 14 |
class StreamIn; |
| 15 |
class StreamOut; |
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
class JPH_EXPORT PhysicsMaterial : public SerializableObject, public RefTarget<PhysicsMaterial> |
| 23 |
{ |
| 24 |
JPH_DECLARE_SERIALIZABLE_VIRTUAL(JPH_EXPORT, PhysicsMaterial) |
| 25 |
|
| 26 |
public: |
| 27 |
|
| 28 |
PhysicsMaterial() = default; |
| 29 |
virtual ~PhysicsMaterial() override = default; |
| 30 |
|
| 31 |
|
| 32 |
static RefConst<PhysicsMaterial> sDefault; |
| 33 |
|
| 34 |
|
| 35 |
virtual const char * GetDebugName() const { return "Unknown"; } |
| 36 |
virtual Color GetDebugColor() const { return Color::sGrey; } |
| 37 |
|
| 38 |
|
| 39 |
virtual void SaveBinaryState(StreamOut &inStream) const; |
| 40 |
|
| 41 |
using PhysicsMaterialResult = Result<Ref<PhysicsMaterial>>; |
| 42 |
|
| 43 |
|
| 44 |
static PhysicsMaterialResult sRestoreFromBinaryState(StreamIn &inStream); |
| 45 |
|
| 46 |
protected: |
| 47 |
|
| 48 |
PhysicsMaterial(const PhysicsMaterial &) = default; |
| 49 |
PhysicsMaterial & operator = (const PhysicsMaterial &) = default; |
| 50 |
|
| 51 |
|
| 52 |
virtual void RestoreBinaryState(StreamIn &inStream); |
| 53 |
}; |
| 54 |
|
| 55 |
using PhysicsMaterialList = Array<RefConst<PhysicsMaterial>>; |
| 56 |
|
| 57 |
JPH_NAMESPACE_END |