How to use the decentraland/samples/ecs/scene.json.scene function in decentraland

To help you get started, we’ve selected a few decentraland examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github decentraland / builder / src / modules / project / export.ts View on Github external
export function getSceneDefinition(project: Project, point: Coordinate, rotation: Rotation) {
  const parcels = getParcelOrientation(project, point, rotation)
  const base = parcels.reduce((base, parcel) => (parcel.x <= base.x && parcel.y <= base.y ? parcel : base), parcels[0])

  return {
    ...sceneJson,
    scene: {
      ...sceneJson.scene,
      parcels: parcels.map(parcelToString),
      base: parcelToString(base)
    },
    source: {
      origin: 'builder',
      projectId: project.id
    }
  }
}

decentraland

Decentraland CLI developer tool.

Apache-2.0
Latest version published 17 days ago

Package Health Score

78 / 100
Full package analysis