Draw a debug line in world space * @param {Vector2} posA * @param {Vector2} posB * @param {Color|string} [color] * @param {number} [width] * @param {number} [time] * @param {boolean} [screenSpace] * @memberof Debug
(posA, posB, color, width=.1, time=0, screenSpace=false)
| 155 | * @param {boolean} [screenSpace] |
| 156 | * @memberof Debug */ |
| 157 | function debugLine(posA, posB, color, width=.1, time=0, screenSpace=false) |
| 158 | { |
| 159 | ASSERT(isVector2(posA), 'posA must be a vec2'); |
| 160 | ASSERT(isVector2(posB), 'posB must be a vec2'); |
| 161 | ASSERT(isNumber(width), 'width must be a number'); |
| 162 | |
| 163 | const halfDelta = vec2((posB.x - posA.x)/2, (posB.y - posA.y)/2); |
| 164 | const size = vec2(width, halfDelta.length()*2); |
| 165 | debugRect(posA.add(halfDelta), size, color, time, halfDelta.angle(), true, screenSpace); |
| 166 | } |
| 167 | |
| 168 | /** Draw a debug combined axis aligned bounding box in world space |
| 169 | * @param {Vector2} posA |
no test coverage detected