修复mover.motion修正错误问题
This commit is contained in:
Vendored
+2
@@ -1661,6 +1661,7 @@ declare module es {
|
|||||||
* 当你需要处理与Matcher相匹配的实体,并且你更喜欢使用Entity的时候,可以使用这个功能。
|
* 当你需要处理与Matcher相匹配的实体,并且你更喜欢使用Entity的时候,可以使用这个功能。
|
||||||
*/
|
*/
|
||||||
abstract class EntityProcessingSystem extends EntitySystem {
|
abstract class EntityProcessingSystem extends EntitySystem {
|
||||||
|
enabled: boolean;
|
||||||
constructor(matcher: Matcher);
|
constructor(matcher: Matcher);
|
||||||
/**
|
/**
|
||||||
* 处理特定的实体
|
* 处理特定的实体
|
||||||
@@ -1674,6 +1675,7 @@ declare module es {
|
|||||||
*/
|
*/
|
||||||
protected process(entities: Entity[]): void;
|
protected process(entities: Entity[]): void;
|
||||||
protected lateProcess(entities: Entity[]): void;
|
protected lateProcess(entities: Entity[]): void;
|
||||||
|
protected checkProcessing(): boolean;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare module es {
|
declare module es {
|
||||||
|
|||||||
+10
-3
@@ -2053,7 +2053,7 @@ var es;
|
|||||||
else {
|
else {
|
||||||
this.localPosition = position;
|
this.localPosition = position;
|
||||||
}
|
}
|
||||||
this._positionDirty = false;
|
this.setDirty(DirtyType.positionDirty);
|
||||||
return this;
|
return this;
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
@@ -2080,6 +2080,7 @@ var es;
|
|||||||
else {
|
else {
|
||||||
this.localRotation = radians;
|
this.localRotation = radians;
|
||||||
}
|
}
|
||||||
|
this.setDirty(DirtyType.rotationDirty);
|
||||||
return this;
|
return this;
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
@@ -2127,6 +2128,7 @@ var es;
|
|||||||
else {
|
else {
|
||||||
this.localScale = scale;
|
this.localScale = scale;
|
||||||
}
|
}
|
||||||
|
this.setDirty(DirtyType.scaleDirty);
|
||||||
return this;
|
return this;
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
@@ -3093,7 +3095,7 @@ var es;
|
|||||||
var _internalcollisionResult = new es.CollisionResult();
|
var _internalcollisionResult = new es.CollisionResult();
|
||||||
if (collider_1.collidesWith(neighbor, motion, _internalcollisionResult)) {
|
if (collider_1.collidesWith(neighbor, motion, _internalcollisionResult)) {
|
||||||
// 如果碰撞 则退回之前的移动量
|
// 如果碰撞 则退回之前的移动量
|
||||||
motion.sub(_internalcollisionResult.minimumTranslationVector);
|
motion.subEqual(_internalcollisionResult.minimumTranslationVector);
|
||||||
// 如果我们碰到多个对象,为了简单起见,只取第一个。
|
// 如果我们碰到多个对象,为了简单起见,只取第一个。
|
||||||
if (_internalcollisionResult.collider != null) {
|
if (_internalcollisionResult.collider != null) {
|
||||||
collisionResult.collider = _internalcollisionResult.collider;
|
collisionResult.collider = _internalcollisionResult.collider;
|
||||||
@@ -3997,7 +3999,9 @@ var es;
|
|||||||
var EntityProcessingSystem = /** @class */ (function (_super) {
|
var EntityProcessingSystem = /** @class */ (function (_super) {
|
||||||
__extends(EntityProcessingSystem, _super);
|
__extends(EntityProcessingSystem, _super);
|
||||||
function EntityProcessingSystem(matcher) {
|
function EntityProcessingSystem(matcher) {
|
||||||
return _super.call(this, matcher) || this;
|
var _this = _super.call(this, matcher) || this;
|
||||||
|
_this.enabled = true;
|
||||||
|
return _this;
|
||||||
}
|
}
|
||||||
EntityProcessingSystem.prototype.lateProcessEntity = function (entity) {
|
EntityProcessingSystem.prototype.lateProcessEntity = function (entity) {
|
||||||
};
|
};
|
||||||
@@ -4021,6 +4025,9 @@ var es;
|
|||||||
this.lateProcessEntity(entity);
|
this.lateProcessEntity(entity);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
EntityProcessingSystem.prototype.checkProcessing = function () {
|
||||||
|
return this.enabled;
|
||||||
|
};
|
||||||
return EntityProcessingSystem;
|
return EntityProcessingSystem;
|
||||||
}(es.EntitySystem));
|
}(es.EntitySystem));
|
||||||
es.EntityProcessingSystem = EntityProcessingSystem;
|
es.EntityProcessingSystem = EntityProcessingSystem;
|
||||||
|
|||||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -60,8 +60,7 @@ module es {
|
|||||||
let _internalcollisionResult: CollisionResult = new CollisionResult();
|
let _internalcollisionResult: CollisionResult = new CollisionResult();
|
||||||
if (collider.collidesWith(neighbor, motion, _internalcollisionResult)) {
|
if (collider.collidesWith(neighbor, motion, _internalcollisionResult)) {
|
||||||
// 如果碰撞 则退回之前的移动量
|
// 如果碰撞 则退回之前的移动量
|
||||||
motion.sub(_internalcollisionResult.minimumTranslationVector);
|
motion.subEqual(_internalcollisionResult.minimumTranslationVector);
|
||||||
|
|
||||||
// 如果我们碰到多个对象,为了简单起见,只取第一个。
|
// 如果我们碰到多个对象,为了简单起见,只取第一个。
|
||||||
if (_internalcollisionResult.collider != null) {
|
if (_internalcollisionResult.collider != null) {
|
||||||
collisionResult.collider = _internalcollisionResult.collider;
|
collisionResult.collider = _internalcollisionResult.collider;
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ module es {
|
|||||||
* 当你需要处理与Matcher相匹配的实体,并且你更喜欢使用Entity的时候,可以使用这个功能。
|
* 当你需要处理与Matcher相匹配的实体,并且你更喜欢使用Entity的时候,可以使用这个功能。
|
||||||
*/
|
*/
|
||||||
export abstract class EntityProcessingSystem extends EntitySystem {
|
export abstract class EntityProcessingSystem extends EntitySystem {
|
||||||
|
public enabled: boolean = true;
|
||||||
|
|
||||||
constructor(matcher: Matcher) {
|
constructor(matcher: Matcher) {
|
||||||
super(matcher);
|
super(matcher);
|
||||||
}
|
}
|
||||||
@@ -45,5 +47,9 @@ module es {
|
|||||||
this.lateProcessEntity(entity);
|
this.lateProcessEntity(entity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected checkProcessing(): boolean {
|
||||||
|
return this.enabled;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -296,7 +296,7 @@ module es {
|
|||||||
} else {
|
} else {
|
||||||
this.localPosition = position;
|
this.localPosition = position;
|
||||||
}
|
}
|
||||||
this._positionDirty = false;
|
this.setDirty(DirtyType.positionDirty);
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -328,6 +328,7 @@ module es {
|
|||||||
} else {
|
} else {
|
||||||
this.localRotation = radians;
|
this.localRotation = radians;
|
||||||
}
|
}
|
||||||
|
this.setDirty(DirtyType.rotationDirty);
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -381,6 +382,7 @@ module es {
|
|||||||
} else {
|
} else {
|
||||||
this.localScale = scale;
|
this.localScale = scale;
|
||||||
}
|
}
|
||||||
|
this.setDirty(DirtyType.scaleDirty);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user