Unreal SDK  v1.2.0
Loading...
Searching...
No Matches
WeArtHapticObject.h
Go to the documentation of this file.
1#pragma once
2
3#include "CoreMinimal.h"
4#include "Components/ActorComponent.h"
5#include "WeArtCommon.h"
6#include "WeArtEffect.h"
7#include "WeArtMessages.h"
8#include <vector>
9
10// Included cause of a bug in UnrealHeaderTool.
11// Those are already included in WeArtEffect.h,
12// but need to be included there as well.
13#include "WeArtTemperature.h"
14#include "WeArtForce.h"
15#include "WeArtTexture.h"
16
18
19// A haptic object class, representing player-controller objects able to interact
20// with objects of the @TouchableObject class.
21//
22// The communication with the lower layers is triggered by adding and removing effects
23// (see @AddEffect() and @RemoveEffect()), which subsequently triggers an @UpdateEffects() event.
24//
25// Such event then sends foward (to, presumably, the middleware)
26// messages representing the processed events
27UCLASS(ClassGroup = (Custom), Blueprintable, meta = (BlueprintSpawnableComponent))
28class WEARTPLUGIN_API UWeArtHapticObject : public UActorComponent
29{
30 GENERATED_BODY()
31
32public:
33 // Sets default values for this component's properties
34 UWeArtHapticObject();
35
36protected:
37
38 // Hand/finger state variables
39 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = WeArtHapticObject, meta = (Bitmask, BitmaskEnum = EHandSide))
40 int32 handSideFlag;
41
42 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = WeArtHapticObject, meta = (Bitmask, BitmaskEnum = EActuationPoint))
43 int32 actuationPointFlag;
44
45 // State variables. Serialized.
46 UPROPERTY(EditAnywhere, Meta = (DisplayName = "Temperature"))
47 FWeArtTemperature weArtTemperature;
48 UPROPERTY(EditAnywhere, Meta = (DisplayName = "Force"))
49 FWeArtForce weArtForce;
50 UPROPERTY(EditAnywhere, Meta = (DisplayName = "Texture"))
51 FWeArtTexture weArtTexture;
52
53 // List of effect active on this object
54 // Not serialized.
55 std::vector<WeArtEffect*> activeEffects;
56
57
58public:
60 void AddEffect(WeArtEffect* effect);
62 void RemoveEffect(WeArtEffect* effect);
64 void RemoveLastEffect();
66 void ClearEffects();
68 bool ContainsEffect(WeArtEffect* effect);
70 void UpdateEffects(void);
72 void SendMessage(WeArtMessage* msg);
74 UPROPERTY(BlueprintReadWrite)
75 bool Touched;
76};
#define WEARTPLUGIN_API
Definition: Definitions.WEARTPlugin.h:292
EHandSide
Definition: WeArtCommon.h:8
A general effect function interface.
Definition: WeArtEffect.h:11
Generic Weart message.
Definition: WeArtMessages.h:178
Definition: json.hpp:5292
Force value to be applied to an effect.
Definition: WeArtForce.h:11
Temperature value to be applied to an effect.
Definition: WeArtTemperature.h:11
Texture information to be applied to an effect.
Definition: WeArtTexture.h:11