ManipulationTransformCalculator
Summary
Section titled “Summary”ManipulationTransformCalculator - Pure logic component for manipulation transform calculations.
Responsibilities: - Calculate final transforms for placed objects after manipulation - Preserve flip semantics (negative scale values) during transform application - Provide testable, isolated transform logic separate from system dependencies
This component contains NO dependencies on: - Scene tree - Signals - State management - Input handling
All methods are pure functions that take inputs and return outputs.
Methods
Section titled “Methods”static func calculate_final_transform( preview_root: Node2D, manipulation_parent: Node2D ) -> Dictionary
Calculates the final transform components for a manipulated object. Extracts position, rotation, and scale from the manipulation preview, preserving flip semantics (negative scale values).
preview_root
: The preview object root (child of ManipulationParent)manipulation_parent
: The ManipulationParent containing accumulated transforms Returns: Dictionary with keys: position (Vector2), rotation (float), scale (Vector2)static func validate_transform_preservation( calculated_transforms: Dictionary ) -> Dictionary
Validates that calculated transforms preserve flip semantics. Checks if negative scale values (flips) are preserved correctly.
calculated_transforms
: Dictionary from calculate_final_transform Returns: Dictionary with keys: is_valid (bool), issues (Array[String])static func format_transforms_debug( transforms: Dictionary ) -> String
Formats transform data for diagnostic output. Creates human-readable string representation of transform components.
transforms
: Dictionary with position, rotation, scale keys Returns: Formatted string for logging/debuggingstatic func extract_transform_components( transform: Transform2D ) -> Dictionary
Extracts transform components from a Transform2D for comparison. Breaks down a Transform2D into position, rotation, and scale for validation.
:::note[Note] Transform2D.basis normalizes negative scale to positive scale + rotation. This method extracts the effective values after normalization. :::
transform
: The Transform2D to extract from Returns: Dictionary with position, rotation, scale keys
Source
Section titled “Source”addons/grid_building/systems/manipulation/manipulation_transform_calculator.gd
This API reference is automatically generated from the plugin source code. For implementation examples and usage guides, see the guides section.