新增shape形状

This commit is contained in:
yhh
2020-06-11 20:36:36 +08:00
parent 53ded30e0b
commit ad68f0e1a0
14 changed files with 235 additions and 67 deletions

View File

@@ -5,6 +5,8 @@ class Composite {
public drawParticles: boolean = true;
public drawConstraints: boolean = true;
public particles: Particle[] = [];
public collidesWithLayers = -1;
/**
* 处理解决所有约束条件
*/
@@ -48,6 +50,13 @@ class Composite {
}
}
public handleConstraintCollisions(){
for (let i = this._constraints.length - 1; i >= 0; i --){
if (this._constraints[i].collidesWithColliders)
this._constraints[i].handleCollisions(this.collidesWithLayers);
}
}
public debugRender(graphics: egret.Graphics){
if (this.drawConstraints){
for (let i = 0; i < this._constraints.length; i ++){