朱峰社區(qū)首頁 朱峰社區(qū)

搜索資源 注冊|登陸

等待

返回 展開菜單
按功能 按軟件

unity3d視頻教程

unity3d視頻教程

包含11節(jié)視頻教程

從零基礎(chǔ)學(xué)習(xí)unity3d游戲引擎,簡單易學(xué)的視頻教程,讓你快速掌握unity3d,并喜歡上游戲開發(fā)的樂趣。

關(guān)閉

Unity組件:Spring Joint 彈簧關(guān)節(jié)

關(guān)注:5989 留言:0 樓主:趣游科技集團有限公司 發(fā)帖時間:15年11月16日

趣游科技集團有限公司

普通會員

趣游科技集團有限公司

社區(qū)朋友:2級

關(guān)注3459人

  • 積分

    43

  • 登陸

    1

  • 發(fā)帖

    2

  • 作品

    3

間隔線

The Spring Joint groups together two Rigidbodies, constraining them to move like they are connected by a spring.

彈簧關(guān)節(jié)組連接兩個剛體,讓它們像被彈簧連接著一樣運動。


The Spring Joint Inspector

Properties 屬性
  • Connected Body 連接體
    Optional reference to the Rigidbody that the joint is dependent upon.
    彈簧關(guān)節(jié)連接的另一個剛體。 可選,不填另一端和世界相連。
  • Anchor
    Position in the object's local space (at rest) that defines the center of the joint. This is not the point that the object will be drawn toward.
    錨,相對于所屬物件(初始時)空間的坐標,用于定義關(guān)節(jié)中心,也就是物件將被拖去的點。
  • X
    Position of the joint's local center along the X axis.
    關(guān)節(jié)的局部中心X坐標
  • Y
    Position of the joint's local center along the Y axis.
    關(guān)節(jié)的局部中心Y坐標
  • Z
    Position of the joint's local center along the Z axis.
    關(guān)節(jié)的局部中心Z坐標
  • Spring 彈簧
    Strength of the spring. 彈簧的強度。值越高,創(chuàng)建的彈簧效果越強。
  • Damper 阻尼器
    Amount that the spring is reduced when active.
    彈簧的阻尼,當彈簧激活時減少彈簧強度。
  • Min Distance 最小距離
    Distances greater than this will not cause the Spring to activate.
    最小距離,如果兩物體的當前距離與初始距離差大于該數(shù),則不激活彈簧。
  • Max Distance 最大距離
    Distances less than this will not cause the Spring to activate.
    最大距離,如果兩物體的當前距離與初始距離差小于該數(shù),則不激活彈簧。
  • Break Force 斷開力
    The force that needs to be applied for this joint to break.
    破壞關(guān)節(jié)的力的大小。
  • Break Torque 斷開扭矩
    The torque that needs to be applied for this joint to break.
    破壞關(guān)節(jié)的扭力的大小。
Details 細節(jié)

Spring Joints allows a Rigidbodied GameObject to be pulled toward a particular "target" position. This position will either be another Rigidbodied GameObject or the world. As the GameObject travels further away from this "target" position, the Spring Joint applies forces that will pull it back to its original "target" position. This creates an effect very similar to a rubber band or a slingshot.

彈簧關(guān)節(jié)允許一個剛體物件被拖向一個指定的"目標"點。這個點即可以是另一個剛體物件,也可以是世界。當物件遠離目標點時,彈簧關(guān)節(jié)對其施加力使其被拉回初始目標點。類似橡皮筋與彈弓的效果。

The "target" position of the Spring is determined by the relative position from the Anchor to the Connected Body (or the world) when the Spring Joint is created, or when Play mode is entered. This makes the Spring Joint very effective at setting up Jointed characters or objects in the Editor, but is harder to create push/pull spring behaviors in runtime through scripting. If you want to primarily control a GameObject's position using a Spring Joint, it is best to create an empty GameObject with a Rigidbody, and set that to be the Connected Rigidbody of the Jointed object. Then in scripting you can change the position of the Connected Rigidbody and see your Spring move in the ways you expect.

這個"目標"點的位置在創(chuàng)建彈簧關(guān)節(jié)或進入PLAY模式時,由關(guān)節(jié)的錨與連接的物件(或世界)的相對位置決定(目標點坐標==錨+物件/世界坐標)。這使得彈簧關(guān)節(jié)在編輯器中設(shè)置給角色或物件十分簡單,但在腳本中實時生成一個推/拉彈簧行為相對困難。如果一個物件主要是通過彈簧關(guān)節(jié)來控制位置,那么最好是創(chuàng)建一個包含剛體的空物件,然后將彈簧關(guān)節(jié)附加給這個空物件,并連接想要控制的物件。這樣,在腳本中,你就可以控制這個空物件移動,使得彈簧可以按你期望的運動。

Connected Rigidbody 連接體

You do not need to use a Connected Rigidbody for your joint to work. Generally, you should only use one if your object's position and/or rotation is dependent on it. If there is no Connected Rigidbody, your Spring will connect to the world.

彈簧關(guān)節(jié)工作連接另一個剛體并不是必需的。一般來說,當你的物件需要依賴另一個剛體的位置和旋轉(zhuǎn)時,那么就連接它。如果關(guān)節(jié)沒有連接到剛體,那么它將和世界連接。

Spring & Damper 彈簧和阻尼器

Spring is the strength of the force that draws the object back toward its "target" position. If this is 0, then there is no force that will pull on the object, and it will behave as if no Spring Joint is attached at all.

"Spring"是將物件拉回到目標點的力的強度,如果是0,那么沒有任何力施加給物件,就像沒有使用彈簧關(guān)節(jié)一樣。

Damper is the resistance encountered by the Spring force. The lower this is, the springier the object will be. As the Damper is increased, the amount of bounciness caused by the Joint will be reduced.

"Damper"是抵抗彈簧彈力的力量。值越低,彈力越強。而隨著Damper的增加,彈簧的總彈力減少。

Min & Max Distance 最小和最大距離

If the position of your object falls in-between the Min & Max Distances, then the Joint will not be applied to your object. The position must be moved outside of these values for the Joint to activate.

當相連物件的當前距離保證在(初始距離-min_dis,初始距離+max_dis)范圍內(nèi),則認為該狀態(tài)是穩(wěn)定的,不激活彈簧。否則激活彈簧。

Hints 提示
  • You do not need to assign a Connected Body to your Joint for it to work.
    你不是必須要指定Connected Body到關(guān)節(jié)來使它工作。
  • Set the ideal positions of your Jointed objects in the Editor prior to entering Play mode.
    在進入play模式前先設(shè)置好的彈簧對象的位置。
  • Spring Joints require your object to have a Rigidbody attached.
    彈簧關(guān)節(jié)依賴的對象需要掛接剛體部件。

贊0 踩0

未知用戶

2005-2025 朱峰社區(qū) 版權(quán)所有 遼ICP備2021001865號-1
2005-2025 ZhuFeng Community All Rights Reserved

VIP

朱峰社區(qū)微信公眾號

回頂部

1.復(fù)制文本發(fā)給您的QQ好友或群、微信等;好友點擊鏈接以后,轉(zhuǎn)發(fā)就成功了。 2.如朋友點擊您的鏈接,您需要需刷新一下才行;同一個好友僅能點擊一次。
購買VIP,觀看所有收費教程!