UE3:Object functions (UDK)

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to navigation Jump to search
UDK Object (functions)

Functions

Static native functions

See Object static native functions.

Other static functions

ClampRotAxis

static final simulated function ClampRotAxis (int ViewAxis, out int out_DeltaViewAxis, int MaxLimit, int MinLimit)

Clamp a rotation Axis. The ViewAxis rotation component must be normalized (within the [-32768,+32767] range). This function will set out_DeltaViewAxis to the delta needed to bring ViewAxis within the [MinLimit,MaxLimit] range.

Parameters:

  • ViewAxis - Rotation Axis to clamp
  • out_DeltaViewAxis - Delta Rotation Axis to be added to ViewAxis rotation (from ProcessViewRotation). Set to be the Delta to bring ViewAxis within the [MinLimit,MaxLimit] range.
  • MaxLimit - Maximum for Clamp. ViewAxis will not exceed this.
  • MinLimit - Minimum for Clamp. ViewAxis will not go below this.

ClampRotAxisFromBase

static final simulated function int ClampRotAxisFromBase (int Current, int Center, int MaxDelta)

Clamp Rotator Axis.

Parameters:

  • Current - Input axis angle.
  • Center - Center of allowed angle.
  • MaxDelta - Maximum delta allowed.

Returns:

axis angle clamped between [Center-MaxDelta, Center+MaxDelta]

ClampRotAxisFromRange

static final simulated function int ClampRotAxisFromRange (int Current, int Min, int Max)

Clamp Rotator Axis.

Parameters:

  • Current - Input axis angle.
  • Min - Min allowed angle.
  • Max - Max allowed angle.

Returns:

axis angle clamped between [Min, Max]

ColorToLinearColor

static final function LinearColor ColorToLinearColor (Color OldColor)

converts a color to a LinearColor

Parameters:

  • OldColor - the color to convert

Returns:

the matching LinearColor

FindDeltaAngle

static final simulated function float FindDeltaAngle (float A1, float A2)

Gets the difference in world space angles in [-PI,PI] range

Parameters:

  • A1 - First angle
  • A2 - Second angle

FInterpEaseIn

static final function float FInterpEaseIn (float A, float B, float Alpha, float Exp)

Interpolates with ease-in (smoothly approaches B).

Parameters:

  • A - Value to interpolate from.
  • B - Value to interpolate to.
  • Alpha - Interpolant.
  • Exp - Exponent. Higher values result in more rapid deceleration.

Returns:

Interpolated value.

FInterpEaseOut

static final function float FInterpEaseOut (float A, float B, float Alpha, float Exp)

Interpolates with ease-out (smoothly departs A).

Parameters:

  • A - Value to interpolate from.
  • B - Value to interpolate to.
  • Alpha - Interpolant.
  • Exp - Exponent. Higher values result in more rapid acceleration.

Returns:

Interpolated value.

FPctByRange

static final simulated function float FPctByRange (float Value, float InMin, float InMax)

Returns the relative percentage position Value is in the range [Min,Max]. Examples: - GetRangeValueByPct( 2, 4, 2 ) == 0 - GetRangeValueByPct( 2, 4, 4 ) == 1 - GetRangeValueByPct( 2, 4, 3 ) == 0.5

Parameters:

  • Min - Min limit
  • Max - Max limit
  • Value - Value between Range.

Returns:

relative percentage position Value is in the range [Min,Max].

GetAngularDegreesFromRadians

static final simulated function GetAngularDegreesFromRadians (out Vector2D OutFOV)


GetHeadingAngle

static final simulated function float GetHeadingAngle (Vector Dir)

Returns world space angle (in radians) of given vector

Parameters:

  • Dir - Vector to be converted into heading angle

GetRangePctByValue

static final simulated function float GetRangePctByValue (Vector2D Range, float Value)

Returns the relative percentage position Value is in the Range. Examples: - GetRangeValueByPct( Range, Range.X ) == 0 - GetRangeValueByPct( Range, Range.Y ) == 1 - GetRangeValueByPct( Range, (Range.X+Range.Y)/2 ) == 0.5

Parameters:

  • Range - Range of values. [Range.X,Range.Y]
  • Value - Value between Range.

Returns:

relative percentage position Value is in the Range.

GetRangeValueByPct

static final simulated function float GetRangeValueByPct (Vector2D Range, float Pct)

Returns the value in the Range, relative to Pct. Examples: - GetRangeValueByPct( Range, 0.f ) == Range.X - GetRangeValueByPct( Range, 1.f ) == Range.Y - GetRangeValueByPct( Range, 0.5 ) == (Range.X+Range.Y)/2

Parameters:

  • Range - Range of values. [Range.X,Range.Y]
  • Pct - Relative position in range in percentage. [0,1]

Returns:

the value in the Range, relative to Pct.

GetRightMost

static final function string GetRightMost (coerce string Text)

Get right most number from an actor name (ie Text == "CoverLink_45" returns "45")

JoinArray

