修复mover.motion修正错误问题
This commit is contained in:
@@ -60,8 +60,7 @@ module es {
|
||||
let _internalcollisionResult: CollisionResult = new CollisionResult();
|
||||
if (collider.collidesWith(neighbor, motion, _internalcollisionResult)) {
|
||||
// 如果碰撞 则退回之前的移动量
|
||||
motion.sub(_internalcollisionResult.minimumTranslationVector);
|
||||
|
||||
motion.subEqual(_internalcollisionResult.minimumTranslationVector);
|
||||
// 如果我们碰到多个对象,为了简单起见,只取第一个。
|
||||
if (_internalcollisionResult.collider != null) {
|
||||
collisionResult.collider = _internalcollisionResult.collider;
|
||||
|
||||
@@ -7,6 +7,8 @@ module es {
|
||||
* 当你需要处理与Matcher相匹配的实体,并且你更喜欢使用Entity的时候,可以使用这个功能。
|
||||
*/
|
||||
export abstract class EntityProcessingSystem extends EntitySystem {
|
||||
public enabled: boolean = true;
|
||||
|
||||
constructor(matcher: Matcher) {
|
||||
super(matcher);
|
||||
}
|
||||
@@ -45,5 +47,9 @@ module es {
|
||||
this.lateProcessEntity(entity);
|
||||
}
|
||||
}
|
||||
|
||||
protected checkProcessing(): boolean {
|
||||
return this.enabled;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -296,7 +296,7 @@ module es {
|
||||
} else {
|
||||
this.localPosition = position;
|
||||
}
|
||||
this._positionDirty = false;
|
||||
this.setDirty(DirtyType.positionDirty);
|
||||
|
||||
return this;
|
||||
}
|
||||
@@ -328,6 +328,7 @@ module es {
|
||||
} else {
|
||||
this.localRotation = radians;
|
||||
}
|
||||
this.setDirty(DirtyType.rotationDirty);
|
||||
|
||||
return this;
|
||||
}
|
||||
@@ -381,6 +382,7 @@ module es {
|
||||
} else {
|
||||
this.localScale = scale;
|
||||
}
|
||||
this.setDirty(DirtyType.scaleDirty);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user