U3D官方手冊碰撞中文翻譯課件_第1頁
U3D官方手冊碰撞中文翻譯課件_第2頁
U3D官方手冊碰撞中文翻譯課件_第3頁
U3D官方手冊碰撞中文翻譯課件_第4頁
U3D官方手冊碰撞中文翻譯課件_第5頁
已閱讀5頁,還剩12頁未讀 繼續免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

1、U3D官方手冊碰撞節中文翻譯2010-08-31 02:30:01|分類: Unity |標簽: |字號大中小訂閱 來源: U3D官方手冊碰撞節中文翻譯-麻雀2009.5.3Box ColliderBox碰撞The Box Collider is a basic cube-shaped collision primitive.box碰撞是最基礎的一種碰撞。A pile of Box Colliders一堆box碰撞Properties屬性Material 物理材料Reference to the Physic Material that determines how this Collider

2、 interacts with others.選擇物理材質,決定物體對其它物體的碰撞方式(自帶的有:彈性的,冰,金屬,橡膠,木頭)Is Trigger 觸發If enabled, this Collider is used for triggering events, and is ignored by the physics engine.觸發碰撞事件,如果勾選則取消物理模擬。Size 碰撞范圍The size of the Collider in the X, Y, Z directions.更改碰撞的X,Y,Z方向的大小Center 中心位置The position of the Col

3、lider in the objects local space.以碰撞的中心點移動碰撞的位置Details詳細資料The Box Collider can be resized into different shapes of rectangular prisms. It works great for doors, walls, platforms, etc. It isalso effective as a human torso in a ragdoll or as a car hull in a vehicle. Of course, it works perfectly for j

4、ust boxes and crates as well!box碰撞可以調整成不同形狀的長方體。應用于門,墻壁,平臺,等。也可以應用于角色的軀體或汽車船體等交通工具。當然,它只是應用于類似BOX形狀的物體。A standard Box Collider標準的Box 碰撞Colliders work with Rigidbodies to bring physics in Unity to life. Whereas Rigidbodies allow objects to be controlled by physics, Colliders allow objects to collide

5、with each other. Colliders must be added to objects independently of Rigidbodies. A Collider does not necessarily need a Rigidbody attached, but a Rigidbody must be attached in order for the object to move as a result of collisions.碰撞附加剛體之后能夠產生物理模擬。剛體能夠讓對象(objects)修改物理模擬屬性。碰撞允許對象(objects)之間相互影響。碰撞可以

6、附加在沒有應用剛體的對象上(objects)。碰撞體不是必須附加剛體,但是,附加了剛體才能實現物理模擬。When a collision between two Colliders occurs and if at least one of them has a Rigidbody attached, three collision messages are sent out to the objects attached to them. These events can be handled in scripting, and allow you to create unique beha

7、viors with or without making use of the built-in Ageias physX engine.如果2個對象之間產生相撞,那么至少有1個是附加剛體的。他們之間會發出相互影響的事件信號。這些事件可以用腳本來實現,你可以自己寫腳本,或者用內置的Ageias physX 引擎來應用腳本。Triggers觸發An alternative way of using Colliders is to mark them as a Trigger, just check the IsTrigger property checkbox in the Inspector.

8、 Triggers are effectively ignored by the physics engine, and have a unique set of three trigger messages that are sent out when a collision with a Trigger occurs. Triggers are useful for triggering other events in your game, like cutscenes, automatic door opening, displaying tutorial messages, etc.

9、Use your imagination!觸發就是對象加不加碰撞的一個標記。觸發屬性在檢視面板(Inspector)里。觸發是控制物理模擬的開關。當碰撞體被觸發狀態時,就會發送出一組觸發信號。觸發在游戲的其它事件中,也起著非常重要的作用。例如:場景布局,自動門,通訊,等等,所有你能想象的!Be aware that in order for two Triggers to send out trigger events when they collide, one of them must include a Rigidbody as well. For a Trigger to collid

