refactor: body vertices
This commit is contained in:
parent
2eb2c58054
commit
62ff586777
|
@ -4,6 +4,7 @@ const decorate = compose(
|
|||
virtualize([
|
||||
'applyForce',
|
||||
'applyImpulse',
|
||||
'vertices',
|
||||
]),
|
||||
);
|
||||
|
||||
|
|
|
@ -148,4 +148,12 @@ export class Body extends AbstractBody {
|
|||
MatterBody.setStatic(this.matterBody, isStatic);
|
||||
}
|
||||
|
||||
get vertices() {
|
||||
const vertices = [];
|
||||
for (const {x, y} of this.matterBody.vertices) {
|
||||
vertices.push([x, y]);
|
||||
}
|
||||
return vertices;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user