mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-04 18:42:40 +08:00
fixed some issues (#2958)
* fixed motion streak * dynamic atlas should ignore render texture * should not enable physics in editor
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user