10、e with a normal Collider, one of them must have a Rigidbody attached. For a detailed chart of different types of collisions, see the collision action matrix in the Advanced section below.注意:要使2個觸發器發出碰撞事件,其中一個必須包含剛體。詳細內容見頁底的碰撞矩陣表。Friction and bouncyness摩擦力和彈力Friction, bouncyness and softness are defi

11、ned in the Physic Material. The Standard Assets contain the most common physics materials. To use one of them click on the Physic Material drop-down and select one, eg. Ice. You can also create your own physics materials and tweak all friction values.摩擦力,彈力和柔和的定義在物理材質(Physic Material)那節。標準資源文件夾中(U3D

12、安裝目錄下的Standard Assets文件夾)帶有很多物理材質。你也可以自己創建物理材質和修改系數。Compound Colliders混合碰撞Compound Colliders are combinations of primitive Colliders, collectively acting as a single Collider. They come in handy when you have a complex mesh to use in collisions but cannot use a Mesh Collider. To create a Compound Co

13、llider, create child objects of your colliding object, then add a primitive Collider to each child object. This allows you to position, rotate, and scale each Collider easily and independently of one another.混合碰撞是結合簡單碰撞,組成獨特的碰撞。當你遇到復雜的物體不合適用mesh碰撞時,可以用混合碰撞的方法。創建每個子物體的簡單碰撞來組成混合碰撞。你可以用移動旋轉和縮放來調整每個碰撞。A

14、 real-world Compound Collider setup 混合碰撞設置In the above picture, the environment has a Mesh Collider attached. Mesh Colliders work the best for terrain or environments made from irregular shapes. The gun_model GameObject has a Rigidbody attached, and multiple primitive Colliders as child GameObjects.

15、 When the Rigidbody parent is moved around by forces, the child Colliders move along with it. The primitive Colliders will collide with the environments Mesh Collider, and the parent Rigidbody will alter the way it moves based on forces being applied to it and how its child Colliders interact with o

16、ther Colliders in the Scene.上圖中,槍的模型運用了混合碰撞,混合碰撞最好應用于地形或者形狀復雜的物體。這個槍模型附加了剛體,還有帶有簡單碰撞的子游戲對象,當剛體移動的時候,子碰撞也隨之移動。Mesh Colliders cant normally collide with each other. If a Mesh Collider is marked as Convex, then it can collide with another Mesh Collider. The typical solution is to use primitive Collider

17、s for any objects that move, and Mesh Colliders for static background objects.通常mesh碰撞不能相互碰撞。如果mesh碰撞是明顯凸起的,那么它可以相互碰撞。典型的解決方法是在每個子對象上附加簡單碰撞。Hints提示 To add multiple Colliders for an object, create child GameObjects and attach a Collider to each one. This allows each Collider to be manipulated indepen

18、dently.給一個物體添加碰撞時,創建多個子游戲對象并給每個對象添加碰撞,允許每個部位自由控制。 You can look at the gizmos in the Scene View to see how the Collider is being calculated on your object.你可以在場景視圖中觀察你建立的對象的碰撞。 Colliders do their best to match the scale of an object. If you have a non-uniform scale (a scale which is different in each

19、 direction), only the Mesh Collider can match completely.盡可能的調整好每個物體的碰撞,只有mesh碰撞才能完全匹配。 If you are moving an object through its Transform component but you want to receive Collision/Trigger messages, you must attach a Rigidbody to the object that is moving.Advanced高級階段Collider combinations碰撞組合There

20、are numerous different combinations of collisions that can happen in Unity. Each game is unique, and different combinations may work better for different types of games. If youre using physics in your game, it will be very helpful to understand the different basic Collider types, their common uses,

21、and how they interact with other types of objects.在Unity中,有許多不同的碰撞組合。每個游戲都是唯一的,不同的碰撞組合適應不同類型的游戲。如果你在你的游戲里利用物理系統,將會很好的讓你了解不同的碰撞類型,和共同點。還有他們是怎么結合每個物體類型的。Static Collider靜態碰撞These are GameObjects that do not have a Rigidbody attached, but do have a Collider attached. These objects should remain still, o