static final function JoinArray (array<stringStringArray, out string out_Result, optional string delim, optional bool bIgnoreBlanks)

Create a single string from an array of strings, using the delimiter specified, optionally ignoring blank members

Parameters:

  • StringArray - the array of strings to join into the single string
  • out_Result - out] will contain a single string containing all elements of the array, separated by the delimiter specified
  • Delim - the delimiter to insert where array elements are concatenated
  • bIgnoreBlanks - TRUE to skip elements which contain emtpy strings

LerpColor

static final function Color LerpColor (Color A, Color B, float Alpha)

Util to interpolate between two colors

MakeColor

static final function Color MakeColor (byte R, byte G, byte B, optional byte A)

Create a Color from independant RGBA components

MakeLinearColor

static final function LinearColor MakeLinearColor (float R, float G, float B, float A)

Create a LinearColor from independant RGBA components.

MakeRotator

static final function Rotator MakeRotator (int Pitch, int Yaw, int Roll)

Create a Rotation from independant Pitch, Yaw, Roll

ParseLocalizedPropertyPath

static final function string ParseLocalizedPropertyPath (string PathName)

given a path to a localized key of the form "Package.Section.Name", return the appropriate value from the localization file for the current language

RandRange

static final simulated function float RandRange (float InMin, float InMax)

Return a random number within the given range.

RSize

static final function float RSize (Rotator R)

returns Rotator Size (vector definition applied to rotators)

Parameters:

  • Rotator - R

Returns:

mathematical vector length: Sqrt(Pitch^2 + Yaw^2 + Roll^2)

SClampRotAxis

static final simulated function bool SClampRotAxis (float DeltaTime, int ViewAxis, out int out_DeltaViewAxis, int MaxLimit, int MinLimit, float InterpolationSpeed)

Smooth clamp a rotator axis. This is mainly used to bring smoothly a rotator component within a certain range [MinLimit,MaxLimit]. For example to limit smoothly the player's ViewRotation Pitch or Yaw component.

