Navigation
API > API/Plugins > API/Plugins/UVEditorTools
UBasic2DTriangleSetComponent and UBasic3DTriangleSetComponent are components that draw a set of lines as small squares. The 2D version stores XY coordinates with Z set to 0 whereas the 3D version stores XYZ coordinates. All lines have the same color, size, and depth bias based on what is set via SetTriangleSetParameters(). The lines are drawn as two triangles, i.e. a square, orthogonal to the view direction. The actual line size is calculated in the shader using a custom material.
Before inserting any lines via AddElement(), the maximum number of lines that will be added needs to be declared via ReserveElements(). The actual number of lines that were added is available via NumElements().
To support both 2D and 3D with minimal code duplication, the line set components are composed from the UBasicTriangleSetComponentBase class for the component specific functionality, and an instantiation of the TBasicElementSet template class for either FVector2f or FVector3f that encapsulates all line specific functionality. The final derived classes UBasic2DTriangleSetComponent and UBasic3DTriangleSetComponent contain identical boilerplate code to facilitate calls that need to go both to the component base class and the line base class, e.g. Clear() will both mark the component as dirty and delete all lines. Base class for component specific functionality independent of the type of line stored in the component.
| Name | UBasicTriangleSetComponentBase |
| Type | class |
| Header File | /Engine/Plugins/Editor/UVEditor/Source/UVEditorTools/Public/Drawing/BasicTriangleSetComponent.h |
| Include Path | #include "Drawing/BasicTriangleSetComponent.h" |
Syntax
UCLASS (MinimalAPI)
class UBasicTriangleSetComponentBase : public UMeshComponent
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UActorComponent → USceneComponent → UPrimitiveComponent → UMeshComponent → UBasicTriangleSetComponentBase
Implements Interfaces
- IAsyncPhysicsStateProcessor
- IInterface_AssetUserData
- IInterface_AsyncCompilation
- INavRelevantInterface
- IPhysicsComponent
Derived Classes
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
UBasicTriangleSetComponentBase() |
Drawing/BasicTriangleSetComponent.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void ClearComponent() |
Clears the component state and marks component as dirty. | Drawing/BasicTriangleSetComponent.h | |
void SetTriangleMaterial
(
UMaterialInterface* InTriangleMaterial |
Specify material that handles lines. | Drawing/BasicTriangleSetComponent.h | |
void SetTriangleSetParameters
(
FColor InColor, |
Set per line material parameters that are uniform for all lines. | Drawing/BasicTriangleSetComponent.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual int32 GetNumMaterials() |
Drawing/BasicTriangleSetComponent.h | ||
FBoxSphereBounds UpdateComponentBounds
(
const FTransform& LocalToWorld, |
Update component bounds using a provided function that determines the box around all line positions. | Drawing/BasicTriangleSetComponent.h |