22、r move very little. These work great for your environment geometry. They will not move if a Rigidbody collides with them.這種游戲對象沒有附加剛體,但附加了碰撞。這些對象保持靜止或只移動一點點。他們不會自己移動,除非有剛體碰撞碰到了他們。Rigidbody Collider剛體碰撞These GameObjects contain both a Rigidbody and a Collider. They are completely affected by the phys

23、ics engine through scripted forces and collisions. They might collide with a GameObject that only contains a Collider. These will likely be your primary type of Collider in games that use physics.這種游戲對象包含了剛體和碰撞2部分。他們從頭到尾都受到物理系統的影響。他們可以影響只帶有碰撞的游戲對象。這是主要的在游戲里使用物理系統的碰撞類型。Kinematic Rigidbody Collider剛體運

24、動碰撞This GameObject contains a Collider and a Rigidbody which is marked IsKinematic. To move this GameObject, you modify its Transform Component, rather than applying forces. Theyre similar to Static Colliders but will work better when you want to move the Collider around frequently. There are some o

25、ther specialized scenarios for using this GameObject.This object can be used for circumstances in which you would normally want a Static Collider to send a trigger event. Since a Trigger must have a Rigidbody attached, you should add a Rigidbody, then enable IsKinematic. This will prevent your Objec

26、t from moving from physics influence, and allow you to receive trigger events when you want to.Kinematic Rigidbodies can easily be turned on and off. This is great for creating ragdolls, when you normally want a character to follow an animation, then turn into a ragdoll when a collision occurs, prom

27、pted by an explosion or anything else you choose. When this happens, simply turn all your Kinematic Rigidbodies into normal Rigidbodies through scripting.If you have Rigidbodies come to rest so they are not moving for some time, they will fall asleep. That is, they will not be calculated during the

28、physics update since they are not going anywhere. If you move a Kinematic Rigidbody out from underneath normal Rigidbodies that are at rest on top of it, the sleeping Rigidbodies will wake up and be correctly calculated again in the physics update. So if you have a lot of Static Colliders that you w

29、ant to move around and have different object fall on them correctly, use Kinematic Rigidbody Colliders.Collision action matrix碰撞矩陣Depending on the configurations of the two colliding Objects, a number of different actions can occur. The chart below outlines what you can expect from two colliding Obj

30、ects, based on the components that are attached to them. Some of the combinations only cause one of the two Objects to be affected by the collision, so keep the standard rule in mind - physics will not be applied to objects that do not have Rigidbodies attached.把2個對象的碰撞進行相應的配置,就會得到許多的結果。下圖表述2個對象碰撞是否

31、能結合一起。Collision detection occurs and messages are sent upon collision碰撞檢測和傳送碰撞信號Static Collider靜態碰撞Rigidbody Collider剛體碰撞KinematicRigidbody Collider剛體運動碰撞StaticTrigger Collider靜態碰撞觸發RigidbodyTrigger Collider剛體碰撞觸發Kinematic RigidbodyTrigger Collider剛體運動碰撞觸發Static Collider靜態碰撞YRigidbody Collider剛體碰撞YY

32、YKinematic Rigidbody Collider剛體運動碰撞YStatic Trigger Collider靜態碰撞觸發Rigidbody Trigger Collider剛體碰撞觸發Kinematic Rigidbody Trigger Collider剛體運動碰撞觸發Trigger messages are sent upon collision觸發時發送的觸發信號Static Collider靜態碰撞Rigidbody Collider剛體碰撞KinematicRigidbody Collider剛體運動碰撞StaticTrigger Collider靜態碰撞觸發Rigidbo

33、dyTrigger Collider剛體碰撞觸發Kinematic RigidbodyTrigger Collider剛體運動碰撞觸發Static Collider靜態碰撞YYRigidbody Collider剛體碰撞YYYKinematic Rigidbody Collider剛體運動碰撞YYYStatic Trigger Collider靜態碰撞觸發YYYYRigidbody Trigger Collider剛體碰撞觸發YYYYYYKinematic Rigidbody Trigger Collider剛體運動碰撞觸發unity 角色動畫2010-08-31 02:18:33|分類: U

