Browse Source

apply format

djeada 1 day ago
parent
commit
66a69c6c25

+ 0 - 11
app/core/minimap_manager.cpp

@@ -34,7 +34,6 @@ void MinimapManager::generate_for_map(const Game::Map::MapDefinition &map_def) {
     m_world_height = static_cast<float>(map_def.grid.height);
     m_tile_size = map_def.grid.tile_size;
 
-    // Initialize fog image with a copy of the base image
     m_minimap_fog_image = m_minimap_base_image.copy();
     m_minimap_image = m_minimap_fog_image.copy();
 
@@ -195,8 +194,6 @@ void MinimapManager::update_units(
     return;
   }
 
-  // Always start with a fresh copy of the fog-processed base image
-  // to prevent overlays (units, camera viewport) from accumulating
   m_minimap_image = m_minimap_fog_image.copy();
 
   std::vector<Game::Map::Minimap::UnitMarker> markers;
@@ -220,7 +217,6 @@ void MinimapManager::update_units(
         continue;
       }
 
-      // Skip dead units - they should not appear on the minimap
       if (unit->health <= 0) {
         continue;
       }
@@ -259,30 +255,23 @@ void MinimapManager::update_camera_viewport(const Render::GL::Camera *camera,
     return;
   }
 
-  // Get camera target position (where the camera is looking)
   const QVector3D &target = camera->get_target();
 
-  // Estimate the visible world area based on camera distance and FOV
   const float distance = camera->get_distance();
   const float fov_rad =
       camera->get_fov() * Game::Map::Minimap::Constants::k_degrees_to_radians;
   const float aspect = screen_width / std::max(screen_height, 1.0F);
 
-  // Calculate approximate viewport dimensions in world space
-  // Based on the vertical FOV and camera distance
   const float viewport_half_height = distance * std::tan(fov_rad * 0.5F);
   const float viewport_half_width = viewport_half_height * aspect;
 
-  // Convert from world units to tile units for the minimap
   const float viewport_width = viewport_half_width * 2.0F / m_tile_size;
   const float viewport_height = viewport_half_height * 2.0F / m_tile_size;
 
-  // Update the camera viewport layer
   m_camera_viewport_layer->update(target.x() / m_tile_size,
                                   target.z() / m_tile_size, viewport_width,
                                   viewport_height);
 
-  // Draw the camera viewport overlay on the minimap
   const QImage &viewport_overlay = m_camera_viewport_layer->get_image();
   if (!viewport_overlay.isNull()) {
     QPainter painter(&m_minimap_image);

+ 3 - 2
app/core/minimap_manager.h

@@ -9,7 +9,7 @@ struct MapDefinition;
 namespace Minimap {
 class UnitLayer;
 class CameraViewportLayer;
-}
+} // namespace Minimap
 } // namespace Game::Map
 
 namespace Engine::Core {
@@ -48,7 +48,8 @@ private:
   QImage m_minimap_fog_image;
   std::uint64_t m_minimap_fog_version = 0;
   std::unique_ptr<Game::Map::Minimap::UnitLayer> m_unit_layer;
-  std::unique_ptr<Game::Map::Minimap::CameraViewportLayer> m_camera_viewport_layer;
+  std::unique_ptr<Game::Map::Minimap::CameraViewportLayer>
+      m_camera_viewport_layer;
   float m_world_width = 0.0F;
   float m_world_height = 0.0F;
   float m_tile_size = 1.0F;

+ 3 - 10
game/map/minimap/camera_viewport_layer.cpp

@@ -59,10 +59,8 @@ void CameraViewportLayer::update(float camera_x, float camera_z,
   QPainter painter(&m_image);
   painter.setRenderHint(QPainter::Antialiasing, true);
 
-  // Convert camera center position to pixel coordinates
   const auto [px, py] = world_to_pixel(camera_x, camera_z);
 
-  // Convert viewport dimensions to pixel space
   const float pixel_width = viewport_width * m_scale_x;
   const float pixel_height = viewport_height * m_scale_y;
 
@@ -72,7 +70,7 @@ void CameraViewportLayer::update(float camera_x, float camera_z,
 void CameraViewportLayer::draw_viewport_rect(QPainter &painter, float px,
                                              float py, float pixel_width,
                                              float pixel_height) {
-  // Calculate the rectangle bounds centered at the camera position
+
   const float half_w = pixel_width * 0.5F;
   const float half_h = pixel_height * 0.5F;
 
@@ -80,7 +78,6 @@ void CameraViewportLayer::draw_viewport_rect(QPainter &painter, float px,
               static_cast<qreal>(pixel_width),
               static_cast<qreal>(pixel_height));
 
-  // Draw a semi-transparent border rectangle
   QColor border_color(m_border_r, m_border_g, m_border_b, m_border_a);
   QPen pen(border_color);
   pen.setWidthF(static_cast<qreal>(m_border_width));
@@ -88,35 +85,31 @@ void CameraViewportLayer::draw_viewport_rect(QPainter &painter, float px,
   painter.setBrush(Qt::NoBrush);
   painter.drawRect(rect);
 
-  // Draw corner markers for better visibility
   const float corner_size =
       std::min(pixel_width, pixel_height) * k_corner_size_ratio;
   const float actual_corner = std::max(corner_size, k_min_corner_size);
 
   QColor corner_color(m_border_r, m_border_g, m_border_b, 255);
   QPen corner_pen(corner_color);
-  corner_pen.setWidthF(static_cast<qreal>(m_border_width) + k_corner_pen_offset);
+  corner_pen.setWidthF(static_cast<qreal>(m_border_width) +
+                       k_corner_pen_offset);
   painter.setPen(corner_pen);
 
-  // Top-left corner
   painter.drawLine(QPointF(rect.left(), rect.top()),
                    QPointF(rect.left() + actual_corner, rect.top()));
   painter.drawLine(QPointF(rect.left(), rect.top()),
                    QPointF(rect.left(), rect.top() + actual_corner));
 
-  // Top-right corner
   painter.drawLine(QPointF(rect.right(), rect.top()),
                    QPointF(rect.right() - actual_corner, rect.top()));
   painter.drawLine(QPointF(rect.right(), rect.top()),
                    QPointF(rect.right(), rect.top() + actual_corner));
 
-  // Bottom-left corner
   painter.drawLine(QPointF(rect.left(), rect.bottom()),
                    QPointF(rect.left() + actual_corner, rect.bottom()));
   painter.drawLine(QPointF(rect.left(), rect.bottom()),
                    QPointF(rect.left(), rect.bottom() - actual_corner));
 
-  // Bottom-right corner
   painter.drawLine(QPointF(rect.right(), rect.bottom()),
                    QPointF(rect.right() - actual_corner, rect.bottom()));
   painter.drawLine(QPointF(rect.right(), rect.bottom()),

+ 5 - 4
game/map/minimap/minimap_utils.h

@@ -16,14 +16,15 @@ constexpr float k_degrees_to_radians = 3.14159265358979323846F / 180.0F;
 
 } // namespace Constants
 
-inline auto grid_to_world_coords(float grid_x, float grid_z,
-                                 const MapDefinition &map_def)
-    -> std::pair<float, float> {
+inline auto
+grid_to_world_coords(float grid_x, float grid_z,
+                     const MapDefinition &map_def) -> std::pair<float, float> {
   float world_x = grid_x;
   float world_z = grid_z;
 
   if (map_def.coordSystem == CoordSystem::Grid) {
-    const float tile = std::max(Constants::k_min_tile_size, map_def.grid.tile_size);
+    const float tile =
+        std::max(Constants::k_min_tile_size, map_def.grid.tile_size);
     world_x = (grid_x - (map_def.grid.width * 0.5F - 0.5F)) * tile;
     world_z = (grid_z - (map_def.grid.height * 0.5F - 0.5F)) * tile;
   }

+ 2 - 3
game/systems/combat_system.cpp

@@ -94,7 +94,7 @@ void CombatSystem::process_attacks(Engine::Core::World *world,
             const float max_melee_separation = 0.9F;
 
             if (dist > max_melee_separation) {
-              // Check if attacker is in hold mode - don't pull if so
+
               if (!isUnitInHoldMode(attacker)) {
                 float const pull_amount =
                     (dist - ideal_melee_distance) * 0.3F * delta_time * 5.0F;
@@ -158,7 +158,7 @@ void CombatSystem::process_attacks(Engine::Core::World *world,
 
           damage = static_cast<int>(damage * 2.0F);
         } else {
-          // All other units in hold mode get a significant attack bonus
+
           damage = static_cast<int>(damage * 1.75F);
         }
       }
@@ -607,7 +607,6 @@ void CombatSystem::process_attacks(Engine::Core::World *world,
             if (dist > 0.001F) {
               QVector3D const direction(dx / dist, 0.0F, dz / dist);
 
-              // Check hold mode - don't move units that are holding
               if (!isUnitInHoldMode(attacker)) {
                 att_t->position.x += direction.x() * move_amount;
                 att_t->position.z += direction.z() * move_amount;

+ 1 - 3
render/entity/nations/carthage/spearman_renderer.cpp

@@ -198,7 +198,6 @@ public:
       float const hold_t =
           anim.is_in_hold_mode ? 1.0F : (1.0F - anim.hold_exit_progress);
 
-      // Use improved kneel transition when exiting hold
       if (anim.is_exiting_hold) {
         controller.kneelTransition(anim.hold_exit_progress, true);
       } else {
@@ -207,14 +206,13 @@ public:
       controller.lean(QVector3D(0.0F, 0.0F, 1.0F),
                       hold_t * k_lean_amount_multiplier);
 
-      // Check if attacking while in hold position
       if (anim.is_attacking && anim.is_melee && anim.is_in_hold_mode) {
         float const attack_phase = std::fmod(
             anim_ctx.attack_phase * SPEARMAN_INV_ATTACK_CYCLE_TIME, 1.0F);
         controller.spearThrustFromHold(attack_phase,
                                        hold_t * k_kneel_depth_multiplier);
       } else {
-        // Standard hold position hand placement
+
         float const lowered_shoulder_y = controller.get_shoulder_y(true);
         float const pelvis_y = controller.get_pelvis_y();
 

+ 1 - 3
render/entity/nations/roman/spearman_renderer.cpp

@@ -140,7 +140,6 @@ public:
       float const hold_t =
           anim.is_in_hold_mode ? 1.0F : (1.0F - anim.hold_exit_progress);
 
-      // Use improved kneel transition when exiting hold
       if (anim.is_exiting_hold) {
         controller.kneelTransition(anim.hold_exit_progress, true);
       } else {
@@ -149,14 +148,13 @@ public:
       controller.lean(QVector3D(0.0F, 0.0F, 1.0F),
                       hold_t * k_lean_amount_multiplier);
 
-      // Check if attacking while in hold position
       if (anim.is_attacking && anim.is_melee && anim.is_in_hold_mode) {
         float const attack_phase = std::fmod(
             anim_ctx.attack_phase * SPEARMAN_INV_ATTACK_CYCLE_TIME, 1.0F);
         controller.spearThrustFromHold(attack_phase,
                                        hold_t * k_kneel_depth_multiplier);
       } else {
-        // Standard hold position hand placement
+
         float const lowered_shoulder_y = controller.get_shoulder_y(true);
         float const pelvis_y = controller.get_pelvis_y();
 

+ 16 - 24
render/humanoid/mounted_pose_controller.cpp

@@ -380,7 +380,6 @@ void MountedPoseController::apply_sword_strike(
     bool keep_left_hand) {
   attack_phase = std::clamp(attack_phase, 0.0F, 1.0F);
 
-  // Key positions for mounted cavalry slash (typically to the side/down)
   QVector3D const rest_pos = seatRelative(mount, 0.08F, 0.20F, 0.12F);
   QVector3D const chamber_pos = seatRelative(mount, -0.05F, 0.25F, 0.40F);
   QVector3D const apex_pos = seatRelative(mount, -0.02F, 0.30F, 0.48F);
@@ -391,14 +390,13 @@ void MountedPoseController::apply_sword_strike(
   QVector3D hand_l_target =
       reinAnchor(mount, true, 0.20F, 0.25F) + mount.seat_up * -0.02F;
 
-  // Body dynamics for mounted combat
   float torso_twist = 0.0F;
   float side_lean = 0.0F;
   float forward_lean = 0.0F;
   float shoulder_dip = 0.0F;
 
   if (attack_phase < 0.18F) {
-    // Phase 1: Chamber - raise weapon overhead, twist body back
+
     float t = attack_phase / 0.18F;
     float ease_t = t * t;
     hand_r_target = rest_pos * (1.0F - ease_t) + chamber_pos * ease_t;
@@ -408,7 +406,7 @@ void MountedPoseController::apply_sword_strike(
 
     update_head_hierarchy(mount, 0.0F, 0.0F, "sword_chamber");
   } else if (attack_phase < 0.28F) {
-    // Phase 2: Apex - brief pause at highest point
+
     float t = (attack_phase - 0.18F) / 0.10F;
     float ease_t = t * t * (3.0F - 2.0F * t);
     hand_r_target = chamber_pos * (1.0F - ease_t) + apex_pos * ease_t;
@@ -418,23 +416,22 @@ void MountedPoseController::apply_sword_strike(
 
     update_head_hierarchy(mount, 0.0F, 0.0F, "sword_apex");
   } else if (attack_phase < 0.48F) {
-    // Phase 3: Strike - explosive downward/outward slash
+
     float t = (attack_phase - 0.28F) / 0.20F;
     float power_t = t * t * t;
     hand_r_target = apex_pos * (1.0F - power_t) + strike_pos * power_t;
 
-    // Uncoil body into the strike
     torso_twist = -0.04F + 0.12F * power_t;
-    side_lean = 0.08F * power_t;     // Lean into strike direction
+    side_lean = 0.08F * power_t;
     forward_lean = 0.06F * power_t;
     shoulder_dip = 0.05F - 0.08F * power_t;
 
-    // Tighten reins during strike for stability
     hand_l_target += mount.seat_up * (-0.03F * power_t);
 
-    update_head_hierarchy(mount, 0.3F * power_t, 0.2F * power_t, "sword_strike");
+    update_head_hierarchy(mount, 0.3F * power_t, 0.2F * power_t,
+                          "sword_strike");
   } else if (attack_phase < 0.65F) {
-    // Phase 4: Follow-through
+
     float t = (attack_phase - 0.48F) / 0.17F;
     float ease_t = t * t * (3.0F - 2.0F * t);
     hand_r_target = strike_pos * (1.0F - ease_t) + followthrough_pos * ease_t;
@@ -446,7 +443,7 @@ void MountedPoseController::apply_sword_strike(
 
     update_head_hierarchy(mount, 0.15F, 0.1F, "sword_followthrough");
   } else {
-    // Phase 5: Recovery - return to guard
+
     float t = (attack_phase - 0.65F) / 0.35F;
     float ease_t = 1.0F - (1.0F - t) * (1.0F - t);
     hand_r_target = followthrough_pos * (1.0F - ease_t) + rest_pos * ease_t;
@@ -459,7 +456,6 @@ void MountedPoseController::apply_sword_strike(
     update_head_hierarchy(mount, 0.0F, 0.0F, "sword_recover");
   }
 
-  // Apply body dynamics relative to mount orientation
   if (std::abs(torso_twist) > 0.001F) {
     QVector3D const twist_offset = mount.seat_forward * torso_twist;
     m_pose.shoulder_r += twist_offset;
@@ -504,7 +500,6 @@ void MountedPoseController::apply_spear_thrust(
     const MountedAttachmentFrame &mount, float attack_phase) {
   attack_phase = std::clamp(attack_phase, 0.0F, 1.0F);
 
-  // Key positions for lance/spear thrust from horseback
   QVector3D const guard_pos = seatRelative(mount, 0.12F, 0.15F, 0.15F);
   QVector3D const couch_pos = seatRelative(mount, 0.05F, 0.12F, 0.08F);
   QVector3D const thrust_pos = seatRelative(mount, 0.95F, 0.08F, 0.18F);
@@ -513,27 +508,25 @@ void MountedPoseController::apply_spear_thrust(
   QVector3D hand_r_target;
   QVector3D hand_l_target;
 
-  // Body dynamics for couched lance thrust
   float forward_lean = 0.0F;
   float torso_twist = 0.0F;
   float shoulder_drop = 0.0F;
   float torso_compression = 0.0F;
 
   if (attack_phase < 0.20F) {
-    // Phase 1: Couch the spear - lower and align for thrust
+
     float t = attack_phase / 0.20F;
     float ease_t = t * t;
     hand_r_target = guard_pos * (1.0F - ease_t) + couch_pos * ease_t;
     hand_l_target = guard_pos - mount.seat_right * 0.25F +
                     (couch_pos - guard_pos) * ease_t * 0.6F;
 
-    // Slight crouch for power
     torso_compression = 0.03F * ease_t;
     forward_lean = 0.04F * ease_t;
 
     update_head_hierarchy(mount, 0.1F * ease_t, 0.0F, "spear_couch");
   } else if (attack_phase < 0.30F) {
-    // Phase 2: Brief tension before thrust
+
     hand_r_target = couch_pos;
     hand_l_target = couch_pos - mount.seat_right * 0.22F;
 
@@ -542,14 +535,13 @@ void MountedPoseController::apply_spear_thrust(
 
     update_head_hierarchy(mount, 0.1F, 0.0F, "spear_tension");
   } else if (attack_phase < 0.50F) {
-    // Phase 3: Explosive thrust - extend fully forward
+
     float t = (attack_phase - 0.30F) / 0.20F;
     float power_t = t * t * t;
     hand_r_target = couch_pos * (1.0F - power_t) + thrust_pos * power_t;
     hand_l_target = (couch_pos - mount.seat_right * 0.22F) * (1.0F - power_t) +
                     (thrust_pos - mount.seat_right * 0.28F) * power_t;
 
-    // Explosive body extension
     forward_lean = 0.04F + 0.16F * power_t;
     torso_twist = 0.05F * power_t;
     shoulder_drop = 0.04F * power_t;
@@ -557,7 +549,7 @@ void MountedPoseController::apply_spear_thrust(
 
     update_head_hierarchy(mount, 0.5F * power_t, 0.0F, "spear_thrust");
   } else if (attack_phase < 0.65F) {
-    // Phase 4: Full extension - hold at maximum reach
+
     float t = (attack_phase - 0.50F) / 0.15F;
     float ease_t = t * t * (3.0F - 2.0F * t);
     hand_r_target = thrust_pos * (1.0F - ease_t) + extended_pos * ease_t;
@@ -570,12 +562,13 @@ void MountedPoseController::apply_spear_thrust(
 
     update_head_hierarchy(mount, 0.5F, 0.0F, "spear_extend");
   } else {
-    // Phase 5: Recovery - return to guard
+
     float t = (attack_phase - 0.65F) / 0.35F;
     float ease_t = 1.0F - (1.0F - t) * (1.0F - t);
     hand_r_target = extended_pos * (1.0F - ease_t) + guard_pos * ease_t;
-    hand_l_target = (extended_pos - mount.seat_right * 0.32F) * (1.0F - ease_t) +
-                    (guard_pos - mount.seat_right * 0.25F) * ease_t;
+    hand_l_target =
+        (extended_pos - mount.seat_right * 0.32F) * (1.0F - ease_t) +
+        (guard_pos - mount.seat_right * 0.25F) * ease_t;
 
     forward_lean = 0.20F * (1.0F - ease_t);
     torso_twist = 0.05F * (1.0F - ease_t);
@@ -584,7 +577,6 @@ void MountedPoseController::apply_spear_thrust(
     update_head_hierarchy(mount, 0.0F, 0.0F, "spear_recover");
   }
 
-  // Apply body dynamics relative to mount orientation
   if (forward_lean > 0.001F) {
     QVector3D const lean_offset = mount.seat_forward * forward_lean;
     m_pose.shoulder_l += lean_offset;

+ 101 - 145
render/humanoid/pose_controller.cpp

@@ -23,7 +23,6 @@ void HumanoidPoseController::kneel(float depth) {
     return;
   }
 
-  // Smooth easing for more natural motion
   float const eased_depth = depth * depth * (3.0F - 2.0F * depth);
 
   float const kneel_offset = eased_depth * 0.40F;
@@ -32,21 +31,19 @@ void HumanoidPoseController::kneel(float depth) {
 
   float const stance_narrow = 0.11F;
 
-  // Left leg (kneeling leg) - knee on ground
   float const left_knee_y = HP::GROUND_Y + 0.07F * eased_depth;
   float const left_knee_z = -0.06F * eased_depth;
   m_pose.knee_l = QVector3D(-stance_narrow, left_knee_y, left_knee_z);
-  m_pose.foot_l = QVector3D(-stance_narrow - 0.025F, HP::GROUND_Y,
-                            left_knee_z - HP::LOWER_LEG_LEN * 0.93F * eased_depth);
+  m_pose.foot_l =
+      QVector3D(-stance_narrow - 0.025F, HP::GROUND_Y,
+                left_knee_z - HP::LOWER_LEG_LEN * 0.93F * eased_depth);
 
-  // Right leg (support leg) - foot planted forward
   float const right_knee_y = pelvis_y - 0.12F;
   float const right_foot_z = 0.28F * eased_depth;
   m_pose.knee_r = QVector3D(stance_narrow, right_knee_y, right_foot_z - 0.05F);
   m_pose.foot_r = QVector3D(stance_narrow, HP::GROUND_Y + m_pose.foot_y_offset,
                             right_foot_z);
 
-  // Upper body follows down with slight forward lean for stability
   float const upper_body_drop = kneel_offset;
   float const forward_lean = 0.03F * eased_depth;
 
@@ -55,7 +52,6 @@ void HumanoidPoseController::kneel(float depth) {
   m_pose.neck_base.setY(m_pose.neck_base.y() - upper_body_drop);
   m_pose.head_pos.setY(m_pose.head_pos.y() - upper_body_drop);
 
-  // Slight forward lean for braced stance
   m_pose.shoulder_l.setZ(m_pose.shoulder_l.z() + forward_lean);
   m_pose.shoulder_r.setZ(m_pose.shoulder_r.z() + forward_lean);
   m_pose.neck_base.setZ(m_pose.neck_base.z() + forward_lean * 0.8F);
@@ -67,93 +63,78 @@ void HumanoidPoseController::kneelTransition(float progress, bool standing_up) {
 
   progress = std::clamp(progress, 0.0F, 1.0F);
 
-  // Easing function for natural motion
   auto ease_in_out = [](float t) { return t * t * (3.0F - 2.0F * t); };
 
-  // When standing up, invert the progress
   float kneel_amount = standing_up ? (1.0F - progress) : progress;
   float eased_progress = ease_in_out(progress);
 
-  // Apply base kneel position
   kneel(kneel_amount);
 
   if (standing_up) {
-    // Standing up animation enhancements
-    // Early phase: push with front leg, shift weight forward
+
     if (progress < 0.35F) {
       float t = progress / 0.35F;
       float push_t = ease_in_out(t);
 
-      // Push forward with supporting leg
       m_pose.foot_r.setZ(m_pose.foot_r.z() - 0.08F * push_t);
       m_pose.knee_r.setZ(m_pose.knee_r.z() - 0.05F * push_t);
 
-      // Lean forward to build momentum
       float momentum_lean = 0.06F * push_t;
       m_pose.shoulder_l.setZ(m_pose.shoulder_l.z() + momentum_lean);
       m_pose.shoulder_r.setZ(m_pose.shoulder_r.z() + momentum_lean);
       m_pose.neck_base.setZ(m_pose.neck_base.z() + momentum_lean * 0.9F);
       m_pose.head_pos.setZ(m_pose.head_pos.z() + momentum_lean * 0.7F);
 
-      // Arms help with momentum
       m_pose.hand_l.setZ(m_pose.hand_l.z() + 0.04F * push_t);
       m_pose.hand_r.setZ(m_pose.hand_r.z() + 0.04F * push_t);
     }
-    // Middle phase: rise up, bring back leg forward
+
     else if (progress < 0.70F) {
       float t = (progress - 0.35F) / 0.35F;
       float rise_t = ease_in_out(t);
 
-      // Slight upward momentum boost
       float lift_boost = 0.02F * std::sin(rise_t * std::numbers::pi_v<float>);
       m_pose.pelvis_pos.setY(m_pose.pelvis_pos.y() + lift_boost);
       m_pose.shoulder_l.setY(m_pose.shoulder_l.y() + lift_boost);
       m_pose.shoulder_r.setY(m_pose.shoulder_r.y() + lift_boost);
 
-      // Bring kneeling leg forward
       m_pose.foot_l.setZ(m_pose.foot_l.z() + 0.15F * rise_t);
       m_pose.knee_l.setZ(m_pose.knee_l.z() + 0.10F * rise_t);
       m_pose.knee_l.setY(m_pose.knee_l.y() + 0.20F * rise_t);
     }
-    // Final phase: settle into standing position
+
     else {
       float t = (progress - 0.70F) / 0.30F;
       float settle_t = ease_in_out(t);
 
-      // Return forward lean to neutral
       float correct_lean = -0.04F * settle_t * (1.0F - kneel_amount);
       m_pose.shoulder_l.setZ(m_pose.shoulder_l.z() + correct_lean);
       m_pose.shoulder_r.setZ(m_pose.shoulder_r.z() + correct_lean);
     }
   } else {
-    // Kneeling down animation enhancements
-    // Early phase: shift weight, prepare to kneel
+
     if (progress < 0.30F) {
       float t = progress / 0.30F;
       float prep_t = ease_in_out(t);
 
-      // Shift weight back slightly
       m_pose.pelvis_pos.setZ(m_pose.pelvis_pos.z() - 0.03F * prep_t);
 
-      // Arms move to brace
       m_pose.hand_l.setY(m_pose.hand_l.y() - 0.02F * prep_t);
       m_pose.hand_r.setY(m_pose.hand_r.y() - 0.02F * prep_t);
     }
-    // Middle phase: controlled descent
+
     else if (progress < 0.75F) {
       float t = (progress - 0.30F) / 0.45F;
 
-      // Controlled forward lean during descent
       float controlled_lean = 0.04F * std::sin(t * std::numbers::pi_v<float>);
       m_pose.shoulder_l.setZ(m_pose.shoulder_l.z() + controlled_lean);
       m_pose.shoulder_r.setZ(m_pose.shoulder_r.z() + controlled_lean);
     }
-    // Final phase: settle into kneel
+
     else {
       float t = (progress - 0.75F) / 0.25F;
       float settle_t = ease_in_out(t);
 
-      // Small adjustment as knee touches ground
       m_pose.knee_l.setY(m_pose.knee_l.y() - 0.01F * settle_t);
     }
   }
@@ -361,7 +342,6 @@ void HumanoidPoseController::meleeStrike(float strike_phase) {
 
   strike_phase = std::clamp(strike_phase, 0.0F, 1.0F);
 
-  // Define key positions for a natural horizontal slash toward the target
   QVector3D const rest_pos(0.22F, HP::SHOULDER_Y + 0.02F, 0.18F);
   QVector3D const chamber_pos(0.30F, HP::SHOULDER_Y + 0.08F, 0.05F);
   QVector3D const strike_pos(0.28F, HP::SHOULDER_Y - 0.05F, 0.65F);
@@ -370,44 +350,42 @@ void HumanoidPoseController::meleeStrike(float strike_phase) {
   QVector3D hand_r_target;
   QVector3D hand_l_target;
 
-  // Body dynamics
   float torso_twist = 0.0F;
   float forward_lean = 0.0F;
   float shoulder_dip = 0.0F;
   float step_forward = 0.0F;
 
   if (strike_phase < 0.20F) {
-    // Phase 1: Chamber - pull weapon back, twist torso away
+
     float t = strike_phase / 0.20F;
     float ease_t = t * t;
     hand_r_target = rest_pos * (1.0F - ease_t) + chamber_pos * ease_t;
-    hand_l_target = QVector3D(-0.18F, HP::SHOULDER_Y + 0.02F, 0.22F - 0.08F * t);
+    hand_l_target =
+        QVector3D(-0.18F, HP::SHOULDER_Y + 0.02F, 0.22F - 0.08F * t);
 
-    // Twist torso back to coil for the strike
     torso_twist = -0.04F * ease_t;
     shoulder_dip = -0.02F * ease_t;
   } else if (strike_phase < 0.28F) {
-    // Phase 2: Brief anticipation hold
+
     hand_r_target = chamber_pos;
     hand_l_target = QVector3D(-0.18F, HP::SHOULDER_Y + 0.02F, 0.14F);
     torso_twist = -0.04F;
     shoulder_dip = -0.02F;
   } else if (strike_phase < 0.48F) {
-    // Phase 3: Explosive strike - uncoil torso, step forward
+
     float t = (strike_phase - 0.28F) / 0.20F;
-    float power_t = t * t * (3.0F - 2.0F * t); // smoothstep for power
+    float power_t = t * t * (3.0F - 2.0F * t);
     hand_r_target = chamber_pos * (1.0F - power_t) + strike_pos * power_t;
     hand_l_target = QVector3D(-0.18F + 0.06F * power_t,
                               HP::SHOULDER_Y + 0.02F - 0.08F * power_t,
                               0.14F + 0.20F * power_t);
 
-    // Uncoil torso forward and rotate into strike
     torso_twist = -0.04F + 0.10F * power_t;
     forward_lean = 0.08F * power_t;
     shoulder_dip = -0.02F + 0.05F * power_t;
     step_forward = 0.06F * power_t;
   } else if (strike_phase < 0.65F) {
-    // Phase 4: Follow-through - weapon continues past target
+
     float t = (strike_phase - 0.48F) / 0.17F;
     float ease_t = t * t;
     hand_r_target = strike_pos * (1.0F - ease_t) + followthrough_pos * ease_t;
@@ -418,14 +396,14 @@ void HumanoidPoseController::meleeStrike(float strike_phase) {
     shoulder_dip = 0.03F;
     step_forward = 0.06F;
   } else {
-    // Phase 5: Recovery - return to guard
+
     float t = (strike_phase - 0.65F) / 0.35F;
     float ease_t = 1.0F - (1.0F - t) * (1.0F - t);
     hand_r_target = followthrough_pos * (1.0F - ease_t) + rest_pos * ease_t;
-    hand_l_target = QVector3D(-0.12F + (-0.18F + 0.12F) * ease_t,
-                              HP::SHOULDER_Y - 0.06F * (1.0F - ease_t) +
-                                  0.02F * ease_t,
-                              0.34F * (1.0F - ease_t) + 0.22F * ease_t);
+    hand_l_target =
+        QVector3D(-0.12F + (-0.18F + 0.12F) * ease_t,
+                  HP::SHOULDER_Y - 0.06F * (1.0F - ease_t) + 0.02F * ease_t,
+                  0.34F * (1.0F - ease_t) + 0.22F * ease_t);
 
     torso_twist = 0.04F * (1.0F - ease_t);
     forward_lean = 0.05F * (1.0F - ease_t);
@@ -433,7 +411,6 @@ void HumanoidPoseController::meleeStrike(float strike_phase) {
     step_forward = 0.06F * (1.0F - ease_t);
   }
 
-  // Apply body dynamics
   if (std::abs(torso_twist) > 0.001F) {
     m_pose.shoulder_r.setZ(m_pose.shoulder_r.z() + torso_twist);
     m_pose.shoulder_l.setZ(m_pose.shoulder_l.z() - torso_twist * 0.5F);
@@ -479,7 +456,6 @@ void HumanoidPoseController::spearThrust(float attack_phase) {
 
   attack_phase = std::clamp(attack_phase, 0.0F, 1.0F);
 
-  // Key positions for a powerful spear thrust
   QVector3D const guard_pos(0.26F, HP::SHOULDER_Y + 0.08F, 0.28F);
   QVector3D const chamber_pos(0.32F, HP::SHOULDER_Y + 0.12F, 0.02F);
   QVector3D const thrust_pos(0.28F, HP::SHOULDER_Y + 0.05F, 0.95F);
@@ -489,7 +465,6 @@ void HumanoidPoseController::spearThrust(float attack_phase) {
   QVector3D hand_r_target;
   QVector3D hand_l_target;
 
-  // Body dynamics for spear thrust
   float forward_lean = 0.0F;
   float torso_twist = 0.0F;
   float shoulder_drop = 0.0F;
@@ -505,45 +480,44 @@ void HumanoidPoseController::spearThrust(float attack_phase) {
   auto ease_out = [](float t) { return 1.0F - (1.0F - t) * (1.0F - t); };
 
   if (attack_phase < 0.18F) {
-    // Phase 1: Chamber - pull spear back, coil body
+
     float const t = easeInOutCubic(attack_phase / 0.18F);
     hand_r_target = guard_pos * (1.0F - t) + chamber_pos * t;
     hand_l_target = QVector3D(-0.08F, HP::SHOULDER_Y - 0.04F,
                               0.22F * (1.0F - t) + 0.06F * t);
 
-    // Twist body back to load power
     torso_twist = -0.06F * t;
     hip_rotation = -0.04F * t;
-    forward_lean = -0.03F * t; // Slight lean back
+    forward_lean = -0.03F * t;
   } else if (attack_phase < 0.28F) {
-    // Phase 2: Tension hold - brief pause before explosion
+
     float const t = (attack_phase - 0.18F) / 0.10F;
     hand_r_target = chamber_pos;
     hand_l_target = QVector3D(-0.08F, HP::SHOULDER_Y - 0.04F, 0.06F);
 
     torso_twist = -0.06F;
     hip_rotation = -0.04F;
-    forward_lean = -0.03F - 0.02F * t; // Slight additional coil
+    forward_lean = -0.03F - 0.02F * t;
   } else if (attack_phase < 0.48F) {
-    // Phase 3: Explosive thrust - uncoil and drive forward
+
     float t = (attack_phase - 0.28F) / 0.20F;
     float power_t = t * t * t;
     hand_r_target = chamber_pos * (1.0F - power_t) + thrust_pos * power_t;
-    hand_l_target =
-        QVector3D(-0.08F + 0.06F * power_t, HP::SHOULDER_Y - 0.04F + 0.02F * power_t,
-                  0.06F + 0.50F * power_t);
+    hand_l_target = QVector3D(-0.08F + 0.06F * power_t,
+                              HP::SHOULDER_Y - 0.04F + 0.02F * power_t,
+                              0.06F + 0.50F * power_t);
 
-    // Explosive uncoil
     torso_twist = -0.06F + 0.14F * power_t;
     hip_rotation = -0.04F + 0.10F * power_t;
     forward_lean = -0.05F + 0.18F * power_t;
     shoulder_drop = 0.05F * power_t;
     step_forward = 0.10F * power_t;
   } else if (attack_phase < 0.60F) {
-    // Phase 4: Full extension - maximum reach
+
     float const t = smoothstep((attack_phase - 0.48F) / 0.12F);
     hand_r_target = thrust_pos * (1.0F - t) + extended_pos * t;
-    hand_l_target = QVector3D(-0.02F, HP::SHOULDER_Y - 0.02F, 0.56F + 0.10F * t);
+    hand_l_target =
+        QVector3D(-0.02F, HP::SHOULDER_Y - 0.02F, 0.56F + 0.10F * t);
 
     torso_twist = 0.08F;
     hip_rotation = 0.06F;
@@ -551,7 +525,7 @@ void HumanoidPoseController::spearThrust(float attack_phase) {
     shoulder_drop = 0.05F + 0.02F * t;
     step_forward = 0.10F + 0.04F * t;
   } else if (attack_phase < 0.78F) {
-    // Phase 5: Withdraw - pull back from extension
+
     float const t = easeInOutCubic((attack_phase - 0.60F) / 0.18F);
     hand_r_target = extended_pos * (1.0F - t) + recover_pos * t;
     hand_l_target = QVector3D(-0.02F * (1.0F - t) - 0.08F * t,
@@ -564,7 +538,7 @@ void HumanoidPoseController::spearThrust(float attack_phase) {
     shoulder_drop = 0.07F * (1.0F - t);
     step_forward = 0.14F * (1.0F - t * 0.5F);
   } else {
-    // Phase 6: Recovery - return to guard
+
     float const t = ease_out((attack_phase - 0.78F) / 0.22F);
     hand_r_target = recover_pos * (1.0F - t) + guard_pos * t;
     hand_l_target =
@@ -575,7 +549,6 @@ void HumanoidPoseController::spearThrust(float attack_phase) {
     step_forward = 0.07F * (1.0F - t);
   }
 
-  // Apply body dynamics
   if (std::abs(torso_twist) > 0.001F) {
     m_pose.shoulder_r.setZ(m_pose.shoulder_r.z() + torso_twist);
     m_pose.shoulder_l.setZ(m_pose.shoulder_l.z() - torso_twist * 0.4F);
@@ -603,7 +576,6 @@ void HumanoidPoseController::spearThrust(float attack_phase) {
     m_pose.foot_l.setZ(m_pose.foot_l.z() - step_forward * 0.15F);
   }
 
-  // Compute offhand grip along spear shaft
   float const thrust_extent =
       std::clamp((attack_phase - 0.18F) / 0.60F, 0.0F, 1.0F);
   float const along_offset = -0.08F + 0.04F * thrust_extent;
@@ -623,20 +595,22 @@ void HumanoidPoseController::spearThrustFromHold(float attack_phase,
   attack_phase = std::clamp(attack_phase, 0.0F, 1.0F);
   hold_depth = std::clamp(hold_depth, 0.0F, 1.0F);
 
-  // Calculate lowered positions based on hold depth
   float const height_offset = -hold_depth * 0.35F;
 
-  // Key positions adjusted for kneeling - spear angled forward/down
-  QVector3D const guard_pos(0.22F, HP::SHOULDER_Y + height_offset + 0.05F, 0.32F);
-  QVector3D const chamber_pos(0.28F, HP::SHOULDER_Y + height_offset + 0.10F, 0.08F);
-  QVector3D const thrust_pos(0.24F, HP::SHOULDER_Y + height_offset - 0.08F, 0.90F);
-  QVector3D const extended_pos(0.22F, HP::SHOULDER_Y + height_offset - 0.12F, 1.00F);
-  QVector3D const recover_pos(0.24F, HP::SHOULDER_Y + height_offset + 0.02F, 0.48F);
+  QVector3D const guard_pos(0.22F, HP::SHOULDER_Y + height_offset + 0.05F,
+                            0.32F);
+  QVector3D const chamber_pos(0.28F, HP::SHOULDER_Y + height_offset + 0.10F,
+                              0.08F);
+  QVector3D const thrust_pos(0.24F, HP::SHOULDER_Y + height_offset - 0.08F,
+                             0.90F);
+  QVector3D const extended_pos(0.22F, HP::SHOULDER_Y + height_offset - 0.12F,
+                               1.00F);
+  QVector3D const recover_pos(0.24F, HP::SHOULDER_Y + height_offset + 0.02F,
+                              0.48F);
 
   QVector3D hand_r_target;
   QVector3D hand_l_target;
 
-  // Body dynamics for kneeling thrust - limited due to position
   float forward_lean = 0.0F;
   float torso_twist = 0.0F;
   float shoulder_extension = 0.0F;
@@ -646,7 +620,7 @@ void HumanoidPoseController::spearThrustFromHold(float attack_phase,
   auto ease_in = [](float t) { return t * t; };
 
   if (attack_phase < 0.15F) {
-    // Phase 1: Quick chamber from braced position
+
     float const t = ease_in(attack_phase / 0.15F);
     hand_r_target = guard_pos * (1.0F - t) + chamber_pos * t;
     hand_l_target = QVector3D(-0.06F, HP::SHOULDER_Y + height_offset - 0.03F,
@@ -654,13 +628,14 @@ void HumanoidPoseController::spearThrustFromHold(float attack_phase,
 
     torso_twist = -0.04F * t;
   } else if (attack_phase < 0.22F) {
-    // Phase 2: Brief tension
+
     hand_r_target = chamber_pos;
-    hand_l_target = QVector3D(-0.06F, HP::SHOULDER_Y + height_offset - 0.03F, 0.10F);
+    hand_l_target =
+        QVector3D(-0.06F, HP::SHOULDER_Y + height_offset - 0.03F, 0.10F);
 
     torso_twist = -0.04F;
   } else if (attack_phase < 0.42F) {
-    // Phase 3: Explosive thrust from kneeling - drive from hip
+
     float t = (attack_phase - 0.22F) / 0.20F;
     float power_t = t * t * t;
     hand_r_target = chamber_pos * (1.0F - power_t) + thrust_pos * power_t;
@@ -669,12 +644,11 @@ void HumanoidPoseController::spearThrustFromHold(float attack_phase,
                   HP::SHOULDER_Y + height_offset - 0.03F + 0.01F * power_t,
                   0.10F + 0.48F * power_t);
 
-    // Drive forward from braced position
     torso_twist = -0.04F + 0.10F * power_t;
     forward_lean = 0.12F * power_t;
     shoulder_extension = 0.06F * power_t;
   } else if (attack_phase < 0.55F) {
-    // Phase 4: Full extension - maximum reach from kneel
+
     float const t = smoothstep((attack_phase - 0.42F) / 0.13F);
     hand_r_target = thrust_pos * (1.0F - t) + extended_pos * t;
     hand_l_target = QVector3D(-0.01F, HP::SHOULDER_Y + height_offset - 0.02F,
@@ -684,37 +658,36 @@ void HumanoidPoseController::spearThrustFromHold(float attack_phase,
     forward_lean = 0.12F + 0.04F * t;
     shoulder_extension = 0.06F + 0.03F * t;
   } else if (attack_phase < 0.75F) {
-    // Phase 5: Withdraw back to braced position
+
     float const t = smoothstep((attack_phase - 0.55F) / 0.20F);
     hand_r_target = extended_pos * (1.0F - t) + recover_pos * t;
     hand_l_target = QVector3D(-0.01F * (1.0F - t) - 0.05F * t,
-                              HP::SHOULDER_Y + height_offset - 0.02F * (1.0F - t) -
-                                  0.04F * t,
+                              HP::SHOULDER_Y + height_offset -
+                                  0.02F * (1.0F - t) - 0.04F * t,
                               0.66F * (1.0F - t) + 0.40F * t);
 
     torso_twist = 0.06F * (1.0F - t);
     forward_lean = 0.16F * (1.0F - t) + 0.03F * t;
     shoulder_extension = 0.09F * (1.0F - t);
   } else {
-    // Phase 6: Return to guard in hold position
+
     float const t = ease_out((attack_phase - 0.75F) / 0.25F);
     hand_r_target = recover_pos * (1.0F - t) + guard_pos * t;
-    hand_l_target =
-        QVector3D(-0.05F - 0.01F * t, HP::SHOULDER_Y + height_offset - 0.04F * (1.0F - t) -
-                                          0.03F * t,
-                  0.40F * (1.0F - t) + 0.28F * t);
+    hand_l_target = QVector3D(-0.05F - 0.01F * t,
+                              HP::SHOULDER_Y + height_offset -
+                                  0.04F * (1.0F - t) - 0.03F * t,
+                              0.40F * (1.0F - t) + 0.28F * t);
 
     forward_lean = 0.03F * (1.0F - t);
   }
 
-  // Apply body dynamics (limited by kneeling position)
   if (std::abs(torso_twist) > 0.001F) {
     m_pose.shoulder_r.setZ(m_pose.shoulder_r.z() + torso_twist);
     m_pose.shoulder_l.setZ(m_pose.shoulder_l.z() - torso_twist * 0.3F);
   }
 
   if (forward_lean > 0.001F) {
-    // When kneeling, lean is more from upper body only
+
     m_pose.shoulder_l.setZ(m_pose.shoulder_l.z() + forward_lean);
     m_pose.shoulder_r.setZ(m_pose.shoulder_r.z() + forward_lean);
     m_pose.neck_base.setZ(m_pose.neck_base.z() + forward_lean * 0.9F);
@@ -722,12 +695,11 @@ void HumanoidPoseController::spearThrustFromHold(float attack_phase,
   }
 
   if (shoulder_extension > 0.001F) {
-    // Extend right shoulder forward for reach
+
     m_pose.shoulder_r.setZ(m_pose.shoulder_r.z() + shoulder_extension);
     m_pose.shoulder_r.setY(m_pose.shoulder_r.y() - shoulder_extension * 0.3F);
   }
 
-  // Compute offhand grip
   float const thrust_extent =
       std::clamp((attack_phase - 0.15F) / 0.55F, 0.0F, 1.0F);
   float const along_offset = -0.06F + 0.03F * thrust_extent;
@@ -745,7 +717,6 @@ void HumanoidPoseController::sword_slash(float attack_phase) {
 
   attack_phase = std::clamp(attack_phase, 0.0F, 1.0F);
 
-  // Key positions for a diagonal downward slash
   QVector3D const rest_pos(0.20F, HP::SHOULDER_Y + 0.05F, 0.15F);
   QVector3D const chamber_pos(0.28F, HP::SHOULDER_Y + 0.20F, 0.02F);
   QVector3D const apex_pos(0.30F, HP::SHOULDER_Y + 0.25F, 0.08F);
@@ -756,7 +727,6 @@ void HumanoidPoseController::sword_slash(float attack_phase) {
   QVector3D hand_r_target;
   QVector3D hand_l_target;
 
-  // Body dynamics
   float torso_twist = 0.0F;
   float forward_lean = 0.0F;
   float shoulder_rotation = 0.0F;
@@ -767,17 +737,17 @@ void HumanoidPoseController::sword_slash(float attack_phase) {
   auto ease_in = [](float t) { return t * t; };
 
   if (attack_phase < 0.15F) {
-    // Phase 1: Prepare - raise weapon to chamber position
+
     float t = attack_phase / 0.15F;
     float ease_t = ease_in(t);
     hand_r_target = rest_pos * (1.0F - ease_t) + chamber_pos * ease_t;
-    hand_l_target = QVector3D(-0.20F, HP::SHOULDER_Y - 0.02F, 0.15F + 0.02F * t);
+    hand_l_target =
+        QVector3D(-0.20F, HP::SHOULDER_Y - 0.02F, 0.15F + 0.02F * t);
 
-    // Rotate shoulders back, coiling for strike
     torso_twist = -0.05F * ease_t;
     shoulder_rotation = 0.03F * ease_t;
   } else if (attack_phase < 0.28F) {
-    // Phase 2: Apex - weapon at highest point, brief tension
+
     float t = (attack_phase - 0.15F) / 0.13F;
     float ease_t = smoothstep(t);
     hand_r_target = chamber_pos * (1.0F - ease_t) + apex_pos * ease_t;
@@ -785,23 +755,22 @@ void HumanoidPoseController::sword_slash(float attack_phase) {
 
     torso_twist = -0.05F;
     shoulder_rotation = 0.03F + 0.02F * ease_t;
-    weight_shift = -0.02F * ease_t; // Weight shifts back before strike
+    weight_shift = -0.02F * ease_t;
   } else if (attack_phase < 0.48F) {
-    // Phase 3: Strike - explosive diagonal slash downward
+
     float t = (attack_phase - 0.28F) / 0.20F;
-    float power_t = t * t * t; // Fast acceleration
+    float power_t = t * t * t;
     hand_r_target = apex_pos * (1.0F - power_t) + strike_pos * power_t;
-    hand_l_target =
-        QVector3D(-0.20F + 0.08F * power_t,
-                  HP::SHOULDER_Y - 0.04F - 0.06F * power_t, 0.17F + 0.22F * power_t);
+    hand_l_target = QVector3D(-0.20F + 0.08F * power_t,
+                              HP::SHOULDER_Y - 0.04F - 0.06F * power_t,
+                              0.17F + 0.22F * power_t);
 
-    // Explosive uncoil - torso rotates into strike, body leans forward
     torso_twist = -0.05F + 0.14F * power_t;
     forward_lean = 0.10F * power_t;
     shoulder_rotation = 0.05F - 0.08F * power_t;
     weight_shift = -0.02F + 0.08F * power_t;
   } else if (attack_phase < 0.62F) {
-    // Phase 4: Follow-through - weapon continues past target
+
     float t = (attack_phase - 0.48F) / 0.14F;
     float ease_t = smoothstep(t);
     hand_r_target = strike_pos * (1.0F - ease_t) + followthrough_pos * ease_t;
@@ -811,22 +780,20 @@ void HumanoidPoseController::sword_slash(float attack_phase) {
     forward_lean = 0.10F - 0.02F * t;
     weight_shift = 0.06F;
   } else {
-    // Phase 5: Recovery - return to guard
+
     float t = (attack_phase - 0.62F) / 0.38F;
     float ease_t = ease_out(t);
-    hand_r_target =
-        followthrough_pos * (1.0F - ease_t) + recover_pos * 0.5F * ease_t +
-        rest_pos * 0.5F * ease_t;
-    hand_l_target =
-        QVector3D(-0.12F - 0.08F * ease_t, HP::SHOULDER_Y - 0.10F * (1.0F - ease_t),
-                  0.39F * (1.0F - ease_t) + 0.15F * ease_t);
+    hand_r_target = followthrough_pos * (1.0F - ease_t) +
+                    recover_pos * 0.5F * ease_t + rest_pos * 0.5F * ease_t;
+    hand_l_target = QVector3D(-0.12F - 0.08F * ease_t,
+                              HP::SHOULDER_Y - 0.10F * (1.0F - ease_t),
+                              0.39F * (1.0F - ease_t) + 0.15F * ease_t);
 
     torso_twist = 0.06F * (1.0F - ease_t);
     forward_lean = 0.08F * (1.0F - ease_t);
     weight_shift = 0.06F * (1.0F - ease_t);
   }
 
-  // Apply body dynamics
   if (std::abs(torso_twist) > 0.001F) {
     m_pose.shoulder_r.setZ(m_pose.shoulder_r.z() + torso_twist);
     m_pose.shoulder_l.setZ(m_pose.shoulder_l.z() - torso_twist * 0.6F);
@@ -919,22 +886,19 @@ void HumanoidPoseController::sword_slash_variant(float attack_phase,
 
   attack_phase = std::clamp(attack_phase, 0.0F, 1.0F);
 
-  // Strike direction constants
   constexpr float kStrikeRightToLeft = 1.0F;
   constexpr float kStrikeLeftToRight = -1.0F;
 
-  // Base positions - will be modified by variant
   QVector3D rest_pos(0.20F, HP::SHOULDER_Y + 0.05F, 0.15F);
   QVector3D chamber_pos(0.28F, HP::SHOULDER_Y + 0.20F, 0.02F);
   QVector3D apex_pos(0.30F, HP::SHOULDER_Y + 0.25F, 0.08F);
   QVector3D strike_pos(0.18F, HP::SHOULDER_Y - 0.15F, 0.62F);
   QVector3D followthrough_pos(0.05F, HP::WAIST_Y + 0.10F, 0.50F);
 
-  // Variant-specific attack patterns
   float strike_direction = kStrikeRightToLeft;
   switch (variant % 3) {
   case 1:
-    // Left-to-right diagonal slash
+
     chamber_pos = QVector3D(-0.10F, HP::SHOULDER_Y + 0.22F, 0.04F);
     apex_pos = QVector3D(-0.08F, HP::SHOULDER_Y + 0.28F, 0.10F);
     strike_pos = QVector3D(0.32F, HP::SHOULDER_Y - 0.12F, 0.58F);
@@ -942,7 +906,7 @@ void HumanoidPoseController::sword_slash_variant(float attack_phase,
     strike_direction = kStrikeLeftToRight;
     break;
   case 2:
-    // Horizontal slash from right
+
     chamber_pos = QVector3D(0.35F, HP::SHOULDER_Y + 0.10F, 0.0F);
     apex_pos = QVector3D(0.38F, HP::SHOULDER_Y + 0.08F, 0.06F);
     strike_pos = QVector3D(0.05F, HP::SHOULDER_Y - 0.05F, 0.65F);
@@ -955,7 +919,6 @@ void HumanoidPoseController::sword_slash_variant(float attack_phase,
   QVector3D hand_r_target;
   QVector3D hand_l_target;
 
-  // Body dynamics
   float torso_twist = 0.0F;
   float forward_lean = 0.0F;
   float shoulder_rotation = 0.0F;
@@ -985,9 +948,9 @@ void HumanoidPoseController::sword_slash_variant(float attack_phase,
     float t = (attack_phase - 0.28F) / 0.20F;
     float power_t = t * t * t;
     hand_r_target = apex_pos * (1.0F - power_t) + strike_pos * power_t;
-    hand_l_target =
-        QVector3D(-0.20F + 0.08F * power_t,
-                  HP::SHOULDER_Y - 0.04F - 0.06F * power_t, 0.17F + 0.22F * power_t);
+    hand_l_target = QVector3D(-0.20F + 0.08F * power_t,
+                              HP::SHOULDER_Y - 0.04F - 0.06F * power_t,
+                              0.17F + 0.22F * power_t);
 
     torso_twist = strike_direction * (-0.05F + 0.14F * power_t);
     forward_lean = 0.10F * power_t;
@@ -1006,16 +969,15 @@ void HumanoidPoseController::sword_slash_variant(float attack_phase,
     float t = (attack_phase - 0.62F) / 0.38F;
     float ease_t = ease_out(t);
     hand_r_target = followthrough_pos * (1.0F - ease_t) + rest_pos * ease_t;
-    hand_l_target =
-        QVector3D(-0.12F - 0.08F * ease_t, HP::SHOULDER_Y - 0.10F * (1.0F - ease_t),
-                  0.39F * (1.0F - ease_t) + 0.15F * ease_t);
+    hand_l_target = QVector3D(-0.12F - 0.08F * ease_t,
+                              HP::SHOULDER_Y - 0.10F * (1.0F - ease_t),
+                              0.39F * (1.0F - ease_t) + 0.15F * ease_t);
 
     torso_twist = 0.06F * strike_direction * (1.0F - ease_t);
     forward_lean = 0.08F * (1.0F - ease_t);
     weight_shift = 0.06F * (1.0F - ease_t);
   }
 
-  // Apply body dynamics
   if (std::abs(torso_twist) > 0.001F) {
     m_pose.shoulder_r.setZ(m_pose.shoulder_r.z() + torso_twist);
     m_pose.shoulder_l.setZ(m_pose.shoulder_l.z() - torso_twist * 0.6F);
@@ -1048,25 +1010,22 @@ void HumanoidPoseController::spear_thrust_variant(float attack_phase,
 
   attack_phase = std::clamp(attack_phase, 0.0F, 1.0F);
 
-  // Thrust height constants for variants
   constexpr float kThrustHigh = 1.0F;
   constexpr float kThrustMiddle = 0.0F;
   constexpr float kThrustLow = -1.0F;
 
-  // Base key positions
   QVector3D guard_pos(0.26F, HP::SHOULDER_Y + 0.08F, 0.28F);
   QVector3D chamber_pos(0.32F, HP::SHOULDER_Y + 0.12F, 0.02F);
   QVector3D thrust_pos(0.28F, HP::SHOULDER_Y + 0.05F, 0.95F);
   QVector3D extended_pos(0.25F, HP::SHOULDER_Y + 0.02F, 1.05F);
   QVector3D recover_pos(0.28F, HP::SHOULDER_Y + 0.06F, 0.45F);
 
-  // Variant-specific thrust patterns
   float thrust_height = kThrustMiddle;
   float crouch_amount = 0.0F;
 
   switch (variant % 3) {
   case 1:
-    // Low thrust - target legs/lower body, with crouch
+
     chamber_pos = QVector3D(0.30F, HP::SHOULDER_Y + 0.18F, 0.0F);
     thrust_pos = QVector3D(0.28F, HP::WAIST_Y + 0.15F, 0.98F);
     extended_pos = QVector3D(0.25F, HP::WAIST_Y + 0.10F, 1.08F);
@@ -1075,21 +1034,20 @@ void HumanoidPoseController::spear_thrust_variant(float attack_phase,
     crouch_amount = 0.08F;
     break;
   case 2:
-    // High thrust - target head/upper body, slight upward angle
+
     chamber_pos = QVector3D(0.35F, HP::SHOULDER_Y + 0.05F, 0.08F);
     thrust_pos = QVector3D(0.30F, HP::SHOULDER_Y + 0.12F, 0.92F);
     extended_pos = QVector3D(0.28F, HP::SHOULDER_Y + 0.15F, 1.02F);
     thrust_height = kThrustHigh;
     break;
   default:
-    // Standard middle thrust
+
     break;
   }
 
   QVector3D hand_r_target;
   QVector3D hand_l_target;
 
-  // Body dynamics for spear thrust variant
   float forward_lean = 0.0F;
   float torso_twist = 0.0F;
   float shoulder_drop = 0.0F;
@@ -1106,7 +1064,7 @@ void HumanoidPoseController::spear_thrust_variant(float attack_phase,
   auto ease_out = [](float t) { return 1.0F - (1.0F - t) * (1.0F - t); };
 
   if (attack_phase < 0.18F) {
-    // Phase 1: Chamber - pull spear back, coil body
+
     float const t = easeInOutCubic(attack_phase / 0.18F);
     hand_r_target = guard_pos * (1.0F - t) + chamber_pos * t;
     hand_l_target = QVector3D(-0.08F, HP::SHOULDER_Y - 0.04F,
@@ -1117,7 +1075,7 @@ void HumanoidPoseController::spear_thrust_variant(float attack_phase,
     forward_lean = -0.03F * t;
     crouch_factor = crouch_amount * t;
   } else if (attack_phase < 0.28F) {
-    // Phase 2: Tension hold
+
     hand_r_target = chamber_pos;
     hand_l_target = QVector3D(-0.08F, HP::SHOULDER_Y - 0.04F, 0.06F);
 
@@ -1126,13 +1084,13 @@ void HumanoidPoseController::spear_thrust_variant(float attack_phase,
     forward_lean = -0.03F;
     crouch_factor = crouch_amount;
   } else if (attack_phase < 0.48F) {
-    // Phase 3: Explosive thrust
+
     float t = (attack_phase - 0.28F) / 0.20F;
     float power_t = t * t * t;
     hand_r_target = chamber_pos * (1.0F - power_t) + thrust_pos * power_t;
-    hand_l_target =
-        QVector3D(-0.08F + 0.06F * power_t, HP::SHOULDER_Y - 0.04F + 0.02F * power_t,
-                  0.06F + 0.50F * power_t);
+    hand_l_target = QVector3D(-0.08F + 0.06F * power_t,
+                              HP::SHOULDER_Y - 0.04F + 0.02F * power_t,
+                              0.06F + 0.50F * power_t);
 
     torso_twist = -0.06F + 0.14F * power_t;
     hip_rotation = -0.04F + 0.10F * power_t;
@@ -1141,19 +1099,19 @@ void HumanoidPoseController::spear_thrust_variant(float attack_phase,
     step_forward = 0.12F * power_t;
     crouch_factor = crouch_amount * (1.0F - power_t * 0.3F);
 
-    // Adjust for thrust height
     if (thrust_height < 0) {
-      // Low thrust - additional crouch during strike
+
       crouch_factor += 0.06F * power_t;
     } else if (thrust_height > 0) {
-      // High thrust - rise up slightly
+
       crouch_factor -= 0.03F * power_t;
     }
   } else if (attack_phase < 0.60F) {
-    // Phase 4: Full extension
+
     float const t = smoothstep((attack_phase - 0.48F) / 0.12F);
     hand_r_target = thrust_pos * (1.0F - t) + extended_pos * t;
-    hand_l_target = QVector3D(-0.02F, HP::SHOULDER_Y - 0.02F, 0.56F + 0.10F * t);
+    hand_l_target =
+        QVector3D(-0.02F, HP::SHOULDER_Y - 0.02F, 0.56F + 0.10F * t);
 
     torso_twist = 0.08F;
     hip_rotation = 0.06F;
@@ -1162,7 +1120,7 @@ void HumanoidPoseController::spear_thrust_variant(float attack_phase,
     step_forward = 0.12F + 0.04F * t;
     crouch_factor = crouch_amount * 0.7F;
   } else if (attack_phase < 0.78F) {
-    // Phase 5: Withdraw
+
     float const t = easeInOutCubic((attack_phase - 0.60F) / 0.18F);
     hand_r_target = extended_pos * (1.0F - t) + recover_pos * t;
     hand_l_target = QVector3D(-0.02F * (1.0F - t) - 0.08F * t,
@@ -1176,7 +1134,7 @@ void HumanoidPoseController::spear_thrust_variant(float attack_phase,
     step_forward = 0.16F * (1.0F - t * 0.5F);
     crouch_factor = crouch_amount * 0.7F * (1.0F - t);
   } else {
-    // Phase 6: Recovery
+
     float const t = ease_out((attack_phase - 0.78F) / 0.22F);
     hand_r_target = recover_pos * (1.0F - t) + guard_pos * t;
     hand_l_target =
@@ -1187,7 +1145,6 @@ void HumanoidPoseController::spear_thrust_variant(float attack_phase,
     step_forward = 0.08F * (1.0F - t);
   }
 
-  // Apply body dynamics
   if (std::abs(torso_twist) > 0.001F) {
     m_pose.shoulder_r.setZ(m_pose.shoulder_r.z() + torso_twist);
     m_pose.shoulder_l.setZ(m_pose.shoulder_l.z() - torso_twist * 0.4F);
@@ -1215,7 +1172,6 @@ void HumanoidPoseController::spear_thrust_variant(float attack_phase,
     m_pose.foot_l.setZ(m_pose.foot_l.z() - step_forward * 0.15F);
   }
 
-  // Apply crouch for low thrusts
   if (crouch_factor > 0.001F) {
     m_pose.pelvis_pos.setY(m_pose.pelvis_pos.y() - crouch_factor);
     m_pose.shoulder_l.setY(m_pose.shoulder_l.y() - crouch_factor * 0.6F);