1

我是新手Box2D,我正在使用 World Construction Kit,我遇到以下问题:球以低速粘在墙上。

所以我阅读了很多讨论这个问题的线程,发现我必须将b2_velocitytresholdvalue 更改为0.0fin b2settings.as

所以我打开了这个文件,我看不到这个值,而是看到了这个

public static function get b2_velocityThreshold():Number {
    return mem._mrf(lib.b2Settings.b2_velocityThreshold);
}

public static function set b2_velocityThreshold(v:Number):void {
    mem._mwf(lib.b2Settings.b2_velocityThreshold, v);
}

所以我不知道如何改变这个值......

我现在搜索了几个小时,但这对我来说真的很难,因为我不是一个说英语的人(我打赌你注意到了)而且我只找到了一个关于wck我的语言的教程。

请帮帮我...

4

2 回答 2

0

Thanks for your Answer, I tried in a lot of way but didn't managed to make it work, so i found another solution.

I added a frame in the world component (2 frames now) :

First frame : LinearVelocity : 0.1 Second frame : LinearVelocity : -0.1

Balls doesn't stick now.

I know it is a "bad" solution, but I was tired of searching and testing every possible option, so this solution is good enough for me.

I will maybe figure how to use your solution in the future when I will learn more about Box2D.

Thank you again.

于 2013-05-20T15:29:12.700 回答
0

您应该发布一个指向您发现应该将 value 的b2_velocitytreshold值 设置为的帖子的链接0.0f

但据我了解,您在这里有 setter/getter for b2_velocitytreshold. 因此,您的问题的解决方案可以简单地改变 getter 的返回值:

public static function get b2_velocityThreshold():Number {
   return 0.0f;
}
于 2013-05-19T22:43:52.140 回答