Parameters:

  • fDeltaTime - Elapsed time since this function was last called, for interpolation.
  • ViewAxis - Rotator's Axis' current angle.
  • out_DeltaViewAxis - Delta Value of Axis to be added to ViewAxis (through PlayerController::ProcessViewRotation(). This value gets modified.
  • MaxLimit - Up angle limit.
  • MinLimit - Negative angle limit (value must be negative)
  • InterpolationSpeed - Interpolation Speed to bring ViewAxis within the [MinLimit,MaxLimit] range.

Split

static final function string Split (coerce string Text, coerce string SplitStr, optional bool bOmitSplitStr)

Splits Text on the first Occurrence of Split and returns the remaining part of Text.

SplitString

static final function array<stringSplitString (string Source, optional string Delimiter, optional bool bCullEmpty)

Wrapper for splitting a string into an array of strings using a single expression.

UnwindHeading

static final simulated function float UnwindHeading (float a)


vect2d

static final function Vector2D vect2d (float InX, float InY)

Construct a vector2d variable

Native functions

Disable

native(118) final function Disable (name ProbeFunc)


DumpStateStack

native final function DumpStateStack ()

Logs the current state stack for debugging purposes.

Enable

native(117) final function Enable (name ProbeFunc)


EvalInterpCurveFloat

native final function float EvalInterpCurveFloat (InterpCurveFloat FloatCurve, float InVal)

Evaluate a float curve for an input of InVal

EvalInterpCurveVector

native final function Vector EvalInterpCurveVector (InterpCurveVector VectorCurve, float InVal)

Evaluate a vector curve for an input of InVal

EvalInterpCurveVector2D

native final function Vector2D EvalInterpCurveVector2D (InterpCurveVector2D Vector2DCurve, float InVal)

Evaluate a vector2D curve for an input of InVal

GetStateName

native(284) final function name GetStateName ()

Returns the current state name, useful for determining current state similar to IsInState. Note: This *doesn't* work with inherited states, in that it will only compare at the lowest state level.

Returns:

Name of the current state

GetSystemTime

native final function GetSystemTime (out int Year, out int Month, out int DayOfWeek, out int Day, out int Hour, out int Min, out int Sec, out int MSec)

Return the system time components.

GotoState

native(113) final function GotoState (optional name NewState, optional name Label, optional bool bForceEvents, optional bool bKeepStack)

Transitions to the desired state and label if specified, generating the EndState event in the current state if applicable and BeginState in the new state, unless transitioning to the same state.

Parameters:

  • NewState - new state to transition to
  • Label - optional Label to jump to
  • bForceEvents - optionally force EndState/BeginState to be called even if transitioning to the same state.
  • bKeepStack - prevents state stack from being cleared

IsA

native(197) final function bool IsA (name ClassName)


IsChildState

native final function bool IsChildState (name TestState, name TestParentState)

Returns true if TestState derives from TestParentState.

IsInState

native(281) final function bool IsInState (name TestState, optional bool bTestStateStack)

Checks the current state and determines whether or not this object is actively in the specified state. Note: This does work with inherited states.

Parameters:

  • TestState - state to check for
  • bTestStateStack - check the state stack? (does *NOT* work with inherited states in the stack)

Returns:

True if currently in TestState

IsPendingKill

native final function bool IsPendingKill ()

Returns whether the object is pending kill and about to have references to it NULLed by the garbage collector.

Returns:

TRUE if object is pending kill, FALSE otherwise

PointDistToLine

native final function float PointDistToLine (Vector Point, Vector Line, Vector Origin, optional out Vector OutClosestPoint)

Calculates the distance of a given Point in world space to a given line, defined by the vector couple (Origin, Direction).

Parameters:

  • Point - point to check distance to Axis
  • Line - unit vector indicating the direction to check against
  • Origin - point of reference used to calculate distance
  • OutClosestPoint - optional point that represents the closest point projected onto Axis

Returns:

distance of Point from line defined by (Origin, Direction)

PointDistToSegment

native final function float PointDistToSegment (Vector Point, Vector StartPoint, Vector EndPoint, optional out Vector OutClosestPoint)

Returns closest distance from a point to a segment.

Parameters:

  • Point - point to check distance for
  • StartPoint - StartPoint of segment
  • EndPoint - EndPoint of segment
  • OutClosestPoint - Closest point on segment.

Returns:

closest distance from Point to segment defined by (StartPoint, EndPoint).

PopState

native final function PopState (optional bool bPopAll)

Pops the current pushed state, returning execution to the previous state at the same code point. Note: PopState() will have no effect if no state has been pushed onto the stack.

This will call PoppedState when entering the state that was just pushed on the state stack. It will not call EndState.

Parameters:

  • bPopAll - optionally pop all states on the stack to the originally executing one

See: event PausedState

PushState

native final function PushState (name NewState, optional name NewLabel)

Pushes the new state onto the state stack, setting it as the current state until a matching PopState() is called. Note that multiple states may be pushed on top of each other. You may not push the same state multiple times.

This will call PushedState when entering the state that was just pushed on the state stack. It will not call BeginState.

Parameters:

  • NewState - name of the state to push on the stack
  • NewLabel - optional name of the state label to jump to

See: event ContinuedState

SaveConfig

native(536) final function SaveConfig ()


TimeStamp

native final function string TimeStamp ()

Returns a string containing a system timestamp

TransformVectorByRotation

native final function Vector TransformVectorByRotation (Rotator SourceRotation, Vector SourceVector, optional bool bInverse)

Script hook to FRotationMatrix::TransformFVector().

Events

BeginState

event BeginState (name PreviousStateName)

Called immediately when entering a state, while within the GotoState() call that caused the state change (before any state code is executed).

ContinuedState

event ContinuedState ()

Called on the state that is no longer paused because of a PopState().

EndState

event EndState (name NextStateName)

Called immediately before going out of the current state, while within the GotoState() call that caused the state change, and before BeginState() is called within the new state.

PausedState

event PausedState ()

Called on the state that is being paused because of a PushState().

PoppedState

event PoppedState ()

Called immediately in the current state that is being popped off of the state stack, before the new state is activated.

PushedState

event PushedState ()

Called immediately in the new state that was pushed onto the state stack, before any state code is executed.

Other instance functions

ByteToFloat

simulated final function float ByteToFloat (byte inputByte, optional bool bSigned)

Converts a 0-255 byte to a float value, to a range of 0.f to 1.f.

Parameters:

  • inputByte - byte to convert
  • bSigned - optional, spit out -1.f to 1.f instead

Returns:

newly converted value

FloatToByte

simulated final function byte FloatToByte (float inputFloat, optional bool bSigned)

Converts a float value to a 0-255 byte, assuming a range of 0.f to 1.f.

Parameters:

  • inputFloat - float to convert
  • bSigned - optional, assume a range of -1.f to 1.f

Returns:

byte value 0-255

GetPackageName

final function name GetPackageName ()

Returns:

the name of the package this object resides in

InCylinder

simulated final function bool InCylinder (Vector Origin, Rotator Dir, float Width, Vector A, optional bool bIgnoreZ)


NoZDot

simulated final function float NoZDot (Vector A, Vector B)

Returns dot product of two vectors while ignoring the Z component.

PointDistToPlane

simulated final function float PointDistToPlane (Vector Point, Rotator Orientation, Vector Origin, optional out Vector out_ClosestPoint)

Calculates the distance of a given point to the given plane. (defined by a combination of vector and rotator) Rotator.AxisX = U, Rotator.AxisY = Normal, Rotator.AxisZ = V

Parameters:

  • Point - Point to check distance to Orientation
  • Orientation - Rotator indicating the direction to check against
  • Origin - Point of reference used to calculate distance
  • out_ClosestPoint - Optional point that represents the closest point projected onto Plane defined by the couple (Origin, Orientation)

Returns:

distance of Point to plane