34、nity |標簽: |字號大中小訂閱 來源: Character Animation角色動畫Unity Manual User Guide Creating Gameplay Character AnimationUnity手冊 使用指南 創建游戲 角色動畫Unitys Animation System allows you to create beautifully animated skinned characters. The Animation System supports animation blending, mixing, additive animations, walk c

35、ycle time synchronization, animation layers, control over all aspects of the animation playback (time, speed, blend-weights), mesh skinning with 1, 2 or 4 bones per vertex and finally physically based ragdolls.Unity的動畫系統允許你創建漂亮的動畫角色.動畫系統支持動畫合成,混合,添加動畫,步調周期時間同步,動畫層,控制所有方面的動畫回放(時間,速度,混合-偏重),網格面每個三角有1,

36、2或4個骨骼,且完成基本的物理玩偶.There are some best practices for creating a rigged character with optimal performance in Unity. It is recommended that you read about these techniques on the Modeling Optimized Characters page.這里有一些最好的方法創建一個作弊的角色在Unity獲得最好的展示.推薦你閱讀下Modeling Optimized Characters頁面上的教程。Making an ani

37、mated character involves two things; moving them through the world and animating them accordingly.制作一個動畫角色需要2個東西;移動他在世界中和做相應的動作.This page focuses on the animation. If you want to learn more about moving characters around (for a Super Mario Bros style game or a first-person shooter), take a look at t

38、he Character Controller page.這個頁面致力于動畫.如果你想要學習更多關于移動角色的(為一個超級瑪麗風格游戲或第一人稱射擊),查看Character Controller page.If you like, quickly jump to one of the topics covered on this page: ortAnim#ImportAnimImporting Character Animations ortSplit#ImportSplitAnimation Splitting ortFile#ImportFileMultiple Files ortIK

39、#ImportIKInverse Kinematics Inserting Into a Unity Scene Animating the Character Animation Blending Animation Layers Additive Animation如果你喜歡,直接跳到一個在這個頁面的標題: 輸入角色動畫 動畫片段 多個文件 反向運動 插入Unity場景 使角色做動作 動畫混合 動畫層 添加動畫You can download an example demo showing pre-setup animated characters here.你能在here下載演示動畫角色

40、設置的例子example demo。Importing The Animations輸入動畫First of all we have to import the character. Unity natively imports Maya (.mb or .ma) files, Cinema 4D (.c4d) files, and fbx files which can be exported from most animation packages. Click here to learn how to ortObject.htmlexport from your modelling/an

41、imation package.首先我們輸入動畫。Unity支持輸入Maya (.mb or .ma)文件, Cinema 4D (.c4d)文件,和fbx文件,這些能輸出為很多動畫包.點擊這里學習怎樣輸出模型/動畫包ortObject.htmlexport from your modelling/animation package.Importing Animations using Animation Splitting輸出動畫使用動畫片段The most convenient way for animators to work is to have a single model cont

42、aining all animations. When importing the animated model, you can define which frames make up each part of the animation. Unity will automatically split the animation into the individual parts, called Animation Clips.最方便的制作動畫的方法是使用單一的模型包含所有的動畫.當輸入動畫模型,你能定義每部分動畫的幀.Unity將自動把動畫片段分成單個動作部分,名為動畫片段Animatio

43、n Clips.For example: walk animation during frames 1 - 33 run animation during frames 41 - 57 kick animation during frames 81 - 97例如: 走路動畫在幀1 -33 跑步動畫在幀41 57 踢的動畫在幀81 - 97To import the animations you simply place the model in the Assets folder of your project. Unity will now automatically import it.

44、Highlight it in the Project View and edit the Import Settings in the Inspector.輸入動畫你可以直接放置他到工程里的Assets文件夾.Unity將自動輸入他.突出顯示他在工程視圖和編輯輸入設置在檢視視圖.The Import Settings Dialog for a mesh一個模型的輸入設置對話框In the Import Settings, the Split Animations table is where you tell Unity which frames in your asset file mak

