LifePlay-Revival/Plugins/StreetMap/Source/StreetMapRuntime/StreetMapSceneProxy.h
edujiro5972 1122e17fa6 L0 : etat initial du projet 5.5 avant toute correction
Instantane de reference de la reprise de migration (2026-09-29).
Contient GI.uasset tel que trouve (copie UE4 identique a 4.27,
MD5 F4550DA5DC05FC005400CDCA2FC123C9). Ajouts de ce commit :
.gitattributes (aucune conversion de fin de ligne), regles .gitignore
CHG-001, Tools/ (Snapshot, Restore, AssetHeaders), empreintes L0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 00:56:10 +02:00

125 lines
No EOL
3.9 KiB
C++

#pragma once
#include "PrimitiveSceneProxy.h"
#include "LocalVertexFactory.h"
#include "DynamicMeshBuilder.h"
#include "StreetMapSceneProxy.generated.h"
/** A single vertex on a street map mesh */
USTRUCT()
struct FStreetMapVertex
{
GENERATED_USTRUCT_BODY()
/** Location of the vertex in local space */
UPROPERTY()
FVector3f Position;
/** Texture coordinate */
UPROPERTY()
FVector2f TextureCoordinate;
/** Tangent vector X */
UPROPERTY()
FVector3f TangentX;
/** Tangent vector Z (normal) */
UPROPERTY()
FVector3f TangentZ;
/** Color */
UPROPERTY()
FColor Color;
/** Default constructor */
FStreetMapVertex() :
Position(FVector3f::ZeroVector),
TextureCoordinate(FVector2f::ZeroVector),
TangentX(FVector3f::ZeroVector),
TangentZ(FVector3f::ZeroVector),
Color(FColor::White)
{
}
/** Construct with a supplied position and tangents for the vertex */
FStreetMapVertex(const FVector InitLocation, const FVector2D InitTextureCoordinate, const FVector InitTangentX, const FVector InitTangentZ, const FColor InitColor)
: Position(InitLocation),
TextureCoordinate(InitTextureCoordinate),
TangentX(InitTangentX),
TangentZ(InitTangentZ),
Color(InitColor)
{
}
};
/** Scene proxy for rendering a section of a street map mesh on the rendering thread */
class FStreetMapSceneProxy : public FPrimitiveSceneProxy
{
public:
/** Construct this scene proxy */
FStreetMapSceneProxy(const class UStreetMapComponent* InComponent);
/**
* Init this street map mesh scene proxy for the specified component (32-bit indices)
*
* @param InComponent The street map mesh component to initialize this with
* @param Vertices The vertices for this street map mesh
* @param Indices The vertex indices for this street map mesh
*/
void Init(const UStreetMapComponent* InComponent, const TArray< FStreetMapVertex >& Vertices, const TArray< uint32 >& Indices);
/** Destructor that cleans up our rendering data */
virtual ~FStreetMapSceneProxy();
/** Return a type (or subtype) specific hash for sorting purposes */
SIZE_T GetTypeHash() const override;
protected:
/** Initializes this scene proxy's vertex buffer, index buffer and vertex factory (on the render thread.) */
void InitResources();
/** Makes a MeshBatch for rendering. Called every time the mesh is drawn */
void MakeMeshBatch(struct FMeshBatch& Mesh, class FMaterialRenderProxy* MaterialRenderProxy, bool bInWireframe) const;
/** Checks to see if this mesh must be drawn during the dynamic pass. Note that even when this returns false, we may still
have other (debug) geometry to render as dynamic */
bool MustDrawMeshDynamically(const class FSceneView& View) const;
/** Returns true , if in a collision view */
bool IsInCollisionView(const FEngineShowFlags& EngineShowFlags) const;
// FPrimitiveSceneProxy interface
virtual void DrawStaticElements(class FStaticPrimitiveDrawInterface* PDI) override;
virtual void GetDynamicMeshElements(const TArray<const FSceneView*>& Views, const FSceneViewFamily& ViewFamily, uint32 VisibilityMap, class FMeshElementCollector& Collector) const override;
virtual uint32 GetMemoryFootprint(void) const override;
virtual FPrimitiveViewRelevance GetViewRelevance(const class FSceneView* View) const override;
virtual bool CanBeOccluded() const override;
protected:
/** Contains all of the vertices in our street map mesh */
FStaticMeshVertexBuffers VertexBuffer;
/** All of the vertex indices32 in our street map mesh */
FDynamicMeshIndexBuffer32 IndexBuffer32;
/** Our vertex factory specific to street map meshes */
FLocalVertexFactory VertexFactory;
/** Cached material relevance */
FMaterialRelevance MaterialRelevance;
/** The material we'll use to render this street map mesh */
class UMaterialInterface* MaterialInterface;
const UStreetMapComponent* StreetMapComp;
// The Collision Response of the component being proxied
FCollisionResponseContainer CollisionResponse;
};