发帖前请先搜索是否有相关帖子: http://forum.cocos.com/search?q=category%3Acreator%20 ,
反馈 Bug 时请提供
- Creator 版本:1.6.2
- 目标平台:(Web )
调用此方法
var rc=cc.rect(0,0,20,20);
var colliderList = cc.director.getPhysicsManager().testAABB(rc);
出现异常
Uncaught TypeError: Cannot read property ‘x’ of undefined
at PhysicsAABBQueryCallback.165.PhysicsAABBQueryCallback.init (CCPhysicsAABBQueryCallback.js:8)
at CCClass.testAABB (CCPhysicsManager.js:246)
at TEST.onLoad (TEST.js:31)
at CCClass.eval [as _invoke] (eval at createInvokeImpl (component-scheduler.js:244),
65)
at CCClass.invoke (component-scheduler.js:142)
at CCClass.activateNode (node-activator.js:220)
at cc_Scene._activate (CCScene.js:93)
at TheClass.runSceneImmediate (CCDirector.js:608)
at boot.js:378
at CCLoader. (CCAssetLibrary.js:244)
查询源码js,看到此处
testAABB: function (rect) {
tempB2AABB.lowerBound.x = rect.xMin/PTM_RATIO;
tempB2AABB.lowerBound.y = rect.yMin/PTM_RATIO;
tempB2AABB.upperBound.x = rect.xMax/PTM_RATIO;
tempB2AABB.upperBound.y = rect.yMax/PTM_RATIO;
var callback = this._aabbQueryCallback;
_callback.init();_ <--------此处没有参数导致下一个函数报错。。这个是什么情况。web浏览器