RuntimeMeshBlueprintMeshBuilder.h
Go to the documentation of this file.
1 // Copyright 2016-2018 Chris Conway (Koderz). All Rights Reserved.
2 
3 #pragma once
4 
5 #include "CoreMinimal.h"
6 #include "RuntimeMeshCore.h"
7 #include "RuntimeMeshBuilder.h"
8 #include "RuntimeMeshBlueprintMeshBuilder.generated.h"
9 
13 UCLASS(BlueprintType, Abstract)
14 class RUNTIMEMESHCOMPONENT_API URuntimeBlueprintMeshAccessor : public UObject
15 {
16  GENERATED_BODY()
17 
18 protected:
19 
20  TSharedPtr<FRuntimeMeshAccessor> MeshAccessor;
21 
22 public:
23 
24 
25 
27 };
28 
29 UCLASS(BlueprintType)
30 class RUNTIMEMESHCOMPONENT_API URuntimeBlueprintMeshBuilder : public URuntimeBlueprintMeshAccessor
31 {
32  GENERATED_BODY()
33 
34  TSharedPtr<FRuntimeMeshBuilder> MeshBuilder;
36 
37 public:
38  TSharedPtr<FRuntimeMeshBuilder> GetMeshBuilder() { return MeshBuilder; }
39 
40 
41  UFUNCTION(BlueprintCallable, Category = "Components|RuntimeMeshBuilder")
42  bool IsUsingHighPrecisionTangents(URuntimeBlueprintMeshBuilder*& OutMeshBuilder)
43  {
44  OutMeshBuilder = this;
45  return MeshAccessor->IsUsingHighPrecisionTangents();
46  }
47  UFUNCTION(BlueprintCallable, Category = "Components|RuntimeMeshBuilder")
48  bool IsUsingHighPrecisionUVs(URuntimeBlueprintMeshBuilder*& OutMeshBuilder)
49  {
50  OutMeshBuilder = this;
51  return MeshAccessor->IsUsingHighPrecisionUVs();
52  }
53  UFUNCTION(BlueprintCallable, Category = "Components|RuntimeMeshBuilder")
54  bool IsUsing32BitIndices(URuntimeBlueprintMeshBuilder*& OutMeshBuilder)
55  {
56  OutMeshBuilder = this;
57  return MeshAccessor->IsUsing32BitIndices();
58  }
59 
60  UFUNCTION(BlueprintCallable, Category = "Components|RuntimeMeshBuilder")
61  bool IsReadonly(URuntimeBlueprintMeshBuilder*& OutMeshBuilder)
62  {
63  OutMeshBuilder = this;
64  return MeshAccessor->IsReadonly();
65  }
66 
67  UFUNCTION(BlueprintCallable, Category = "Components|RuntimeMeshBuilder")
68  int32 NumVertices(URuntimeBlueprintMeshBuilder*& OutMeshBuilder)
69  {
70  OutMeshBuilder = this;
71  return MeshAccessor->NumVertices();
72  }
73  UFUNCTION(BlueprintCallable, Category = "Components|RuntimeMeshBuilder")
74  int32 NumUVChannels(URuntimeBlueprintMeshBuilder*& OutMeshBuilder)
75  {
76  OutMeshBuilder = this;
77  return MeshAccessor->NumUVChannels();
78  }
79  UFUNCTION(BlueprintCallable, Category = "Components|RuntimeMeshBuilder")
80  int32 NumIndices(URuntimeBlueprintMeshBuilder*& OutMeshBuilder)
81  {
82  OutMeshBuilder = this;
83  return MeshAccessor->NumIndices();
84  }
85 
86  UFUNCTION(BlueprintCallable, Category = "Components|RuntimeMeshBuilder")
87  void EmptyVertices(URuntimeBlueprintMeshBuilder*& OutMeshBuilder, int32 Slack = 0)
88  {
89  OutMeshBuilder = this;
90  MeshAccessor->EmptyVertices(Slack);
91  }
92  UFUNCTION(BlueprintCallable, Category = "Components|RuntimeMeshBuilder")
93  void SetNumVertices(URuntimeBlueprintMeshBuilder*& OutMeshBuilder, int32 NewNum)
94  {
95  OutMeshBuilder = this;
96  MeshAccessor->SetNumVertices(NewNum);
97  }
98  UFUNCTION(BlueprintCallable, Category = "Components|RuntimeMeshBuilder")
99  void EmptyIndices(URuntimeBlueprintMeshBuilder*& OutMeshBuilder, int32 Slack = 0)
100  {
101  OutMeshBuilder = this;
102  MeshAccessor->EmptyIndices(Slack);
103  }
104  UFUNCTION(BlueprintCallable, Category = "Components|RuntimeMeshBuilder")
105  void SetNumIndices(URuntimeBlueprintMeshBuilder*& OutMeshBuilder, int32 NewNum)
106  {
107  OutMeshBuilder = this;
108  MeshAccessor->SetNumIndices(NewNum);
109  }
110 
111  UFUNCTION(BlueprintCallable, Category = "Components|RuntimeMeshBuilder")
112  int32 AddVertex(URuntimeBlueprintMeshBuilder*& OutMeshBuilder, FVector InPosition, FVector Normal, FRuntimeMeshTangent Tangent, FVector2D UV0, FLinearColor Color)
113  {
114  OutMeshBuilder = this;
115  int32 Index = MeshAccessor->AddVertex(InPosition);
116  MeshAccessor->SetNormalTangent(Index, Normal, Tangent);
117  MeshAccessor->SetUV(Index, UV0);
118  MeshAccessor->SetColor(Index, Color.ToFColor(false));
119  return Index;
120  }
121 
122  UFUNCTION(BlueprintCallable, Category = "Components|RuntimeMeshBuilder")
123  FVector GetPosition(URuntimeBlueprintMeshBuilder*& OutMeshBuilder, int32 Index)
124  {
125  OutMeshBuilder = this;
126  return MeshAccessor->GetPosition(Index);
127  }
128  UFUNCTION(BlueprintCallable, Category = "Components|RuntimeMeshBuilder")
129  FVector4 GetNormal(URuntimeBlueprintMeshBuilder*& OutMeshBuilder, int32 Index)
130  {
131  OutMeshBuilder = this;
132  return MeshAccessor->GetNormal(Index);
133  }
134  UFUNCTION(BlueprintCallable, Category = "Components|RuntimeMeshBuilder")
135  FVector GetTangent(URuntimeBlueprintMeshBuilder*& OutMeshBuilder, int32 Index)
136  {
137  OutMeshBuilder = this;
138  return MeshAccessor->GetTangent(Index);
139  }
140  UFUNCTION(BlueprintCallable, Category = "Components|RuntimeMeshBuilder")
141  FLinearColor GetColor(URuntimeBlueprintMeshBuilder*& OutMeshBuilder, int32 Index)
142  {
143  OutMeshBuilder = this;
144  return FLinearColor(MeshAccessor->GetColor(Index));
145  }
146  UFUNCTION(BlueprintCallable, Category = "Components|RuntimeMeshBuilder")
147  FVector2D GetUV(URuntimeBlueprintMeshBuilder*& OutMeshBuilder, int32 Index, int32 Channel = 0)
148  {
149  OutMeshBuilder = this;
150  return MeshAccessor->GetUV(Index, Channel);
151  }
152 
153  UFUNCTION(BlueprintCallable, Category = "Components|RuntimeMeshBuilder")
154  int32 SetVertex(URuntimeBlueprintMeshBuilder*& OutMeshBuilder, int32 Index, FVector InPosition, FVector Normal, FRuntimeMeshTangent Tangent, FVector2D UV0, FLinearColor Color)
155  {
156  OutMeshBuilder = this;
157  MeshAccessor->SetPosition(Index, InPosition);
158  MeshAccessor->SetNormalTangent(Index, Normal, Tangent);
159  MeshAccessor->SetUV(Index, UV0);
160  MeshAccessor->SetColor(Index, Color.ToFColor(false));
161  return Index;
162  }
163 
164 
165  UFUNCTION(BlueprintCallable, Category = "Components|RuntimeMeshBuilder")
166  int32 SetPosition(URuntimeBlueprintMeshBuilder*& OutMeshBuilder, int32 Index, FVector Value)
167  {
168  OutMeshBuilder = this;
169  MeshAccessor->SetPosition(Index, Value);
170  return Index;
171  }
172  UFUNCTION(BlueprintCallable, Category = "Components|RuntimeMeshBuilder")
173  int32 SetNormal(URuntimeBlueprintMeshBuilder*& OutMeshBuilder, int32 Index, const FVector4& Value)
174  {
175  OutMeshBuilder = this;
176  MeshAccessor->SetNormal(Index, Value);
177  return Index;
178  }
179 
180  UFUNCTION(BlueprintCallable, Category = "Components|RuntimeMeshBuilder")
181  int32 SetTangent(URuntimeBlueprintMeshBuilder*& OutMeshBuilder, int32 Index, FRuntimeMeshTangent Value)
182  {
183  OutMeshBuilder = this;
184  MeshAccessor->SetTangent(Index, Value);
185  return Index;
186  }
187  UFUNCTION(BlueprintCallable, Category = "Components|RuntimeMeshBuilder")
188  int32 SetColor(URuntimeBlueprintMeshBuilder*& OutMeshBuilder, int32 Index, FLinearColor Value)
189  {
190  OutMeshBuilder = this;
191  MeshAccessor->SetColor(Index, Value.ToFColor(false));
192  return Index;
193  }
194  UFUNCTION(BlueprintCallable, Category = "Components|RuntimeMeshBuilder")
195  int32 SetUV(URuntimeBlueprintMeshBuilder*& OutMeshBuilder, int32 Index, FVector2D Value, int32 Channel = 0)
196  {
197  OutMeshBuilder = this;
198  MeshAccessor->SetUV(Index, Channel, Value);
199  return Index;
200  }
201 
202  UFUNCTION(BlueprintCallable, Category = "Components|RuntimeMeshBuilder")
203  int32 SetNormalTangent(URuntimeBlueprintMeshBuilder*& OutMeshBuilder, int32 Index, FVector Normal, FRuntimeMeshTangent Tangent)
204  {
205  OutMeshBuilder = this;
206  MeshAccessor->SetNormalTangent(Index, Normal, Tangent);
207  return Index;
208  }
209  UFUNCTION(BlueprintCallable, Category = "Components|RuntimeMeshBuilder")
210  int32 SetTangents(URuntimeBlueprintMeshBuilder*& OutMeshBuilder, int32 Index, FVector TangentX, FVector TangentY, FVector TangentZ)
211  {
212  OutMeshBuilder = this;
213  MeshAccessor->SetTangents(Index, TangentX, TangentY, TangentZ);
214  return Index;
215  }
216 
217  //FRuntimeMeshAccessorVertex GetVertex(int32 Index) const;
218  //void SetVertex(int32 Index, const FRuntimeMeshAccessorVertex& Vertex);
219  //int32 AddVertex(const FRuntimeMeshAccessorVertex& Vertex);
220 
221 
222  UFUNCTION(BlueprintCallable, Category = "Components|RuntimeMeshBuilder")
223  int32 AddIndex(URuntimeBlueprintMeshBuilder*& OutMeshBuilder, int32 NewIndex)
224  {
225  OutMeshBuilder = this;
226  return MeshAccessor->AddIndex(NewIndex);
227  }
228  UFUNCTION(BlueprintCallable, Category = "Components|RuntimeMeshBuilder")
229  int32 AddTriangle(URuntimeBlueprintMeshBuilder*& OutMeshBuilder, int32 Index0, int32 Index1, int32 Index2)
230  {
231  OutMeshBuilder = this;
232  return MeshAccessor->AddTriangle(Index0, Index1, Index2);
233  }
234 
235  UFUNCTION(BlueprintCallable, Category = "Components|RuntimeMeshBuilder")
236  int32 GetIndex(URuntimeBlueprintMeshBuilder*& OutMeshBuilder, int32 Index)
237  {
238  OutMeshBuilder = this;
239  return MeshAccessor->GetIndex(Index);
240  }
241  UFUNCTION(BlueprintCallable, Category = "Components|RuntimeMeshBuilder")
242  void SetIndex(URuntimeBlueprintMeshBuilder*& OutMeshBuilder, int32 Index, int32 Value)
243  {
244  OutMeshBuilder = this;
245  MeshAccessor->SetIndex(Index, Value);
246  }
247 };
248 
249 
250 
251 UCLASS()
252 class RUNTIMEMESHCOMPONENT_API URuntimeMeshBuilderFunctions : public UBlueprintFunctionLibrary
253 {
254 
255  GENERATED_BODY()
256 
257 public:
258 
259  UFUNCTION(BlueprintCallable, Category = "Components|RuntimeMeshBuilder")
260  static URuntimeBlueprintMeshBuilder* MakeRuntimeMeshBuilder(bool bWantsHighPrecisionTangents = false, bool bWantsHighPrecisionUVs = false, int32 NumUVs = 1, bool bUse16BitIndices = false);
261 };
typedef void(APIENTRY *GLDEBUGPROC)(GLenum source
TSharedPtr< FRuntimeMeshAccessor > MeshAccessor
const bool IsUsingHighPrecisionTangents() const
IMGUI_API void Value(const char *prefix, bool b)
Definition: imgui.cpp:9538
struct Index Index
Definition: sqlite3.c:11789
FORCEINLINE TSharedRef< FRuntimeMeshBuilder > MakeRuntimeMeshBuilder()


librealsense2
Author(s): Sergey Dorodnicov , Doron Hirshberg , Mark Horn , Reagan Lopez , Itay Carpis
autogenerated on Mon May 3 2021 02:47:41