UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FStaticLightingMesh Class Referenceabstract

#include <StaticLighting.h>

+ Inheritance diagram for FStaticLightingMesh:

Public Member Functions

ENGINE_API FStaticLightingMesh (int32 InNumTriangles, int32 InNumShadingTriangles, int32 InNumVertices, int32 InNumShadingVertices, int32 InTextureCoordinateIndex, bool bInCastShadow, bool bInTwoSidedMaterial, const TArray< ULightComponent * > &InRelevantLights, const UPrimitiveComponent *const InComponent, const FBox &InBoundingBox, const FGuid &InSourceMeshGuid, const FGuid &InComponentGuid)
 
ENGINE_API FStaticLightingMesh ()
 
virtual ENGINE_API void Serialize (FArchive &Ar)
 
virtual ~FStaticLightingMesh ()
 
virtual void GetTriangle (int32 TriangleIndex, FStaticLightingVertex &OutV0, FStaticLightingVertex &OutV1, FStaticLightingVertex &OutV2) const =0
 
virtual void GetShadingTriangle (int32 TriangleIndex, FStaticLightingVertex &OutV0, FStaticLightingVertex &OutV1, FStaticLightingVertex &OutV2) const
 
virtual void GetTriangleIndices (int32 TriangleIndex, int32 &OutI0, int32 &OutI1, int32 &OutI2) const =0
 
virtual void GetShadingTriangleIndices (int32 TriangleIndex, int32 &OutI0, int32 &OutI1, int32 &OutI2) const
 
virtual bool ShouldCastShadow (ULightComponent *Light, const FStaticLightingMapping *Receiver) const
 
virtual bool IsTriangleCastingShadow (uint32 TriangleIndex) const
 
virtual bool IsControllingShadowPerElement () const
 
virtual bool IsUniformShadowCaster () const
 
virtual FLightRayIntersection IntersectLightRay (const FVector &Start, const FVector &End, bool bFindNearestIntersection) const =0
 
virtual const FGuidGetLightingGuid () const
 
virtual bool IsInstancedMesh () const =0
 
- Public Member Functions inherited from FRefCountedObject
 FRefCountedObject ()
 
virtual ~FRefCountedObject ()
 
 FRefCountedObject (const FRefCountedObject &Rhs)=delete
 
FRefCountedObjectoperator= (const FRefCountedObject &Rhs)=delete
 
FReturnedRefCountValue AddRef () const
 
uint32 Release () const
 
uint32 GetRefCount () const
 

Public Attributes

const int32 NumTriangles
 
const int32 NumShadingTriangles
 
const int32 NumVertices
 
const int32 NumShadingVertices
 
const int32 TextureCoordinateIndex
 
TArray< int32VisibilityIds
 
const uint32 bCastShadow: 1
 
const uint32 bTwoSidedMaterial: 1
 
const TArray< ULightComponent * > RelevantLights
 
TArray< FGuidRelevantLightsGuid
 
const UPrimitiveComponent *const Component
 
FGuid ComponentGuid
 
FBox BoundingBox
 
FGuid Guid
 
FGuid SourceMeshGuid
 
TArray< TRefCountPtr< FStaticLightingMesh > > OtherMeshLODs
 
uint32 HLODTreeIndex
 
uint32 HLODChildStartIndex
 
uint32 HLODChildEndIndex
 

Detailed Description

A mesh which is used for computing static lighting.

Constructor & Destructor Documentation

◆ FStaticLightingMesh() [1/2]

FStaticLightingMesh::FStaticLightingMesh ( int32  InNumTriangles,
int32  InNumShadingTriangles,
int32  InNumVertices,
int32  InNumShadingVertices,
int32  InTextureCoordinateIndex,
bool  bInCastShadow,
bool  bInTwoSidedMaterial,
const TArray< ULightComponent * > &  InRelevantLights,
const UPrimitiveComponent *const  InComponent,
const FBox InBoundingBox,
const FGuid InSourceMeshGuid,
const FGuid InComponentGuid 
)

Initialization constructor.

◆ FStaticLightingMesh() [2/2]

