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{
24public:
26
27
28 virtual ~PhysicsMaterial() override = default;
29
31 static RefConst<PhysicsMaterial> sDefault;
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:227
#define JPH_NAMESPACE_END
Definition: Core.h:367
#define JPH_NAMESPACE_BEGIN
Definition: Core.h:361
Array< RefConst< PhysicsMaterial > > PhysicsMaterialList
Definition: PhysicsMaterial.h:50
std::vector< T, STLAllocator< T > > Array
Definition: STLAllocator.h:81
#define JPH_DECLARE_SERIALIZABLE_VIRTUAL(linkage, class_name)
Definition: SerializableObject.h:100
Class that holds an RGBA color with 8-bits per component.
Definition: Color.h:16
static const Color sGrey
Definition: Color.h:62
Definition: PhysicsMaterial.h:23
virtual Color GetDebugColor() const
Definition: PhysicsMaterial.h:35
Definition: Reference.h:151
Definition: Reference.h:35
Helper class that either contains a valid result or an error.
Definition: Result.h:15
Definition: SerializableObject.h:147
Simple binary input stream.
Definition: StreamIn.h:13
Simple binary output stream.
Definition: StreamOut.h:13