Class CinemachineTargetGroup
Defines a group of target objects, each with a radius and a weight. The weight is used when calculating the average position of the target group. Higher-weighted members of the group will count more. The bounding box is calculated by taking the member positions, weight, and radii into account.
Implements
Inherited Members
Namespace: Cinemachine
Assembly: solution.dll
Syntax
[DocumentationSorting(DocumentationSortingAttribute.Level.UserRef)]
[AddComponentMenu("Cinemachine/CinemachineTargetGroup")]
[ExecuteInEditMode]
public class CinemachineTargetGroup : MonoBehaviour, ICinemachineTargetGroup
Fields
Name | Description |
---|---|
m_PositionMode | How the group's position is calculated |
m_RotationMode | How the group's orientation is calculated |
m_Targets | The target objects, together with their weights and radii, that will contribute to the group's average position, orientation, and size |
m_UpdateMethod | When to update the group's transform based on the position of the group members |
Properties
Name | Description |
---|---|
BoundingBox | The axis-aligned bounding box of the group, computed using the targets positions and radii |
IsEmpty | Return true if there are no members with weight > 0 |
Sphere | The bounding sphere of the group, computed using the targets positions and radii |
Transform | Get the MonoBehaviour's Transform |
Methods
Name | Description |
---|---|
AddMember(Transform, float, float) | Add a member to the group |
DoUpdate() | Update the group's transform right now, depending on the transforms of the members. Normally this is called automatically by Update() or LateUpdate(). |
FindMember(Transform) | Locate a member's index in the group. Returns -1 if not a member |
GetViewSpaceAngularBounds(Matrix4x4, out Vector2, out Vector2, out Vector2) | Get the local-space angular bounds of the group, from a spoecific point of view. Also returns the z depth range of the members. |
GetViewSpaceBoundingBox(Matrix4x4) | The axis-aligned bounding box of the group, in a specific reference frame |
GetWeightedBoundsForMember(int) | Get the bounding sphere of a group memebr, with the weight taken into account. As the member's weight goes to 0, the position lerps to the group average position. |
RemoveMember(Transform) | Remove a member from the group |