menu_bookDocumentation

s&box StackAlignMode: Stacker alignment modes

calendar_today May 12, 2026 schedule ~2 min read person PatrickJr verified 50

s&box StackAlignMode Enum

StackAlignMode is an enum used by the Stacker tool to determine how the stack direction axis is interpreted. It controls whether stacking follows world-space axes or the target object's local axes.

Type Signature

CSHARP
public enum StackAlignMode
{
    /// <summary>
    /// Stack along world-space axes regardless of object orientation.
    /// </summary>
    World,

    /// <summary>
    /// Stack along the target object's local axes.
    /// </summary>
    Object
}

Values

  • World - Stack along world-space axes regardless of object orientation. The stack direction (Up, Down, etc.) always refers to the same world axes, regardless of how the target object is rotated.
  • Object - Stack along the target object's local axes. The stack direction is interpreted relative to the target object's rotation, so "Up" means the object's local up vector, not world up.

Usage

StackAlignMode is used in the StackerTool to control the coordinate system used for stacking. This affects both the placement direction and how angle offsets are applied.

CSHARP
// Used in StackerTool.cs
[Property, Sync, Title("Alignment")]
public StackAlignMode AlignMode { get; set; } = StackAlignMode.Object;

// Toggle between modes on secondary input
private void CycleAlignment()
{
    AlignMode = AlignMode == StackAlignMode.World
        ? StackAlignMode.Object
        : StackAlignMode.World;
}

// Determine the actual world-space axis based on mode
var initialAxis = AlignMode == StackAlignMode.Object
    ? baseRot * localDir
    : localDir;

Behavior Differences

  • World Mode: Stacking always follows the same world axes regardless of object rotation. Angle offsets rotate in world space.
  • Object Mode: Stacking follows the object's local axes. If the object is rotated 45 degrees, "Up" stacking follows that rotated direction. Angle offsets rotate in the object's local frame.

Notes

  • Default is Object mode for more intuitive stacking
  • Can be toggled using the secondary input
  • Affects both position offset direction and rotation offset application
Was this helpful?