MCPcopy Index your code
hub / github.com/KilledByAPixel/LittleJS / worldToLocal

Method worldToLocal

src/engineObject.js:399–399  ·  view source on GitHub ↗

Convert from world space to local space * @param {Vector2} pos - world space point

(pos)

Source from the content-addressed store, hash-verified

397 /** Convert from world space to local space
398 * @param {Vector2} pos - world space point */
399 worldToLocal(pos) { return pos.subtract(this.pos).rotate(-this.angle); }
400
401 /** Convert from local space to world space for a vector (rotation only)
402 * @param {Vector2} vec - local space vector */

Callers 9

constructorMethod · 0.80
constructorMethod · 0.80
constructorMethod · 0.80
constructorMethod · 0.80
constructorMethod · 0.80
constructorMethod · 0.80
constructorMethod · 0.80
constructorMethod · 0.80
constructorMethod · 0.80

Calls 2

rotateMethod · 0.80
subtractMethod · 0.45

Tested by

no test coverage detected