求3.x版注册物理碰撞监听的写法

小弟对c++不是很熟,接触cocos2dx 引擎也是直接从quick介入的,之前用quick2.x版物理引擎知道怎么写碰撞回调之类,最近在研究3.x版本,发现根本不知道怎么注册碰撞检测函数,baidu许久终未果,因此发贴求教下.
ps:demo中那个工程没加入注册函数的方法真是个坑啊;
看了下c++的源码发现EventListenerPhysicsContact里有4个变量,但是在lua 中直接赋值也不行,
小弟是这么写的
local callback = function(PhysicsContact)
print("-------------------------")
end
local listener = cc.EventListenerPhysicsContact:create()
listener.onContactBegin = callback
local dispatcher = cc.Director:getInstance():getEventDispatcher()
dispatcher:addEventListenerWithSceneGraphPriority(listener,self)
但是运行的是却报 ASSERT FAILED ON LUA EXECUTE: Invalid PhysicsContactListener.

终于知道怎么写了,看来还是对整个系统不了解啊
不过关键是也没啥好的入门教程,一个版本一代写法
local listener = cc.EventListenerPhysicsContact:create()
listener:registerScriptHandler(onContactBegin, cc.Handler.EVENT_PHYSICS_CONTACT_BEGIN)