TMeshTangents

[TMeshTangents](API\Runtime\GeometryCore\DynamicMesh\TMeshTangents) is a utility class that can calculate and store various types of tangent vectors for a FDynamicMesh.

Choose your operating system:

Windows

macOS

Linux

References

Module

GeometryCore

Header

/Engine/Source/Runtime/GeometryCore/Public/DynamicMesh/MeshTangents.h

Include

#include "DynamicMesh/MeshTangents.h"

Syntax

template<typename RealType>
class TMeshTangents

Remarks

TMeshTangents is a utility class that can calculate and store various types of tangent vectors for a FDynamicMesh.

Variables

Name Description

Protected variable

TArray< int32 >

 

AllDegenerateTris

Indices of degenerate triangles.

Protected variable

TArray< TVector...

 

Bitangents

Set of computed bitangents

Protected variable

const FDynamicM...

 

Mesh

Target Mesh

Protected variable

TArray< TVector...

 

Tangents

Set of computed tangents

Constructors

Name Description

Public function

TMeshTangents()

Public function

TMeshTangents

(
    const FDynamicMesh3* Mesh
)

Functions

Name Description

Protected function

void

 

ComputeMikkTStyleTangents

(
    const FDynamicMeshNormalOverlay...,
    const FDynamicMeshUVOverlay* U...,
    const FComputeTangentsOptions& Opt...
)

Calculate MikkT-space-style tangents.

Protected function

void

 

ComputeSeparatePerTriangleTangents

(
    const FDynamicMeshNormalOverlay...,
    const FDynamicMeshUVOverlay* U...,
    const FComputeTangentsOptions& Opt...
)

Calculate per-triangle tangents and then projected to overlay normals at each triangle-vertex

Public function

void

 

ComputeTriangleTangents

(
    const FDynamicMeshUVOverlay* U...,
    bool bOrthogonalize
)

Compute per-triangle tangents for the given UV Overlay

Public function

void

 

ComputeTriVertexTangents

(
    const FDynamicMeshNormalOverlay...,
    const FDynamicMeshUVOverlay* U...,
    const FComputeTangentsOptions& Opt...
)

Calculate per-triangle tangent spaces based on the given per-triangle normal and UV overlays.

Public function Const

bool

 

CopyToOverlays

(
    FDynamicMesh3& MeshToSet
)

Set Tangents on mesh overlays

Public function

bool

 

CopyTriVertexTangents

(
    const FDynamicMesh3& SourceMesh
)

Initialize Tangents from the FDynamicMeshAttributeSet of SourceMesh

Public function

void

 

CopyTriVertexTangents

(
    const TMeshTangents< OtherRealType ...
)

Initialize Tangents from other Tangents set

Public function Const

const TArray...

 

GetBitangents()

Public function Const

const TArray...

 

GetDegenerateTris()

Public function Const

void

 

GetInterpolatedTriangleTangent

(
    int32 TriangleID,
    const UE::Math::TVector< RealType >...,
    UE::Math::TVector< RealType >& Tan...,
    UE::Math::TVector< RealType >& Bit...
)

Public function Const

void

 

GetPerTriangleTangent

(
    int32 TriangleID,
    int32 TriVertIdx,
    VectorType& TangentOut,
    VectorType& BitangentOut
)

Return tangent and bitangent at a vertex of triangle for per-triangle computed tangents

Public function Const

void

 

GetPerTriangleTangent

(
    int32 TriangleID,
    int32 TriVertIdx,
    UE::Math::TVector< RealType >& Tan...,
    UE::Math::TVector< RealType >& Bit...
)

Return tangent and bitangent at a vertex of triangle for per-triangle computed tangents

Public function Const

const TArray...

 

GetTangents()

Public function Const

void

 

GetTriangleVertexTangentVectors

(
    int32 TriangleID,
    int32 TriVertexIndex,
    OtherVectorType& TangentOut,
    OtherVectorType& BitangentOut
)

Get tangent and bitangent at a vertex of a triangle for per-triangle computed tangents

Public function

void

 

InitializeTriangleTangents

(
    bool bClearToZero
)

Per-Triangle Tangents Number of Tangents is NumTrianglesInitialize buffer sizes to one tangent/bitangent per mesh triangle

Public function

void

 

InitializeTriVertexTangents

(
    bool bClearToZero
)

Per-Triangle-Vertex Tangents Number of Tangents is NumTriangles * 3 Set internal buffer sizes suitable for calculating per-triangle tangents.

Public function

void

 

SetMesh

(
    const FDynamicMesh3* MeshIn
)

Public function

void

 

SetPerTriangleTangent

(
    int TriangleID,
    int TriVertIdx,
    const TVector< RealType >& Tangent,
    const TVector< RealType >& Bitange...
)

Set tangent and bitangent at a vertex of triangle for per-triangle computed tangents.

Protected function

void

 

SetTangentCount

(
    int Count,
    bool bClearToZero
)

Set the size of the Tangents array to Count, and optionally clear all values to (0,0,0)