Rev 75 | Rev 116 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 75 | Rev 81 | ||
---|---|---|---|
Line 844... | Line 844... | ||
844 | movement_maxheight *= 2.0f; // knights jump high |
844 | movement_maxheight *= 2.0f; // knights jump high |
845 | else if ((currentmove->part == PART_KING) && (movement_diffco == 2)) |
845 | else if ((currentmove->part == PART_KING) && (movement_diffco == 2)) |
846 | movement_maxheight *= 5.0f; // kings jump VERY high when castling too |
846 | movement_maxheight *= 5.0f; // kings jump VERY high when castling too |
847 | else if (movement_maxheight > 5.0f) |
847 | else if (movement_maxheight > 5.0f) |
848 | movement_maxheight = 5.0f; // all other parts just hover above the ground |
848 | movement_maxheight = 5.0f; // all other parts just hover above the ground |
849 | current_z = 0.04f + sin (MATH_PI * movement_ratio) * movement_maxheight; |
849 | current_z = 0.04f + (float) sin (MATH_PI * movement_ratio) * movement_maxheight; |
850 | 850 | ||
851 | // make this part move realistically |
851 | // make this part move realistically |
852 | Scene_AddPart (scene, boardslot->part, boardslot->color, current_x, current_y, current_z, 0.0f, (boardslot->color == COLOR_BLACK ? -1 : 1) * min (current_z * 3.0f, 10.0f)); |
852 | Scene_AddPart (scene, boardslot->part, boardslot->color, current_x, current_y, current_z, 0.0f, (boardslot->color == COLOR_BLACK ? -1 : 1) * min (current_z * 3.0f, 10.0f)); |
853 | } |
853 | } |
854 | else |
854 | else |
Line 913... | Line 913... | ||
913 | current_x = source_x + (target_x - source_x) * movement_ratio; |
913 | current_x = source_x + (target_x - source_x) * movement_ratio; |
914 | current_y = source_y + (target_y - source_y) * movement_ratio; |
914 | current_y = source_y + (target_y - source_y) * movement_ratio; |
915 | 915 | ||
916 | // height is a sine positive, max height is proportional to travelled distance |
916 | // height is a sine positive, max height is proportional to travelled distance |
917 | movement_maxheight = 1.0f; // castling rook will barely hover above the ground |
917 | movement_maxheight = 1.0f; // castling rook will barely hover above the ground |
918 | current_z = 0.04f + sin (MATH_PI * movement_ratio) * movement_maxheight; |
918 | current_z = 0.04f + (float) sin (MATH_PI * movement_ratio) * movement_maxheight; |
919 | 919 | ||
920 | // make this part move realistically - do we want the 3D models or the flat icons ? |
920 | // make this part move realistically - do we want the 3D models or the flat icons ? |
921 | // we do when EITHER we don't want flat icons OR the player playing the current move is looking downstraight |
921 | // we do when EITHER we don't want flat icons OR the player playing the current move is looking downstraight |
922 | if (!want_flaticons || (current_pitch < MAX_PITCH_FOR_FLAT_ICONS)) |
922 | if (!want_flaticons || (current_pitch < MAX_PITCH_FOR_FLAT_ICONS)) |
923 | Scene_AddPart (scene, boardslot->part, boardslot->color, current_x, current_y, current_z, 0.0f, (boardslot->color == COLOR_BLACK ? -1 : 1) * min (current_z * 3.0f, 10.0f)); |
923 | Scene_AddPart (scene, boardslot->part, boardslot->color, current_x, current_y, current_z, 0.0f, (boardslot->color == COLOR_BLACK ? -1 : 1) * min (current_z * 3.0f, 10.0f)); |