| 44 | constructor(position: Vec2Value, radius?: number); |
| 45 | constructor(radius?: number); |
| 46 | constructor(a: any, b?: any) { |
| 47 | // @ts-ignore |
| 48 | if (_CONSTRUCTOR_FACTORY && !(this instanceof CircleShape)) { |
| 49 | return new CircleShape(a, b); |
| 50 | } |
| 51 | |
| 52 | super(); |
| 53 | |
| 54 | this.m_type = CircleShape.TYPE; |
| 55 | this.m_p = Vec2.zero(); |
| 56 | this.m_radius = 1; |
| 57 | |
| 58 | if (typeof a === "object" && Vec2.isValid(a)) { |
| 59 | this.m_p.setVec2(a); |
| 60 | |
| 61 | if (typeof b === "number") { |
| 62 | this.m_radius = b; |
| 63 | } |
| 64 | } else if (typeof a === "number") { |
| 65 | this.m_radius = a; |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | /** @hidden */ |
| 70 | _serialize(): object { |