chore: formatting

This commit is contained in:
cha0s 2019-03-23 20:04:59 -05:00
parent 151ca214e0
commit f745c61ab0
2 changed files with 6 additions and 4 deletions

View File

@ -53,12 +53,13 @@ export class Listed extends Trait {
const upperRight = Vector.add(upperLeft, [width, 0]);
const lowerLeft = Vector.add(upperLeft, [0, height]);
const lowerRight = Vector.add(upperLeft, [width, height]);
this.quadTreeNodes = [
const points = [
upperLeft,
upperRight,
lowerLeft,
lowerRight,
].map((point) => [...point, this.entity]);
];
this.quadTreeNodes = points.map((point) => [...point, this.entity]);
// Add points to quad tree.
for (const node of this.quadTreeNodes) {
quadTree.add(node);

View File

@ -71,12 +71,13 @@ export class World {
const upperRight = Vector.add(upperLeft, [width, 0]);
const lowerLeft = Vector.add(upperLeft, [0, height]);
const lowerRight = Vector.add(upperLeft, [width, height]);
const nodes = [
const points = [
upperLeft,
upperRight,
lowerLeft,
lowerRight,
].map((point) => [...point, body]);
];
const nodes = points.map((point) => [...point, body]);
this.quadTreeNodes.set(body, nodes);
for (const node of nodes) {
this.quadTree.add(node);