![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <MeshTangents.h>
Static Public Member Functions | |
| static bool | ComputeDefaultOverlayTangents (FDynamicMesh3 &Mesh) |
Protected Member Functions | |
| GEOMETRYCORE_API void | SetTangentCount (int Count, bool bClearToZero) |
| void | ComputeSeparatePerTriangleTangents (const FDynamicMeshNormalOverlay *NormalOverlay, const FDynamicMeshUVOverlay *UVOverlay, const FComputeTangentsOptions &Options) |
| void | ComputeMikkTStyleTangents (const FDynamicMeshNormalOverlay *NormalOverlay, const FDynamicMeshUVOverlay *UVOverlay, const FComputeTangentsOptions &Options) |
Protected Attributes | |
| const FDynamicMesh3 * | Mesh |
| TArray< TVector< RealType > > | Tangents |
| TArray< TVector< RealType > > | Bitangents |
| TArray< int32 > | AllDegenerateTris |
TMeshTangents is a utility class that can calculate and store various types of tangent vectors for a FDynamicMesh.
|
inline |
|
inline |
|
inlinestatic |
Convenience function to compute tangents from the mesh attribute set's primary UVs and normals
|
protected |
|
protected |
| void TMeshTangents::ComputeTriangleTangents | ( | const FDynamicMeshUVOverlay * | UVOverlay, |
| bool | bOrthogonalize = true |
||
| ) |
Compute per-triangle tangents for the given UV Overlay
| bOrthogonalize | if true, we orthogonalize the tangents by computing the Bitangent sign and regenerating it. Otherwise the tangents are left non-orthogonal. |
| void TMeshTangents::ComputeTriVertexTangents | ( | const FDynamicMeshNormalOverlay * | NormalOverlay, |
| const FDynamicMeshUVOverlay * | UVOverlay, | ||
| const FComputeTangentsOptions & | Options | ||
| ) |
Calculate per-triangle tangent spaces based on the given per-triangle normal and UV overlays. In this mode there is no averaging of tangents across triangles. So if we have N triangles in the mesh, then 3*N tangents are generated. These tangents are computed in parallel.
| bool TMeshTangents::CopyToOverlays | ( | FDynamicMesh3 & | MeshToSet | ) | const |
Set Tangents on mesh overlays
| MeshToSet | Mesh to copy overlays to; does not need to be the same as the Mesh member of this class |
| bool TMeshTangents::CopyTriVertexTangents | ( | const FDynamicMesh3 & | SourceMesh | ) |
Initialize Tangents from the FDynamicMeshAttributeSet of SourceMesh
| void UE::Geometry::TMeshTangents< RealType >::CopyTriVertexTangents | ( | const TMeshTangents< OtherRealType > & | OtherTangents | ) |
Initialize Tangents from other Tangents set
|
inline |
|
inline |
|
inline |
| TriangleID | triangle index in mesh |
| BaryCoords | barycentric coordinates in triangle |
| TangentOut | interpolated tangent |
| BitangentOut | interpolated bitangent |
|
inline |
|
inline |
Return tangent and bitangent at a vertex of triangle for per-triangle computed tangents
| TriangleID | triangle index in mesh |
| TriVertIdx | vertex index in range 0,1,2 |
|
inline |
Return tangent and bitangent at a vertex of triangle for per-triangle computed tangents
| TriangleID | triangle index in mesh |
| TriVertIdx | vertex index in range 0,1,2 |
|
inline |
|
inline |
Get tangent and bitangent at a vertex of a triangle for per-triangle computed tangents
| TriangleID | triangle index in mesh |
| TriVertIdx | vertex index in range 0,1,2 |
|
inline |
Initialize buffer sizes to one tangent/bitangent per mesh triangle
|
inline |
Set internal buffer sizes suitable for calculating per-triangle tangents. This is intended to be used if you wish to calculate your own tangents and use SetPerTriangleTangent()
|
inline |
|
inline |
Set tangent and bitangent at a vertex of triangle for per-triangle computed tangents.
| TriangleID | triangle index in mesh |
| TriVertIdx | vertex index in range 0,1,2 |
|
protected |
Set the size of the Tangents array to Count, and optionally clear all values to (0,0,0)
|
protected |
Indices of degenerate triangles. This may be useful to know externally, as those tangets are often meaningless
|
protected |
Set of computed bitangents
|
protected |
Target Mesh
|
protected |
Set of computed tangents