You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Refactor core of FDynamicMeshEditor::DisconnectTriangles into an overload that takes precomputed triangle TSet and BoundaryLoops array, as some call sites already have computed this info Refactor new-polygroup computation out of OffsetMeshRegion into UE::Geometry::ComputeNewGroupIDsAlongEdgeLoop util function in PolyEditingEdgeUtil.h/cpp Add new function UE::Geometry::ComputeAverageUVScaleRatioAlongVertexPath in PolyEditingUVUtil.h/cpp Introduce new type FQuadGridPatch, this is a book-keeping data structure for keeping track of "grid of quads" subregion of a triangle mesh, that provides easy access to vertex and quad/trainagle rows/columns Add util functions ComputeNormalsForQuadPatch() and ComputeUVIslandForQuadPatch() in QuadGridPatchUtil.h Add new version of OffsetMeshRegion geometric operation, inside FOffsetMeshRegion class. EVersion parameter determines which version of operation to run. Code for the "Legacy" version has not been modified, so back-compat is maintained. New implementation supports variable number of subdivisions along the Offset (via .NumSubdivisions), and computes normal/UV-islands "per group" in extrusion region, instead of per-quad. New version also splits bowties in extrude region before any additional processing, which simplifies some of the book-keeping/etc. FExtrudeOp currently hardcoded to use use the FOffsetMeshRegion implementation #rb none #preflight 639762350a67152550ee9a18 [CL 23481550 by ryan schmidt in ue5-main branch]
79 lines
2.8 KiB
C++
79 lines
2.8 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "MathUtil.h"
|
|
#include "VectorTypes.h"
|
|
#include "IntVectorTypes.h"
|
|
#include "GeometryTypes.h"
|
|
#include "LineTypes.h"
|
|
|
|
class FProgressCancel;
|
|
|
|
namespace UE
|
|
{
|
|
namespace Geometry
|
|
{
|
|
|
|
class FDynamicMesh3;
|
|
|
|
/**
|
|
* For each edge in EdgeList, compute a line segment offset from the original edge by
|
|
* distance InsetDistance. Assumes that each Edge is a boundary edge and so Triangle0
|
|
* of that edge defines "inside" direction.
|
|
*/
|
|
DYNAMICMESH_API void ComputeInsetLineSegmentsFromEdges(
|
|
const FDynamicMesh3& Mesh,
|
|
const TArray<int32>& EdgeList,
|
|
double InsetDistance,
|
|
TArray<FLine3d>& InsetLinesOut );
|
|
|
|
/**
|
|
* For each vertex in VertexIDs, compute inset position based on list of precomputed
|
|
* inset lines and store in VertexPositionsOut. Assumption is that each vertex position
|
|
* was at the intersection point of the pre-inset lines, ie sequential edge-line-pairs
|
|
* determine each sequential vertex position
|
|
* @param bIsLoop if true, vertex list is treated as a loop, otherwise as an open span
|
|
*/
|
|
DYNAMICMESH_API void SolveInsetVertexPositionsFromInsetLines(
|
|
const FDynamicMesh3& Mesh,
|
|
const TArray<FLine3d>& InsetEdgeLines,
|
|
const TArray<int32>& VertexIDs,
|
|
TArray<FVector3d>& VertexPositionsOut,
|
|
bool bIsLoop);
|
|
|
|
/**
|
|
* Solve for a new inset position by finding the intersection point
|
|
* a pair of inset-lines (or handle parallel-lines case). Assumption
|
|
* is that Position is the location of the initial vertex on the
|
|
* pre-inset edge-line-pair, ie at their intersection point.
|
|
*/
|
|
DYNAMICMESH_API FVector3d SolveInsetVertexPositionFromLinePair(
|
|
const FVector3d& Position,
|
|
const FLine3d& InsetEdgeLine1,
|
|
const FLine3d& InsetEdgeLine2);
|
|
|
|
|
|
/**
|
|
* Compute a new set of GroupIDs along an edge loop under the assumption that
|
|
* the edge loop is about to be split and new geometry introduced. The decision
|
|
* is based on a provided EdgesShouldHaveSameGroupFunc function which is called
|
|
* with sequential pairs of edges. For example if this function returns true when
|
|
* the GroupIDs are the same on both edges, then this function will create a new
|
|
* GroupID for each sequential span of non-matching GroupIDs (ie often the "expected" behavior).
|
|
*
|
|
* @param LoopEdgeIDs the EdgeIDs of the loop
|
|
* @param NewLoopEdgeGroupIDsOut returned with new GroupID for each input EdgeID, same length as LoopEdgeIDs
|
|
* @param NewGroupIDsOut list of newly-allocated GroupIDs
|
|
* @param EdgesShouldHaveSameGroupFunc predicate that determines where new GroupIDs will be allocated
|
|
*/
|
|
DYNAMICMESH_API void ComputeNewGroupIDsAlongEdgeLoop(
|
|
FDynamicMesh3& Mesh,
|
|
const TArray<int32>& LoopEdgeIDs,
|
|
TArray<int32>& NewLoopEdgeGroupIDsOut,
|
|
TArray<int32>& NewGroupIDsOut,
|
|
TFunctionRef<bool(int32 Eid1, int32 Eid2)> EdgesShouldHaveSameGroupFunc);
|
|
|
|
|
|
} // end namespace UE::Geometry
|
|
} // end namespace UE
|