Class UUxtFollowComponent
The follow component has three different constraints that keeps its owner in front of the camera: Angular Clamp, Distance Clamp, and Orientation. The combination of Angular and Distance Clamp creates a frustum in front of the camera where its owner can be. If its owner is outside that frustum it is adjusted.
Angular Clamp: The objective of this constraint is to ensure that the reference forward vector remains within the bounds set by the leashing parameters. To do this, determine the angles between toTarget and the leashing bounds about the global Z-axis and the reference's Y-axis. If the toTarget falls within the leashing bounds, then we don't have to modify it. Otherwise, we apply a correction rotation to bring it within bounds. This will ensure that the its owner stays within the top, bottom, right and left planes of the frustum.
Distance Clamp: The objective of this constraint is to ensure that the following actor stays within bounds set by the distance parameters. To do this, we measure the current distance from the camera to the its owner. If the distance is within the MinimumDistance and MaximumDistance then we don't have to modify it. Otherwise, we push away or pull in the its owner along the reference forward vector. This will ensure that the its owner stays within the near and far planes of the frustum.
Orientation: The two options provided are constant FaceCamera or WorldLock. While world locked there are three conditions that will cause the its owner to face the camera: Angular Clamps Distance Clamps The angle between the forward vector of the its owner and toTarget vector (vector between the camera and the its owner) is larger than dead zone angle parameter
Inheritance
Namespace:
Assembly: .dll
Syntax
public: class UUxtFollowComponent
Constructors
| Improve this Doc View SourceUUxtFollowComponent()
Declaration
public: UUxtFollowComponent()
Fields
| Improve this Doc View SourceActorToFollow
Actor that this component will follow. If null, this component will follow the camera
Declaration
public: AActor * ActorToFollow
Field Value
Type | Description |
---|---|
AActor * |
bIgnoreAngleClamp
Option to ignore angle clamping
Declaration
public: bool bIgnoreAngleClamp= false
Field Value
Type | Description |
---|---|
bool |
bIgnoreCameraPitchAndRoll
Option to ignore the pitch and roll of the camera
Declaration
public: bool bIgnoreCameraPitchAndRoll= false
Field Value
Type | Description |
---|---|
bool |
bIgnoreDistanceClamp
Option to ignore distance clamping
Declaration
public: bool bIgnoreDistanceClamp= false
Field Value
Type | Description |
---|---|
bool |
bInterpolatePose
Option to ignore interpolation between follow poses
Declaration
public: bool bInterpolatePose= true
Field Value
Type | Description |
---|---|
bool |
DefaultDistance
Default distance from eye to position its owner around, i.e. the sphere radius
Declaration
public: float DefaultDistance= 75.0f
Field Value
Type | Description |
---|---|
float |
MaximumDistance
Max distance from eye to its owner
Declaration
public: float MaximumDistance= 100.0f
Field Value
Type | Description |
---|---|
float |
MaxViewHorizontalDegrees
The horizontal angle from the camera forward axis to the owner will not exceed this value
Declaration
public: float MaxViewHorizontalDegrees= 30.0f
Field Value
Type | Description |
---|---|
float |
MaxViewVerticalDegrees
The vertical angle from the camera forward axis to the owner will not exceed this value
Declaration
public: float MaxViewVerticalDegrees= 30.0f
Field Value
Type | Description |
---|---|
float |
MinimumDistance
Min distance from eye to position its owner around, i.e. the sphere radius
Declaration
public: float MinimumDistance= 50.0f
Field Value
Type | Description |
---|---|
float |
MoveToDefaultDistanceLerpTime
Rate at which its owner will move toward default distance when angular leashing
Declaration
public: float MoveToDefaultDistanceLerpTime= 10.0f
Field Value
Type | Description |
---|---|
float |
OrientationType
Orientation Type
Declaration
public: TEnumAsByte<EUxtFollowOrientBehavior> OrientationType= EUxtFollowOrientBehavior::WorldLock
Field Value
Type | Description |
---|---|
TEnumAsByte<EUxtFollowOrientBehavior> |
OrientToCameraDeadzoneDegrees
The owner will not reorient until the angle between its forward vector and the vector to the camera is greater than this value
Declaration
public: float OrientToCameraDeadzoneDegrees= 60.0f
Field Value
Type | Description |
---|---|
float |
PitchOffset
Pitch offset from camera (relative to Max Distance)
Declaration
public: float PitchOffset= 0.0f
Field Value
Type | Description |
---|---|
float |
VerticalMaxDistance
Max vertical distance between the owner and camera
Declaration
public: float VerticalMaxDistance= 0.0f
Field Value
Type | Description |
---|---|
float |
Methods
| Improve this Doc View SourceBeginPlay()
Declaration
protected: virtual void BeginPlay() override
Recenter()
Force the owner to recenter in the camera's field of view.
Declaration
public: void Recenter()
TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction *ThisTickFunction)
Declaration
protected: virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction *ThisTickFunction) override
Parameters
Type | Name | Description |
---|---|---|
float | DeltaTime | |
ELevelTick | TickType | |
FActorComponentTickFunction * | ThisTickFunction |