UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
StaticMeshLight.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3/*=============================================================================
4 StaticMeshLight.h: Static mesh lighting code.
5=============================================================================*/
6
7#pragma once
8
9#include "CoreMinimal.h"
11#include "StaticLighting.h"
12#include "RawIndexBuffer.h"
13
15class ULevel;
16class ULightComponent;
17class UStaticMesh;
18class UStaticMeshComponent;
21
24{
25public:
26
29
32
34
35 // FStaticLightingMesh interface.
36
38
39 virtual void GetTriangleIndices(int32 TriangleIndex,int32& OutI0,int32& OutI1,int32& OutI2) const;
40
41 virtual bool ShouldCastShadow(ULightComponent* Light,const FStaticLightingMapping* Receiver) const;
42
44 virtual bool IsTriangleCastingShadow(uint32 TriangleIndex) const;
45
47 virtual bool IsControllingShadowPerElement() const;
48
49 virtual bool IsUniformShadowCaster() const;
50
52
53 virtual bool IsInstancedMesh() const override { return false; }
54
55#if WITH_EDITOR
60 UNREALED_API virtual void ExportMeshInstance(class FLightmassExporter* Exporter) const;
61
62 virtual const struct FSplineMeshParams* GetSplineParameters() const { return NULL; }
63
64#endif //WITH_EDITOR
65
66protected:
67
70
77
78private:
79
82
84 const UStaticMeshComponent* const Primitive;
85
87 FStaticMeshLODResources* LODRenderData;
88
90 FIndexArrayView LODIndexBuffer;
91
93 FMatrix LocalToWorld;
94
96 FMatrix LocalToWorldInverseTranspose;
97
99 float LocalToWorldDeterminant;
100
102 const uint32 bReverseWinding : 1;
103
104 friend class FLightmassExporter;
105};
106
109{
110public:
111
114
115#if WITH_EDITOR
116
117 // For serialization
119
120 // FStaticLightingTextureMapping interface
121 ENGINE_API virtual void Apply(FQuantizedLightmapData* QuantizedData, const TMap<ULightComponent*,FShadowMapData2D*>& ShadowMapData, const FStaticLightingBuildContext* LightingContext) override;
122
127 UNREALED_API virtual void ExportMapping(class FLightmassExporter* Exporter) override;
128
129 ENGINE_API virtual void Serialize(FArchive& Ar);
130#endif //WITH_EDITOR
131
132 virtual FString GetDescription() const override
133 {
134 return FString(TEXT("SMTextureMapping"));
135 }
136
138 virtual bool IsValidMapping() const override {return Primitive.IsValid();}
139
141
142protected:
143
146
149};
150
#define NULL
Definition oodle2base.h:134
#define TEXT(x)
Definition Platform.h:1272
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition Archive.h:1208
Definition RawIndexBuffer.h:92
Definition StaticLighting.h:93
Definition ShadowMap.h:100
Definition StaticLighting.h:303
Definition StaticLighting.h:114
Definition StaticLighting.h:406
virtual void Apply(struct FQuantizedLightmapData *QuantizedData, const TMap< ULightComponent *, class FShadowMapData2D * > &ShadowMapData, const FStaticLightingBuildContext *LightingContext)=0
Definition StaticMeshLight.h:24
virtual FLightRayIntersection IntersectLightRay(const FVector &Start, const FVector &End, bool bFindNearestIntersection) const
Definition StaticMeshLight.cpp:180
const int32 LODIndex
Definition StaticMeshLight.h:69
FStaticMeshStaticLightingMesh()
Definition StaticMeshLight.cpp:79
void SetLocalToWorld(const FMatrix &InLocalToWorld)
Definition StaticMeshLight.cpp:93
TArray< FStaticLightingMesh * > OtherLODs
Definition StaticMeshLight.h:28
virtual void GetTriangle(int32 TriangleIndex, FStaticLightingVertex &OutV0, FStaticLightingVertex &OutV1, FStaticLightingVertex &OutV2) const
Definition StaticMeshLight.cpp:104
virtual bool IsInstancedMesh() const override
Definition StaticMeshLight.h:53
virtual bool ShouldCastShadow(ULightComponent *Light, const FStaticLightingMapping *Receiver) const
Definition StaticMeshLight.cpp:126
virtual void GetTriangleIndices(int32 TriangleIndex, int32 &OutI0, int32 &OutI1, int32 &OutI2) const
Definition StaticMeshLight.cpp:118
virtual bool IsControllingShadowPerElement() const
Definition StaticMeshLight.cpp:158
virtual bool IsUniformShadowCaster() const
Definition StaticMeshLight.cpp:172
virtual bool IsTriangleCastingShadow(uint32 TriangleIndex) const
Definition StaticMeshLight.cpp:140
friend class FLightmassExporter
Definition StaticMeshLight.h:104
Definition StaticMeshLight.h:109
int32 GetLODIndex()
Definition StaticMeshLight.h:140
virtual FString GetDescription() const override
Definition StaticMeshLight.h:132
virtual bool IsValidMapping() const override
Definition StaticMeshLight.h:138
int32 LODIndex
Definition StaticMeshLight.h:148
TWeakObjectPtr< UStaticMeshComponent > Primitive
Definition StaticMeshLight.h:145
Definition Array.h:670
Definition UnrealString.h.inl:34
Definition Level.h:423
Definition StaticMesh.h:593
Definition LightMap.h:500
Definition SplineMeshComponent.h:45
Definition StaticLighting.h:23
Definition StaticMeshResources.h:426
Definition WeakObjectPtrTemplates.h:25
FORCEINLINE bool IsValid(bool bEvenIfPendingKill, bool bThreadsafeTest=false) const
Definition WeakObjectPtrTemplates.h:232