PathDataEnd gets the ending coords and angle from the path
(data []PathData)
| 636 | |
| 637 | // PathDataEnd gets the ending coords and angle from the path |
| 638 | func PathDataEnd(data []PathData) (vec math32.Vector2, ang float32) { |
| 639 | gotSome := false |
| 640 | PathDataIterFunc(data, func(idx int, cmd PathCmds, ptIndex int, cp math32.Vector2, ctrls []math32.Vector2) bool { |
| 641 | if gotSome { |
| 642 | ang = math32.Atan2(cp.Y-vec.Y, cp.X-vec.X) |
| 643 | } |
| 644 | vec = cp |
| 645 | gotSome = true |
| 646 | return tree.Continue |
| 647 | }) |
| 648 | return |
| 649 | } |
| 650 | |
| 651 | // PathCmdNMap gives the number of points per each command |
| 652 | var PathCmdNMap = map[PathCmds]int{ |
no test coverage detected