/* -------------------------- */ /* nodesPlugin */ /* -------------------------- */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (factory((global.nodesPlugin = global.nodesPlugin || {}))); }(this, function (exports) { 'use strict'; var nodesPlugin = function nodesPlugin(__mapper = {}) { let node = {} node.items = [ ...__mapper("solars").items(), // solars ...__mapper("planets").items() // planets ] var nodesPlugin = function nodesPlugin() {} nodesPlugin.distance2 = (s, t) => (t.x - s.x) * (t.x - s.x) + (t.y - s.y) * (t.y - s.y) nodesPlugin.distance = (s, t) => Math.sqrt(nodesPlugin.distance2(s, t)) nodesPlugin.items = function items(_) { if (arguments.length < 1) return node.items node.items = _ return nodesPlugin } nodesPlugin.searchRange = function searchRange(_) { if (arguments.length < 1) return range range = _ return nodesPlugin } nodesPlugin.collideRadius = function collideRadius(_) { if (arguments.length < 1) return radius radius = _ return nodesPlugin } return nodesPlugin } exports.nodesPlugin = nodesPlugin }));