Skip to content

Commit 0539418

Browse files
author
Chris Conway
committed
Fixed problem with DECLARE_RUNTIME_MESH_VERTEX
Cleaned up generic vertex header. Fixed dllexport not applying to registration container...
1 parent 357bdc6 commit 0539418

File tree

3 files changed

+38
-268
lines changed

3 files changed

+38
-268
lines changed

Source/RuntimeMeshComponent/Public/RuntimeMeshAsync.h

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ class RUNTIMEMESHCOMPONENT_API FRuntimeMeshAsync
117117
* @param UpdateFlags Flags pertaining to this particular update.
118118
*/
119119
template<typename VertexType>
120-
void CreateMeshSection(TWeakObjectPtr<URuntimeMeshComponent> InRuntimeMeshComponent, int32 SectionIndex, TArray<VertexType>& Vertices, TArray<int32>& Triangles,
120+
static void CreateMeshSection(TWeakObjectPtr<URuntimeMeshComponent> InRuntimeMeshComponent, int32 SectionIndex, TArray<VertexType>& Vertices, TArray<int32>& Triangles,
121121
const FBox& BoundingBox, bool bCreateCollision = false, EUpdateFrequency UpdateFrequency = EUpdateFrequency::Average, ESectionUpdateFlags UpdateFlags = ESectionUpdateFlags::None)
122122
{
123123
struct FRMCAsyncData
@@ -166,7 +166,7 @@ class RUNTIMEMESHCOMPONENT_API FRuntimeMeshAsync
166166
* @param UpdateFlags Flags pertaining to this particular update.
167167
*/
168168
template<typename VertexType>
169-
void CreateMeshSectionDualBuffer(TWeakObjectPtr<URuntimeMeshComponent> InRuntimeMeshComponent, int32 SectionIndex, TArray<FVector>& VertexPositions,
169+
static void CreateMeshSectionDualBuffer(TWeakObjectPtr<URuntimeMeshComponent> InRuntimeMeshComponent, int32 SectionIndex, TArray<FVector>& VertexPositions,
170170
TArray<VertexType>& VertexData, TArray<int32>& Triangles, bool bCreateCollision = false,
171171
EUpdateFrequency UpdateFrequency = EUpdateFrequency::Average, ESectionUpdateFlags UpdateFlags = ESectionUpdateFlags::None)
172172
{
@@ -218,7 +218,7 @@ class RUNTIMEMESHCOMPONENT_API FRuntimeMeshAsync
218218
* @param UpdateFlags Flags pertaining to this particular update.
219219
*/
220220
template<typename VertexType>
221-
void CreateMeshSectionDualBuffer(TWeakObjectPtr<URuntimeMeshComponent> InRuntimeMeshComponent, int32 SectionIndex, TArray<FVector>& VertexPositions,
221+
static void CreateMeshSectionDualBuffer(TWeakObjectPtr<URuntimeMeshComponent> InRuntimeMeshComponent, int32 SectionIndex, TArray<FVector>& VertexPositions,
222222
TArray<VertexType>& VertexData, TArray<int32>& Triangles, const FBox& BoundingBox,
223223
bool bCreateCollision = false, EUpdateFrequency UpdateFrequency = EUpdateFrequency::Average, ESectionUpdateFlags UpdateFlags = ESectionUpdateFlags::None)
224224
{
@@ -268,7 +268,7 @@ class RUNTIMEMESHCOMPONENT_API FRuntimeMeshAsync
268268
* @param UpdateFlags Flags pertaining to this particular update.
269269
*/
270270
template<typename VertexType>
271-
void UpdateMeshSection(TWeakObjectPtr<URuntimeMeshComponent> InRuntimeMeshComponent, int32 SectionIndex, TArray<VertexType>& Vertices,
271+
static void UpdateMeshSection(TWeakObjectPtr<URuntimeMeshComponent> InRuntimeMeshComponent, int32 SectionIndex, TArray<VertexType>& Vertices,
272272
ESectionUpdateFlags UpdateFlags = ESectionUpdateFlags::None)
273273
{
274274
struct FRMCAsyncData
@@ -306,7 +306,7 @@ class RUNTIMEMESHCOMPONENT_API FRuntimeMeshAsync
306306
* @param UpdateFlags Flags pertaining to this particular update.
307307
*/
308308
template<typename VertexType>
309-
void UpdateMeshSection(TWeakObjectPtr<URuntimeMeshComponent> InRuntimeMeshComponent, int32 SectionIndex, TArray<VertexType>& Vertices,
309+
static void UpdateMeshSection(TWeakObjectPtr<URuntimeMeshComponent> InRuntimeMeshComponent, int32 SectionIndex, TArray<VertexType>& Vertices,
310310
const FBox& BoundingBox, ESectionUpdateFlags UpdateFlags = ESectionUpdateFlags::None)
311311
{
312312
struct FRMCAsyncData
@@ -346,7 +346,7 @@ class RUNTIMEMESHCOMPONENT_API FRuntimeMeshAsync
346346
* @param UpdateFlags Flags pertaining to this particular update.
347347
*/
348348
template<typename VertexType>
349-
void UpdateMeshSection(TWeakObjectPtr<URuntimeMeshComponent> InRuntimeMeshComponent, int32 SectionIndex, TArray<VertexType>& Vertices,
349+
static void UpdateMeshSection(TWeakObjectPtr<URuntimeMeshComponent> InRuntimeMeshComponent, int32 SectionIndex, TArray<VertexType>& Vertices,
350350
TArray<int32>& Triangles, ESectionUpdateFlags UpdateFlags = ESectionUpdateFlags::None)
351351
{
352352
struct FRMCAsyncData
@@ -388,7 +388,7 @@ class RUNTIMEMESHCOMPONENT_API FRuntimeMeshAsync
388388
* @param UpdateFlags Flags pertaining to this particular update.
389389
*/
390390
template<typename VertexType>
391-
void UpdateMeshSection(TWeakObjectPtr<URuntimeMeshComponent> InRuntimeMeshComponent, int32 SectionIndex, TArray<VertexType>& Vertices,
391+
static void UpdateMeshSection(TWeakObjectPtr<URuntimeMeshComponent> InRuntimeMeshComponent, int32 SectionIndex, TArray<VertexType>& Vertices,
392392
TArray<int32>& Triangles, const FBox& BoundingBox, ESectionUpdateFlags UpdateFlags = ESectionUpdateFlags::None)
393393
{
394394
struct FRMCAsyncData
@@ -432,7 +432,7 @@ class RUNTIMEMESHCOMPONENT_API FRuntimeMeshAsync
432432
* @param UpdateFlags Flags pertaining to this particular update.
433433
*/
434434
template<typename VertexType>
435-
void UpdateMeshSection(TWeakObjectPtr<URuntimeMeshComponent> InRuntimeMeshComponent, int32 SectionIndex, TArray<FVector>& VertexPositions,
435+
static void UpdateMeshSection(TWeakObjectPtr<URuntimeMeshComponent> InRuntimeMeshComponent, int32 SectionIndex, TArray<FVector>& VertexPositions,
436436
TArray<VertexType>& Vertices, ESectionUpdateFlags UpdateFlags = ESectionUpdateFlags::None)
437437
{
438438
struct FRMCAsyncData
@@ -474,7 +474,7 @@ class RUNTIMEMESHCOMPONENT_API FRuntimeMeshAsync
474474
* @param UpdateFlags Flags pertaining to this particular update.
475475
*/
476476
template<typename VertexType>
477-
void UpdateMeshSection(TWeakObjectPtr<URuntimeMeshComponent> InRuntimeMeshComponent, int32 SectionIndex, TArray<FVector>& VertexPositions,
477+
static void UpdateMeshSection(TWeakObjectPtr<URuntimeMeshComponent> InRuntimeMeshComponent, int32 SectionIndex, TArray<FVector>& VertexPositions,
478478
TArray<VertexType>& Vertices, const FBox& BoundingBox, ESectionUpdateFlags UpdateFlags = ESectionUpdateFlags::None)
479479
{
480480
struct FRMCAsyncData
@@ -518,7 +518,7 @@ class RUNTIMEMESHCOMPONENT_API FRuntimeMeshAsync
518518
* @param UpdateFlags Flags pertaining to this particular update.
519519
*/
520520
template<typename VertexType>
521-
void UpdateMeshSection(TWeakObjectPtr<URuntimeMeshComponent> InRuntimeMeshComponent, int32 SectionIndex, TArray<FVector>& VertexPositions,
521+
static void UpdateMeshSection(TWeakObjectPtr<URuntimeMeshComponent> InRuntimeMeshComponent, int32 SectionIndex, TArray<FVector>& VertexPositions,
522522
TArray<VertexType>& Vertices, TArray<int32>& Triangles, ESectionUpdateFlags UpdateFlags = ESectionUpdateFlags::None)
523523
{
524524
struct FRMCAsyncData
@@ -564,7 +564,7 @@ class RUNTIMEMESHCOMPONENT_API FRuntimeMeshAsync
564564
* @param UpdateFlags Flags pertaining to this particular update.
565565
*/
566566
template<typename VertexType>
567-
void UpdateMeshSection(TWeakObjectPtr<URuntimeMeshComponent> InRuntimeMeshComponent, int32 SectionIndex, TArray<FVector>& VertexPositions,
567+
static void UpdateMeshSection(TWeakObjectPtr<URuntimeMeshComponent> InRuntimeMeshComponent, int32 SectionIndex, TArray<FVector>& VertexPositions,
568568
TArray<VertexType>& Vertices, TArray<int32>& Triangles, const FBox& BoundingBox, ESectionUpdateFlags UpdateFlags = ESectionUpdateFlags::None)
569569
{
570570
struct FRMCAsyncData
@@ -609,7 +609,7 @@ class RUNTIMEMESHCOMPONENT_API FRuntimeMeshAsync
609609
* @param VertexPositions Vertex buffer containing only the position information for each vertex.
610610
* @param UpdateFlags Flags pertaining to this particular update.
611611
*/
612-
void UpdateMeshSectionPositionsImmediate(TWeakObjectPtr<URuntimeMeshComponent> InRuntimeMeshComponent, int32 SectionIndex,
612+
static void UpdateMeshSectionPositionsImmediate(TWeakObjectPtr<URuntimeMeshComponent> InRuntimeMeshComponent, int32 SectionIndex,
613613
TArray<FVector>& VertexPositions, ESectionUpdateFlags UpdateFlags = ESectionUpdateFlags::None)
614614
{
615615
struct FRMCAsyncData
@@ -646,7 +646,7 @@ class RUNTIMEMESHCOMPONENT_API FRuntimeMeshAsync
646646
* @param BoundingBox The bounds of this section. Faster than the RMC automatically calculating it.
647647
* @param UpdateFlags Flags pertaining to this particular update.
648648
*/
649-
void UpdateMeshSectionPositionsImmediate(TWeakObjectPtr<URuntimeMeshComponent> InRuntimeMeshComponent, int32 SectionIndex,
649+
static void UpdateMeshSectionPositionsImmediate(TWeakObjectPtr<URuntimeMeshComponent> InRuntimeMeshComponent, int32 SectionIndex,
650650
TArray<FVector>& VertexPositions, const FBox& BoundingBox, ESectionUpdateFlags UpdateFlags = ESectionUpdateFlags::None)
651651
{
652652
struct FRMCAsyncData
@@ -694,7 +694,7 @@ class RUNTIMEMESHCOMPONENT_API FRuntimeMeshAsync
694694
* @param bCreateCollision Indicates whether collision should be created for this section. This adds significant cost.
695695
* @param UpdateFrequency Indicates how frequently the section will be updated. Allows the RMC to optimize itself to a particular use.
696696
*/
697-
void CreateMeshSection(TWeakObjectPtr<URuntimeMeshComponent> InRuntimeMeshComponent, int32 SectionIndex, const TArray<FVector>& Vertices,
697+
static void CreateMeshSection(TWeakObjectPtr<URuntimeMeshComponent> InRuntimeMeshComponent, int32 SectionIndex, const TArray<FVector>& Vertices,
698698
const TArray<int32>& Triangles, const TArray<FVector>& Normals, const TArray<FVector2D>& UV0, const TArray<FColor>& Colors,
699699
const TArray<FRuntimeMeshTangent>& Tangents, bool bCreateCollision = false,
700700
EUpdateFrequency UpdateFrequency = EUpdateFrequency::Average, ESectionUpdateFlags UpdateFlags = ESectionUpdateFlags::None)
@@ -759,7 +759,7 @@ class RUNTIMEMESHCOMPONENT_API FRuntimeMeshAsync
759759
* @param bCreateCollision Indicates whether collision should be created for this section. This adds significant cost.
760760
* @param UpdateFrequency Indicates how frequently the section will be updated. Allows the RMC to optimize itself to a particular use.
761761
*/
762-
void CreateMeshSection(TWeakObjectPtr<URuntimeMeshComponent> InRuntimeMeshComponent, int32 SectionIndex, const TArray<FVector>& Vertices,
762+
static void CreateMeshSection(TWeakObjectPtr<URuntimeMeshComponent> InRuntimeMeshComponent, int32 SectionIndex, const TArray<FVector>& Vertices,
763763
const TArray<int32>& Triangles, const TArray<FVector>& Normals, const TArray<FVector2D>& UV0, const TArray<FVector2D>& UV1,
764764
const TArray<FColor>& Colors, const TArray<FRuntimeMeshTangent>& Tangents,
765765
bool bCreateCollision = false, EUpdateFrequency UpdateFrequency = EUpdateFrequency::Average, ESectionUpdateFlags UpdateFlags = ESectionUpdateFlags::None)
@@ -824,7 +824,7 @@ class RUNTIMEMESHCOMPONENT_API FRuntimeMeshAsync
824824
* @param Colors Optional array of colors for each vertex. If supplied, must be same length as Vertices array.
825825
* @param Tangents Optional array of tangent vector for each vertex. If supplied, must be same length as Vertices array.
826826
*/
827-
void UpdateMeshSection(TWeakObjectPtr<URuntimeMeshComponent> InRuntimeMeshComponent, int32 SectionIndex, const TArray<FVector>& Vertices,
827+
static void UpdateMeshSection(TWeakObjectPtr<URuntimeMeshComponent> InRuntimeMeshComponent, int32 SectionIndex, const TArray<FVector>& Vertices,
828828
const TArray<FVector>& Normals, const TArray<FVector2D>& UV0, const TArray<FColor>& Colors, const TArray<FRuntimeMeshTangent>& Tangents,
829829
ESectionUpdateFlags UpdateFlags = ESectionUpdateFlags::None)
830830
{
@@ -880,7 +880,7 @@ class RUNTIMEMESHCOMPONENT_API FRuntimeMeshAsync
880880
* @param Colors Optional array of colors for each vertex. If supplied, must be same length as Vertices array.
881881
* @param Tangents Optional array of tangent vector for each vertex. If supplied, must be same length as Vertices array.
882882
*/
883-
void UpdateMeshSection(TWeakObjectPtr<URuntimeMeshComponent> InRuntimeMeshComponent, int32 SectionIndex, const TArray<FVector>& Vertices,
883+
static void UpdateMeshSection(TWeakObjectPtr<URuntimeMeshComponent> InRuntimeMeshComponent, int32 SectionIndex, const TArray<FVector>& Vertices,
884884
const TArray<FVector>& Normals, const TArray<FVector2D>& UV0, const TArray<FVector2D>& UV1, const TArray<FColor>& Colors,
885885
const TArray<FRuntimeMeshTangent>& Tangents, ESectionUpdateFlags UpdateFlags = ESectionUpdateFlags::None)
886886
{
@@ -938,7 +938,7 @@ class RUNTIMEMESHCOMPONENT_API FRuntimeMeshAsync
938938
* @param Colors Optional array of colors for each vertex. If supplied, must be same length as Vertices array.
939939
* @param Tangents Optional array of tangent vector for each vertex. If supplied, must be same length as Vertices array.
940940
*/
941-
void UpdateMeshSection(TWeakObjectPtr<URuntimeMeshComponent> InRuntimeMeshComponent, int32 SectionIndex, const TArray<FVector>& Vertices,
941+
static void UpdateMeshSection(TWeakObjectPtr<URuntimeMeshComponent> InRuntimeMeshComponent, int32 SectionIndex, const TArray<FVector>& Vertices,
942942
const TArray<int32>& Triangles, const TArray<FVector>& Normals, const TArray<FVector2D>& UV0, const TArray<FColor>& Colors,
943943
const TArray<FRuntimeMeshTangent>& Tangents, ESectionUpdateFlags UpdateFlags = ESectionUpdateFlags::None)
944944
{
@@ -997,7 +997,7 @@ class RUNTIMEMESHCOMPONENT_API FRuntimeMeshAsync
997997
* @param Colors Optional array of colors for each vertex. If supplied, must be same length as Vertices array.
998998
* @param Tangents Optional array of tangent vector for each vertex. If supplied, must be same length as Vertices array.
999999
*/
1000-
void UpdateMeshSection(TWeakObjectPtr<URuntimeMeshComponent> InRuntimeMeshComponent, int32 SectionIndex, const TArray<FVector>& Vertices,
1000+
static void UpdateMeshSection(TWeakObjectPtr<URuntimeMeshComponent> InRuntimeMeshComponent, int32 SectionIndex, const TArray<FVector>& Vertices,
10011001
const TArray<int32>& Triangles, const TArray<FVector>& Normals, const TArray<FVector2D>& UV0, const TArray<FVector2D>& UV1,
10021002
const TArray<FColor>& Colors, const TArray<FRuntimeMeshTangent>& Tangents, ESectionUpdateFlags UpdateFlags = ESectionUpdateFlags::None)
10031003
{
@@ -1051,7 +1051,7 @@ class RUNTIMEMESHCOMPONENT_API FRuntimeMeshAsync
10511051

10521052

10531053
/** Clear a section of the procedural mesh. */
1054-
void ClearMeshSection(TWeakObjectPtr<URuntimeMeshComponent> InRuntimeMeshComponent, int32 SectionIndex)
1054+
static void ClearMeshSection(TWeakObjectPtr<URuntimeMeshComponent> InRuntimeMeshComponent, int32 SectionIndex)
10551055
{
10561056
struct FRMCAsyncData
10571057
{
@@ -1068,7 +1068,7 @@ class RUNTIMEMESHCOMPONENT_API FRuntimeMeshAsync
10681068
}
10691069

10701070
/** Clear all mesh sections and reset to empty state */
1071-
void ClearAllMeshSections(TWeakObjectPtr<URuntimeMeshComponent> InRuntimeMeshComponent)
1071+
static void ClearAllMeshSections(TWeakObjectPtr<URuntimeMeshComponent> InRuntimeMeshComponent)
10721072
{
10731073
struct FRMCAsyncData
10741074
{
@@ -1084,7 +1084,7 @@ class RUNTIMEMESHCOMPONENT_API FRuntimeMeshAsync
10841084

10851085

10861086
/** Sets the tessellation triangles needed to correctly support tessellation on a section. */
1087-
void SetSectionTessellationTriangles(TWeakObjectPtr<URuntimeMeshComponent> InRuntimeMeshComponent, int32 SectionIndex,
1087+
static void SetSectionTessellationTriangles(TWeakObjectPtr<URuntimeMeshComponent> InRuntimeMeshComponent, int32 SectionIndex,
10881088
const TArray<int32>& TessellationTriangles, bool bShouldMoveArray = false)
10891089
{
10901090
struct FRMCAsyncData
@@ -1113,7 +1113,7 @@ class RUNTIMEMESHCOMPONENT_API FRuntimeMeshAsync
11131113

11141114

11151115
/** Sets the geometry for a collision only section */
1116-
void SetMeshCollisionSection(TWeakObjectPtr<URuntimeMeshComponent> InRuntimeMeshComponent, int32 CollisionSectionIndex,
1116+
static void SetMeshCollisionSection(TWeakObjectPtr<URuntimeMeshComponent> InRuntimeMeshComponent, int32 CollisionSectionIndex,
11171117
const TArray<FVector>& Vertices, const TArray<int32>& Triangles)
11181118
{
11191119
struct FRMCAsyncData
@@ -1134,7 +1134,7 @@ class RUNTIMEMESHCOMPONENT_API FRuntimeMeshAsync
11341134
}
11351135

11361136
/** Clears the geometry for a collision only section */
1137-
void ClearMeshCollisionSection(TWeakObjectPtr<URuntimeMeshComponent> InRuntimeMeshComponent, int32 CollisionSectionIndex)
1137+
static void ClearMeshCollisionSection(TWeakObjectPtr<URuntimeMeshComponent> InRuntimeMeshComponent, int32 CollisionSectionIndex)
11381138
{
11391139
struct FRMCAsyncData
11401140
{
@@ -1150,7 +1150,7 @@ class RUNTIMEMESHCOMPONENT_API FRuntimeMeshAsync
11501150
}
11511151

11521152
/** Clears the geometry for ALL collision only sections */
1153-
void ClearAllMeshCollisionSections(TWeakObjectPtr<URuntimeMeshComponent> InRuntimeMeshComponent)
1153+
static void ClearAllMeshCollisionSections(TWeakObjectPtr<URuntimeMeshComponent> InRuntimeMeshComponent)
11541154
{
11551155
struct FRMCAsyncData
11561156
{
@@ -1166,7 +1166,7 @@ class RUNTIMEMESHCOMPONENT_API FRuntimeMeshAsync
11661166

11671167

11681168
/** Add simple collision convex to this component */
1169-
void AddCollisionConvexMesh(TWeakObjectPtr<URuntimeMeshComponent> InRuntimeMeshComponent, TArray<FVector> ConvexVerts)
1169+
static void AddCollisionConvexMesh(TWeakObjectPtr<URuntimeMeshComponent> InRuntimeMeshComponent, TArray<FVector> ConvexVerts)
11701170
{
11711171
struct FRMCAsyncData
11721172
{
@@ -1182,7 +1182,7 @@ class RUNTIMEMESHCOMPONENT_API FRuntimeMeshAsync
11821182
}
11831183

11841184
/** Add simple collision convex to this component */
1185-
void ClearCollisionConvexMeshes(TWeakObjectPtr<URuntimeMeshComponent> InRuntimeMeshComponent)
1185+
static void ClearCollisionConvexMeshes(TWeakObjectPtr<URuntimeMeshComponent> InRuntimeMeshComponent)
11861186
{
11871187
struct FRMCAsyncData
11881188
{
@@ -1197,7 +1197,7 @@ class RUNTIMEMESHCOMPONENT_API FRuntimeMeshAsync
11971197
}
11981198

11991199
/** Function to replace _all_ simple collision in one go */
1200-
void SetCollisionConvexMeshes(TWeakObjectPtr<URuntimeMeshComponent> InRuntimeMeshComponent, const TArray< TArray<FVector> >& ConvexMeshes)
1200+
static void SetCollisionConvexMeshes(TWeakObjectPtr<URuntimeMeshComponent> InRuntimeMeshComponent, const TArray< TArray<FVector> >& ConvexMeshes)
12011201
{
12021202
struct FRMCAsyncData
12031203
{

Source/RuntimeMeshComponent/Public/RuntimeMeshCore.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,12 +225,12 @@ struct FRuntimeMeshTangent
225225
, bFlipTangentY(false)
226226
{}
227227

228-
FRuntimeMeshTangent(float X, float Y, float Z)
228+
FRuntimeMeshTangent(float X, float Y, float Z, bool bInFlipTangentY = false)
229229
: TangentX(X, Y, Z)
230-
, bFlipTangentY(false)
230+
, bFlipTangentY(bInFlipTangentY)
231231
{}
232232

233-
FRuntimeMeshTangent(FVector InTangentX, bool bInFlipTangentY)
233+
FRuntimeMeshTangent(FVector InTangentX, bool bInFlipTangentY = false)
234234
: TangentX(InTangentX)
235235
, bFlipTangentY(bInFlipTangentY)
236236
{}
@@ -365,7 +365,7 @@ struct RUNTIMEMESHCOMPONENT_API FRuntimeMeshVertexTypeInfo
365365
/*
366366
* Internal container used to track known vertex types, for serialization and other purposes.
367367
*/
368-
class FRuntimeMeshVertexTypeRegistrationContainer
368+
class RUNTIMEMESHCOMPONENT_API FRuntimeMeshVertexTypeRegistrationContainer
369369
{
370370
struct VertexRegistration
371371
{

0 commit comments

Comments
 (0)