reckfellENGINE

LookAtModifier3D

The LookAtModifier3D rotates a bone to look at a target.

On this page
class LookAtModifier3DReckfellSharpInherits SkeletonModifier3D

The LookAtModifier3D rotates a bone to look at a target.

This SkeletonModifier3D rotates a bone to look at a target. This is helpful for moving a character's head to look at the player, rotating a turret to look at a target, or any other case where you want to make a bone rotate towards something quickly and easily. When applying multiple LookAtModifier3Ds, the LookAtModifier3D assigned to the parent bone must be put above the LookAtModifier3D assigned to the child bone in the list in order for the child bone results to be correct.

Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.

Constructors1

LookAtModifier3DConstructor
# LookAtModifier3D
C#
public LookAtModifier3D();

Properties31

BoneProperty
# Bone
C#
public int Bone { get; set; }

Index of the LookAtModifier3D.BoneName in the parent Skeleton3D.

BoneNameProperty
# BoneName
C#
public string BoneName { get; set; }

The bone name of the Skeleton3D that the modification will operate on.

DurationProperty
# Duration
C#
public float Duration { get; set; }

The duration of the time-based interpolation. Interpolation is triggered at the following cases:

  • When the target node is changed
  • When an axis is flipped due to angle limitation Note: The flipping occurs when the target is outside the angle limitation and the internally computed secondary rotation axis of the forward vector is flipped. Visually, it occurs when the target is outside the angle limitation and crosses the plane of the LookAtModifier3D.ForwardAxis and LookAtModifier3D.PrimaryRotationAxis.
EaseTypeProperty
# EaseType
C#
public Tween.EaseType EaseType { get; set; }

The ease type of the time-based interpolation. See also Tween.EaseType.

ForwardAxisProperty
# ForwardAxis
C#
public SkeletonModifier3D.BoneAxis ForwardAxis { get; set; }

The forward axis of the bone. This SkeletonModifier3D modifies the bone so that this axis points toward the target_node.

OriginBoneProperty
# OriginBone
C#
public int OriginBone { get; set; }

Index of the LookAtModifier3D.OriginBoneName in the parent Skeleton3D.

OriginBoneNameProperty
# OriginBoneName
C#
public string OriginBoneName { get; set; }

If LookAtModifier3D.OriginFrom is LookAtModifier3D.OriginFromEnum.SpecificBone, the bone global pose position specified for this is used as origin.

OriginExternalEntityProperty
# OriginExternalEntity
C#
public EntityPath OriginExternalEntity { get; set; }

If LookAtModifier3D.OriginFrom is LookAtModifier3D.OriginFromEnum.ExternalNode, the global position of the Entity3D specified for this is used as origin.

OriginFromProperty
# OriginFrom
C#
public LookAtModifier3D.OriginFromEnum OriginFrom { get; set; }

This value determines from what origin is retrieved for use in the calculation of the forward vector.

OriginOffsetProperty
# OriginOffset
C#
public Vector3 OriginOffset { get; set; }

The offset of the bone pose origin. Matching the origins by offset is useful for cases where multiple bones must always face the same direction, such as the eyes. Note: This value indicates the local position of the object set in LookAtModifier3D.OriginFrom.

OriginSafeMarginProperty
# OriginSafeMargin
C#
public float OriginSafeMargin { get; set; }

If the target passes through too close to the origin than this value, time-based interpolation is used even if the target is within the angular limitations, to prevent the angular velocity from becoming too high.

PrimaryDampThresholdProperty
# PrimaryDampThreshold
C#
public float PrimaryDampThreshold { get; set; }

The threshold to start damping for LookAtModifier3D.PrimaryLimitAngle. It provides non-linear (b-spline) interpolation, let it feel more resistance the more it rotate to the edge limit. This is useful for simulating the limits of human motion. If 1.0, no damping is performed. If 0.0, damping is always performed.

PrimaryLimitAngleProperty
# PrimaryLimitAngle
C#
public float PrimaryLimitAngle { get; set; }

The limit angle of the primary rotation when LookAtModifier3D.SymmetryLimitation is true, in radians.

PrimaryNegativeDampThresholdProperty
# PrimaryNegativeDampThreshold
C#
public float PrimaryNegativeDampThreshold { get; set; }

The threshold to start damping for LookAtModifier3D.PrimaryNegativeLimitAngle.