FStaticLightingMesh::FStaticLightingMesh ( )

◆ ~FStaticLightingMesh()

virtual FStaticLightingMesh::~FStaticLightingMesh ( )
inlinevirtual

Virtual destructor.

Member Function Documentation

◆ GetLightingGuid()

virtual const FGuid & FStaticLightingMesh::GetLightingGuid ( ) const
inlinevirtual

Returns the Guid used for static lighting.

Returns
FGuid that identifies the mapping

Reimplemented in FBSPSurfaceStaticLighting.

◆ GetShadingTriangle()

virtual void FStaticLightingMesh::GetShadingTriangle ( int32  TriangleIndex,
FStaticLightingVertex OutV0,
FStaticLightingVertex OutV1,
FStaticLightingVertex OutV2 
) const
inlinevirtual

Accesses a triangle for shading.

Parameters
TriangleIndex- The triangle to access, valid range is [0, NumShadingTriangles).
OutV0- Upon return, should contain the first vertex of the triangle.
OutV1- Upon return, should contain the second vertex of the triangle.
OutV2- Upon return, should contain the third vertex of the triangle.
ElementIndex- Indicates the element index of the triangle.

◆ GetShadingTriangleIndices()

virtual void FStaticLightingMesh::GetShadingTriangleIndices ( int32  TriangleIndex,
int32 OutI0,
int32 OutI1,
int32 OutI2 
) const
inlinevirtual

Accesses a triangle's vertex indices for shading.

Parameters
TriangleIndex- The triangle to access, valid range is [0, NumShadingTriangles).
OutI0- Upon return, should contain the first vertex index of the triangle.
OutI1- Upon return, should contain the second vertex index of the triangle.
OutI2- Upon return, should contain the third vertex index of the triangle.

◆ GetTriangle()

virtual void FStaticLightingMesh::GetTriangle ( int32  TriangleIndex,
FStaticLightingVertex OutV0,
FStaticLightingVertex OutV1,
FStaticLightingVertex OutV2 
) const
pure virtual

Accesses a triangle.

Parameters
TriangleIndex- The triangle to access.
OutV0- Upon return, should contain the first vertex of the triangle.
OutV1- Upon return, should contain the second vertex of the triangle.
OutV2- Upon return, should contain the third vertex of the triangle.

Implemented in FStaticMeshStaticLightingMesh, FLandscapeStaticLightingMesh, and FBSPSurfaceStaticLighting.

◆ GetTriangleIndices()

virtual void FStaticLightingMesh::GetTriangleIndices ( int32  TriangleIndex,
int32 OutI0,
int32 OutI1,
int32 OutI2 
) const
pure virtual

Accesses a triangle's vertex indices.

Parameters
TriangleIndex- The triangle to access.
OutI0- Upon return, should contain the first vertex index of the triangle.
OutI1- Upon return, should contain the second vertex index of the triangle.
OutI2- Upon return, should contain the third vertex index of the triangle.

Implemented in FStaticMeshStaticLightingMesh, FLandscapeStaticLightingMesh, and FBSPSurfaceStaticLighting.

◆ IntersectLightRay()

virtual FLightRayIntersection FStaticLightingMesh::IntersectLightRay ( const FVector Start,
const FVector End,
bool  bFindNearestIntersection 
) const
pure virtual

Checks if a line segment intersects the mesh.

Parameters
Start- The start point of the line segment.
End- The end point of the line segment.
bFindNearestIntersection- Whether the nearest intersection is needed, or any intersection.
Returns
The intersection of the light-ray with the mesh.

Implemented in FStaticMeshStaticLightingMesh, FLandscapeStaticLightingMesh, and FBSPSurfaceStaticLighting.

◆ IsControllingShadowPerElement()

virtual bool FStaticLightingMesh::IsControllingShadowPerElement ( ) const
inlinevirtual
Returns
true if the mesh wants to control shadow casting per element rather than per mesh.

Reimplemented in FStaticMeshStaticLightingMesh.

◆ IsInstancedMesh()

virtual bool FStaticLightingMesh::IsInstancedMesh ( ) const
pure virtual

