(renderable: Renderable, p: Vector2d)
| 654 | } |
| 655 | |
| 656 | setPosition(renderable: Renderable, p: Vector2d): void { |
| 657 | const body = this.bodyMap.get(renderable); |
| 658 | if (body) { |
| 659 | // `p` is in renderable.pos space (typically top-left). The body |
| 660 | // is anchored at the shape centroid; convert via the cached |
| 661 | // offset so syncFromPhysics keeps renderable.pos at the |
| 662 | // requested value. |
| 663 | const off = this.posOffsets.get(renderable); |
| 664 | const wpx = p.x - (off?.x ?? 0); |
| 665 | const wpy = p.y - (off?.y ?? 0); |
| 666 | body.setTransform(this.vec2InMeters(wpx, wpy), body.getAngle()); |
| 667 | } |
| 668 | renderable.pos.x = p.x; |
| 669 | renderable.pos.y = p.y; |
| 670 | } |
| 671 | |
| 672 | setAngle(renderable: Renderable, angle: number): void { |
| 673 | const body = this.bodyMap.get(renderable); |
nothing calls this directly
no test coverage detected