G1R AngelScript
Scripting reference for the Gothic 1 Remake
Loading...
Searching...
No Matches
AnimGraph Namespace Reference

Functions

Animation|Utilities
float32 EndProfilingTimer (bool bLog=true, FString LogPrefix="")
 This function ends measuring a profiling bracket and optionally logs the result.
float32 CalculateVelocityFromPositionHistory (float32 DeltaSeconds, FVector Position, FPositionHistory &History, int NumberOfSamples, float32 VelocityMin, float32 VelocityMax)
 This function calculates the velocity of a position changing over time. You need to hook up a valid PositionHistory variable to this for storage.
float32 CalculateVelocityFromSockets (float32 DeltaSeconds, USkeletalMeshComponent Component, const FName SocketOrBoneName, const FName ReferenceSocketOrBone, ERelativeTransformSpace SocketSpace, FVector OffsetInBoneSpace, FPositionHistory &History, int NumberOfSamples, float32 VelocityMin, float32 VelocityMax, EEasingFuncType EasingType, FRuntimeFloatCurve CustomCurve)
 This function calculates the velocity of an offset position on a bone / socket over time. The bone's / socket's motion can be expressed within a reference frame (another bone / socket). You need to hook up a valid PositionHistory variable to this for storage.
FVector DirectionBetweenSockets (const USkeletalMeshComponent Component, const FName SocketOrBoneNameFrom, const FName SocketOrBoneNameTo)
 Computes the direction between two bones / sockets.
float32 DistanceBetweenSockets (const USkeletalMeshComponent Component, const FName SocketOrBoneNameA, ERelativeTransformSpace SocketSpaceA, const FName SocketOrBoneNameB, ERelativeTransformSpace SocketSpaceB, bool bRemapRange, float32 InRangeMin, float32 InRangeMax, float32 OutRangeMin, float32 OutRangeMax)
 Computes the distance between two bones / sockets and can remap the range.
float32 CalculateDirection (FVector Velocity, FRotator BaseRotation)
 Returns degree of the angle between Velocity and Rotation forward vector The range of return will be from [-180, 180]. Useful for feeding directional blendspaces.
FTransform LookAt (FTransform CurrentTransform, FVector TargetPosition, FVector LookAtVector, bool bUseUpVector, FVector UpVector, float32 ClampConeInDegree)
 Computes the transform which is "looking" at target position with a local axis.
float32 MakeFloatFromPerlinNoise (float32 Value, float32 RangeOutMin, float32 RangeOutMax)
 This function creates perlin noise for a single float and then range map to RangeOut.
FVector MakeVectorFromPerlinNoise (float32 X, float32 Y, float32 Z, float32 RangeOutMinX, float32 RangeOutMaxX, float32 RangeOutMinY, float32 RangeOutMaxY, float32 RangeOutMinZ, float32 RangeOutMaxZ)
 This function creates perlin noise from input X, Y, Z, and then range map to RangeOut, and out put to OutX, OutY, OutZ.
void StartProfilingTimer ()
 This function starts measuring the time for a profiling bracket.
void TwoBoneIK (FVector RootPos, FVector JointPos, FVector EndPos, FVector JointTarget, FVector Effector, FVector &OutJointPos, FVector &OutEndPos, bool bAllowStretching, float32 StartStretchRatio, float32 MaxStretchScale)
 Computes the transform for two bones using inverse kinematics.

Function Documentation

◆ CalculateDirection()

float32 CalculateDirection ( FVector Velocity,
FRotator BaseRotation )

Returns degree of the angle between Velocity and Rotation forward vector The range of return will be from [-180, 180]. Useful for feeding directional blendspaces.

Parameters
VelocityThe velocity to use as direction relative to BaseRotation
BaseRotationThe base rotation, e.g. of a pawn

◆ CalculateVelocityFromPositionHistory()

float32 CalculateVelocityFromPositionHistory ( float32 DeltaSeconds,
FVector Position,
FPositionHistory & History,
int NumberOfSamples,
float32 VelocityMin,
float32 VelocityMax )

This function calculates the velocity of a position changing over time. You need to hook up a valid PositionHistory variable to this for storage.

Parameters
DeltaSecondsThe time passed in seconds
PositionThe position to track over time.
HistoryThe history to use for storage.
NumberOfSamplesThe number of samples to use for the history. The higher the number of samples - the smoother the velocity changes.
VelocityMinThe minimum velocity to use for normalization (if both min and max are set to 0, normalization is turned off)
VelocityMaxThe maximum velocity to use for normalization (if both min and max are set to 0, normalization is turned off)

◆ CalculateVelocityFromSockets()

float32 CalculateVelocityFromSockets ( float32 DeltaSeconds,
USkeletalMeshComponent Component,
const FName SocketOrBoneName,
const FName ReferenceSocketOrBone,
ERelativeTransformSpace SocketSpace,
FVector OffsetInBoneSpace,
FPositionHistory & History,
int NumberOfSamples,
float32 VelocityMin,
float32 VelocityMax,
EEasingFuncType EasingType,
FRuntimeFloatCurve CustomCurve )

This function calculates the velocity of an offset position on a bone / socket over time. The bone's / socket's motion can be expressed within a reference frame (another bone / socket). You need to hook up a valid PositionHistory variable to this for storage.

