Mesh Optimizer: sibling StaticMesh duplicate remover (UE 5.7)
Editor plugin that detects geometrically-identical sibling StaticMeshes across a level, rebases each placement onto one canonical mesh with a corrected transform (W' = D * W, verified by exact vertex matching), and can collapse groups into HISM. Native Slate tool panel + BlueprintCallable UOptimizerSubsystem. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
27
Source/OptimizerEditor/Private/OptimizerReconciler.h
Normal file
27
Source/OptimizerEditor/Private/OptimizerReconciler.h
Normal file
@ -0,0 +1,27 @@
|
||||
// Copyright IHY.
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
|
||||
namespace OptimizerReconciler
|
||||
{
|
||||
/**
|
||||
* Compute the corrected world transform for the canonical mesh so it lands exactly where the
|
||||
* sibling currently sits. With D = CanonToMember (row-vector matrix) and W = sibling world
|
||||
* transform: W'_matrix = D * W_matrix (the verified formula).
|
||||
*
|
||||
* FTransform cannot represent shear; if the actor's non-uniform scale combined with D's rotation
|
||||
* produces shear, the reconstructed FTransform deviates from the exact matrix at the bbox corners.
|
||||
* We measure that deviation and reject (return false) when it exceeds ShearTol — the caller then
|
||||
* skips and reports the placement rather than silently corrupting it.
|
||||
*
|
||||
* @return false if the result shears (unrepresentable) — OutWprime is then not safe to apply.
|
||||
*/
|
||||
bool ComputeCorrectedWorld(
|
||||
const FMatrix& CanonToMember,
|
||||
const FTransform& W,
|
||||
const FBox& CanonLocalBounds,
|
||||
double ShearTol,
|
||||
FTransform& OutWprime,
|
||||
double& OutMaxCornerDev);
|
||||
}
|
||||
Reference in New Issue
Block a user