Plasma Engine  2.0
Loading...
Searching...
No Matches
SurfaceResourceDescriptor.h
1#pragma once
2
3#include <Core/CoreDLL.h>
4
5#include <Core/ResourceManager/Resource.h>
6#include <Foundation/Containers/ArrayMap.h>
7#include <Foundation/Reflection/Reflection.h>
8#include <Foundation/Strings/HashedString.h>
9#include <Foundation/Types/RangeView.h>
10#include <Foundation/Types/Variant.h>
11
14
15
17{
18 using StorageType = plUInt8;
19
20 enum Enum
21 {
22 SurfaceNormal,
23 IncidentDirection,
24 ReflectedDirection,
25 ReverseSurfaceNormal,
26 ReverseIncidentDirection,
27 ReverseReflectedDirection,
28
29 Default = SurfaceNormal
30 };
31};
32
33PL_DECLARE_REFLECTABLE_TYPE(PL_CORE_DLL, plSurfaceInteractionAlignment);
34
35
36struct PL_CORE_DLL plSurfaceInteraction
37{
38 void SetPrefab(const char* szPrefab);
39 const char* GetPrefab() const;
40
41 plString m_sInteractionType;
42
43 plPrefabResourceHandle m_hPrefab;
45 plAngle m_Deviation;
46 float m_fImpulseThreshold = 0.0f;
47 float m_fImpulseScale = 1.0f;
48
49 const plRangeView<const char*, plUInt32> GetParameters() const; // [ property ] (exposed parameter)
50 void SetParameter(const char* szKey, const plVariant& value); // [ property ] (exposed parameter)
51 void RemoveParameter(const char* szKey); // [ property ] (exposed parameter)
52 bool GetParameter(const char* szKey, plVariant& out_value) const; // [ property ] (exposed parameter)
53
55};
56
57PL_DECLARE_REFLECTABLE_TYPE(PL_CORE_DLL, plSurfaceInteraction);
58
60{
61 PL_ADD_DYNAMIC_REFLECTION(plSurfaceResourceDescriptor, plReflectedClass);
62
63public:
64 void Load(plStreamReader& inout_stream);
65 void Save(plStreamWriter& inout_stream) const;
66
67 void SetBaseSurfaceFile(const char* szFile);
68 const char* GetBaseSurfaceFile() const;
69
70 void SetCollisionInteraction(const char* szName);
71 const char* GetCollisionInteraction() const;
72
73 void SetSlideReactionPrefabFile(const char* szFile);
74 const char* GetSlideReactionPrefabFile() const;
75
76 void SetRollReactionPrefabFile(const char* szFile);
77 const char* GetRollReactionPrefabFile() const;
78
79 plSurfaceResourceHandle m_hBaseSurface;
80 float m_fPhysicsRestitution;
81 float m_fPhysicsFrictionStatic;
82 float m_fPhysicsFrictionDynamic;
83 float m_fSoundObstruction;
84 plHashedString m_sOnCollideInteraction;
85 plHashedString m_sSlideInteractionPrefab;
86 plHashedString m_sRollInteractionPrefab;
87 plInt8 m_iGroundType = -1;
88
90};
Float wrapper struct for a safe usage and conversions of angles.
Definition Angle.h:10
See plArrayMapBase for details.
Definition ArrayMap.h:149
This class is optimized to take nearly no memory (sizeof(void*)) and to allow very fast checks whethe...
Definition HashedString.h:25
A hybrid array uses in-place storage to handle the first few elements without any allocation....
Definition HybridArray.h:12
This class uses delegates to define a range of values that can be enumerated using a forward iterator...
Definition RangeView.h:24
All classes that should be dynamically reflectable, need to be derived from this base class.
Definition DynamicRTTI.h:86
Interface for binary in (read) streams.
Definition Stream.h:22
Interface for binary out (write) streams.
Definition Stream.h:107
plVariant is a class that can store different types of variables, which is useful in situations where...
Definition Variant.h:44
A custom enum implementation that allows to define the underlying storage type to control its memory ...
Definition Enum.h:37
Definition SurfaceResourceDescriptor.h:17
Definition SurfaceResourceDescriptor.h:37
Definition SurfaceResourceDescriptor.h:60