弹簧关节 (Spring Joint) 将两个刚体连接在一起,但允许两者之间的距离改变,就好像它们通过弹簧连接一样。
属性: | 功能: |
---|---|
Connected Body | 包含弹簧关节的对象连接到的刚体对象。如果未指定对象,则弹簧将连接到空间中的固定点。 |
Anchor | 关节在对象的局部空间中所附加到的点。 |
Auto Configure Connected Anchor | Unity 是否应该自动计算连接锚点的位置? |
Connected Anchor | 关节在连接对象的局部空间中所附加到的点。 |
Spring | 弹簧的强度。 |
Damper | 弹簧为活性状态时的压缩程度。 |
Min Distance | 弹簧不施加任何力的距离范围的下限。 |
Max Distance | 弹簧不施加任何力的距离范围的上限。 |
Tolerance | 更改容错。允许弹簧具有不同的静止长度。 |
Break Force | 为破坏此关节而需要施加的力。 |
Break Torque | 为破坏此关节而需要施加的扭矩。 |
Enable Collision | 是否应启用两个连接对象之间的相互碰撞? |
Enable Preprocessing | 禁用预处理有助于稳定无法满足的配置。 |
弹簧就像一块弹性物,试图将两个锚点一起拉到完全相同的位置。拉力的强度与两个点之间的当前距离成比例,其中每单位距离的力由 Spring 属性设定。为了防止弹簧无休止振荡,可以设置 Damper 值,从而根据与两个对象之间的相对速度按比例减小弹簧力。值越高,振荡消失的速度越快。
可以手动设置锚点,但如果启用 _Auto Configure Connected Anchor_,Unity 将自动设置连接锚点,以保持它们之间的初始距离(即,在定位对象时在 Scene 视图中设置的距离)。
Min Distance 和 Max Distance 值用于设置弹簧不施加任何力的距离范围。例如,可以使用该距离范围允许对象进行少量的独立移动,但当对象之间的距离太大时将它们拉到一起。
SpringJoint
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.