Returns true if this mesh is an instanced mesh.

Implemented in FBSPSurfaceStaticLighting, FStaticMeshStaticLightingMesh, and FLandscapeStaticLightingMesh.

◆ IsTriangleCastingShadow()

virtual bool FStaticLightingMesh::IsTriangleCastingShadow ( uint32  TriangleIndex) const
inlinevirtual
Returns
true if the specified triangle casts a shadow.

Reimplemented in FStaticMeshStaticLightingMesh.

◆ IsUniformShadowCaster()

virtual bool FStaticLightingMesh::IsUniformShadowCaster ( ) const
inlinevirtual

Checks whether ShouldCastShadow will return true always.

Returns
true if ShouldCastShadow will return true always.

Reimplemented in FStaticMeshStaticLightingMesh.

◆ Serialize()

void FStaticLightingMesh::Serialize ( FArchive Ar)
virtual

◆ ShouldCastShadow()

bool FStaticLightingMesh::ShouldCastShadow ( ULightComponent Light,
const FStaticLightingMapping Receiver 
) const
inlinevirtual

Determines whether the mesh should cast a shadow from a specific light on a specific mapping. This doesn't determine if the mesh actually shadows the receiver, just whether it should be allowed to.

Parameters
Light- The light source.
Receiver- The mapping which is receiving the light.
Returns
true if the mesh should shadow the receiver from the light.

Reimplemented in FStaticMeshStaticLightingMesh.

Member Data Documentation

◆ bCastShadow

const uint32 FStaticLightingMesh::bCastShadow

Whether the mesh casts a shadow.

◆ BoundingBox

FBox FStaticLightingMesh::BoundingBox

The bounding box of the mesh.

◆ bTwoSidedMaterial

const uint32 FStaticLightingMesh::bTwoSidedMaterial

Whether the mesh uses a two-sided material.

◆ Component

const UPrimitiveComponent* const FStaticLightingMesh::Component

The primitive component this mesh was created by.

◆ ComponentGuid

FGuid FStaticLightingMesh::ComponentGuid

The guid identifying the component associated with this mesh

◆ Guid

FGuid FStaticLightingMesh::Guid

Unique ID for tracking this lighting mesh during distributed lighting

◆ HLODChildEndIndex

uint32 FStaticLightingMesh::HLODChildEndIndex

◆ HLODChildStartIndex

uint32 FStaticLightingMesh::HLODChildStartIndex

◆ HLODTreeIndex

uint32 FStaticLightingMesh::HLODTreeIndex

◆ NumShadingTriangles

const int32 FStaticLightingMesh::NumShadingTriangles

The number of shading triangles in the mesh.

◆ NumShadingVertices

const int32 FStaticLightingMesh::NumShadingVertices

The number of shading vertices in the mesh.

◆ NumTriangles

const int32 FStaticLightingMesh::NumTriangles

The number of triangles in the mesh that will be used for visibility tests.

◆ NumVertices

const int32 FStaticLightingMesh::NumVertices

The number of vertices in the mesh that will be used for visibility tests.

◆ OtherMeshLODs

TArray<TRefCountPtr<FStaticLightingMesh> > FStaticLightingMesh::OtherMeshLODs

Other FStaticLightingMesh's that should be considered the same mesh object (just different LOD), and should not shadow this LOD.

◆ RelevantLights

const TArray<ULightComponent*> FStaticLightingMesh::RelevantLights

The lights which affect the mesh's primitive.

◆ RelevantLightsGuid

TArray<FGuid> FStaticLightingMesh::RelevantLightsGuid

The guids of the lights which affect the mesh's primitive.

◆ SourceMeshGuid

FGuid FStaticLightingMesh::SourceMeshGuid

Cached guid for the source mesh

◆ TextureCoordinateIndex

const int32 FStaticLightingMesh::TextureCoordinateIndex

The texture coordinate index which is used to parametrize materials.

◆ VisibilityIds

TArray<int32> FStaticLightingMesh::VisibilityIds

Used for precomputed visibility


The documentation for this class was generated from the following files: