1. 程式人生 > >[翻譯]:Cinemachine 官方文件(0)

[翻譯]:Cinemachine 官方文件(0)

目錄

What is Cinemachine? : 什麼是Cinemachine?

Cinemachine is a suite of ‘smart’ procedural modules which allow you to define the shot and
they’ll dynamically follow your direction. Setup shots which track and compose motion in
realtime, like AI camera operators. The procedural nature makes them bug-resistant as they
always work to make the shot based on your direction. That’s great for gameplay, but they’re
also amazingly fast for cutscenes. Change an animation, a vehicle speed, ground terrain -
whatever - and Cinemachine will dynamically make the shot. You can use really telephoto
lenses and not have to update the cutscene if things change .

Cinemachine是一套“智慧”程式模組,可以讓你定義鏡頭並且他們會動態地按照你的指示行事。如同一個AI相機操作員般,實時地設定跟蹤和組成運動的鏡頭。程式性質使它們像它們一樣具有抗病性
總是根據你的方向努力拍攝。這對於遊戲玩法來說非常棒,並且它們在過場動畫的表現也出人意料的快。
改變動畫、車速、地面地形或者無論什麼效果——Cinemachine都將動態拍攝。你可以使用真正的長焦鏡頭,如果事情發生變化,不必更新過場動畫。

History :

Cinemachine has been in development over a number of years across multiple projects We’ve been designing camera systems for almost 20 years and have shipped millions of AAA titles across numerous genres. The Cinemachine team has an award winning cinematographer and a senior engineer with heavy math skills. Also, we love this stuff to bits.

Cinemachine多年來一直處於多個專案的開發之下,我們已經設計了相當近20年的相機系統,並已經出版了數百萬種AAA級別的遊戲。 Cinemachine團隊擁有一位屢獲殊榮的攝影師和一名具有繁重數學技能的高階工程師。 此外,我們喜歡這些東西。

Mission :

Our mission with Cinemachine is built to be an entirely united camera system bridging gameplay, cutscenes, from fully procedural cameras to entirely canned sequences and everything in between.

我們與Cinemachine的使命是建立一個完全統一的相機系統,與遊戲玩法,過場動畫,從完全程式相機到完全固定序列以及介於兩者之間的所有內容相銜接。

Example Scenes :

Please have a look at our example scenes. They are shipped with the package under Assets/Cinemachine/Examples. This folder also includes some handy noise presets that you can use as a starting point for implementing camera noise.

請看一下我們的示例場景。 它們隨Assets / Cinemachine / Examples下的package一起提供。 此資料夾還包括一些方便的噪音預設,您可以將其用作實現相機噪音的起點。

Forums :

We have a busy discussion area on the forums.
https://forum.unity3d.com/forums/cinemachine.136/

我們在論壇上有一個熱鬧的討論區。

Frequently asked questions :

  • Do we have to replace our camera system with Cinemachine?

    No, Cinemachine can work alongside your existing camera system and you can seamlessly blend back and forth between both systems. If you wrote some camera tech you love but want Cinemachine for something else, no problem, mix the two together.

  • 我們是否必須用Cinemachine替換我們的相機系統?

    不,Cinemachine可以與您現有的相機系統配合使用,您可以在兩個系統之間來回無縫混合。 如果你寫了一些你喜歡的相機技術,但想要Cinemachine的一些別的東西,沒問題,將兩者混合在一起。

  • Isn’t having all these cameras around kind of heavy?
    No, in fact it’s incredibly light. Each virtual camera has a super low overhead - make as many as you want. If you are hypersensitive to performance you can disable all the cameras and just enable the ones you wish to have running at any given moment for extreme performance.

  • 是不是所有這些相機都很沉重(耗費效能)?

    不,實際上它非常輕盈。 每個虛擬攝像機都具有超低的開銷 - 可以根據需要進行調整。 如果您對效能敏感,可以禁用所有攝像頭,只需啟用您希望在任何給定時刻執行的攝像頭以獲得極致效能。

  • How does it all work?
    Cinemachine works a bit like a marionette system for your existing Main Camera. It doesn’t create any new cameras, only new virtual ones. The Cinemachine ‘Brain’ component is automatically added to the Main Camera in your scene and Cinemachine works with all its camera blending, priority, mixing magic to deliver a set of transforms to your Main Camera.

    Because it’s a completely unified system, you can blend from any camera type to any other. Seamlessly go from an in-game freelook system to a keyframed cutscene camera and back.

    Any combination is possible and the options are limitless.

  • 它是怎麼執行的?

    Cinemachine的工作方式有點像現有主攝像頭的牽線木偶系統。 它不會建立任何新的相機,只會建立新的虛擬相機。 Cinemachine'Brain'元件會自動新增到場景中的主攝像頭中,Cinemachine可以使用其所有攝像頭混合,優先順序,混合效果來為主攝像頭提供一組變換。

    因為它是一個完全統一的系統,您可以從任何相機型別混合到任何其他型別。 無縫地從遊戲中的freelook系統轉變為關鍵幀的過場動畫相機和背部。

    任何組合都是可能的,選項是無限的。

  • Can I really save all my tunings in Play mode?
    Yes! Almost everything in Cinemachine saves in play mode so jump in and tune some cameras while the game is running. When you think about it, it’s really the only way to do it. We want you to get right into the zone and massage cameras at any point in your game - while you’re in there playing it.

    Our engineer spent a long time on our camera system and doesn’t want to change it.

    We hear this a lot. It’s never fun to throw code away but you need to think about the big picture of your project. If you can get up and running really quickly creating and tuning cameras without further bothering your engineer, isn’t that an advantage? It’s doubtful your existing system behaves exactly as desired in every scenario so there’s yet more coding to be done anyway.

    Cameras are such a huge part of your project and good cameras can make the difference between an OK game and an amazing one. Try running Cinemachine next to your existing cameras and see what it’s like. If that engineer is still reluctant share this idea with them - Rockets eject perfectly great booster sections to get into space. That camera code helped push you into orbit! Great scenes are often left on the editing room floor. Make the decision that’s best for your project.

  • 我可以在Play模式下真正儲存所有除錯嗎?

    當然! Cinemachine中的幾乎所有內容都儲存在播放模式中,因此在遊戲執行時跳入並調整一些相機。 當你想到它時,它確實是唯一的方法。 我們希望您在遊戲中的任何一個時間點都能直接進入區域並調整相機 - 即使您在執行中時。

    我們的工程師花了很長時間在我們的相機系統上,並不想改變它。

    我們聽到了很多。拋棄程式碼永遠不會有趣,但你需要考慮專案的大局。如果您能夠在不進一步打擾工程師的情況下快速啟動並執行建立和調整攝像頭,那麼這不是一個優勢嗎?令人懷疑的是,您現有的系統在每種情況下的行為都完全符合要求,因此無論如何還有更多的編碼要做。

    攝像機是你專案中非常重要的一部分,好的攝像機可以在一個尚可的遊戲和一個驚人的遊戲之間產生差距。嘗試在現有相機旁邊執行Cinemachine,看看它是什麼樣的。如果那個工程師仍然不願意與他們分享這個想法——火箭隊會彈出非常好的助推器部分進入太空。相機程式碼幫助你進入軌道!編輯室的場景經常留下很棒的場景。做出最適合您專案的決定。

  • Can I mix between gameplay and cutscene cameras?
    You can mix between any cameras. Seamless transitions from gameplay to cutscene and back are as easy as turning on a camera or playing a Timeline with CM clips on it.

  • 我可以將遊戲玩法和過場動畫相機過渡嗎?

    你可以在任何相機之間過渡。 從遊戲玩法到過場動畫和後背的無縫過渡就像開啟相機或播放帶有CM剪輯的時間軸一樣簡單。

  • How do you typically configure the cameras for a project?
    Instead of one big ball-of-code camera trying to do everything, you make lots of custom vcams for every given moment and turn them on when needed. Blending or cutting to a new camera is as easy as turning one on. If the priority is the same or higher, CM will use the new camera and blend to it based on how you’ve defined the default blend or any other blends in the Custom Blends section of the CM ‘Brain’ on the Main Camera.

  • 您通常如何為專案配置攝像頭?

    區別於一個大的程式碼相機試圖做所有事情,你為每個給定的時刻製作了許多自定義vcams,並在需要時開啟它們。 將新相機混合或切割就像開啟一個相機一樣簡單。 如果優先順序相同或更高,CM將使用新相機並根據您在主相機上CM'Brain'的自定義混合部分中定義的預設混合方式或任何其他混合的方式進行混合。

  • I don’t want to drastically change the camera in X scenario, I just want a little tweak.

    Camera changes can be really subtle. You can duplicate your main camera, only change the FOV or Composition and then blend to that camera just when a player enters a trigger volume. You can turn on vcams with only the subtlest of differences to get exactly the behavior you want in whatever situation. Projects can have many vcams all with only minor changes, ready and waiting for whatever game scenario demands them.

  • 我不想在X場景中大幅改變相機,我只想稍微調整一下。

    相機的變化可能會非常微妙。 您可以複製主攝像頭,僅更改FOV或構成方式,然後在玩家進入觸發音量時混合到該攝像頭。您可以只使用最細微的差異開啟vcams,以在任何情況下獲得您想要的行為。 專案可以擁有許多vcams,只需進行微小的更改,準備好並等待任何遊戲場景需要它們。

  • When would I use the State Driven Camera? Why have so many camera rigs?
    The SDC makes it super easy to link animations and states to different cameras. Picture your character’s local-motion system and orbit camera. It makes your game feel so much more alive when the camera shakes a bit more when your character is running, when the camera pulls back to a larger orbit when they go outside, when the camera gets all close when the character is sneaking around. The SDC allows you to craft the cameras to best suit what your player is doing.

  • 我何時使用狀態驅動相機? 為什麼有這麼多攝像機裝備?

    SDC可以非常輕鬆地將動畫和狀態連結到不同的攝像機。 想象你角色的本地運動系統和軌道攝像機。 當你的角色在跑步時,相機可以輕微的抖動;當角色向外走時,相機可進入一個更大的軌道;當角色偷偷摸摸移動時,相機可以全部靠近,這些會使你的遊戲感覺更加生動。 SDC允許您製作最適合您的播放器正在進行的相機。

For example, one project in dev had 20+ different camera rigs all listening to animations and game events. Stand, walk, sprint, jump, attack, >3 enemies arrive, inside, outside, trigger volumes in particular areas of the map, health <20%, etc. So much control is easily possible.

例如,開發中的一個專案有20多個不同的攝像機裝備都在收聽動畫和遊戲事件。 站立,行走,衝刺,跳躍,攻擊,3個以上的敵人到達,內部,外部,觸發地圖特定區域的體積,健康<20%等。如此多的控制很容易。

Overview :

Cinemachine is a modular suite of camera tools for Unity which give AAA game quality controls for every camera in your project. It’s an easy to install plugin which lets you add functionality to cameras you’ve already got, or make new ones with amazing behaviors.

Cinemachine has been designed to be the entire unified camera system in your project but can be used alongside your existing cameras as well. If you have a bunch of camera stuff working already and just want to use Cinemachine for cutscenes or something specific, no problem at all. However when you use it across your project it allows you to blend any camera to any other camera in a gameplay-to-cutscene-and-back-seamlessly kind of way. The heart of Cinemachine is two components; everything else builds on those. They are:

Cinemachine是Unity的模組化相機工具套件,可為專案中的每個相機提供AAA遊戲質量控制。 這是一個易於安裝的外掛,可以讓您為已經擁有的相機新增功能,或者製作具有豐富行為的新相機。

Cinemachine被設計出來作為您專案中的整個統一攝像系統,但也可以與現有攝像頭一起使用。 如果你有一堆相機的東西已經工作,只是想使用Cinemachine的過場動畫或特定的東西,沒有任何問題。 除此之外,當您在整個專案中使用它時,它也允許您將任何相機混合到從遊戲玩法到過場動畫再返回過程中的任何其他相機,諸如此類。 Cinemachine的核心是兩個件; 其他的一切內容都建立在它們之上。 他們是:

Cinemachine Virtual Camera :

The Virtual Camera is a shot, a single camera. It has child modules which you can turn on to make it do things like procedurally track and compose objects, follow things and shake with procedural noise. Together they are a very powerful combination and can yield an unlimited number of results.

These modules have been designed, re-designed and re-designed again to offer the widest range of possibilities with the least number of controls. The math driving these camera behaviours is complex and sophisticated, having gone through many different scenarios across all sorts of games.

The reason for the ‘virtual’ camera scenario is because Unity renders from the main camera. Out-of-the-box Unity is limited to only one camera being active camera at a time – which makes the blending of two shots effectively impossible. Cinemachine is engineered to solve this and provide a wealth of simple, powerful functionality at the same time, allowing unsurpassed camera behaviors which are fast and easy to setup.

虛擬相機是一個鏡頭,一個相機。它有一些子模組,您可以開啟這些模組,使其執行程式跟蹤和組合物件,跟蹤事物並使用程式噪聲進行抖動。它們是一個非常強大的組合,可以產生無數的結果。

這些模組經過設計,重新設計和再次重新設計,以最少的控制提供最廣泛的可能性。推動這些攝像機行為的數學複雜而精密,在各種遊戲中經歷了許多不同的場景(的考驗)。

“虛擬”相機場景的原因是因為Unity從主相機渲染。開箱即用的Unity限定在同一時間僅能有一臺攝像機是有源攝像機 —— 這使得有效地無法混合兩個鏡頭。 Cinemachine旨在解決這個問題,同時提供豐富的簡單,強大的功能,允許無與倫比的相機行為,並且它們快速,易於設定。

Cinemachine Brain :

This is the central Cinemachine component that does all the magic. It’s a component attached to the Unity camera and it monitors all the Virtual Cameras in the scene and drives the Unity camera using the shot it likes best.

這是中央Cinemachine元件,可以完成所有效果。 它是連線到Unity攝像頭的一個元件,它監視場景中的所有虛擬攝像機,並使用它最喜歡的鏡頭驅動Unity攝像機。

Installation and Getting Started :安裝並開始

Installing Cinemachine is easy.

  1. Drag the Cinemachine unitypackage onto your assets folder in Unity, OR Install it directly: Assets->Import Package ->Custom Package… and point to the Cinemachine unitypackage.
  2. Setup the Cinemachine Virtual Cameraenvironment Cinemachine-> Create Virtual Camera. This is also the way to create additional Cinemachine shots.
  3. That’s it! You now have Cinemachine installed on your machine.

安裝Cinemachine很容易。

  1. 將Cinemachine unitypackage拖到Unity中的assets資料夾中,或直接安裝:Assets-> Import Package - > Custom Package ...並指向Cinemachine unitypackage。
  2. 設定Cinemachine虛擬攝像機環境Cinemachine->建立虛擬攝像機。這也是建立其他Cinemachine鏡頭的方法。
  3. 僅此而已!您現在已在計算機上安裝了Cinemachine。

You will notice two changes to your scene:

  1. The main camera has a little icon next to it in the scene hierarchy. This indicates that your camera has been Cinemachine-enabled using a new component: the CinemachineBrain.
  2. A new GameObject CM vcam1 with a CinemachineVirtualCamera component, which is a single camera or shot.

您會注意到場景的兩處變化:

  1. 主攝像機在場景層次結構中旁邊有一個小圖示。這表示您的相機已使用新元件啟用Cinemachine:CinemachineBrain。
  2. 帶有CinemachineVirtualCamera元件的新GameObject CM vcam1,它是一個攝像頭或鏡頭。

There’s more info below on how to use these new things. Don’t forget to check out the example scenes included in Cinemachine/Examples/Scenes, and please visit our user forum at https://forum.unity3d.com/forums/cinemachine.136/

下面有關於如何使用這些新東西的更多資訊。不要忘記檢視Cinemachine / Examples / Scenes中包含的示例場景,請訪問我們的使用者論壇:https://forum.unity3d.com/forums/cinemachine.136/

User Guide :使用者指南

This guide is organized in logical sections that cover the ground from simple basic setups all the way through to advanced cinematic features of Cinemachine. Each of the classes and behaviours that make up Cinemachine are described in detail.

本指南按邏輯部分組織,涵蓋了從簡單的基本設定到Cinemachine的高階電影功能。 組成Cinemachine的每個類和行為都將詳細介紹。

Cinemachine is by no means limited to the classes and behaviours described here. It has an open pipeline architecture, and we look forward to seeing the exciting new behaviours and intelligence that our users will build into the system.

Cinemachine絕不僅限於此處描述的類和行為。 它具有開放的管道架構,我們期待看到使用者將在系統中構建的令人興奮的新行為和智慧。

Basic Virtual Cameras

Each virtual camera is a ‘shot’, or a single camera. You can animate them directly or blend two together to create camera moves. The reason they are ‘virtual’ cameras is to allow for blending, camera selection based on priorities and the ability to have Cinemachine hold multiple cameras in memory with the final product being presented to the current active Unity camera(s) which are rendering.

Cinemachine allows you to create an unlimited number of virtual cameras, blend them together with the result being presented to the single Unity camera. It does all this automatically.

每個虛擬攝像機都是“鏡頭”或單個攝像機。 您可以直接為它們設定動畫或將兩者混合在一起以建立相機移動。 它們是“虛擬”攝像機的原因是為了允許混合,基於優先順序的攝像機選擇以及使Cinemachine在記憶體中保持多個攝像機的能力,最終產品被呈現給正在渲染的當前活動Unity攝像機。

Cinemachine允許您建立無限數量的虛擬攝像機,將它們混合在一起,並將結果呈現給單個Unity攝像機。 它自動完成所有這些。

Key components of the Virtual Camera are:

  • Priority: The priority of this shot. Equal or Higher value camera priorities compared to the current camera priority will be activated. This allows for camera state machine setups where cameras are called based on trigger volumes, animations, health states, etc. Important cameras will trigger over lower priority ones.
  • Lens Settings : What kind of lens to use for this shot: FOV, clipping planes, and dutch (camera roll). Post-processing effects can also be included here.
  • Body: Where the camera is placed in your scene, and procedural ways to ‘mount’ your camera to any object and move the camera with it.
  • Aim: What the camera looks at, and procedural ways to track and compose any subject.
  • Noise: Procedural Perlin multi-layered noise system for handheld behaviors, shakes, and vibrations.
  • Extensions: These are add-ons to the basic Cinemachine pipeline. Post-Processing and Collision Avoidance are examples of standard extensions shipped with Cinemachine. The API is open, so that you can author your own extensions as well.

虛擬相機的關鍵元件是:

  • 優先順序:此鏡頭的優先順序。與當前攝像機優先順序相比,優先順序相等或更高值的攝像機將被啟用。這允許攝像機狀態機設定,使得基於觸發音量,動畫,健康狀態等呼叫攝像機。重要的攝像機將觸發優先順序較低的攝像機。
  • 鏡頭設定:此鏡頭使用哪種鏡頭效果:FOV(畫幅),剪裁平面和荷蘭(相機膠捲)。這裡也可以包括後處理效果。
  • 主體:攝像機放置在場景中的位置,以及將攝像機“安裝”到任何物體並用它移動攝像機的程式方法。
  • 目標:相機所看到的內容,以及跟蹤和撰寫任何主題的程式方法。
  • 噪音:程式Perlin多層噪音系統,用於手持行為,震動和振動。
  • 擴充套件:這些是基本Cinemachine管道的附加元件。後處理和衝突避免是Cinemachine附帶的標準擴充套件的示例。 API是開放的,因此您也可以建立自己的擴充套件程式。

The Solo Button in the Virtual Camera inspector panel will make the virtual camera temporarily Live so that you can have immediate visual feedback in the game view when tweaking the behavioural parameters of the camera.

The Game Window Guides checkbox toggles the visibility of any screen compositional guides that the virtual camera might want to display in the game window. This toggle is a static global, and applies to all virtual cameras.

The Save During Play checkbox enables the Cinemachine feature of taking camera settings tweaks made while in Play mode, and propagating them back to the scene. This allows in-game fine tuning of cameras without having to do a whole lot of copy/pasting. After you exit play mode, the scene will be updated to reflect the changes made during play. Pressing Undo will revert those changes.

The following sections describe the behaviours and classes that make up the Cinemachine Virtual Camera, and some of its standard procedural components.

虛擬相機檢查器面板中的Solo按鈕將使虛擬相機暫時生效,以便在調整相機的行為引數時可以在遊戲檢視中立即獲得視覺反饋。

Game Window Guides”複選框可切換虛擬攝像機可能要在遊戲視窗中顯示的任何螢幕組成指南的可見性。此切換是靜態全域性,適用於所有虛擬攝像機。

Save During Play”複選框啟用Cinemachine功能,即在播放模式下進行相機設定調整,並將它們傳播回場景。這允許在遊戲中對相機進行微調,而無需進行大量的複製/貼上。退出播放模式後,將更新場景以反映播放期間所做的更改。按撤消將還原這些更改。

以下部分描述了構成Cinemachine虛擬相機的行為和類,以及它的一些標準過程元件。

CinemachineVirtualCamera

This behaviour is intended to be attached to an empty Transform GameObject, and it represents a Virtual Camera within the Unity scene.

The Virtual Camera will animate its Transform according to the rules contained in its CinemachineComponent pipeline (Aim, Body, and Noise). When the virtual camera is Live, the Unity Camera equipped with a CinemachineBrain will assume the position and orientation of the virtual camera.

A virtual camera is not a camera. Instead, it can be thought of as a camera controller, not unlike a cameraman. It can drive the Unity Camera and control its position, orientation, lens settings, and PostProcessing effects. Each Virtual Camera owns its own Cinemachine Component Pipeline, through which you provide the instructions for dynamically tracking specific game objects.

A virtual camera is very lightweight, and does no rendering of its own. It merely tracks interesting GameObjects, and positions itself accordingly. A typical game can have dozens of virtual cameras, each set up to follow a particular character or capture a particular event.

此行為旨在附加到空的Transform GameObject,它表示Unity場景中的虛擬相機。

虛擬攝像機將根據其CinemachineComponent管道(目標,主體和噪聲)中包含的規則為其變換設定動畫。當虛擬攝像機處於實時狀態時,配備CinemachineBrain的Unity攝像機將採用虛擬攝像機的位置和方向。

虛擬相機不是相機。相反,它可以被認為是相機控制器,與攝影師不同。它可以驅動Unity相機並控制其位置,方向,鏡頭設定和後處理效果。每個虛擬相機都擁有自己的Cinemachine元件管道,通過它您可以提供動態跟蹤特定遊戲物件的說明。

虛擬相機非常輕巧,不會自行渲染。它只跟蹤有趣的GameObjects,並相應地定位自己。典型的遊戲可以具有數十個虛擬攝像機,每個攝像機設定為跟隨特定角色或捕獲特定事件。

A Virtual Camera can be in any of three states:

  • Live : The virtual camera is actively controlling the Unity Camera. The virtual camera is tracking its targets and being updated every frame.
  • Standby : The virtual camera is tracking its targets and being updated every frame, but no Unity Camera is actively being controlled by it. This is the state of a virtual camera that is enabled in the scene but perhaps at a lower priority than the Live virtual camera.
  • Disabled : The virtual camera is present but disabled in the scene. It is not actively tracking its targets and so consumes no processing power. However, the virtual camera can be made live from the Timeline.

虛擬攝像機可以處於以下三種狀態中的任何一種:

  • 直播:虛擬攝像機正在主動控制Unity攝像頭。 虛擬攝像機正在跟蹤其目標並每幀更新。
  • 待機:虛擬攝像機正在跟蹤其目標並每幀更新,但沒有Unity攝像機正在被它主動控制。 這是在場景中啟用的虛擬攝像機的狀態,但可能比實時虛擬攝像機的優先順序低。
  • 已禁用:虛擬攝像機存在但在場景中已禁用。 它沒有主動跟蹤其目標,因此不消耗處理能力。 但是,虛擬攝像機可以從時間軸生成。

The Unity Camera can be driven by any virtual camera in the scene. The game logic can choose the virtual camera to make live by manipulating the virtual cameras’ enabled flags and their priorities, based on game logic.

In order to be driven by a virtual camera, the Unity Camera must have a CinemachineBrain behaviour, which will select the most eligible virtual camera based on its priority or on other criteria, and will manage blending.

Unity Camera可以由場景中的任何虛擬攝像頭驅動。 遊戲邏輯可以通過基於遊戲邏輯操縱虛擬相機的啟用標誌及其優先順序來選擇虛擬相機來實現。

為了由虛擬攝像頭驅動,Unity Camera必須具有CinemachineBrain行為,該行為將根據其優先順序或其他標準選擇最符合條件的虛擬攝像機,並將管理混合。

Setting Type Description
Look At Transform The object that the camera wants to look at (the Aim target). If this is null, then the vcam’s Transform orientation will define the camera’s orientation.
Follow Transform The object that the camera wants to move with (the Body target). If this is null, then the vcam’s Transform position will define the camera’s position.
Lens LensSettings Specifies the lens properties of this Virtual Camera. This generally mirrors the Unity Camera’s lens settings, and will beused to drive the Unity camera when the vcam is active.
Priority Int32 The priority will determine which camera becomes active based on the state of other cameras and this camera. Higher number shave greater priority.
設定 型別 描述
LookAt Transform 相機想要檢視的物件(Aim 目標)。 如果為null,則vcam的Transform方向將定義攝像機的方向。
Follow Transform 相機想要跟隨的物件(Body目標)。 如果為null,則vcam的Transform位置將定義攝像機的位置。
Lens LensSettings 指定此虛擬攝像機的鏡頭屬性。 這通常反映了Unity Camera的鏡頭設定,並將在vcam處於活動狀態時用於驅動Unity相機。
Priority Int32 優先順序將根據其他攝像機和本攝像機的狀態確定哪個攝像機變為活動狀態。 數字越大,優先順序越高。
LensSettings

Describes the FOV and clip planes for a camera. This generally mirrors the Unity Camera’s lens settings, and will be used to drive the Unity camera when the vcam is active.

描述攝像機的FOV和剪裁平面。 這通常反映了Unity Camera的鏡頭設定,並將在vcam處於活動狀態時用於驅動Unity相機。

Setting Type Description
Field Of View Single This is the camera view in vertical degrees. For cinematic people, a 50mm lens on a super-35mm sensor would equal a 19.6 degree FOV.
Orthographic Size Single When using an orthographic camera, this defines the half-height, in world coordinates, of the camera view.
Near Clip Plane Single This defines the near region in the renderable range of the camera frustum. Raising this value will stop the game from drawing things near the camera, which can sometimes come in handy. Larger values will also increase your shadow resolution.
Far Clip Plane Single This defines the far region of the renderable range of the camera frustum. Typically you want to set this value as low as possible without cutting off desired distant objects.
Dutch Single Camera Z roll, or tilt, in degrees.
設定 型別 描述
視野 Single 這是垂直度的攝像機檢視。 對於電影人來說,超35mm感測器上的50mm鏡頭等於19.6度FOV。
正交尺寸 Single 使用正交相機時,它定義了攝像機檢視的世界座標的半高。
近裁剪平面 Single 這定義了相機平截頭體的可渲染範圍內的近區域。 提高此值將阻止遊戲在相機附近繪製物品,這有時會派上用場。 較大的值也會增加陰影解析度。
遠裁剪平面 Single 這定義了相機平截頭體的可渲染範圍的遠區域。 通常,您希望在不切斷所需遠處物體的情況下將此值設定得儘可能低。
Dutch(鏡頭傾斜) Single 相機Z以度為單位滾動或傾斜。
CinemachineComposer :

This is a CinemachineComponent in the Aim section of the component pipeline. Its job is to aim the camera at the vcam’s LookAt target object, with configurable offsets, damping, and composition rules.

The composer does not change the camera’s position. It will only pan and tilt the camera where it is, in order to get the desired framing. To move the camera, you have to use the virtual camera’s Body section.

The vcam’s LookAt target is the Composer’s target. Common Composer targets: include bones on a character like the upper spine or head bone, vehicles, or dummy objects which are controlled or animated programmatically.

這是元件管道的Aim部分中的CinemachineComponent。 它的工作是將攝像機對準vcam的LookAt目標物件,具有可配置的偏移,阻尼和合成規則。

Composer不會改變相機的位置。 它只會將攝像機平移和傾斜,以獲得所需的取景。 要移動相機,您必須使用虛擬相機的“身體”部分。

vcam的LookAt目標是Composer的目標。 Common Composer目標:在角色上繫結骨骼,例如上部脊柱或頭骨,車輛或虛擬物件,這些物件可通過程式設計方式進行控制或動畫處理。

Once you’ve set the vcam’s LookAt target and are tracking something, you need to define where you’d like it to be on the screen and how aggressively you’d like to camera to track it. The degree of lag, or how tightly the camera follows the subject is defined by the two controls:

Horizontal/Vertical Soft Damping: Setting these values to zero means the camera will hard track the subject and the blue regions above will act as rigid barriers locking the camera movement to keep the target inside those values. Setting the larger will allow the target to ‘squish’ into the blue regions, giving you some really nice camera weight and lag. This is what real camera operators do!. The vertical and horizontal values are separated so you can let the camera squish more left to right or follow tighter up and down, etc.

SoftZone/DeadZone: Tune these to define where you want the subject to be onscreen. These controls are incredibly versatile. The blue areas are the ‘squishy’ areas based on how much horizontal/vertical damping you have, and the red areas define the ‘no pass’ limits where the camera will always track the subject. Opening up the soft areas to create a ‘dead zone’ in the middle allows you to make areas of the screen immune to target motion, handy for things like animation cycles where you don’t want the camera to track the target if it moves just a little.

一旦你設定了vcam的LookAt目標並跟蹤某些東西,你需要定義你想要它在螢幕上的位置以及你想要相機跟蹤它的積極程度。兩個控制元件定義了延遲程度或相機跟隨主體的緊密程度:

水平/垂直軟阻尼:將這些值設定為零意味著攝像機將硬跟蹤主體,上方的藍色區域將作為鎖定攝像機移動的剛性障礙,以使目標保持在這些值內。設定較大的將允許目標“擠壓”到藍色區域,給你一些非常好的相機重量和滯後。這就是真正的相機操作員所做的!垂直和水平值是分開的,因此您可以讓相機從左到右更加擠壓,或者跟隨上下更緊,等等。

SoftZone / DeadZone:調整這些以定義主體在螢幕上的位置。這些控制元件非常通用。藍色區域是基於您具有多少水平/垂直阻尼的“柔軟”區域,紅色區域定義了攝像機始終跟蹤主體的“無通過”限制。開啟柔和區域以在中間建立“死區”允許您使螢幕區域免受目標運動的影響,這對於像動畫週期這樣的事情很方便,如果它只是移動一點點的話,你可能不希望攝像機跟蹤目標。

Setting Type Description
Tracked Object Offset Vector3 Target offset from the target object’s center in target-local space. Use this to fine-tune the tracking target position when the desired area is not the tracked object’s center.
Lookahead Time Single This setting will instruct the composer to adjust its target offset based on the motion of the target. The composer will look at a point where it estimates the target will be this many seconds into the future. Note that this setting is sensitive to noisy animation, and can amplify the noise, resulting in undesirable camera jitter. If the camera jitters unacceptably when the target is in motion, turn down this setting, or animate the target more smoothly.
Horizontal Damping Single How aggressively the camera tries to follow the target in the screen-horizontal direction. Small numbers are more responsive, rapidly orienting the camera to keep the target in the dead zone. Larger numbers give a more heavy slowly responding camera. Using different vertical and horizontal settings can yield a wide range of camera behaviors.
Vertical Damping Single How aggressively the camera tries to follow the target in the screen-vertical direction. Small numbers are more responsive, rapidly orienting the camera to keep the target in the dead zone. Larger numbers give a more heavy slowly responding camera. Using different vertical and horizontal settings can yield a wide range of camera behaviors.
Screen X Single Horizontal screen position for target. The camera will rotate to position the tracked object here.
Screen Y Single Vertical screen position for target, The camera will rotate to position the tracked object here.
Dead Zone Width Single Camera will not rotate horizontally if the target is within this range of the position.
Dead Zone Height Single Camera will not rotate vertically if the target is within this range of the position.
Soft Zone Width Single When target is within this region, camera will gradually rotate horizontally to re-align towards the desired position, depending on the damping speed.
Soft Zone Height Single When target is within this region, camera will gradually rotate vertically to re-align towards the desired position, depending on the damping speed.
Bias X Single A non-zero bias will move the target position horizontally away from the center of the soft zone.
Bias Y Single A non-zero bias will move the target position vertically away from
the center of the soft zone.
設定 型別 描述
跟蹤物件偏移 Vector3 目標物件在目標 - 本地空間中心的目標偏移量。 當所需區域不是被跟蹤物件的中心時,使用此選項微調跟蹤目標位置。
前瞻時間 Single 此設定將指示Composer根據目標的運動調整其目標偏移。 Composer將會看到一個點,它估計目標在未來的多少秒內到達目標點。 請注意,此設定對噪聲動畫很敏感,並且可能會放大噪聲,從而導致不需要的相機抖動。 如果在目標運動時相機抖動不可接受,請調低此設定,或者更平穩地為目標設定動畫。
水平阻尼 Single 相機在螢幕水平方向上試圖跟蹤目標的程度如何。 小數字響應更快,快速定向相機以使目標保持在死區。 較大的數字給出了一個更加沉重的慢響應相機。 使用不同的垂直和水平設定可以產生各種相機行為。
垂直阻尼 Single 相機在螢幕垂直方向上試圖跟蹤目標的程度如何。 小數字響應更快,快速定向相機以使目標保持在死區。 較大的數字給出了一個更加沉重的慢響應相機。 使用不同的垂直和水平設定可以產生各種相機行為。
水平螢幕位置 Single 目標的水平螢幕位置。 相機將旋轉以將跟蹤物件定位在此處。
垂直螢幕位置 Single 目標的垂直螢幕位置,攝像機將旋轉以將跟蹤物件定位在此處。
死區寬度 Single 如果目標位於該位置範圍內,相機將不會水平旋轉。
死區高度 Single 如果目標位於該位置範圍內,相機將不會垂直旋轉。
軟區寬度 Single 當目標位於此區域內時,攝像機將逐漸水平旋轉,以根據阻尼速度重新對齊到所需位置。
軟區高度 Single 當目標位於此區域內時,攝像機將逐漸垂直旋轉,以根據阻尼速度重新對齊到所需位置。
水平非零偏差 Single 非零偏差將使目標位置水平移動遠離軟區域的中心。
垂直非零偏差 Single 非零偏差將使目標位置垂直移動遠離軟區域的中心。
CinemachineTransposer

This is a CinemachineComponent in the Body section of the component pipeline. Its job is to position the camera in a fixed relationship to the vcam’s Follow target object, with offsets and damping.

The Transposer will only change the camera’s position in space. It will not re-orient or otherwise aim the camera. To to that, you need to instruct the vcam in the Aim section of its pipeline.

Transposer is a component which mounts a camera to any object. It has a number of advantages over just putting the camera under the object you want to have the camera follow. Hood Cam, Door Cam, POV Cam, Missile Cam - if you want to mount the camera to something, use Transposer.

這是元件管道的Body部分中的CinemachineComponent。 它的工作是將攝像機定位到與攝像機的跟隨目標物體固定的關係,具有偏移和阻尼。

Transposer只會改變相機在空間中的位置。 它不會重新定位或以其他方式瞄準相機。 為此,您需要在其管道的Aim部分中指示vcam。

Transposer是將相機安裝到任何物體上的元件。 與將相機放在想要讓相機跟隨的物體之下相比,它具有許多優點。 相機遮光罩,門鏡,視點相機,投擲相機(類似R6的女武神?)如果你想將相機安裝到某物上,請使用轉換器。

Using Transposer for your camera body motion has advantages:

  • The position tuning is kept, even if the game is running. Tune a regular camera in game mode and the position is lost once you quit, not with Transposer. Tune it up while the game is running and you’re done.
  • Add damping to the camera - if your camera follows something, the damping values can give you some ‘weight’ to the camera so they feel smoother.
  • Organization: Put all your cameras in one place, instead of having them hidden under all sorts of assets in your project - you pick their targets vs. put the camera under them in the hierarchy.

使用Transposer進行相機機身運動具有以下優勢:

  • 即使遊戲正在執行,也會保持位置調整。 在遊戲模式下調整普通相機,一旦退出,位置就會丟失,而不是使用Transposer。 在遊戲執行時調整它並完成。
  • 為相機增加阻尼 - 如果你的相機跟隨某些東西,阻尼值可以給你一些相機的“重量”,讓它們感覺更順暢。
  • 組織:將所有攝像機放在一個位置,而不是將它們隱藏在專案中的各種資產下 - 選擇目標而不是將攝像機置於層次結構中。

Follow Offset: The camera will go to the centre of the object you’re targeting in the Transposer Camera Target, so if you want the camera to be further behind, put in some offsets. We default at -10 so the camera is behind whatever you’re targeting.

Damping: Per channel damping which will cause the camera to lag behind the target. You can control both the position damping, and the orientation damping.

跟隨偏移:攝像機將轉到您在轉置相機目標中定位的物件的中心,因此如果您希望將攝像機放在後面,請放入一些偏移。 我們預設為-10,因此無論您的目標是什麼,相機都會落後。

阻尼:每通道阻尼,這將導致相機滯後於目標。 您可以控制位置阻尼(線阻力?)和方向阻尼(角阻力?)。

Binding Mode: There’s options in the relationship between the camera and the target object.

  • Lock To Target interprets the camera offset in target-local coords. As the target rotates, the camera rotates around it to maintain the offset.
  • Lock to Target With World Up is the same as the above but it keeps the camera pointing up. Handy if your target flips over.
  • Lock to Target On Target Assign mounts the camera relative to the target’s local coordinate system at the time the camera is initialized. This offset remains constant in world space, and the camera will not rotate along with the target.
  • World Space offsets positions the camera relative to the target in world coords no matter what direction the target object is facing.
  • Simple Follow this will follow the target at the desired distance and height while moving the camera position as little as possible. This is quite similar to what a human camera operator would do when instructed to follow a target.

