Jolt Physics
A multi core friendly Game Physics Engine
Loading...
Searching...
No Matches
PhysicsMaterial.h
Go to the documentation of this file.
1// Jolt Physics Library (https://github.com/jrouwe/JoltPhysics)
2// SPDX-FileCopyrightText: 2021 Jorrit Rouwe
3// SPDX-License-Identifier: MIT
4
5#pragma once
6
8#include <Jolt/Core/Color.h>
9#include <Jolt/Core/Result.h>
11
13
14class StreamIn;
15class StreamOut;
16
22class JPH_EXPORT PhysicsMaterial : public SerializableObject, public RefTarget<PhysicsMaterial>
23{
25
26public:
28 virtual ~PhysicsMaterial() override = default;
29
32
33 // Properties
34 virtual const char * GetDebugName() const { return "Unknown"; }
35 virtual Color GetDebugColor() const { return Color::sGrey; }
36
38 virtual void SaveBinaryState(StreamOut &inStream) const;
39
41
43 static PhysicsMaterialResult sRestoreFromBinaryState(StreamIn &inStream);
44
45protected:
47 virtual void RestoreBinaryState(StreamIn &inStream);
48};
49
51
#define JPH_EXPORT
Definition Core.h:271
#define JPH_NAMESPACE_END
Definition Core.h:414
#define JPH_NAMESPACE_BEGIN
Definition Core.h:408
#define JPH_DECLARE_SERIALIZABLE_VIRTUAL(linkage, class_name)
Definition SerializableObject.h:109
Class that holds an RGBA color with 8-bits per component.
Definition Color.h:16
static const Color sGrey
Definition Color.h:65
Definition PhysicsMaterial.h:23
virtual const char * GetDebugName() const
Definition PhysicsMaterial.h:34
static RefConst< PhysicsMaterial > sDefault
Default material that is used when a shape has no materials defined.
Definition PhysicsMaterial.h:31
virtual Color GetDebugColor() const
Definition PhysicsMaterial.h:35
virtual ~PhysicsMaterial() override=default
Virtual destructor.
Definition Reference.h:163
Definition Reference.h:35
Helper class that either contains a valid result or an error.
Definition Result.h:12
Definition SerializableObject.h:156
Simple binary input stream.
Definition StreamIn.h:13
Simple binary output stream.
Definition StreamOut.h:13