gb_grid_rotation_utils_test

AUTO-GENERATED FILE – DO NOT EDIT MANUALLY

Unit tests for GBGridRotationUtils Tests grid-aware rotation utilities for both cardinal (4-direction) and multi-directional rotation

Covers:

  • Cardinal direction rotation (4-dir, 90° increments) - backward compatibility
  • 8-direction rotation (45° increments) - isometric with diagonals
  • Custom increment angles (30°, 60°, 15°, etc.)
  • Edge cases (360° wraparound, negative angles, fractional increments)
  • Transform hierarchy handling with various rotation angles
  • Grid snapping with different rotation increments

Source File: /addons/grid_building/test/utilities/data/gb_grid_rotation_utils_test.gd

Extends: GdUnitTestSuite

Properties

  • Property: test_map: TileMapLayer
  • Property: test_node: Node2D

Constants

  • Constant: GridRotationUtils = preload("res://addons/grid_building/utils/gb_grid_rotation_utils.gd")

Public Methods

before_test

1
before_test() -> void

after_test

1
after_test() -> void

test_degrees_to_cardinal_conversion

1
test_degrees_to_cardinal_conversion() -> void

Test cardinal direction conversion from degrees


test_cardinal_to_degrees_conversion

1
test_cardinal_to_degrees_conversion() -> void

Test cardinal direction conversion to degrees


test_clockwise_rotation_sequence

1
test_clockwise_rotation_sequence() -> void

Test clockwise rotation sequence


test_counter_clockwise_rotation_sequence

1
test_counter_clockwise_rotation_sequence() -> void

Test counter-clockwise rotation sequence


test_node_rotation_with_grid_snapping

1
test_node_rotation_with_grid_snapping() -> void

Test node rotation with grid snapping


test_direction_tile_deltas

1
test_direction_tile_deltas() -> void

Test direction tile delta calculations


test_opposite_directions

1
test_opposite_directions() -> void

Test opposite direction calculation


test_direction_classification

1
test_direction_classification() -> void

Test horizontal/vertical direction classification


test_direction_to_string

1
test_direction_to_string() -> void

Test string representation of directions


test_45_degree_increment_rotation

1
test_45_degree_increment_rotation() -> void

Test 8-direction rotation with 45° increments (isometric with diagonals)


test_30_degree_increment_rotation

1
test_30_degree_increment_rotation() -> void

Test 30° increment rotation (12-direction system)


test_60_degree_increment_rotation

1
test_60_degree_increment_rotation() -> void

Test 60° increment rotation (6-direction system, hex-style)


test_15_degree_increment_rotation

1
test_15_degree_increment_rotation() -> void

Test 15° increment rotation (24-direction system)


test_360_degree_wraparound

1
test_360_degree_wraparound() -> void

Test 360° wraparound edge case


test_negative_angles

1
test_negative_angles() -> void

Test negative angle handling


test_fractional_degree_increments

1
test_fractional_degree_increments() -> void

Test fractional increment angles


test_rotation_with_skewed_parent

1
test_rotation_with_skewed_parent() -> void

Test rotation with isometric-style parent transform (skewed)


test_grid_snapping_with_arbitrary_angles

1
test_grid_snapping_with_arbitrary_angles() -> void

Test grid snapping works with non-90° rotations


test_45_degree_rotation_sequence

1
test_45_degree_rotation_sequence() -> void

Test rotation sequence with 45° increments (8-direction system)


test_rotation_with_multi_level_hierarchy

1
test_rotation_with_multi_level_hierarchy() -> void

Test rotation with complex parent hierarchy (multiple levels of transforms)


normalize_degrees

1
normalize_degrees(degrees: float) -> float

Helper: Normalize degrees to 0-360 range


assert_rotation_degrees

1
2
3
4
5
assert_rotation_degrees(
    actual_deg: float,
    expected_deg: float,
    context: String
) -> void

Helper: Assert rotation in degrees with detailed failure message


test_full_clockwise_rotation_cycle

1
test_full_clockwise_rotation_cycle() -> void

Test clockwise rotation cycle


test_full_counter_clockwise_rotation_cycle

1
test_full_counter_clockwise_rotation_cycle() -> void

Test counter-clockwise rotation cycle



Grid Building v5.0.8 | Generated 24/05/2026