繫結模式:這是一些攝像機和目標物件之間的關係選項。

  • Lock To Target:解釋目標區域性座標中的攝像機偏移。 當目標旋轉時,相機圍繞它旋轉以保持偏移。
  • 使用World Up鎖定目標:與上面相同,但它會使攝像機朝上。 如果您的目標翻轉,很方便。
  • 基於目標分配鎖定目標:攝像機相對於目標的本地座標系在攝像機初始化時的安裝。 此偏移在世界空間中保持不變,並且攝像機不會與目標一起旋轉。
  • 無論目標物體朝向什麼方向,世界空間偏移都會使相機相對於目標在世界座標中定位。
  • 簡單跟隨:此操作將在所需距離和高度處跟隨目標,同時儘可能少地移動攝像機位置。 這非常類似於人類攝像機操作員在被指示跟隨目標時所做的事情。

These different modes do incredibly different things, so try them out and one should work well for whatever your requirements are. The ‘Door Cam’ or ‘Hood Cam’ ideas would use L ocal Space Locked To Target.

這些不同的模式做了非常不同的事情,所以嘗試一下,某個應該適合你的要求。 “監視器”或“固定在遮光罩上的鏡頭”的想法應使用Local Space Locked To Target。

Setting Type Description
Binding Mode BindingMode The coordinate space to use when interpreting the offset from the target. This is also used to set the camera’s Up vector, which will be maintained when aiming the camera. Possible Values:
Lock To Target On Assign: Camera will be bound to the Follow target using a frame of reference consisting of the target’s local frame at the moment when the virtual camera was enabled, or when the target was assigned.
Lock To Target With World Up: Camera will be bound to the Follow target using a frame of reference consisting of the target’s local frame, with the tilt and roll zeroed out.
Lock To Target No Roll: Camera will be bound to the Follow target using a frame of reference consisting of the target’s local frame, with the roll zeroed out.
Lock To Target: Camera will be bound to the Follow target using the target’s local frame.
World Space: Camera will be bound to the Follow target using a world space offset.
Simple Follow: Offsets will be calculated relative to the target, using Camera-local axes.
Follow Offset Vector3 The distance vector that the transposer will attempt to maintain from the Follow target.
X Damping Single How aggressively the camera tries to maintain the offset in the X-axis. Small numbers are more responsive, rapidly translating the camera to keep the target’s x-axis offset. Larger numbers give a more heavy slowly responding camera. Using different settings per axis can yield a wide range of camera behaviors.
Y Damping Single How aggressively the camera tries to maintain the offset in the Y-axis. Small numbers are more responsive, rapidly translating the camera to keep the target’s y-axis offset. Larger numbers give a more heavy slowly responding camera. Using different settings per axis can yield a wide range of camera behaviors.
Z Damping Single How aggressively the camera tries to maintain the offset in the Z-axis. Small numbers are more responsive, rapidly translating the camera to keep the target’s z-axis offset. Larger numbers give a more heavy slowly responding camera. Using different settings per axis can yield a wide range of camera behaviors.
Pitch Damping Single How aggressively the camera tries to track the target rotation’s X angle. Small numbers are more responsive. Larger numbers give a more heavy slowly responding camera.
Yaw Damping Single How aggressively the camera tries to track the target rotation’s Y angle. Small numbers are more responsive. Larger numbers give a more heavy slowly responding camera.
Roll Damping Single How aggressively the camera tries to track the target rotation’s Z angle. Small numbers are more responsive. Larger numbers give a more heavy slowly responding camera.
設定 型別 描述
繫結模式 繫結模式 解釋目標偏移時使用的座標空間。 這也用於設定相機的向上向量,瞄準相機時將保持該向量。 可能的值:
鎖定目標開啟分配:攝像機將使用參考框架繫結到“跟隨”目標,該框架由啟用虛擬攝像機時或目標分配時目標的本地幀組成。
使用World Up鎖定目標:使用由目標的本地幀組成的參照系將攝像機繫結到Follow目標,並將傾斜和滾動歸零。
鎖定目標無滾動:攝像機將使用由目標的本地框架組成的參考框架繫結到“跟隨”目標,並將滾動歸零。
鎖定目標:使用目標的本地幀將相機繫結到關注目標。
世界空間:使用世界空間偏移將攝像機繫結到關注目標。
簡單跟隨:使用相機區域性軸,相對於目標計算偏移。
跟隨位移 Vector3 轉置器將嘗試從Follow目標維護的距離向量。
X軸阻尼 Single 相機如何積極地保持X軸的偏移。 小數字響應更快,快速轉換相機以保持目標的x軸偏移。 較大的數字給出了一個更加沉重的慢響應相機。 每個軸使用不同的設定可以產生各種相機行為。
Y軸阻尼 Single 相機如何積極地保持Y軸的偏移。 小數字響應更快,快速轉換相機以保持目標的x軸偏移。 較大的數字給出了一個更加沉重的慢響應相機。 每個軸使用不同的設定可以產生各種相機行為。
Z軸阻尼 Single 相機如何積極地保持Z軸的偏移。 小數字響應更快,快速轉換相機以保持目標的x軸偏移。 較大的數字給出了一個更加沉重的慢響應相機。 每個軸使用不同的設定可以產生各種相機行為。
音高阻尼 Single 相機如何積極地嘗試跟蹤目標旋轉的X角度。 小數字響應更快。 較大的數字給出了一個更加沉重的慢響應相機。
偏航阻尼 Single 相機如何積極地嘗試跟蹤目標旋轉的Y角度。 小數字響應更快。 較大的數字給出了一個更加沉重的慢響應相機。
滾動阻尼 Single 相機如何積極地嘗試跟蹤目標旋轉的Z角度。 小數字響應更快。 較大的數字給出了一個更加沉重的慢響應相機。