Class TransformDelta
Represents a collection of transform changes for procedural animation — scale, local Z rotation, and local position offset — each stored in its own independently-keyed facet. Analogous to MaterialDelta but for transform properties instead of material colors.
Facet Independence: Scale, rotation and position entries are stored in separate dictionaries, keyed by the same TransformId space. A single TransformId can carry any combination of a scale entry, a rotation entry and a position entry — including none or all three — and writing one facet never disturbs the others for that id.
Combination Semantics: Uses last-write-wins per TransformId, independently per facet. When combining two TransformDeltas, entries from the other delta overwrite existing entries with the same TransformId within the same facet. This is deterministic given consistent ordering.
Weight Semantics: Weight represents blend strength, not multiplicative contribution. A weight of 0 means "no change" (identity scale/rotation/position preserved), and 1 means "full delta applied". The WRITER (the authoring layer) is responsible for pre-blending its own value toward identity by this weight before writing the entry — see Weight/ Weight/Weight. The applier does not read or lerp by Weight.
Position is layout-hostile. Unlike scale and rotation, the position facet is not safe for a
FLEXBOX-parented HUD element: UGUI's layout rebuild runs after the animator tick and overwrites whatever
local position this facet wrote. UnityTransformApplier enforces this at the applier level
via each target's AllowPosition flag, set once at registration — see
UnityHudHostComponent.BuildAnimator, which only passes allowPositionOverride: true for a
root-level element (no ParentId).
Inherited Members
Namespace: Serenity.ProceduralAnimator.Domain.Entities
Assembly: Serenity.ProceduralAnimator.Domain.dll
Syntax
public class TransformDelta
Constructors
TransformDelta()
Creates an empty TransformDelta with no entries.
Declaration
public TransformDelta()
Properties
Count
Gets the total number of entries across every facet — a TransformId carrying entries in more than one facet counts once per facet.
Declaration
public int Count { get; }
Property Value
| Type | Description |
|---|---|
| int |
IsEmpty
Checks if this delta has any entries in any facet.
Declaration
public bool IsEmpty { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Methods
Clear()
Clears all transform scale, rotation and position entries.
Declaration
public void Clear()
Clone()
Creates a deep copy of this TransformDelta, across every facet.
Declaration
public TransformDelta Clone()
Returns
| Type | Description |
|---|---|
| TransformDelta | A new TransformDelta with the same entries. |
Combine(TransformDelta)
Combines another TransformDelta into this one using last-write-wins semantics, independently per facet. Entries from the other delta overwrite existing entries with the same TransformId within the same facet (a scale entry never overwrites a rotation or position entry, or vice versa).
Declaration
public void Combine(TransformDelta other)
Parameters
| Type | Name | Description |
|---|---|---|
| TransformDelta | other | The TransformDelta to merge into this one. |
GetPositionEntries()
Gets all transform position entries for applier access.
Declaration
public IReadOnlyDictionary<TransformId, TransformPositionData> GetPositionEntries()
Returns
| Type | Description |
|---|---|
| IReadOnlyDictionary<TransformId, TransformPositionData> | Read-only dictionary of TransformId to TransformPositionData. |
GetRotationEntries()
Gets all transform rotation entries for applier access.
Declaration
public IReadOnlyDictionary<TransformId, TransformRotationData> GetRotationEntries()
Returns
| Type | Description |
|---|---|
| IReadOnlyDictionary<TransformId, TransformRotationData> | Read-only dictionary of TransformId to TransformRotationData. |
GetScaleEntries()
Gets all transform scale entries for applier access.
Declaration
public IReadOnlyDictionary<TransformId, TransformScaleData> GetScaleEntries()
Returns
| Type | Description |
|---|---|
| IReadOnlyDictionary<TransformId, TransformScaleData> | Read-only dictionary of TransformId to TransformScaleData. |
MultiplyLocalScale(TransformId, Vector3, float)
Sets the scale multiplier for a transform target with the specified blend weight. If a scale entry already exists for this TransformId, it is overwritten. Independent of any rotation entry already present for the same TransformId. Named "Multiply" (not "Set") because scale's identity is 1 — the applier composes this entry onto the original scale by multiplication, the same reason SetLocalZRotation(TransformId, float, float)'s additive (identity 0) offset is named "Set" instead.
Declaration
public void MultiplyLocalScale(TransformId id, Vector3 scaleMultiplier, float weight = 1)
Parameters
| Type | Name | Description |
|---|---|---|
| TransformId | id | The transform target identifier. |
| Vector3 | scaleMultiplier | The scale multiplier to apply (1,1,1 = no change). |
| float | weight | Blend weight (0-1). Default is 1 (full application). |
Scale(float)
Scales all internal weights, across every facet, by the given factor. Used for layer blending where the layer itself has a weight.
Declaration
public void Scale(float weight)
Parameters
| Type | Name | Description |
|---|---|---|
| float | weight | The weight multiplier (0-1). |
SetLocalPositionOffset(TransformId, Vector3, float)
Sets the local position offset for a transform target with the specified blend weight. If a position entry already exists for this TransformId, it is overwritten. Independent of any scale or rotation entry already present for the same TransformId. Named "Set" (not "Add") because position's identity is Vector3.Zero — the applier composes this entry onto the original position as an additive local offset, the same convention SetLocalZRotation(TransformId, float, float) uses for rotation's identity-0 offset.
Layout-hostile — root elements only. See this class's own remarks: a FLEXBOX-parented
HUD element's local position is owned by its parent's layout rebuild, which runs after the animator
tick and clobbers whatever this writes. UnityTransformApplier enforces this at the
applier level via each target's AllowPosition flag — writing an entry for a target registered
with that flag false is silently dropped by the applier, not by this method.
Declaration
public void SetLocalPositionOffset(TransformId id, Vector3 offset, float weight = 1)
Parameters
| Type | Name | Description |
|---|---|---|
| TransformId | id | The transform target identifier. |
| Vector3 | offset | The local position offset to apply (Vector3.Zero = no change). |
| float | weight | Blend weight (0-1). Default is 1 (full application). |
SetLocalZRotation(TransformId, float, float)
Sets the local Z rotation for a transform target with the specified blend weight. If a rotation entry already exists for this TransformId, it is overwritten. Independent of any scale entry already present for the same TransformId. Named "Set" (not "Multiply") because rotation's identity is 0 — the applier composes this entry onto the original rotation as an additive Z-degrees offset, the mirror image of MultiplyLocalScale(TransformId, Vector3, float)'s multiplicative (identity 1) convention.
Declaration
public void SetLocalZRotation(TransformId id, float zDegrees, float weight = 1)
Parameters
| Type | Name | Description |
|---|---|---|
| TransformId | id | The transform target identifier. |
| float | zDegrees | The local Z rotation to apply, in degrees (0 = no change). |
| float | weight | Blend weight (0-1). Default is 1 (full application). |