Skip to content

Commit

Permalink
Add LookAtDataOnSpline component
Browse files Browse the repository at this point in the history
  • Loading branch information
glabute committed May 15, 2024
1 parent 7c09510 commit ee6d63d
Show file tree
Hide file tree
Showing 11 changed files with 532 additions and 1 deletion.
3 changes: 2 additions & 1 deletion com.unity.cinemachine/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- CinemachineGroupFraming now has a compatibility mode so that it can work with CinemachineConfiner2D out of the box.

### Added
- Added Recenter Target setting to CinemachinePanTilt
- New Rotation Control behaviour LookAtDataOnSpline lets you specify LookAt points at desird positions along a Spline Dolly trajectory.
- Added Recenter Target setting to CinemachinePanTilt.


## [3.1.0] - 2024-04-01
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# LookAt Data On Spline

This CinemachineCamera __Rotation Control__ behaviour lets you assign LookAt targets to points on a spline, so that as the camera arrives at the position on the spline, it looks at the specified place.

It's useful for creating curated dolly shots with specified aim targets along the way. This behaviour eliminates the need to provide rotation animations for the camera that are synchronized with the spline position animation. LookAt points are anchored to specific spline positions, and because they specify a LookAt target point, the appropriate rotation angles get computed dynamically. As a result, the rotation animation is more robust and less likely to break if the spline is modified.

To use this behaviour, select it in the Rotation Control section of the CinemachineCamera inspector, or just add it manually to a CinemachineCamera. Note that a CinemachineSplineDolly behaviour is required in the Position Control section of the CinemachineCamera. Then, add Data Points to the array.

### Scene View Tool

When the LookAtDataOnSpline is selected in the inspector, a Scene View tool is provided to position the LookAt targets along the spline. The tool lets you add, remove, and reposition LookAt targets.

![LookAt Data On Spline Tool](images/LookAtDataOnSplineTool.png)


### Properties

| Property | Field | Description |
| --- | --- | --- |
| __Index Unit__ | | Defines how to interpret the _Index_ field for each data point. _Knot_ is the recommended value because it remains robust if the spline points change. |
| __Data Points__ | | The list of markup points on the spline. As the camera approaches these points, the corresponding fields will come into effect. |
| | _Index_ | The position on the Spline where the camera should look at the supplied point. The value is interpreted according to the _Index Unit_ setting. |
| | _Look At Point_ | The point that the camera should look at, in world space co-ordinates. |
| | _Easing_ | Controls how to ease in and out of this target. A value of 0 will linearly interpolate between LookAt points, while a value of 1 will slow down and briefly pause the rotation to look at the target. |


Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
114 changes: 114 additions & 0 deletions com.unity.cinemachine/Editor/EditorResources/Icons/[email protected]

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
114 changes: 114 additions & 0 deletions com.unity.cinemachine/Editor/EditorResources/Icons/[email protected]

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit ee6d63d

Please sign in to comment.