| 383 | |
| 384 | if (InputSubsystem::Instance().IsKeyDown(SDL_SCANCODE_LSHIFT) || |
| 385 | InputSubsystem::Instance().IsKeyDown(SDL_SCANCODE_RSHIFT)) |
| 386 | { |
| 387 | // rotate |
| 388 | Vector3 sum = VZero; |
| 389 | int count = 0; |
| 390 | _template->CalculateCenter(sum, count, true); |
| 391 | if (count > 0) |
| 392 | { |
| 393 | Vector3 center = (1.0f / count) * sum; |
| 394 | Vector3 oldDir = _lastPos - center; |
| 395 | Vector3 dir = curPos - center; |
| 396 | float angle = AngleDifference(atan2(dir.X(), dir.Z()), atan2(oldDir.X(), oldDir.Z())); |
| 397 | _template->Rotate(center, angle, true); |
| 398 | } |
| 399 | } |
| 400 | else |
| 401 | { |
| 402 | Vector3 offset = curPos - _lastPos; |
| 403 | // move all selected items by offset |
| 404 | for (int i = 0; i < _template->markers.Size(); i++) |
| 405 | { |
| 406 | ArcadeMarkerInfo& mInfo = _template->markers[i]; |
| 407 | if (!HasWizVarPrefix(mInfo.name)) |
| 408 | { |
| 409 | continue; |
| 410 | } |
| 411 | if (mInfo.selected) |
| 412 | { |
| 413 | Vector3 pos = mInfo.position + offset; |
| 414 | pos[1] = GLOB_LAND->RoadSurfaceYAboveWater(pos[0], pos[2]); |
| 415 | _template->MarkerChangePosition(i, pos); |
| 416 | } |
| 417 | } |
| 418 | } |
| 419 | |
| 420 | _lastPos = curPos; |
| 421 | } |
| 422 | else if (_selecting) |
| 423 | { |
| 424 | _lastPos = ScreenToWorld(DrawCoord(x, y)); |
| 425 | } |
nothing calls this directly
no test coverage detected