PhysicsJS - 如何通过标签(或其他值)查找正文

时间:2016-02-24 00:18:45

标签: javascript physicsjs

如何正确使用findOne方法? (http://wellcaffeinated.net/PhysicsJS/docs/#Physics-world-prototype-findOne

此代码返回错误:Uncaught TypeError:无法读取未定义的属性“label”

var theBall = world.findOne([{ label: ball }];

1 个答案:

答案 0 :(得分:1)

我认为它不期望数组而是对象:world.findOne({ label: ball });