PrimaryNegativeLimitAngleProperty
# PrimaryNegativeLimitAngle
C#
public float PrimaryNegativeLimitAngle { get; set; }

The limit angle of negative side of the primary rotation when LookAtModifier3D.SymmetryLimitation is false, in radians.

PrimaryPositiveDampThresholdProperty
# PrimaryPositiveDampThreshold
C#
public float PrimaryPositiveDampThreshold { get; set; }

The threshold to start damping for LookAtModifier3D.PrimaryPositiveLimitAngle.

PrimaryPositiveLimitAngleProperty
# PrimaryPositiveLimitAngle
C#
public float PrimaryPositiveLimitAngle { get; set; }

The limit angle of positive side of the primary rotation when LookAtModifier3D.SymmetryLimitation is false, in radians.

PrimaryRotationAxisProperty
# PrimaryRotationAxis
C#
public Vector3.Axis PrimaryRotationAxis { get; set; }

The axis of the first rotation. This SkeletonModifier3D works by compositing the rotation by Euler angles to prevent to rotate the LookAtModifier3D.ForwardAxis. Note: Since LookAtModifier3D never modifies the twist when LookAtModifier3D.UseSecondaryRotation is false and LookAtModifier3D.Relative is true, the twist is not fixed even if LookAtModifier3D.UseRestForLimitation is true.

RelativeProperty
# Relative
C#
public bool Relative { get; set; }

The relative option. If true, the rotation is applied relative to the pose. If false, the rotation is applied relative to the rest. It means to replace the current pose with the LookAtModifier3D's result.

SecondaryDampThresholdProperty
# SecondaryDampThreshold
C#
public float SecondaryDampThreshold { get; set; }

The threshold to start damping for LookAtModifier3D.SecondaryLimitAngle.

SecondaryLimitAngleProperty
# SecondaryLimitAngle
C#
public float SecondaryLimitAngle { get; set; }

The limit angle of the secondary rotation when LookAtModifier3D.SymmetryLimitation is true, in radians.

SecondaryNegativeDampThresholdProperty
# SecondaryNegativeDampThreshold
C#
public float SecondaryNegativeDampThreshold { get; set; }

The threshold to start damping for LookAtModifier3D.SecondaryNegativeLimitAngle.

SecondaryNegativeLimitAngleProperty
# SecondaryNegativeLimitAngle
C#
public float SecondaryNegativeLimitAngle { get; set; }

The limit angle of negative side of the secondary rotation when LookAtModifier3D.SymmetryLimitation is false, in radians.

SecondaryPositiveDampThresholdProperty
# SecondaryPositiveDampThreshold
C#
public float SecondaryPositiveDampThreshold { get; set; }

The threshold to start damping for LookAtModifier3D.SecondaryPositiveLimitAngle.

SecondaryPositiveLimitAngleProperty
# SecondaryPositiveLimitAngle
C#
public float SecondaryPositiveLimitAngle { get; set; }

The limit angle of positive side of the secondary rotation when LookAtModifier3D.SymmetryLimitation is false, in radians.

SymmetryLimitationProperty
# SymmetryLimitation
C#
public bool SymmetryLimitation { get; set; }

If true, the limitations are spread from the bone symmetrically. If false, the limitation can be specified separately for each side of the reference pose. In here, the reference pose is the bone pose immediately before processing this modifier.

TargetEntityProperty
# TargetEntity
C#
public EntityPath TargetEntity { get; set; }

The EntityPath to the node that is the target for the look at modification. This node is what the modification will rotate the bone to.

TransitionTypeProperty
# TransitionType
C#
public Tween.TransitionType TransitionType { get; set; }

The transition type of the time-based interpolation. See also Tween.TransitionType.

UseAngleLimitationProperty
# UseAngleLimitation
C#
public bool UseAngleLimitation { get; set; }

If true, limits the amount of rotation. For example, this helps to prevent a character's neck from rotating 360 degrees. Note: As with AnimationTree blending, interpolation is provided that favors Skeleton3D.GetBoneRest or Skeleton3D.GetBonePose depends on the LookAtModifier3D.Relative option. This means that interpolation does not select the shortest path in some cases. Note: Some values for LookAtModifier3D.TransitionType (such as Tween.TransitionType.Back, Tween.TransitionType.Elastic, and Tween.TransitionType.Spring) may exceed the limitations. If interpolation occurs while overshooting the limitations, the result might not respect the bone rest.

UseRestForLimitationProperty
# UseRestForLimitation
C#
public bool UseRestForLimitation { get; set; }

If true, the angle limitation and the rotation axes are applied based on the Skeleton3D.GetBoneRest. If false, the angle limitation is applied based on the reference pose. In here, the reference pose is the bone pose immediately before processing this modifier. Note: The limitation is applied to the rotation computed by this modifier. If the reference pose is rotated around the same axis, the limitation behaves as if it also limits the rotation of the reference pose. A rotation that this modifier does not change, such as the twist, is not limited.

UseSecondaryRotationProperty
# UseSecondaryRotation
C#
public bool UseSecondaryRotation { get; set; }

If true, provides rotation by two axes.

Methods65

GetBoneint
# GetBone
C#
public int GetBone();
Returns int
GetBoneNamestring
# GetBoneName
C#
public string GetBoneName();
Returns string
GetDurationfloat
# GetDuration
C#
public float GetDuration();
Returns float
GetEaseTypeTween.EaseType
# GetEaseType
C#
public Tween.EaseType GetEaseType();
Returns Tween.EaseType
GetForwardAxisSkeletonModifier3D.BoneAxis
# GetForwardAxis
C#
public SkeletonModifier3D.BoneAxis GetForwardAxis();
Returns SkeletonModifier3D.BoneAxis
GetInterpolationRemainingfloat
# GetInterpolationRemaining
C#
public float GetInterpolationRemaining();

Returns the remaining seconds of the time-based interpolation.

Returns float
GetOriginBoneint
# GetOriginBone
C#
public int GetOriginBone();
Returns int
GetOriginBoneNamestring
# GetOriginBoneName
C#
public string GetOriginBoneName();
Returns string
GetOriginExternalEntityEntityPath
# GetOriginExternalEntity
C#
public EntityPath GetOriginExternalEntity();
Returns EntityPath
GetOriginFromLookAtModifier3D.OriginFromEnum
# GetOriginFrom
C#
public LookAtModifier3D.OriginFromEnum GetOriginFrom();
Returns LookAtModifier3D.OriginFromEnum
GetOriginOffsetVector3
# GetOriginOffset
C#
public Vector3 GetOriginOffset();
Returns Vector3
GetOriginSafeMarginfloat
# GetOriginSafeMargin
C#
public float GetOriginSafeMargin();
Returns float
GetPrimaryDampThresholdfloat
# GetPrimaryDampThreshold
C#
public float GetPrimaryDampThreshold();
Returns float
GetPrimaryLimitAnglefloat
# GetPrimaryLimitAngle
C#
public float GetPrimaryLimitAngle();
Returns float
GetPrimaryNegativeDampThresholdfloat
# GetPrimaryNegativeDampThreshold
C#
public float GetPrimaryNegativeDampThreshold();
Returns float
GetPrimaryNegativeLimitAnglefloat
# GetPrimaryNegativeLimitAngle
C#
public float GetPrimaryNegativeLimitAngle();
Returns float
GetPrimaryPositiveDampThresholdfloat
# GetPrimaryPositiveDampThreshold
C#
public float GetPrimaryPositiveDampThreshold();
Returns float
GetPrimaryPositiveLimitAnglefloat
# GetPrimaryPositiveLimitAngle
C#
public float GetPrimaryPositiveLimitAngle();
Returns float
GetPrimaryRotationAxisVector3.Axis
# GetPrimaryRotationAxis
C#
public Vector3.Axis GetPrimaryRotationAxis();
Returns Vector3.Axis
GetSecondaryDampThresholdfloat
# GetSecondaryDampThreshold
C#
public float GetSecondaryDampThreshold();
Returns float
GetSecondaryLimitAnglefloat
# GetSecondaryLimitAngle
C#
public float GetSecondaryLimitAngle();
Returns float
GetSecondaryNegativeDampThresholdfloat
# GetSecondaryNegativeDampThreshold
C#
public float GetSecondaryNegativeDampThreshold();
Returns float
GetSecondaryNegativeLimitAnglefloat
# GetSecondaryNegativeLimitAngle
C#
public float GetSecondaryNegativeLimitAngle();
Returns float
GetSecondaryPositiveDampThresholdfloat
# GetSecondaryPositiveDampThreshold
C#
public float GetSecondaryPositiveDampThreshold();
Returns float
GetSecondaryPositiveLimitAnglefloat
# GetSecondaryPositiveLimitAngle
C#
public float GetSecondaryPositiveLimitAngle();
Returns float
GetTargetEntityEntityPath
# GetTargetEntity
C#
public EntityPath GetTargetEntity();
Returns EntityPath
GetTransitionTypeTween.TransitionType
# GetTransitionType
C#
public Tween.TransitionType GetTransitionType();
Returns Tween.TransitionType
IsInterpolatingbool
# IsInterpolating
C#
public bool IsInterpolating();

Returns true if time-based interpolation is running. If false, it is equivalent to LookAtModifier3D.GetInterpolationRemaining returning 0.0. This is useful to determine whether a LookAtModifier3D can be removed safely.

Returns bool
IsLimitationSymmetrybool
# IsLimitationSymmetry
C#
public bool IsLimitationSymmetry();
Returns bool
IsRelativebool
# IsRelative
C#
public bool IsRelative();
Returns bool
IsTargetWithinLimitationbool
# IsTargetWithinLimitation
C#
public bool IsTargetWithinLimitation();

Returns whether the target is within the angle limitations. It is useful for unsetting the target_node when the target is outside of the angle limitations. Note: The value is updated after SkeletonModifier3D._ProcessModification. To retrieve this value correctly, we recommend using the signal SkeletonModifier3D.ModificationProcessed.

Returns bool
IsUsingAngleLimitationbool
# IsUsingAngleLimitation
C#
public bool IsUsingAngleLimitation();
Returns bool
IsUsingRestForLimitationbool
# IsUsingRestForLimitation
C#
public bool IsUsingRestForLimitation();
Returns bool
IsUsingSecondaryRotationbool
# IsUsingSecondaryRotation
C#
public bool IsUsingSecondaryRotation();
Returns bool
SetBonevoid
# SetBone
C#
public void SetBone(int bone);
Parameters
NameTypeDefault
boneint—
SetBoneNamevoid
# SetBoneName
C#
public void SetBoneName(string boneName);
Parameters
NameTypeDefault
boneNamestring—
SetDurationvoid
# SetDuration
C#
public void SetDuration(float duration);
Parameters
NameTypeDefault
durationfloat—
SetEaseTypevoid
# SetEaseType
C#
public void SetEaseType(Tween.EaseType easeType);
Parameters
NameTypeDefault
easeTypeTween.EaseType—
SetForwardAxisvoid
# SetForwardAxis
C#
public void SetForwardAxis(SkeletonModifier3D.BoneAxis forwardAxis);
Parameters
NameTypeDefault
forwardAxisSkeletonModifier3D.BoneAxis—
SetOriginBonevoid
# SetOriginBone
C#
public void SetOriginBone(int bone);
Parameters
NameTypeDefault
boneint—
SetOriginBoneNamevoid
# SetOriginBoneName
C#
public void SetOriginBoneName(string boneName);
Parameters
NameTypeDefault
boneNamestring—
SetOriginExternalEntityvoid
# SetOriginExternalEntity
C#
public void SetOriginExternalEntity(EntityPath externalNode);
Parameters
NameTypeDefault
externalNodeEntityPath—
SetOriginFromvoid
# SetOriginFrom
C#
public void SetOriginFrom(LookAtModifier3D.OriginFromEnum originFrom);
Parameters
NameTypeDefault
originFromLookAtModifier3D.OriginFromEnum—
SetOriginOffsetvoid
# SetOriginOffset
C#
public void SetOriginOffset(Vector3 offset);
Parameters
NameTypeDefault
offsetVector3—
SetOriginSafeMarginvoid
# SetOriginSafeMargin
C#
public void SetOriginSafeMargin(float margin);
Parameters
NameTypeDefault
marginfloat—
SetPrimaryDampThresholdvoid
# SetPrimaryDampThreshold
C#
public void SetPrimaryDampThreshold(float power);
Parameters
NameTypeDefault
powerfloat—
SetPrimaryLimitAnglevoid
# SetPrimaryLimitAngle
C#
public void SetPrimaryLimitAngle(float angle);
Parameters
NameTypeDefault
anglefloat—
SetPrimaryNegativeDampThresholdvoid
# SetPrimaryNegativeDampThreshold
C#
public void SetPrimaryNegativeDampThreshold(float power);
Parameters
NameTypeDefault
powerfloat—
SetPrimaryNegativeLimitAnglevoid
# SetPrimaryNegativeLimitAngle
C#
public void SetPrimaryNegativeLimitAngle(float angle);
Parameters
NameTypeDefault
anglefloat—
SetPrimaryPositiveDampThresholdvoid
# SetPrimaryPositiveDampThreshold
C#
public void SetPrimaryPositiveDampThreshold(float power);
Parameters
NameTypeDefault
powerfloat—
SetPrimaryPositiveLimitAnglevoid
# SetPrimaryPositiveLimitAngle
C#
public void SetPrimaryPositiveLimitAngle(float angle);
Parameters
NameTypeDefault
anglefloat—
SetPrimaryRotationAxisvoid
# SetPrimaryRotationAxis
C#
public void SetPrimaryRotationAxis(Vector3.Axis axis);
Parameters
NameTypeDefault
axisVector3.Axis—
SetRelativevoid
# SetRelative
C#
public void SetRelative(bool enabled);
Parameters
NameTypeDefault
enabledbool—
SetSecondaryDampThresholdvoid
# SetSecondaryDampThreshold
C#
public void SetSecondaryDampThreshold(float power);
Parameters
NameTypeDefault
powerfloat—
SetSecondaryLimitAnglevoid
# SetSecondaryLimitAngle
C#
public void SetSecondaryLimitAngle(float angle);
Parameters
NameTypeDefault
anglefloat—
SetSecondaryNegativeDampThresholdvoid
# SetSecondaryNegativeDampThreshold
C#
public void SetSecondaryNegativeDampThreshold(float power);
Parameters
NameTypeDefault
powerfloat—
SetSecondaryNegativeLimitAnglevoid
# SetSecondaryNegativeLimitAngle
C#
public void SetSecondaryNegativeLimitAngle(float angle);
Parameters
NameTypeDefault
anglefloat—
SetSecondaryPositiveDampThresholdvoid
# SetSecondaryPositiveDampThreshold
C#
public void SetSecondaryPositiveDampThreshold(float power);
Parameters
NameTypeDefault
powerfloat—
SetSecondaryPositiveLimitAnglevoid
# SetSecondaryPositiveLimitAngle
C#
public void SetSecondaryPositiveLimitAngle(float angle);
Parameters
NameTypeDefault
anglefloat—
SetSymmetryLimitationvoid
# SetSymmetryLimitation
C#
public void SetSymmetryLimitation(bool enabled);
Parameters
NameTypeDefault
enabledbool—
SetTargetEntityvoid
# SetTargetEntity
C#
public void SetTargetEntity(EntityPath targetEntity);
Parameters
NameTypeDefault
targetEntityEntityPath—
SetTransitionTypevoid
# SetTransitionType
C#
public void SetTransitionType(Tween.TransitionType transitionType);
Parameters
NameTypeDefault
transitionTypeTween.TransitionType—
SetUseAngleLimitationvoid
# SetUseAngleLimitation
C#
public void SetUseAngleLimitation(bool enabled);
Parameters
NameTypeDefault
enabledbool—
SetUseRestForLimitationvoid
# SetUseRestForLimitation
C#
public void SetUseRestForLimitation(bool enabled);
Parameters
NameTypeDefault
enabledbool—
SetUseSecondaryRotationvoid
# SetUseSecondaryRotation
C#
public void SetUseSecondaryRotation(bool enabled);
Parameters
NameTypeDefault
enabledbool—

LookAtModifier3D.OriginFromEnum

ValueDescription
ExternalNode = 2

The global position of the Entity3D specified in origin_external_node is used as origin. Note: Same as LookAtModifier3D.OriginFromEnum.SpecificBone, when specifying a BoneAttachment3D with a child bone assigned, the rendered result and direction will not match.

Self = 0

The bone rest position of the bone specified in LookAtModifier3D.Bone is used as origin.

SpecificBone = 1

The bone global pose position of the bone specified in LookAtModifier3D.OriginBone is used as origin. Note: It is recommended that you select only the parent bone unless you are familiar with the bone processing process. The specified bone pose at the time the LookAtModifier3D is processed is used as a reference. In other words, if you specify a child bone and the LookAtModifier3D causes the child bone to move, the rendered result and direction will not match.

Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.