RuntimeMeshComponentProxy.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 "RuntimeMeshData.h"
8 
9 class UBodySetup;
10 class URuntimeMeshComponent;
11 
13 class FRuntimeMeshComponentSceneProxy : public FPrimitiveSceneProxy
14 {
15 private:
17  {
18  UMaterialInterface* Material;
20  };
21 
22 
24 
25  TMap<int32, FRuntimeMeshSectionRenderData> SectionRenderData;
26 
27  // Reference to the body setup for rendering.
28  UBodySetup* BodySetup;
29 
30  FMaterialRelevance MaterialRelevance;
31 
35 
36 public:
37 
38  /*Constructor, copies the whole mesh data to feed to UE */
39  FRuntimeMeshComponentSceneProxy(URuntimeMeshComponent* Component);
40 
42 
43  void CreateRenderThreadResources() override;
44 
45  virtual bool CanBeOccluded() const override
46  {
47  return !MaterialRelevance.bDisableDepthTest;
48  }
49 
50  virtual FPrimitiveViewRelevance GetViewRelevance(const FSceneView* View) const override;
51 
52  void CreateMeshBatch(FMeshBatch& MeshBatch, const FRuntimeMeshSectionProxyPtr& Section, const FRuntimeMeshSectionRenderData& RenderData, FMaterialRenderProxy* Material, FMaterialRenderProxy* WireframeMaterial) const;
53 
54  virtual void DrawStaticElements(FStaticPrimitiveDrawInterface* PDI) override;
55 
56  virtual void GetDynamicMeshElements(const TArray<const FSceneView*>& Views, const FSceneViewFamily& ViewFamily, uint32 VisibilityMap, FMeshElementCollector& Collector) const override;
57 
58  virtual uint32 GetMemoryFootprint(void) const
59  {
60  return(sizeof(*this) + GetAllocatedSize());
61  }
62 
63  uint32 GetAllocatedSize(void) const
64  {
65  return(FPrimitiveSceneProxy::GetAllocatedSize());
66  }
67 
68 #if ENGINE_MAJOR_VERSION >= 4 && ENGINE_MINOR_VERSION >= 19
69  SIZE_T GetTypeHash() const override
70  {
71  static size_t UniquePointer;
72  return reinterpret_cast<size_t>(&UniquePointer);
73  }
74 #endif
75 };
virtual void GetDynamicMeshElements(const TArray< const FSceneView * > &Views, const FSceneViewFamily &ViewFamily, uint32 VisibilityMap, FMeshElementCollector &Collector) const override
virtual uint32 GetMemoryFootprint(void) const
TSharedPtr< FRuntimeMeshSectionProxy, ESPMode::NotThreadSafe > FRuntimeMeshSectionProxyPtr
virtual void DrawStaticElements(FStaticPrimitiveDrawInterface *PDI) override
FRuntimeMeshComponentSceneProxy(URuntimeMeshComponent *Component)
void CreateMeshBatch(FMeshBatch &MeshBatch, const FRuntimeMeshSectionProxyPtr &Section, const FRuntimeMeshSectionRenderData &RenderData, FMaterialRenderProxy *Material, FMaterialRenderProxy *WireframeMaterial) const
TSharedPtr< FRuntimeMeshProxy, ESPMode::ThreadSafe > FRuntimeMeshProxyPtr
TMap< int32, FRuntimeMeshSectionRenderData > SectionRenderData
virtual FPrimitiveViewRelevance GetViewRelevance(const FSceneView *View) const override
virtual bool CanBeOccluded() const override


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