chore: formatting
This commit is contained in:
parent
151ca214e0
commit
f745c61ab0
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue
Block a user