Files
UnrealEngineUWP/Engine/Source/Runtime/MeshDescription/Public/MeshAttributes.h
ryan durand 0f0464a30e Updating copyright for Engine Runtime.
#rnx
#rb none


#ROBOMERGE-OWNER: ryan.durand
#ROBOMERGE-AUTHOR: ryan.durand
#ROBOMERGE-SOURCE: CL 10869210 via CL 10869511 via CL 10869900
#ROBOMERGE-BOT: (v613-10869866)

[CL 10870549 by ryan durand in Main branch]
2019-12-26 14:45:42 -05:00

52 lines
1.3 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "MeshDescription.h"
namespace MeshAttribute
{
namespace Vertex
{
extern MESHDESCRIPTION_API const FName Position;
}
}
class MESHDESCRIPTION_API FMeshAttributes
{
public:
explicit FMeshAttributes(FMeshDescription& InMeshDescription)
: MeshDescription(InMeshDescription)
{}
virtual ~FMeshAttributes() = default;
virtual void Register();
/** Accessors for cached vertex position array */
TVertexAttributesRef<FVector> GetVertexPositions() { return MeshDescription.VertexAttributes().GetAttributesRef<FVector>(MeshAttribute::Vertex::Position); }
TVertexAttributesConstRef<FVector> GetVertexPositions() const { return MeshDescription.VertexAttributes().GetAttributesRef<FVector>(MeshAttribute::Vertex::Position); }
protected:
FMeshDescription& MeshDescription;
};
class FMeshConstAttributes
{
public:
explicit FMeshConstAttributes(const FMeshDescription& InMeshDescription)
: MeshDescription(InMeshDescription)
{}
/** Accessors for cached vertex position array */
TVertexAttributesConstRef<FVector> GetVertexPositions() const { return MeshDescription.VertexAttributes().GetAttributesRef<FVector>(MeshAttribute::Vertex::Position); }
protected:
const FMeshDescription& MeshDescription;
};