merge
merge
#Overview
name: merge
This variable is created as a Console Variable (cvar).
- type:
Cmd
- help:
Either merge three assets or a single conflicted asset.\nformat: \'merge <remote> <local> <base> [-o out_path]\' or \'merge <local> [-o out_path]\'
It is referenced in 36
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of ‘merge’ in Unreal Engine 5 is multifaceted, as it serves different functions depending on the context and subsystem in which it’s used. Here’s an overview of its various uses:
-
Version Control and Asset Management: In the PlasticSourceControl plugin, ‘merge’ is used to resolve conflicts and combine changes from different versions of assets or files.
-
Geometry Processing: In the GeometryProcessing module, ‘merge’ is used to combine geometric containers such as bounding boxes, capsules, ellipses, and spheres.
-
Rendering and Mesh Processing: In the MutableTools module, ‘merge’ is used in mesh operations, likely for combining or blending different mesh components.
-
Navigation Mesh Generation: In the Navmesh module, ‘merge’ is used to combine and compress regions during navigation mesh generation.
-
Diffing and Asset Comparison: In the UnrealEd module, ‘merge’ is used as part of the asset diffing and merging functionality, allowing developers to compare and combine different versions of assets.
The variable is used across multiple Unreal Engine subsystems, including the Editor (UnrealEd), PlasticSourceControl plugin, GeometryProcessing plugin, and core engine modules like Navmesh.
The value of this variable is typically set within the specific functions where it’s used, often as a local variable or function parameter. It’s not a global setting but rather a context-specific operation or flag.
Developers should be aware that ‘merge’ operations can be complex and may have different implications depending on the subsystem. For example, merging assets might require careful consideration of conflicts, while merging geometric shapes involves mathematical operations to create a new encompassing shape.
Best practices when using ‘merge’ include:
- Understand the specific context and implications of the merge operation you’re performing.
- When merging assets or version-controlled files, always review the changes carefully before confirming the merge.
- In geometry processing, ensure that the merged results maintain the required properties and don’t introduce unexpected artifacts.
- For navigation mesh generation, consider the impact of merging regions on pathfinding performance and accuracy.
- When implementing custom merge functionality, provide clear documentation on the behavior and any potential side effects.
Remember that ‘merge’ operations often involve combining or reconciling different sets of data, so it’s crucial to handle edge cases and potential conflicts appropriately.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/DiffUtils.cpp:76
Scope (from outer to inner):
file
namespace UEDiffUtils_Private
Source code excerpt:
FAutoConsoleCommand DiffConsoleCommand(
TEXT("merge"),
*FString::Format(TEXT("Either merge three assets or a single conflicted asset.\n{0}"), {MergeSyntaxHelp}),
FConsoleCommandWithArgsDelegate::CreateStatic(&RunMergeCommand),
ECVF_Default
);
FAutoConsoleCommand MergeConsoleCommand(
#Loc: <Workspace>/Engine/Plugins/Developer/PlasticSourceControl/Source/PlasticSourceControl/Private/PlasticSourceControlOperations.cpp:1415
Scope (from outer to inner):
file
function bool FPlasticResolveWorker::Execute
Source code excerpt:
UE_LOG(LogSourceControl, Log, TEXT("resolve %s"), *State->PendingResolveInfo.BaseFile);
// Mark the conflicted file as resolved
InCommand.bCommandSuccessful = PlasticSourceControlUtils::RunCommand(TEXT("merge"), Parameters, OneFile, InCommand.InfoMessages, InCommand.ErrorMessages);
}
// now update the status of our files
PlasticSourceControlUtils::RunUpdateStatus(InCommand.Files, PlasticSourceControlUtils::EStatusSearchType::ControlledOnly, false, InCommand.ErrorMessages, States, InCommand.ChangesetNumber, InCommand.BranchName);
return InCommand.bCommandSuccessful;
#Loc: <Workspace>/Engine/Plugins/Developer/PlasticSourceControl/Source/PlasticSourceControl/Private/PlasticSourceControlUtils.cpp:467
Scope (from outer to inner):
file
namespace PlasticSourceControlUtils
function static bool RunCheckMergeStatus
Source code excerpt:
Parameters.Add(TEXT("--machinereadable"));
// call 'cm merge cs:xxx --machinereadable' (only dry-run, without the --merge parameter)
bResult = RunCommand(TEXT("merge"), Parameters, TArray<FString>(), Results, ErrorMessages);
OutErrorMessages.Append(MoveTemp(ErrorMessages));
// Parse the result, one line for each conflicted files:
for (const FString& Result : Results)
{
PlasticSourceControlParsers::FPlasticMergeConflictParser MergeConflict(Result);
UE_LOG(LogSourceControl, Log, TEXT("MergeConflict.Filename: '%s'"), *MergeConflict.Filename);
#Loc: <Workspace>/Engine/Plugins/Developer/PlasticSourceControl/Source/PlasticSourceControl/Private/PlasticSourceControlUtils.cpp:1022
Scope (from outer to inner):
file
namespace PlasticSourceControlUtils
function bool RunMergeBranch
Source code excerpt:
Parameters.Add(TEXT("--merge"));
Parameters.Add(FString::Printf(TEXT("\"br:%s\""), *InBranchName));
bResult = PlasticSourceControlUtils::RunCommand(TEXT("merge"), Parameters, TArray<FString>(), InfoMessages, OutErrorMessages);
if (bResult)
{
// Load and parse the result of the update command
FString Results;
if (FFileHelper::LoadFileToString(Results, *MergeResultFile.GetFilename()))
{
#Loc: <Workspace>/Engine/Plugins/Experimental/Mutable/Source/MutableTools/Private/MuT/CodeOptimiser_Logic.cpp:1080
Scope (from outer to inner):
file
namespace mu
function bool LocalLogicOptimiserAST
lambda-function
Source code excerpt:
if ( yes && yes->GetOpType()==OP_TYPE::ME_MERGE )
{
Ptr<ASTOpFixed> merge = static_cast<ASTOpFixed*>(yes.get());
bool ended = false;
while (!ended)
{
ended = true;
Ptr<ASTOp> base = merge->children[merge->op.args.MeshMerge.base].child();
if ( base && base->GetOpType()==OP_TYPE::ME_CONDITIONAL )
{
ASTOpConditional* bottomConditional = static_cast<ASTOpConditional*>(base.get());
// Are the two conditions exclusive?
bool conditionaAreExclusive = false;
#Loc: <Workspace>/Engine/Plugins/Experimental/Mutable/Source/MutableTools/Private/MuT/CodeOptimiser_Logic.cpp:1107
Scope (from outer to inner):
file
lambda-function
Source code excerpt:
if (conditionaAreExclusive)
{
if (merge->GetParentCount()==1)
{
// Directly modify the instruction to skip the impossible child option
merge->SetChild(merge->op.args.MeshMerge.base, bottomConditional->no.child() );
}
else
{
// Other parents may not impose the same condition that allows
// the optimisation.
Ptr<ASTOpFixed> newMerge = mu::Clone<ASTOpFixed>(merge);
newMerge->SetChild(newMerge->op.args.MeshMerge.base, bottomConditional->no.child());
topConditional->yes = newMerge;
merge = newMerge;
}
modified = true;
ended = false;
}
}
#Loc: <Workspace>/Engine/Plugins/Runtime/GeometryProcessing/Source/GeometryAlgorithms/Private/ThirdParty/GTEngine/Mathematics/GteContAlignedBox.h:26
Scope (from outer to inner):
file
namespace gte
Source code excerpt:
template <int N, typename Real>
bool MergeContainers(AlignedBox<N, Real> const& box0,
AlignedBox<N,Real> const& box1, AlignedBox<N, Real>& merge);
template <int N, typename Real>
bool GetContainer(int numPoints, Vector<N, Real> const* points,
AlignedBox<N, Real>& box)
{
#Loc: <Workspace>/Engine/Plugins/Runtime/GeometryProcessing/Source/GeometryAlgorithms/Private/ThirdParty/GTEngine/Mathematics/GteContAlignedBox.h:52
Scope (from outer to inner):
file
namespace gte
function bool MergeContainers
Source code excerpt:
template <int N, typename Real>
bool MergeContainers(AlignedBox<N, Real> const& box0,
AlignedBox<N, Real> const& box1, AlignedBox<N, Real>& merge)
{
for (int i = 0; i < N; ++i)
{
merge.min[i] = std::min(box0.min[i], box1.min[i]);
merge.max[i] = std::max(box0.max[i], box1.max[i]);
}
return true;
}
}
#Loc: <Workspace>/Engine/Plugins/Runtime/GeometryProcessing/Source/GeometryAlgorithms/Private/ThirdParty/GTEngine/Mathematics/GteContCapsule3.h:40
Scope (from outer to inner):
file
namespace gte
Source code excerpt:
template <typename Real>
bool MergeContainers(Capsule3<Real> const& capsule0,
Capsule3<Real> const& capsule1, Capsule3<Real>& merge);
template <typename Real>
bool GetContainer(int numPoints, Vector3<Real> const* points,
Capsule3<Real>& capsule)
{
#Loc: <Workspace>/Engine/Plugins/Runtime/GeometryProcessing/Source/GeometryAlgorithms/Private/ThirdParty/GTEngine/Mathematics/GteContCapsule3.h:143
Scope (from outer to inner):
file
namespace gte
function bool MergeContainers
Source code excerpt:
template <typename Real>
bool MergeContainers(Capsule3<Real> const& capsule0,
Capsule3<Real> const& capsule1, Capsule3<Real>& merge)
{
if (InContainer<Real>(capsule0, capsule1))
{
merge = capsule1;
return true;
}
if (InContainer<Real>(capsule1, capsule0))
{
merge = capsule0;
return true;
}
Vector3<Real> P0, P1, D0, D1;
Real extent0, extent1;
capsule0.segment.GetCenteredForm(P0, D0, extent0);
#Loc: <Workspace>/Engine/Plugins/Runtime/GeometryProcessing/Source/GeometryAlgorithms/Private/ThirdParty/GTEngine/Mathematics/GteContCapsule3.h:281
Scope (from outer to inner):
file
namespace gte
function bool MergeContainers
Source code excerpt:
}
merge.segment = Segment3<Real>(center, line.direction, extent);
merge.radius = radius;
return true;
}
}
#Loc: <Workspace>/Engine/Plugins/Runtime/GeometryProcessing/Source/GeometryAlgorithms/Private/ThirdParty/GTEngine/Mathematics/GteContCircle2.h:49
Scope (from outer to inner):
file
namespace gte
function bool MergeContainers
Source code excerpt:
// Compute the smallest bounding circle that contains the input circles.
template <typename Real>
bool MergeContainers(Circle2<Real> const& circle0, Circle2<Real> const& circle1, Circle2<Real>& merge)
{
Vector2<Real> cenDiff = circle1.center - circle0.center;
Real lenSqr = Dot(cenDiff, cenDiff);
Real rDiff = circle1.radius - circle0.radius;
Real rDiffSqr = rDiff * rDiff;
if (rDiffSqr >= lenSqr)
{
merge = (rDiff >= (Real)0 ? circle1 : circle0);
}
else
{
Real length = std::sqrt(lenSqr);
if (length > (Real)0)
{
Real coeff = (length + rDiff) / (((Real)2)*length);
merge.center = circle0.center + coeff * cenDiff;
}
else
{
merge.center = circle0.center;
}
merge.radius = ((Real)0.5)*(length + circle0.radius + circle1.radius);
}
return true;
}
}
#Loc: <Workspace>/Engine/Plugins/Runtime/GeometryProcessing/Source/GeometryAlgorithms/Private/ThirdParty/GTEngine/Mathematics/GteContEllipse2.h:33
Scope (from outer to inner):
file
namespace gte
Source code excerpt:
template <typename Real>
bool MergeContainers(Ellipse2<Real> const& ellipse0,
Ellipse2<Real> const& ellipse1, Ellipse2<Real>& merge);
template <typename Real>
bool GetContainer(int numPoints, Vector2<Real> const* points,
Ellipse2<Real>& ellipse)
{
#Loc: <Workspace>/Engine/Plugins/Runtime/GeometryProcessing/Source/GeometryAlgorithms/Private/ThirdParty/GTEngine/Mathematics/GteContEllipse2.h:113
Scope (from outer to inner):
file
namespace gte
function bool MergeContainers
Source code excerpt:
template <typename Real>
bool MergeContainers(Ellipse2<Real> const& ellipse0,
Ellipse2<Real> const& ellipse1, Ellipse2<Real>& merge)
{
// Compute the average of the input centers.
merge.center = ((Real)0.5)*(ellipse0.center + ellipse1.center);
// The bounding ellipse orientation is the average of the input
// orientations.
if (Dot(ellipse0.axis[0], ellipse1.axis[0]) >= (Real)0)
{
merge.axis[0] = ((Real)0.5)*(ellipse0.axis[0] + ellipse1.axis[0]);
}
else
{
merge.axis[0] = ((Real)0.5)*(ellipse0.axis[0] - ellipse1.axis[0]);
}
Normalize(merge.axis[0]);
merge.axis[1] = -Perp(merge.axis[0]);
// Project the input ellipses onto the axes obtained by the average of the
// orientations and that go through the center obtained by the average of
// the centers.
for (int j = 0; j < 2; ++j)
{
// Projection axis.
Line2<Real> line(merge.center, merge.axis[j]);
// Project ellipsoids onto the axis.
Real min0, max0, min1, max1;
Project(ellipse0, line, min0, max0);
Project(ellipse1, line, min1, max1);
#Loc: <Workspace>/Engine/Plugins/Runtime/GeometryProcessing/Source/GeometryAlgorithms/Private/ThirdParty/GTEngine/Mathematics/GteContEllipse2.h:151
Scope (from outer to inner):
file
namespace gte
function bool MergeContainers
Source code excerpt:
// Update the average center to be the center of the bounding box
// defined by the projected intervals.
merge.center += line.direction*(((Real)0.5)*(minIntr + maxIntr));
// Compute the extents of the box based on the new center.
merge.extent[j] = ((Real)0.5)*(maxIntr - minIntr);
}
return true;
}
#Loc: <Workspace>/Engine/Plugins/Runtime/GeometryProcessing/Source/GeometryAlgorithms/Private/ThirdParty/GTEngine/Mathematics/GteContEllipsoid3.h:36
Scope (from outer to inner):
file
namespace gte
Source code excerpt:
template <typename Real>
bool MergeContainers(Ellipsoid3<Real> const& ellipsoid0,
Ellipsoid3<Real> const& ellipsoid1, Ellipsoid3<Real>& merge);
template <typename Real>
bool GetContainer(int numPoints, Vector3<Real> const* points,
Ellipsoid3<Real>& ellipsoid)
{
#Loc: <Workspace>/Engine/Plugins/Runtime/GeometryProcessing/Source/GeometryAlgorithms/Private/ThirdParty/GTEngine/Mathematics/GteContEllipsoid3.h:119
Scope (from outer to inner):
file
namespace gte
function bool MergeContainers
Source code excerpt:
template <typename Real>
bool MergeContainers(Ellipsoid3<Real> const& ellipsoid0,
Ellipsoid3<Real> const& ellipsoid1, Ellipsoid3<Real>& merge)
{
// Compute the average of the input centers
merge.center = ((Real)0.5)*(ellipsoid0.center + ellipsoid1.center);
// The bounding ellipsoid orientation is the average of the input
// orientations.
Matrix3x3<Real> rot0, rot1;
rot0.SetCol(0, ellipsoid0.axis[0]);
rot0.SetCol(1, ellipsoid0.axis[1]);
#Loc: <Workspace>/Engine/Plugins/Runtime/GeometryProcessing/Source/GeometryAlgorithms/Private/ThirdParty/GTEngine/Mathematics/GteContEllipsoid3.h:145
Scope (from outer to inner):
file
namespace gte
function bool MergeContainers
Source code excerpt:
for (int j = 0; j < 3; ++j)
{
merge.axis[j] = rot.GetCol(j);
}
// Project the input ellipsoids onto the axes obtained by the average
// of the orientations and that go through the center obtained by the
// average of the centers.
for (int i = 0; i < 3; ++i)
{
// Projection axis.
Line3<Real> line(merge.center, merge.axis[i]);
// Project ellipsoids onto the axis.
Real min0, max0, min1, max1;
Project(ellipsoid0, line, min0, max0);
Project(ellipsoid1, line, min1, max1);
#Loc: <Workspace>/Engine/Plugins/Runtime/GeometryProcessing/Source/GeometryAlgorithms/Private/ThirdParty/GTEngine/Mathematics/GteContEllipsoid3.h:168
Scope (from outer to inner):
file
namespace gte
function bool MergeContainers
Source code excerpt:
// Update the average center to be the center of the bounding box
// defined by the projected intervals.
merge.center += line.direction*(((Real)0.5)*(minIntr + maxIntr));
// Compute the extents of the box based on the new center.
merge.extent[i] = ((Real)0.5)*(maxIntr - minIntr);
}
return true;
}
#Loc: <Workspace>/Engine/Plugins/Runtime/GeometryProcessing/Source/GeometryAlgorithms/Private/ThirdParty/GTEngine/Mathematics/GteContOrientedBox2.h:30
Scope (from outer to inner):
file
namespace gte
Source code excerpt:
template <typename Real>
bool MergeContainers(OrientedBox2<Real> const& box0,
OrientedBox2<Real> const& box1, OrientedBox2<Real>& merge);
template <typename Real>
bool GetContainer(int numPoints, Vector2<Real> const* points,
OrientedBox2<Real>& box)
{
#Loc: <Workspace>/Engine/Plugins/Runtime/GeometryProcessing/Source/GeometryAlgorithms/Private/ThirdParty/GTEngine/Mathematics/GteContOrientedBox2.h:97
Scope (from outer to inner):
file
namespace gte
function bool MergeContainers
Source code excerpt:
template <typename Real>
bool MergeContainers(OrientedBox2<Real> const& box0,
OrientedBox2<Real> const& box1, OrientedBox2<Real>& merge)
{
// The first guess at the box center. This value will be updated later
// after the input box vertices are projected onto axes determined by an
// average of box axes.
merge.center = ((Real)0.5)*(box0.center + box1.center);
// The merged box axes are the averages of the input box axes. The axes
// of the second box are negated, if necessary, so they form acute angles
// with the axes of the first box.
if (Dot(box0.axis[0], box1.axis[0]) >= (Real)0)
{
merge.axis[0] = ((Real)0.5)*(box0.axis[0] + box1.axis[0]);
}
else
{
merge.axis[0] = ((Real)0.5)*(box0.axis[0] - box1.axis[0]);
}
Normalize(merge.axis[0]);
merge.axis[1] = -Perp(merge.axis[0]);
// Project the input box vertices onto the merged-box axes. Each axis
// D[i] containing the current center C has a minimum projected value
// min[i] and a maximum projected value max[i]. The corresponding
// endpoints on the axes are C+min[i]*D[i] and C+max[i]*D[i]. The point
// C is not necessarily the midpoint for any of the intervals. The actual
#Loc: <Workspace>/Engine/Plugins/Runtime/GeometryProcessing/Source/GeometryAlgorithms/Private/ThirdParty/GTEngine/Mathematics/GteContOrientedBox2.h:136
Scope (from outer to inner):
file
namespace gte
function bool MergeContainers
Source code excerpt:
for (int i = 0; i < 4; ++i)
{
Vector2<Real> diff = vertex[i] - merge.center;
for (int j = 0; j < 2; ++j)
{
Real dot = Dot(diff, merge.axis[j]);
if (dot > pmax[j])
{
pmax[j] = dot;
}
else if (dot < pmin[j])
{
#Loc: <Workspace>/Engine/Plugins/Runtime/GeometryProcessing/Source/GeometryAlgorithms/Private/ThirdParty/GTEngine/Mathematics/GteContOrientedBox2.h:154
Scope (from outer to inner):
file
namespace gte
function bool MergeContainers
Source code excerpt:
for (int i = 0; i < 4; ++i)
{
Vector2<Real> diff = vertex[i] - merge.center;
for (int j = 0; j < 2; ++j)
{
Real dot = Dot(diff, merge.axis[j]);
if (dot > pmax[j])
{
pmax[j] = dot;
}
else if (dot < pmin[j])
{
#Loc: <Workspace>/Engine/Plugins/Runtime/GeometryProcessing/Source/GeometryAlgorithms/Private/ThirdParty/GTEngine/Mathematics/GteContOrientedBox2.h:175
Scope (from outer to inner):
file
namespace gte
function bool MergeContainers
Source code excerpt:
for (int j = 0; j < 2; ++j)
{
merge.center += half*(pmax[j] + pmin[j])*merge.axis[j];
merge.extent[j] = half*(pmax[j] - pmin[j]);
}
return true;
}
#Loc: <Workspace>/Engine/Plugins/Runtime/GeometryProcessing/Source/GeometryAlgorithms/Private/ThirdParty/GTEngine/Mathematics/GteContOrientedBox3.h:32
Scope (from outer to inner):
file
namespace gte
Source code excerpt:
template <typename Real>
bool MergeContainers(OrientedBox3<Real> const& box0,
OrientedBox3<Real> const& box1, OrientedBox3<Real>& merge);
template <typename Real>
bool GetContainer(int numPoints, Vector3<Real> const* points,
OrientedBox3<Real>& box)
{
#Loc: <Workspace>/Engine/Plugins/Runtime/GeometryProcessing/Source/GeometryAlgorithms/Private/ThirdParty/GTEngine/Mathematics/GteContOrientedBox3.h:101
Scope (from outer to inner):
file
namespace gte
function bool MergeContainers
Source code excerpt:
template <typename Real>
bool MergeContainers(OrientedBox3<Real> const& box0,
OrientedBox3<Real> const& box1, OrientedBox3<Real>& merge)
{
// The first guess at the box center. This value will be updated later
// after the input box vertices are projected onto axes determined by an
// average of box axes.
merge.center = ((Real)0.5)*(box0.center + box1.center);
// A box's axes, when viewed as the columns of a matrix, form a rotation
// matrix. The input box axes are converted to quaternions. The average
// quaternion is computed, then normalized to unit length. The result is
// the slerp of the two input quaternions with t-value of 1/2. The result
// is converted back to a rotation matrix and its columns are selected as
#Loc: <Workspace>/Engine/Plugins/Runtime/GeometryProcessing/Source/GeometryAlgorithms/Private/ThirdParty/GTEngine/Mathematics/GteContOrientedBox3.h:133
Scope (from outer to inner):
file
namespace gte
function bool MergeContainers
Source code excerpt:
for (int j = 0; j < 3; ++j)
{
merge.axis[j] = rot.GetCol(j);
}
// Project the input box vertices onto the merged-box axes. Each axis
// D[i] containing the current center C has a minimum projected value
// min[i] and a maximum projected value max[i]. The corresponding end
// points on the axes are C+min[i]*D[i] and C+max[i]*D[i]. The point C
#Loc: <Workspace>/Engine/Plugins/Runtime/GeometryProcessing/Source/GeometryAlgorithms/Private/ThirdParty/GTEngine/Mathematics/GteContOrientedBox3.h:154
Scope (from outer to inner):
file
namespace gte
function bool MergeContainers
Source code excerpt:
for (int i = 0; i < 8; ++i)
{
Vector3<Real> diff = vertex[i] - merge.center;
for (int j = 0; j < 3; ++j)
{
Real dot = Dot(diff, merge.axis[j]);
if (dot > pmax[j])
{
pmax[j] = dot;
}
else if (dot < pmin[j])
{
#Loc: <Workspace>/Engine/Plugins/Runtime/GeometryProcessing/Source/GeometryAlgorithms/Private/ThirdParty/GTEngine/Mathematics/GteContOrientedBox3.h:172
Scope (from outer to inner):
file
namespace gte
function bool MergeContainers
Source code excerpt:
for (int i = 0; i < 8; ++i)
{
Vector3<Real> diff = vertex[i] - merge.center;
for (int j = 0; j < 3; ++j)
{
Real dot = Dot(diff, merge.axis[j]);
if (dot > pmax[j])
{
pmax[j] = dot;
}
else if (dot < pmin[j])
{
#Loc: <Workspace>/Engine/Plugins/Runtime/GeometryProcessing/Source/GeometryAlgorithms/Private/ThirdParty/GTEngine/Mathematics/GteContOrientedBox3.h:193
Scope (from outer to inner):
file
namespace gte
function bool MergeContainers
Source code excerpt:
for (int j = 0; j < 3; ++j)
{
merge.center += half*(pmax[j] + pmin[j])*merge.axis[j];
merge.extent[j] = half*(pmax[j] - pmin[j]);
}
return true;
}
#Loc: <Workspace>/Engine/Plugins/Runtime/GeometryProcessing/Source/GeometryAlgorithms/Private/ThirdParty/GTEngine/Mathematics/GteContSphere3.h:49
Scope (from outer to inner):
file
namespace gte
function bool MergeContainers
Source code excerpt:
// Compute the smallest bounding sphere that contains the input spheres.
template <typename Real>
bool MergeContainers(Sphere3<Real> const& sphere0, Sphere3<Real> const& sphere1, Sphere3<Real>& merge)
{
Vector3<Real> cenDiff = sphere1.center - sphere0.center;
Real lenSqr = Dot(cenDiff, cenDiff);
Real rDiff = sphere1.radius - sphere0.radius;
Real rDiffSqr = rDiff * rDiff;
if (rDiffSqr >= lenSqr)
{
merge = (rDiff >= (Real)0 ? sphere1 : sphere0);
}
else
{
Real length = std::sqrt(lenSqr);
if (length > (Real)0)
{
Real coeff = (length + rDiff) / (((Real)2)*length);
merge.center = sphere0.center + coeff * cenDiff;
}
else
{
merge.center = sphere0.center;
}
merge.radius = ((Real)0.5)*(length + sphere0.radius + sphere1.radius);
}
return true;
}
}
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/DiffUtils.cpp:222
Scope (from outer to inner):
file
function static void UEDiffUtils_Private::RunMergeCommand
lambda-function
Source code excerpt:
ResetLoaders(Results.MergedPackage);
}
UE::CmdLink::GEndAsyncCommand(TEXT("merge"), Args);
});
if (bThreeWayMerge)
{
FAssetManualMergeArgs MergeArgs;
MergeArgs.LocalAsset = Local;
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/DiffUtils.cpp:242
Scope (from outer to inner):
file
function static void UEDiffUtils_Private::RunMergeCommand
Source code excerpt:
return;
}
UE::CmdLink::GBeginAsyncCommand(TEXT("merge"), Args);
AssetDefinition->Merge(MergeArgs);
}
}
else
{
FAssetAutomaticMergeArgs MergeArgs;
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/DiffUtils.cpp:261
Scope (from outer to inner):
file
function static void UEDiffUtils_Private::RunMergeCommand
Source code excerpt:
return;
}
UE::CmdLink::GBeginAsyncCommand(TEXT("merge"), Args);
AssetDefinition->Merge(MergeArgs);
}
}
}
FPropertySoftPath::FPropertySoftPath()
#Loc: <Workspace>/Engine/Source/Runtime/Navmesh/Private/DetourTileCache/DetourTileCacheRegion.cpp:1468
Scope (from outer to inner):
file
function static void MergeAndCompressRegions
Source code excerpt:
// (results in even more long thin polys)
int merge = -1;
int mergea = 0;
for (int j = 0; j < reg.neis.size(); ++j)
{
const unsigned short nei = (unsigned short)reg.neis[j];
dtLayerMonotoneRegion& regn = regs[nei];
if (reg.regId == regn.regId)
#Loc: <Workspace>/Engine/Source/Runtime/Navmesh/Private/DetourTileCache/DetourTileCacheRegion.cpp:1483
Scope (from outer to inner):
file
function static void MergeAndCompressRegions
Source code excerpt:
{
mergea = regn.area;
merge = (int)nei;
}
}
}
if (merge != -1)
{
const unsigned short oldId = reg.regId;
const unsigned short newId = regs[merge].regId;
for (int j = 0; j < nregs; ++j)
if (regs[j].regId == oldId)
regs[j].regId = newId;
}
}