debugRender 新增camera参数来修正渲染位置

This commit is contained in:
yhh
2020-08-28 18:04:50 +08:00
parent a3c53116e1
commit 7a308f76b6
27 changed files with 236 additions and 192 deletions

View File

@@ -43,7 +43,7 @@ module es {
constructor(entity: Entity) {
super();
this.entity = entity;
this.scale = Vector2.one;
this.scale = this._localScale = Vector2.one;
this._children = [];
}
@@ -147,7 +147,7 @@ module es {
this._position = this._localPosition;
} else {
this.parent.updateTransform();
this._position = Vector2Ext.transformR(this._localPosition, this.parent._worldTransform);
Vector2Ext.transformR(this._localPosition, this.parent._worldTransform, this._position);
}
this._positionDirty = false;
@@ -293,7 +293,7 @@ module es {
this._position = position;
if (this.parent) {
this.localPosition = Vector2Ext.transformR(this._position, this._worldToLocalTransform);
this.localPosition = Vector2.transform(this._position, this._worldToLocalTransform);
} else {
this.localPosition = position;
}