logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class DirectionalLeanLayerSO

    Stateless procedural layer that drives a constant (non-oscillating) postural lean from the current travel direction: the chest and hips pitch forward while advancing and lean back (more pronounced) while retreating, both roll into the direction of a lateral strafe, and the head yaws slightly toward the strafe direction. Reads the same directional state keys as GaitCycleLayerSO (dirForwardKey/dirLateralKey) but is a separate layer/asset because this offset is not part of the periodic stride cycle — it has no phase input and applies to different bones (Chest/Hips/Head rather than the leg chain).

    Mechanism: every bone offset is a deterministic function of the current direction state — no per-instance runtime state on this shared asset — via the pure SolveLean(double, double, double, double, double, double).

    Common applications: selling forward/backward/strafe travel direction on a humanoid whose gait cycle alone (antiphase leg swing) reads identically for forward and backward motion.

    Inheritance
    object
    ProceduralLayerSO
    DirectionalLeanLayerSO
    Implements
    IProceduralLayer<UnityProceduralContext>
    IFoundationSettings
    Inherited Members
    ProceduralLayerSO.Id
    ProceduralLayerSO.Guid
    ProceduralLayerSO.displayName
    ProceduralLayerSO.phaseMode
    ProceduralLayerSO.repeatCount
    ProceduralLayerSO.Evaluate(in UnityProceduralContext, float, ref PoseDelta, ref MaterialDelta)
    ProceduralLayerSO.Evaluate(in UnityProceduralContext, float, ref PoseDelta, ref MaterialDelta, ref TransformDelta)
    ProceduralLayerSO.Evaluate(in UnityProceduralContext, float, ref PoseDelta, ref MaterialDelta, ref TransformDelta, ref ActivationDelta)
    ProceduralLayerSO.Evaluate(in UnityProceduralContext, float, ref PoseDelta, ref MaterialDelta, ref TransformDelta, ref ActivationDelta, ref UiColorDelta)
    ProceduralLayerSO.OnLayerActivated()
    ProceduralLayerSO.OnLayerDeactivated()
    ProceduralLayerSO.DisplayName
    ProceduralLayerSO.PhaseMode
    ProceduralLayerSO.RepeatCount
    ProceduralLayerSO.SequenceDurationSeconds
    Namespace: Serenity.ProceduralAnimator.Infrastructure.ProceduralLayers
    Assembly: Serenity.UnityProceduralAnimator.Infrastructure.dll
    Syntax
    public class DirectionalLeanLayerSO : ProceduralLayerSO, IProceduralLayer<UnityProceduralContext>, IFoundationSettings

    Constructors

    DirectionalLeanLayerSO()

    Declaration
    public DirectionalLeanLayerSO()

    Properties

    DrivenChannels

    Writes only Pose — the only Evaluate overload this layer overrides.

    Declaration
    public override ProceduralChannels DrivenChannels { get; }
    Property Value
    Type Description
    ProceduralChannels
    Overrides
    ProceduralLayerSO.DrivenChannels

    Methods

    Evaluate(in UnityProceduralContext, float, ref PoseDelta)

    Evaluates this layer and adds its contribution to the pose delta. Called every frame for all active layers.

    Declaration
    public override void Evaluate(in UnityProceduralContext ctx, float weight, ref PoseDelta pose)
    Parameters
    Type Name Description
    UnityProceduralContext ctx

    The procedural context containing state and time information.

    float weight

    The weight of this layer (0-1). Used for blending.

    PoseDelta pose

    The pose delta to add contributions to.

    Overrides
    ProceduralLayerSO.Evaluate(in UnityProceduralContext, float, ref PoseDelta)

    Implements

    IProceduralLayer<TContext>
    IFoundationSettings
    In this article
    © 2026 Serenity. All Rights Reserved