2014-12-07 19:09:38 -05:00
|
|
|
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2015-01-08 16:49:49 -05:00
|
|
|
#include "ModuleInterface.h"
|
|
|
|
|
|
2014-12-18 23:37:29 -05:00
|
|
|
/**
|
|
|
|
|
* Interface for a class to provide mesh painting support for a subclass of UMeshComponent
|
|
|
|
|
*/
|
|
|
|
|
class IMeshPaintGeometryAdapter
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
virtual bool Construct(UMeshComponent* InComponent, int32 InPaintingMeshLODIndex, int32 InUVChannelIndex) = 0;
|
|
|
|
|
virtual int32 GetNumTexCoords() const = 0;
|
|
|
|
|
virtual void GetTriangleInfo(int32 TriIndex, struct FTexturePaintTriangleInfo& OutTriInfo) const = 0;
|
|
|
|
|
virtual bool SupportsTexturePaint() const = 0;
|
|
|
|
|
virtual bool SupportsVertexPaint() const = 0;
|
2014-12-19 00:12:28 -05:00
|
|
|
virtual bool LineTraceComponent(struct FHitResult& OutHit, const FVector Start, const FVector End, const struct FCollisionQueryParams& Params) const = 0;
|
2014-12-19 01:47:27 -05:00
|
|
|
virtual void SphereIntersectTriangles(TArray<int32>& OutTriangles, const float ComponentSpaceSquaredBrushRadius, const FVector& ComponentSpaceBrushPosition) const = 0;
|
2015-01-05 16:36:11 -05:00
|
|
|
virtual void QueryPaintableTextures(int32 MaterialIndex, int32& OutDefaultIndex, TArray<struct FPaintableTexture>& InOutTextureList) = 0;
|
2015-04-21 20:28:46 -04:00
|
|
|
virtual void ApplyOrRemoveTextureOverride(UTexture* SourceTexture, UTexture* OverrideTexture) const = 0;
|
2014-12-18 23:37:29 -05:00
|
|
|
virtual ~IMeshPaintGeometryAdapter() {}
|
2015-01-05 16:36:11 -05:00
|
|
|
|
2015-04-21 20:28:46 -04:00
|
|
|
MESHPAINT_API static void DefaultApplyOrRemoveTextureOverride(UMeshComponent* InMeshComponent, UTexture* SourceTexture, UTexture* OverrideTexture);
|
2015-01-05 16:36:11 -05:00
|
|
|
MESHPAINT_API static void DefaultQueryPaintableTextures(int32 MaterialIndex, UMeshComponent* MeshComponent, int32& OutDefaultIndex, TArray<struct FPaintableTexture>& InOutTextureList);
|
2014-12-18 23:37:29 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Factory for IMeshPaintGeometryAdapter
|
|
|
|
|
*/
|
|
|
|
|
class IMeshPaintGeometryAdapterFactory
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
virtual TSharedPtr<IMeshPaintGeometryAdapter> Construct(class UMeshComponent* InComponent, int32 InPaintingMeshLODIndex, int32 InUVChannelIndex) const = 0;
|
2014-12-19 01:47:27 -05:00
|
|
|
virtual ~IMeshPaintGeometryAdapterFactory() {}
|
2014-12-18 23:37:29 -05:00
|
|
|
};
|
|
|
|
|
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* MeshPaint module interface
|
|
|
|
|
*/
|
|
|
|
|
class IMeshPaintModule : public IModuleInterface
|
|
|
|
|
{
|
|
|
|
|
public:
|
2014-12-18 23:37:29 -05:00
|
|
|
virtual void RegisterGeometryAdapterFactory(TSharedRef<IMeshPaintGeometryAdapterFactory> Factory) = 0;
|
|
|
|
|
virtual void UnregisterGeometryAdapterFactory(TSharedRef<IMeshPaintGeometryAdapterFactory> Factory) = 0;
|
2014-03-14 14:13:41 -04:00
|
|
|
};
|
|
|
|
|
|