Draw a debug poly in world space * @param {Vector2} pos * @param {Array } points * @param {Color|string} [color] * @param {number} [time] * @param {number} [angle] * @param {boolean} [fill] * @param {boolean} [screenSpace] * @memberof Debug
(pos, points, color=WHITE, time=0, angle=0, fill=false, screenSpace=false)
| 99 | * @param {boolean} [screenSpace] |
| 100 | * @memberof Debug */ |
| 101 | function debugPoly(pos, points, color=WHITE, time=0, angle=0, fill=false, screenSpace=false) |
| 102 | { |
| 103 | ASSERT(isVector2(pos), 'pos must be a vec2'); |
| 104 | ASSERT(isArray(points), 'points must be an array'); |
| 105 | ASSERT(isStringLike(color) || isColor(color), 'color is invalid'); |
| 106 | ASSERT(isNumber(time), 'time must be a number'); |
| 107 | ASSERT(isNumber(angle), 'angle must be a number'); |
| 108 | |
| 109 | if (isColor(color)) |
| 110 | color = color.toString(); |
| 111 | pos = pos.copy(); |
| 112 | points = points.map(p=>p.copy()); |
| 113 | const timer = new Timer(time); |
| 114 | debugPrimitives.push({pos, points, color, timer, angle, fill, screenSpace}); |
| 115 | } |
| 116 | |
| 117 | /** Draw a debug circle in world space |
| 118 | * @param {Vector2} pos |