LEAP Documentation 40220
Documentation for the LEAP project
GameGlobals.h
Go to the documentation of this file.
1// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "Engine/DeveloperSettings.h"
6#include "Runtime/Engine/Classes/Curves/RichCurve.h"
7#include "Runtime/Engine/Classes/Curves/CurveFloat.h"
8
9#include "GameGlobals.generated.h"
10
12
16UCLASS(config=Game, defaultconfig)
17class PROJECTX_API UGameGlobals : public UDeveloperSettings
18{
19 GENERATED_BODY()
20
21public:
22
23 UGameGlobals(const FObjectInitializer& ObjectInitializer);
24
25 FORCEINLINE const FRichCurve* GetAnalogCursorAccelerationCurve() const
26 {
27 return AnalogCursorAccelerationCurve.GetRichCurveConst();
28 }
29
30 FORCEINLINE float GetMaxAnalogCursorSpeed() const
31 {
32 return MaxAnalogCursorSpeed;
33 }
34
35 FORCEINLINE float GetMaxAnalogCursorSpeedWhenHovered() const
36 {
37 return MaxAnalogCursorSpeedWhenHovered;
38 }
39
40 FORCEINLINE float GetAnalogCursorDragCoefficient() const
41 {
42 return FMath::Min<float>(AnalogCursorDragCoefficientWhenHovered, AnalogCursorDragCoefficient);
43 }
44
46 {
47 return FMath::Max<float>(AnalogCursorDragCoefficientWhenHovered, AnalogCursorDragCoefficient);
48 }
49
50 FORCEINLINE float GetMinAnalogCursorSpeed() const
51 {
52 return MinAnalogCursorSpeed;
53 }
54
55 FORCEINLINE float GetAnalogCursorAccelerationMultiplier() const
56 {
57 return AnalogCursorAccelerationMultiplier;
58 }
59
60 FORCEINLINE float GetAnalogCursorDeadZone() const
61 {
62 return AnalogCursorDeadZone;
63 }
64
65 FORCEINLINE float GetAnalogCursorSize() const
66 {
67 return FMath::Max<float>(AnalogCursorSize, 1.0f);
68 }
69
70 FORCEINLINE FVector2D GetAnalogCursorSizeVector() const
71 {
72 return FVector2D(GetAnalogCursorSize(), GetAnalogCursorSize());
73 }
74
75 FORCEINLINE float GetAnalogCursorRadius() const
76 {
77 return GetAnalogCursorSize() / 2.0f;
78 }
79
80 FORCEINLINE bool GetUseEngineAnalogCursor() const
81 {
82 return bUseEngineAnalogCursor;
83 }
84
85 FORCEINLINE bool GetAnalogCursorNoAcceleration() const
86 {
87 return bAnalogCursorNoAcceleration;
88 }
89
90 FORCEINLINE void SetAnalogCursor(TSharedPtr<FGameAnalogCursor> InAnalogCursor)
91 {
92 AnalogCursor = InAnalogCursor;
93 }
94
95 FORCEINLINE TSharedPtr<FGameAnalogCursor> GetAnalogCursor() const
96 {
97 return AnalogCursor.Pin();
98 }
99
100private:
101 UPROPERTY(config, EditAnywhere, Category = "Analog Cursor", meta=(
102 XAxisName="Strength",
103 YAxisName="Acceleration" ))
104 FRuntimeFloatCurve AnalogCursorAccelerationCurve;
105
107 UPROPERTY(config, EditAnywhere, Category = "Analog Cursor", meta = (ClampMin = "1.0"))
108 float MaxAnalogCursorSpeed;
109
111 UPROPERTY(config, EditAnywhere, Category = "Analog Cursor", meta = (ClampMin = "1.0"))
112 float MaxAnalogCursorSpeedWhenHovered;
113
115 UPROPERTY(config, EditAnywhere, Category = "Analog Cursor", meta = (ClampMin = "0.0"))
116 float AnalogCursorDragCoefficient;
117
119 UPROPERTY(config, EditAnywhere, Category = "Analog Cursor", meta = (ClampMin = "0.0"))
120 float AnalogCursorDragCoefficientWhenHovered;
121
123 UPROPERTY(config, EditAnywhere, Category = "Analog Cursor", meta = (ClampMin = "0.0"))
124 float MinAnalogCursorSpeed;
125
127 UPROPERTY(config, EditAnywhere, Category = "Analog Cursor", meta = (ClampMin = "0.0", ClampMax = "1.0"))
128 float AnalogCursorDeadZone;
129
131 UPROPERTY(config, EditAnywhere, Category = "Analog Cursor", meta = (ClampMin = "1.0"))
132 float AnalogCursorAccelerationMultiplier;
133
135 UPROPERTY(config, EditAnywhere, Category = "Analog Cursor", meta = (ClampMin = "1.0", ClampMax = "128.0"))
136 float AnalogCursorSize;
137
139 UPROPERTY(config, EditAnywhere, Category = "Analog Cursor")
140 bool bUseEngineAnalogCursor;
141
143 UPROPERTY(config, EditAnywhere, Category = "Analog Cursor")
144 bool bAnalogCursorNoAcceleration;
145
146 // Analog Cursor
148};
Definition: GameAnalogCursor.h:10
static TSharedPtr< FGameAnalogCursor > AnalogCursor
Definition: GameAnalogCursor.h:20
Definition: GameGlobals.h:18
FORCEINLINE bool GetAnalogCursorNoAcceleration() const
Definition: GameGlobals.h:85
FORCEINLINE float GetAnalogCursorSize() const
Definition: GameGlobals.h:65
FORCEINLINE float GetAnalogCursorDragCoefficient() const
Definition: GameGlobals.h:40
FORCEINLINE float GetAnalogCursorDeadZone() const
Definition: GameGlobals.h:60
FORCEINLINE float GetMaxAnalogCursorSpeedWhenHovered() const
Definition: GameGlobals.h:35
FORCEINLINE float GetMaxAnalogCursorSpeed() const
Definition: GameGlobals.h:30
FORCEINLINE void SetAnalogCursor(TSharedPtr< FGameAnalogCursor > InAnalogCursor)
Definition: GameGlobals.h:90
FORCEINLINE const FRichCurve * GetAnalogCursorAccelerationCurve() const
Definition: GameGlobals.h:25
FORCEINLINE float GetAnalogCursorAccelerationMultiplier() const
Definition: GameGlobals.h:55
FORCEINLINE TSharedPtr< FGameAnalogCursor > GetAnalogCursor() const
Definition: GameGlobals.h:95
FORCEINLINE FVector2D GetAnalogCursorSizeVector() const
Definition: GameGlobals.h:70
FORCEINLINE float GetMinAnalogCursorSpeed() const
Definition: GameGlobals.h:50
FORCEINLINE float GetAnalogCursorRadius() const
Definition: GameGlobals.h:75
FORCEINLINE bool GetUseEngineAnalogCursor() const
Definition: GameGlobals.h:80
FORCEINLINE float GetAnalogCursorDragCoefficientWhenHovered() const
Definition: GameGlobals.h:45