fixed some issues (#2958)

* fixed motion streak

* dynamic atlas should ignore render texture

* should not enable physics in editor
This commit is contained in:
yinkaile
2018-07-10 15:15:13 +08:00
committed by pandamicro
parent 7396874344
commit 5e84cd63e6
3 changed files with 7 additions and 3 deletions
+2
View File
@@ -549,6 +549,8 @@ cc.js.getset(PhysicsManager.prototype, 'enabled',
return this._enabled;
},
function (value) {
if (CC_EDITOR) return;
if (value && !this._world) {
var world = new b2.World( new b2.Vec2(0, -10) );
world.SetAllowSleeping(true);
@@ -108,6 +108,8 @@ let dynamicAtlasManager = {
!spriteFrame || spriteFrame._original) return;
let texture = spriteFrame._texture;
if (texture instanceof cc.RenderTexture) return;
let w = texture.width, h = texture.height;
let min = texture._minFilter, mag = texture._magFilter;
let LINEAR = cc.Texture2D.Filter.LINEAR;
@@ -111,8 +111,8 @@ var motionStreakAssembler = {
let cur;
if (points.length > 1) {
let difx = points[0].x - tx;
let dify = points[0].y - ty;
let difx = points[0].point.x - tx;
let dify = points[0].point.y - ty;
if ((difx*difx + dify*dify) < comp.minSeg) {
cur = points[0];
}
@@ -124,7 +124,7 @@ var motionStreakAssembler = {
}
cur.setPoint(tx, ty);
cur.time = comp._fadeTime;
cur.time = comp._fadeTime + dt;
renderData.dataLength = 0;
if (points.length < 2) {