Parameters
DeltaSecondsThe time passed in seconds
ComponentThe skeletal component to look for the bones / sockets
SocketOrBoneNameThe name of the bone / socket to track.
ReferenceSocketOrBoneThe name of the bone / socket to use as a frame of reference (or None if no frame of reference == world space).
SocketSpaceThe space to use for the two sockets / bones
OffsetInBoneSpaceThe relative position in the space of the bone / socket to track over time.
HistoryThe history to use for storage.
NumberOfSamplesThe number of samples to use for the history. The higher the number of samples - the smoother the velocity changes.
VelocityMinThe minimum velocity to use for normalization (if both min and max are set to 0, normalization is turned off)
VelocityMaxThe maximum velocity to use for normalization (if both min and max are set to 0, normalization is turned off)
EasingTypeThe easing function to use
CustomCurveThe curve to use if the easing type is "Custom"

◆ DirectionBetweenSockets()

FVector DirectionBetweenSockets ( const USkeletalMeshComponent Component,
const FName SocketOrBoneNameFrom,
const FName SocketOrBoneNameTo )

Computes the direction between two bones / sockets.

Parameters
ComponentThe skeletal component to look for the sockets / bones within
SocketOrBoneNameFromThe name of the first socket / bone
SocketOrBoneNameToThe name of the second socket / bone

◆ DistanceBetweenSockets()

float32 DistanceBetweenSockets ( const USkeletalMeshComponent Component,
const FName SocketOrBoneNameA,
ERelativeTransformSpace SocketSpaceA,
const FName SocketOrBoneNameB,
ERelativeTransformSpace SocketSpaceB,
bool bRemapRange,
float32 InRangeMin,
float32 InRangeMax,
float32 OutRangeMin,
float32 OutRangeMax )

Computes the distance between two bones / sockets and can remap the range.

Parameters
ComponentThe skeletal component to look for the sockets / bones within
SocketOrBoneNameAThe name of the first socket / bone
SocketSpaceAThe space for the first socket / bone
SocketOrBoneNameBThe name of the second socket / bone
SocketSpaceBThe space for the second socket / bone
bRemapRangeIf set to true, the distance will be remapped using the range parameters
InRangeMinThe minimum for the input range (commonly == 0.0)
InRangeMaxThe maximum for the input range (the max expected distance)
OutRangeMinThe minimum for the output range (commonly == 0.0)
OutRangeMaxThe maximum for the output range (commonly == 1.0)

◆ EndProfilingTimer()

float32 EndProfilingTimer ( bool bLog = true,
FString LogPrefix = "" )

This function ends measuring a profiling bracket and optionally logs the result.

Parameters
bLogIf set to true the result is logged to the OutputLog
LogPrefixA prefix to use for the log

◆ LookAt()

FTransform LookAt ( FTransform CurrentTransform,
FVector TargetPosition,
FVector LookAtVector,
bool bUseUpVector,
FVector UpVector,
float32 ClampConeInDegree )

Computes the transform which is "looking" at target position with a local axis.

Parameters
CurrentTransformThe input transform to modify
TargetPositionThe position this transform should look at
LookAtVectorThe local vector to align with the target
bUseUpVectorIf set to true the lookat will also perform a twist rotation
UpVectorThe position to use for the upvector target (only used is bUseUpVector is turned on)
ClampConeInDegreeA limit for only allowing the lookat to rotate as much as defined by the float value

◆ MakeFloatFromPerlinNoise()

float32 MakeFloatFromPerlinNoise ( float32 Value,
float32 RangeOutMin,
float32 RangeOutMax )

This function creates perlin noise for a single float and then range map to RangeOut.

Parameters
ValueThe input value for the noise function
RangeOutMinThe minimum for the output range
RangeOutMaxThe maximum for the output range

◆ MakeVectorFromPerlinNoise()

FVector MakeVectorFromPerlinNoise ( float32 X,
float32 Y,
float32 Z,
float32 RangeOutMinX,
float32 RangeOutMaxX,
float32 RangeOutMinY,
float32 RangeOutMaxY,
float32 RangeOutMinZ,
float32 RangeOutMaxZ )

This function creates perlin noise from input X, Y, Z, and then range map to RangeOut, and out put to OutX, OutY, OutZ.

Parameters
XThe x component for the input position of the noise
YThe y component for the input position of the noise
ZThe z component for the input position of the noise
RangeOutMinXThe minimum for the output range for the x component
RangeOutMaxXThe maximum for the output range for the x component
RangeOutMinYThe minimum for the output range for the y component
RangeOutMaxYThe maximum for the output range for the y component
RangeOutMinZThe minimum for the output range for the z component
RangeOutMaxZThe maximum for the output range for the z component

◆ StartProfilingTimer()

void StartProfilingTimer ( )

This function starts measuring the time for a profiling bracket.

◆ TwoBoneIK()

void TwoBoneIK ( FVector RootPos,
FVector JointPos,
FVector EndPos,
FVector JointTarget,
FVector Effector,
FVector & OutJointPos,
FVector & OutEndPos,
bool bAllowStretching,
float32 StartStretchRatio,
float32 MaxStretchScale )

Computes the transform for two bones using inverse kinematics.

Parameters
RootPosThe input root position of the two bone chain
JointPosThe input center (elbow) position of the two bone chain
EndPosThe input end (wrist) position of the two bone chain
JointTargetThe IK target for the write to reach
EffectorThe position of the target effector for the IK Chain.
OutJointPosThe resulting position for the center (elbow)
OutEndPosThe resulting position for the end (wrist)
bAllowStretchingIf set to true the bones are allowed to stretch
StartStretchRatioThe ratio at which the bones should start to stretch. The higher the value, the later the stretching wil start.
MaxStretchScaleThe maximum multiplier for the stretch to reach.