I3DHDrawing.h Source File

instant3Dhub: I3DHDrawing.h Source File
instant3Dhub
I3DHDrawing.h
Go to the documentation of this file.
1
6#pragma once
7
8#include "CoreMinimal.h"
9
10#include "GameFramework/Actor.h"
11
12#include "I3DHDrawing.generated.h"
13
18UCLASS(NotPlaceable, MinimalAPI)
19class AI3DHDrawing : public AActor
20{
21 GENERATED_BODY()
22
23public:
24 // ----------------------------------------------------------
25 // AI3DHDrawing API
26 // ----------------------------------------------------------
27 INSTANT3DHUB_API AI3DHDrawing();
28
33 FORCEINLINE int GetDrawingHandle() const { return DrawingHandle; }
34
35 INSTANT3DHUB_API void SetHubConnector(class AI3DHConnector* InHubConnector);
36
41 FORCEINLINE class AI3DHConnector* GetHubConnector() const { return Connector.Get(); }
42
44 UFUNCTION(BlueprintCallable, Category = "{instant3Dhub}|Drawing")
45 INSTANT3DHUB_API virtual void OnHoverStart();
46
48 UFUNCTION(BlueprintCallable, Category = "{instant3Dhub}|Drawing")
49 INSTANT3DHUB_API virtual void OnHoverEnd();
50
56 INSTANT3DHUB_API virtual UMaterialInterface* GetHoveredMaterial(const FLinearColor& DrawingColor) const { return nullptr; };
57
63 INSTANT3DHUB_API void SetDrawingVisibilityOverride(const bool bIsVisible);
65 INSTANT3DHUB_API void ClearDrawingVisibilityOverride();
66
67public:
68 // Call once after spawning. Creates the components to render the passed in DrawingResult.
69 void BuildFromDrawingResult(class AI3DHConnector* Connector, class FI3DHDrawingAPI* DrawingAPI, const struct FI3DHDrawingResult& DrawingResult);
70 void SetDrawingHandle(int InDrawingHandle);
71 void ApplyDrawingProperties(const struct FI3DHDrawingProperties& Properties);
72
73private:
74 // Called when the async build of a body setup is finished.
75 void FinishPhysicsAsyncCook(bool bSuccess, class UBodySetup* FinishedBodySetup);
76 void ApplyDrawingVisibility();
77
78 void ResetMeshComponentsMaterial() const;
79
80public:
82 UPROPERTY(Category = "{instant3Dhub}|Drawing", EditDefaultsOnly, BlueprintReadWrite)
83 uint8 bCreateDrawingCollisions : 1;
84
85private:
86 uint8 bIsDrawingEnabled : 1;
87 uint8 bIsHovered : 1;
88
89 TOptional<bool> bDrawingVisibilityOverride;
90
91private:
92 TWeakObjectPtr<class AI3DHConnector> Connector;
93
94 UPROPERTY(Category = "{instant3Dhub}|Drawing", VisibleAnywhere)
95 int DrawingHandle { INDEX_NONE };
96
97 UPROPERTY(Transient)
98 TMap<class UBodySetup*, UStaticMeshComponent*> AsyncCookBodySetupToMeshComponent;
99
100 UPROPERTY(Transient)
101 TArray<UStaticMeshComponent*> DrawingMeshes;
102
103 TArray<FLinearColor> DrawingColors;
104};
The HubConnector is the central actor for communication with an instant3Dhub instance in your network...
Definition I3DHConnector.h:98
This actor is the scene representation of drawings in the session.
Definition I3DHDrawing.h:20
class AI3DHConnector * GetHubConnector() const
Gets hub connector that's connected to the instant3Dhub session this drawing belongs to.
Definition I3DHDrawing.h:41
int GetDrawingHandle() const
Gets instant3Dhub Drawing Handle of this Drawing Actor.
Definition I3DHDrawing.h:33