Link Search Menu Expand Document

Fitting

PCGEx’ fitting overview

This page centralizes documentation for Fitting, allowing us to keep relevant content accessible without duplicating extensive details across individual pages; as a few nodes have fitting capabilities and it’s a heavy piece of doc.


Table of content


There’s a few node in PCGEx that offer fitting settings – and while what is fitted is highly contextual, they all share the same settings.
Fitting is broken down in two parts: Scale to Fit, which is responsible for scaling something against a reference point’ bounds & scale, and Justification, which is responsible for the placement of the fitted something against the same reference bounds.


Scale to Fit

details/assets-staging/scale-to-fit.png

Scale the spawned asset bounds in order to fit within the host point’ bounds.

Scale to Fit Mode Which type of scale-to-fit mode is to be applied. None disables this section, Uniform applies the same rule to each individual component, while Individual lets you pick per-component rules.
Scale to Fit (value) If Asset is selected as a source, this is the Asset Collection that will be used for staging points.

You can use the following rules:

Scale to Fit
details/assets-staging/enum-stf-none.png None
Disable the scaling rule.
details/assets-staging/enum-stf-fill.png Fill
Scale the asset so it fills the point’ bounds.
details/assets-staging/enum-stf-min.png Min
Scale the asset so it fits snuggly within the minimum point’ bounds.
details/assets-staging/enum-stf-max.png Max
Scale the asset so it fits snuggly within the maximum point’ bounds.
details/assets-staging/enum-stf-avg.png Average
Scale the asset so it fits the average of the point’ bounds.

Justification

details/assets-staging/justification.png

Offset the spawned asset bounds relative to the host point’ bounds.
Justification is processed per-component, after the scale-to-fit pass.

Per component
From The location within the Asset bounds that will be justified To the point’ bounds.
i.e, from which location in the asset do i start moving.
To The location withn the Point bounds to which the Asset bounds will be justified.
i.e, to which location in the point do i want to go.
Consolidated custom inputs
Custom from Vector Attribute An FVector whose individual component will be used to drive From properties set to Custom.
Prefer this consolidated approach if you’re using custom values on more than one component.
Custom to Vector Attribute An FVector whose individual component will be used to drive To properties set to Custom. Prefer this consolidated approach if you’re using custom values on more than one component.

From

You can use the following rules for From:

Justify From
details/assets-staging/enum-justify-from-center.png Center
Uses the asset bounds’ local center as reference point.
details/assets-staging/enum-justify-from-min.png Min
Uses the asset bounds’ min as reference point.
details/assets-staging/enum-justify-from-max.png Max
Uses the asset bounds’ max as reference point.
details/assets-staging/enum-justify-from-pivot.png Pivot
Uses the asset pivot as reference point, ignoring bounds.
details/assets-staging/enum-justify-from-custom.png Custom
Uses a lerped reference point between the asset bounds’ min & max.
Value is expected to be in the range 0-1 but isn’t clamped.

To

You can use the following rules for To:

Justify To
details/assets-staging/enum-justify-to-same.png Same
Auto-selects the same justification as From, but computed against the point’ bounds.
details/assets-staging/enum-justify-to-center.png Center
Uses the point bounds’ local center as reference point.
details/assets-staging/enum-justify-to-min.png Min
Uses the point bounds’ min as reference point.
details/assets-staging/enum-justify-to-max.png Max
Uses the point bounds’ max as reference point.
details/assets-staging/enum-justify-to-pivot.png Pivot
Uses the point bounds’ pivot, ignoring bounds.
details/assets-staging/enum-justify-to-custom.png Custom
Uses a lerped reference point between the asset bounds’ min & max.
Value is expected to be in the range 0-1 but isn’t clamped.