[LayaAirIDE 2.0]Box2D使用Destory join报错?
使用box2d物理系统 在destory被collider绑定的sprite时会报错
Error
preload.js:55
at Object.box2d.b2Assert (file:///D:/develop/layaspace/smallballs/bin/libs/laya.physics.js:38:57)
at box2d.b2World.DestroyJoint (file:///D:/develop/layaspace/smallballs/bin/libs/laya.physics.js:793:295)
at Physics.__proto._removeJoint (file:///D:/develop/layaspace/smallballs/bin/libs/laya.physics.js:3091:15)
at DistanceJoint.__proto._onDisable (file:///D:/develop/layaspace/smallballs/bin/libs/laya.physics.js:1748:13)
at DistanceJoint.__proto._setActive (file:///D:/develop/layaspace/smallballs/bin/libs/laya.core.js:731:26)
at Sprite.__proto._inActiveHierarchy (file:///D:/develop/layaspace/smallballs/bin/libs/laya.core.js:13622:24)
at Sprite.__proto._onRemoved (file:///D:/develop/layaspace/smallballs/bin/libs/laya.core.js:13650:58)
at Sprite.__proto._setParent (file:///D:/develop/layaspace/smallballs/bin/libs/laya.core.js:13367:10)
at Sprite.__proto._setParent (file:///D:/develop/layaspace/smallballs/bin/libs/laya.core.js:18323:31)
at MainScene.__proto.removeChildAt (file:///D:/develop/layaspace/smallballs/bin/libs/laya.core.js:13307:9)
但并不是每次都报错 偶尔报一次? 请问这是什么原因造成的
Error
preload.js:55
at Object.box2d.b2Assert (file:///D:/develop/layaspace/smallballs/bin/libs/laya.physics.js:38:57)
at box2d.b2World.DestroyJoint (file:///D:/develop/layaspace/smallballs/bin/libs/laya.physics.js:793:295)
at Physics.__proto._removeJoint (file:///D:/develop/layaspace/smallballs/bin/libs/laya.physics.js:3091:15)
at DistanceJoint.__proto._onDisable (file:///D:/develop/layaspace/smallballs/bin/libs/laya.physics.js:1748:13)
at DistanceJoint.__proto._setActive (file:///D:/develop/layaspace/smallballs/bin/libs/laya.core.js:731:26)
at Sprite.__proto._inActiveHierarchy (file:///D:/develop/layaspace/smallballs/bin/libs/laya.core.js:13622:24)
at Sprite.__proto._onRemoved (file:///D:/develop/layaspace/smallballs/bin/libs/laya.core.js:13650:58)
at Sprite.__proto._setParent (file:///D:/develop/layaspace/smallballs/bin/libs/laya.core.js:13367:10)
at Sprite.__proto._setParent (file:///D:/develop/layaspace/smallballs/bin/libs/laya.core.js:18323:31)
at MainScene.__proto.removeChildAt (file:///D:/develop/layaspace/smallballs/bin/libs/laya.core.js:13307:9)
但并不是每次都报错 偶尔报一次? 请问这是什么原因造成的
没有找到相关结果
已邀请:
要回复问题请先登录
8 个回复
林继衍
赞同来自: NilZ
pal
赞同来自:
;box2d.ENABLE_ASSERTS&&box2d.b2Assert(0<this.m_jointCount);
这句话会报错
Aar0n
赞同来自:
kura
赞同来自:
心塞 ,难道移除sprite时需要手动destory所有关节吗
林继衍
赞同来自:
Aar0n
赞同来自:
ippon
赞同来自:
莫等闲
赞同来自: