这几天简单试用了下4.2版的物理特性,很炫酷。不过有几个自认为比较实用的功能似乎还没找到实现的方法。
目前使用来看,选项中的风力和重力只是简单的在X和Y坐标位移一定的数值,和直觉里的风力和重力有出入。
如果能为风力添加一个随机扰动的选项,我认为会更加真实。
接着是重力的一些疑惑,我试着做了一个小鸟站在树枝上的场景,然后用物理绑定它们。我想实现小鸟在树枝上跳动,将树枝影响而轻微摇晃,但是不奏效,参数里的重力似乎是相互独立的。
不知将来官方会不会考虑加入力的相互影响这种能力,又或者是刚体碰撞、真正的重力加速度这种仿真力学。
目前4.2只是beta版,感觉一切皆有可能

Related Discussions
...

Wind and gravity provide constant acceleration. If you want "turbulence" you can modulate them by keying them. You can use an animation applied on a higher track from your other animations to get various effects. If you use 2 animations of different lengths, the combined wind/gravity will not be repetitive, nearly random. Lastly, you can write code at runtime to control the wind to provide truly random behavior.

Physic constraint parameters are independent, unless the "global" checkbox is checked.

We don't have plans to allow building out entire scenes using physics. What we have is efficient and easy to use. A more complex physics engine that handles more forces and collisions cannot be as efficient or as easy to use. Take a look at Box2D, it provides extensive physics features like what you describe, but it also massive and very complicated. That said, we do have a list of cool features we want to add to physics!

Spine is primarily an animation tool and our physics is designed to be combined with keying. For your bird example, you can key the rotation of the branch moving down when the bird leaves it. Your keys can act like forces and then let physics take over. For example, set a stepped key to rotate the branch downward, reset the physics, then immediately move it back up with another stepped key. The branch will return to where it was using physics, simulating the bird jumping off. I don't have a branch image, but if you can pretend Spineboy's head is a branch: 😃

Image removed due to the lack of support for HTTPS. | Show Anyway

Doing that with only physics may be challenging, but combining keys with your physics makes it possible to get all kinds of movements very easily. The keys look like this:

Image removed due to the lack of support for HTTPS. | Show Anyway

(The flash of the head moving too far could be improved, I did this quickly!)

Note that physic constraint gravity is "real". It is applied as a constant acceleration according to Newtonian physics. Strength is a spring force that wants to return the bones to the unconstrained pose, so you may want to set strength to zero to have your bones fall realistically.

    Nate
    感谢你用心的回复!我试了你提供的方法,实现了想要的效果,而且对spine物理系统的理解也加深了 😃