45、e up which Animation Clip. The names you specify here are used to activate them in your game.在輸入設置, Split Animations表是告訴Unity你的資源文件的哪些幀是表示哪些動畫片段的.你指定在這里的名字在你的游戲使用觸發他們.nameDefines the Animation Clips name within Unity.first frameThe first frame of the animation. The frame number refers to the same fr

46、ame as in the 3D program used to create the animation.last frameThe last frame of the animation.loop frameIf enabled, an extra loop frame is inserted at the end of the animation. This frame matches the first frame in the clip. Use this if you want to make a looping animation and the first & last fra

47、mes dont match up exactly.名字定義Unity里動畫片段的名字.起始幀動畫的起始幀.幀數值和創建動畫的3D程序使用相同的幀.終止幀動畫的終止幀循環幀如果激活,額外的循環幀插入到動畫的最后.這個幀匹配片段的起始幀.如果你想要制作一個循環動畫和起始&終止幀不是很準確的匹配時.Importing Animations using multiple model files輸入動畫使用多個模型文件The other way to import animations is to follow the animation naming scheme. You create separ

48、ate model files and use this naming convention: model nameanimation name.fbx另一個輸入動畫的方法是在動畫名后面加.你創建單獨的模型文件和使用這種命名方法模型名字動畫名字.fbxAn example of four animation files for an animated character有4個動畫文件的動畫角色例子Unity automatically imports all four files and collects all animations to the file without the sign

49、in. In the example above, the goober.mb file will be set up to reference idle, jump, walk and wallJump automatically.Unity自動輸入所有4個文件并收集所有動畫到沒有標簽的文件.在上面的例子里, goober.mb將自動建立空閑,跳躍,走路和翻墻的引用.Importing Inverse Kinematics輸入反向運動When importing animated characters from Maya that are created using IK, you have

50、 to check the Bake IK & simulation box in the Import Settings. Otherwise, your character will not animate correctly.當輸入動畫角色使用Maya會創建使用IK,你可以檢查Bake IK & simulation盒在輸入設定.否則你的角色將不能正常運動.Bringing the character into the Scene放置角色到場景When you have imported your model you drag the object from the Project vi

51、ew into the Scene View or Hierarchy.當你輸入模型后,拖拽物體從工程視圖到場景視圖或層次視圖.The animated character is added by dragging it into the scene動畫角色通過拖拽添加到場景The character above has three animations in the animation list and no default animation. You can add more animations to the character by dragging animation clips

52、from the Project View on to the character (in either the Hierarchy or Scene View). This will also set the default animation. When you hit Play, the default animation will be played.上面角色的三個動作列表不是缺省動作.你能添加更多動畫到角色通過在工程視圖的角色中拖拽動畫片段(到層次或場景視圖).這也將設置缺省動畫.當你按下運行,缺省動畫將運行.TIP: You can use this to quickly test

53、 if your animation plays back correctly. Also use the Wrap Mode to view different behaviors of the animation, especially looping.技術:你能使用這個快速測試,如果你的動畫重播正常.也可使用卷模式Wrap Mode觀察不同的動畫行為.特別是循環.Animating the Character使角色動起來The actual animating of characters is done through Unitys scripting interface.真實的角色動畫

54、使用Unity腳本接口執行.Animation Blending動畫合成In todays games, animation blending is an essential feature to ensure that characters have smooth animations. Animators create separate animations, e.g. a walk cycle, run cycle, idle animation or shoot animation. At any point in time in your game you need to be ab

55、le to transition from the idle animation into the walk cycle and vice versa. Of course you dont want any sudden jumps in the motion, you want the animation to smoothly transition.現在的游戲,動畫合成是一個必不可少的特征為確保角色有平滑的動畫.動畫師創建單個動畫,如走路循環,跑步循環,空閑動畫或射擊動畫.有些時候你的游戲需要能轉換空閑動畫到走路循環或反之.當然你不想要在運動中有突然的跳躍,你想要動畫平滑轉換.This is where animation blending comes in. In Unity you can have an arbitrary amount of animations playing on the same character. All animations are blended or added together to generate the f

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經權益所有人同意不得將文件中的內容挪作商業或盈利用途。
  • 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
  • 6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論