此关节连接到指定目标,而不是像其他关节那样连接到另一个刚体对象。这是一种弹簧式关节,例如可将其用于拾取和移动处于重力作用下的对象。
属性: | 功能: |
---|---|
Anchor | 关节端点连接到此对象的位置(以__刚体__上的 X、Y 坐标表示)。 |
Target | 关节另一端尝试移到的位置(以世界坐标系中的 X、Y 坐标表示)。 |
Auto Configure Target | 选中此框可自动将关节的另一端设置为对象的当前位置。(移动对象时,此选项很有用,因为它将初始目标位置设置为当前位置。)注意:选择此选项后,目标会随着对象移动而发生变化;如果未选择此选项,目标将不会变化。 |
Max Force | 设置在尝试将对象移动到目标位置时关节可以施加的力。该值越大,最大力就越大。 |
Damping Ratio | 想要抑制弹簧振荡的程度:介于 0 到 1 范围内,值越大,移动越少。 |
Frequency | 对象接近所需的间隔距离时弹簧振荡的频率(以每秒周期数表示):频率值介于 0 到 1,000,000 范围内 - 值越高,弹簧越硬。 |
Break Force | 指定破坏并进而删除关节所需的作用力水平。Infinity 表示关节牢不可破。 |
(另请参阅 2D 关节中的详情和提示以了解所有 2D 关节的有用背景信息。)
使用此关节可将刚体游戏对象连接到空间中的点。
此关节的目的是使以下两点之间的线性距离保持为零:刚体对象上的锚点和世界坐标系位置(称为“目标”)。关节对刚体对象施加线性力,不会施加扭矩(角力)。
此关节使用模拟弹簧。可以设置弹簧的刚度和运动:
一个几乎不动的僵硬弹簧…
高(1,000,000 为最高)__Frequency__ == 僵硬弹簧。
高(1 为最高)__Damping Ratio__ == 几乎不动的弹簧。
一个移动的松弛弹簧…
低 Frequency == 松弛弹簧。
低 Damping Ratio == 移动的弹簧。
弹簧在刚体对象与目标之间施力时,往往会超过它们之间设定的距离,然后反复反弹,产生连续振荡。Damping Ratio 用于设置刚体对象在多长时间内停止移动。Frequency 用于设置刚体对象在指定距离的任一侧振荡的速度。
此关节有一个约束:
例如:
使用此关节构建的物理对象可以移动到指定目标位置并停留在此处直到选择另一个目标位置或关闭。例如:
还可以使用关节来允许对象悬挂:如果锚点不是质心,则对象会旋转。例如:
提示:
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.