新增事件发送接收器
This commit is contained in:
@@ -120,7 +120,7 @@ class Polygon extends Shape {
|
||||
|
||||
for (let i = 0; i < vertCount; i++) {
|
||||
let a = 2 * Math.PI * (i / vertCount);
|
||||
verts[i] = new Vector2(Math.cos(a), Math.sign(a) * radius);
|
||||
verts[i] = new Vector2(Math.cos(a), Math.sin(a) * radius);
|
||||
}
|
||||
|
||||
return verts;
|
||||
|
||||
@@ -2,7 +2,14 @@ class ShapeCollisions {
|
||||
public static polygonToPolygon(first: Polygon, second: Polygon){
|
||||
let result = new CollisionResult();
|
||||
let isIntersecting = true;
|
||||
// let firstEdges = first.ed
|
||||
|
||||
let firstEdges = first.edgeNormals;
|
||||
let secondEdges = second.edgeNormals;
|
||||
let minIntervalDistance = Number.POSITIVE_INFINITY;
|
||||
let translationAxis = new Vector2();
|
||||
let polygonOffset = Vector2.subtract(first.position, second.position);
|
||||
let axis: Vector2;
|
||||
|
||||
}
|
||||
|
||||
public static circleToPolygon(circle: Circle, polygon: Polygon){
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
class Particle {
|
||||
public position: Vector2 = new Vector2(0, 0);
|
||||
public lastPosition: Vector2 = new Vector2(0, 0);
|
||||
public isPinned: boolean;
|
||||
public pinnedPosition;
|
||||
public acceleration: Vector2 = new Vector2(0, 0);
|
||||
public mass: number = 1;
|
||||
public radius: number = 0;
|
||||
public collidesWithColliders = true;
|
||||
|
||||
constructor(position: Vector2){
|
||||
this.position = position;
|
||||
this.lastPosition = position;
|
||||
}
|
||||
|
||||
public applyForce(force: Vector2){
|
||||
this.acceleration = Vector2.add(this.acceleration, new Vector2(force.x / this.mass, force.y / this.mass));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user