Skip to content

@vaguevoid/fiasco / math/coordinates / worldToLocal

Function: worldToLocal()

worldToLocal(worldPosition, localToWorld): Vec2

Defined in: src/math/coordinates.ts:144

Convert the given world-position into the local coordinate system represented by localToWorld.

ts
import { Coords, LocalToWorld, Query } from '@vaguevoid/fiasco'

function system(locals: Query<[LocalToWorld]>) {
  for (const [local] of locals) {
    const result = Coords.worldToLocal({ x: 0, y: 0 }, local.matrix)
  }
}

Parameters

worldPosition

Vec2

localToWorld

Mat4

Returns

Vec2