包含11節(jié)視頻教程
從零基礎(chǔ)學(xué)習(xí)unity3d游戲引擎,簡單易學(xué)的視頻教程,讓你快速掌握unity3d,并喜歡上游戲開發(fā)的樂趣。
![]()
|
![]() The Spring Joint groups together two Rigidbodies, constraining them to move like they are connected by a spring. 彈簧關(guān)節(jié)組連接兩個剛體,讓它們像被彈簧連接著一樣運動。
Properties 屬性
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 提示
贊0 踩0 |
未知用戶
2005-2025 朱峰社區(qū) 版權(quán)所有 遼ICP備2021001865號-1
2005-2025 ZhuFeng Community All Rights Reserved
VIP