(position?: Vec2Value, rotation?: number)
| 38 | q: Rot; |
| 39 | |
| 40 | constructor(position?: Vec2Value, rotation?: number) { |
| 41 | if (_CONSTRUCTOR_FACTORY && !(this instanceof Transform)) { |
| 42 | return new Transform(position, rotation); |
| 43 | } |
| 44 | this.p = Vec2.zero(); |
| 45 | this.q = Rot.identity(); |
| 46 | if (typeof position !== "undefined") { |
| 47 | this.p.setVec2(position); |
| 48 | } |
| 49 | if (typeof rotation !== "undefined") { |
| 50 | this.q.setAngle(rotation); |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | static clone(xf: Transform): Transform { |
| 55 | const obj = Object.create(Transform.prototype); |