unreal.MathLibrary
¶
- class unreal.MathLibrary(outer: Object | None = None, name: Name | str = 'None')¶
Bases:
BlueprintFunctionLibrary
Kismet Math Library
C++ Source:
Module: Engine
File: KismetMathLibrary.h
- classmethod abs(a) double ¶
Returns the absolute (positive) value of A
- Parameters:
a (double) –
- Return type:
double
- classmethod abs_int(a) int32 ¶
Returns the absolute (positive) value of A
- Parameters:
a (int32) –
- Return type:
int32
- classmethod abs_int64(a) int64 ¶
Returns the absolute (positive) value of A
- Parameters:
a (int64) –
- Return type:
int64
- classmethod acos(a) double ¶
Returns the inverse cosine (arccos) of A (result is in Radians)
- Parameters:
a (double) –
- Return type:
double
- classmethod add_byte_byte(a, b=1) uint8 ¶
Addition (A + B)
- Parameters:
a (uint8) –
b (uint8) –
- Return type:
uint8
- classmethod add_double_double(a, b=1.000000) double ¶
Addition (A + B)
- Parameters:
a (double) –
b (double) –
- Return type:
double
- classmethod add_float_float(a: float, b: float = 1.0) float ¶
deprecated: ‘add_float_float’ was renamed to ‘add_double_double’.
- classmethod add_int64_int64(a, b=1) int64 ¶
Addition (A + B)
- Parameters:
a (int64) –
b (int64) –
- Return type:
int64
- classmethod add_int_int(a, b=1) int32 ¶
Addition (A + B)
- Parameters:
a (int32) –
b (int32) –
- Return type:
int32
- classmethod add_linear_color_linear_color(a, b) LinearColor ¶
Element-wise addition of two linear colors (R+R, G+G, B+B, A+A)
- Parameters:
a (LinearColor) –
b (LinearColor) –
- Return type:
- classmethod add_vector2d_vector2d(a, b) Vector2D ¶
Returns addition of Vector A and Vector B (A + B)
- classmethod and_int64_int64(a, b) int64 ¶
Bitwise AND (A & B)
- Parameters:
a (int64) –
b (int64) –
- Return type:
int64
- classmethod and_int_int(a, b) int32 ¶
Bitwise AND (A & B)
- Parameters:
a (int32) –
b (int32) –
- Return type:
int32
- classmethod asin(a) double ¶
Returns the inverse sine (arcsin) of A (result is in Radians)
- Parameters:
a (double) –
- Return type:
double
- classmethod atan(a) double ¶
Returns the inverse tan (atan) (result is in Radians)
- Parameters:
a (double) –
- Return type:
double
- classmethod atan2(y, x) double ¶
Returns the inverse tan (atan2) of A/B (result is in Radians)
- Parameters:
y (double) –
x (double) –
- Return type:
double
- classmethod average_of_int_array(int_array) float ¶
Returns average of all array entries. Returns value of 0 if the supplied array is empty.
- classmethod b_max(a, b) uint8 ¶
Returns the maximum value of A and B
- Parameters:
a (uint8) –
b (uint8) –
- Return type:
uint8
- classmethod b_min(a, b) uint8 ¶
Returns the minimum value of A and B
- Parameters:
a (uint8) –
b (uint8) –
- Return type:
uint8
- classmethod break_color(color) -> (r=float, g=float, b=float, a=float)¶
Breaks apart a color into individual RGB components (as well as alpha)
- Parameters:
color (LinearColor) –
- Returns:
r (float):
g (float):
b (float):
a (float):
- Return type:
tuple
- classmethod break_rot_into_axes(rot) -> (x=Vector, y=Vector, z=Vector)¶
Breaks apart a rotator into its component axes
- Parameters:
rot (Rotator) –
- Returns:
x (Vector):
y (Vector):
z (Vector):
- Return type:
tuple
- classmethod c_interp_to(current, target, delta_time, interp_speed) LinearColor ¶
Interpolate Linear Color from Current to Target. Scaled by distance to Target, so it has a strong start speed and ease out.
- Parameters:
current (LinearColor) – Current Color
target (LinearColor) – Target Color
delta_time (float) – Time since last tick
interp_speed (float) – Interpolation speed, if the speed given is 0, then jump to the target.
- Returns:
New interpolated Color
- Return type:
- classmethod clamp(value, min, max) int32 ¶
Returns Value clamped to be between A and B (inclusive)
- Parameters:
value (int32) –
min (int32) –
max (int32) –
- Return type:
int32
- classmethod clamp_angle(angle_degrees, min_angle_degrees, max_angle_degrees) double ¶
Clamps an arbitrary angle to be between the given angles. Will clamp to nearest boundary.
- Parameters:
angle_degrees (double) –
min_angle_degrees (double) – “from” angle that defines the beginning of the range of valid angles (sweeping clockwise)
max_angle_degrees (double) – “to” angle that defines the end of the range of valid angles
- Returns:
Returns clamped angle in the range -180..180.
- Return type:
double
- classmethod clamp_axes2d(a, min_axis_val, max_axis_val) Vector2D ¶
Creates a copy of this vector with both axes clamped to the given range.
- classmethod clamp_int64(value, min, max) int64 ¶
Returns Value clamped to be between A and B (inclusive)
- Parameters:
value (int64) –
min (int64) –
max (int64) –
- Return type:
int64
- classmethod clamp_vector_size(a, min, max) Vector ¶
Create a copy of this vector, with its magnitude/size/length clamped between Min and Max.
- classmethod class_is_child_of(test_class, parent_class) bool ¶
Determine if a class is a child of another class.
- classmethod compose_rotators(a, b) Rotator ¶
Combine 2 rotations to give you the resulting rotation of first applying A, then B.
- classmethod compose_transforms(a, b) Transform ¶
Compose two transforms in order: A * B.
Order matters when composing transforms: A * B will yield a transform that logically first applies A then B to any subsequent transformation.
Example: LocalToWorld = ComposeTransforms(DeltaRotation, LocalToWorld) will change rotation in local space by DeltaRotation. Example: LocalToWorld = ComposeTransforms(LocalToWorld, DeltaRotation) will change rotation in world space by DeltaRotation.
- classmethod conv_bool_to_byte(bool) uint8 ¶
Converts a bool to a byte
- Parameters:
bool (bool) –
- Return type:
uint8
- classmethod conv_bool_to_double(bool) double ¶
Converts a bool to a float (0.0 or 1.0)
- Parameters:
bool (bool) –
- Return type:
double
- classmethod conv_bool_to_float(bool: bool) float ¶
deprecated: ‘conv_bool_to_float’ was renamed to ‘conv_bool_to_double’.
- classmethod conv_bool_to_int(bool) int32 ¶
Converts a bool to an int
- Parameters:
bool (bool) –
- Return type:
int32
- classmethod conv_byte_to_double(byte) double ¶
Converts a byte to a float
- Parameters:
byte (uint8) –
- Return type:
double
- classmethod conv_byte_to_float(byte: int) float ¶
deprecated: ‘conv_byte_to_float’ was renamed to ‘conv_byte_to_double’.
- classmethod conv_byte_to_int(byte) int32 ¶
Converts a byte to an integer
- Parameters:
byte (uint8) –
- Return type:
int32
- classmethod conv_byte_to_int64(byte) int64 ¶
Converts a byte to an integer
- Parameters:
byte (uint8) –
- Return type:
int64
- classmethod conv_color_to_linear_color(color) LinearColor ¶
Converts a color to LinearColor
- Parameters:
color (Color) –
- Return type:
- classmethod conv_double_to_int64(double) int64 ¶
Converts a float to a 64 bit integer
- Parameters:
double (double) –
- Return type:
int64
- classmethod conv_double_to_linear_color(double) LinearColor ¶
Converts a float into a LinearColor, where each RGB element is that float
- Parameters:
double (double) –
- Return type:
- classmethod conv_double_to_vector(double) Vector ¶
Converts a double into a vector, where each element is that float
- Parameters:
double (double) –
- Return type:
- classmethod conv_double_to_vector2d(double) Vector2D ¶
Convert a float into a vector, where each element is that float
- Parameters:
double (double) –
- Return type:
- classmethod conv_float_to_linear_color(double: float) LinearColor ¶
deprecated: ‘conv_float_to_linear_color’ was renamed to ‘conv_double_to_linear_color’.
- classmethod conv_float_to_vector(double: float) Vector ¶
deprecated: ‘conv_float_to_vector’ was renamed to ‘conv_double_to_vector’.
- classmethod conv_int64_to_byte(int) uint8 ¶
Converts a 64 bit integer to a byte (if the integer is too large, returns the low 8 bits)
- Parameters:
int (int64) –
- Return type:
uint8
- classmethod conv_int64_to_double(int) double ¶
Converts a 64 bit integer to a float
- Parameters:
int (int64) –
- Return type:
double
- classmethod conv_int64_to_int(int) int32 ¶
Converts a 64 bit integer to a 32 bit integer (if the integer is too large, returns the low 32 bits)
- Parameters:
int (int64) –
- Return type:
int32
- classmethod conv_int_to_bool(int) bool ¶
Converts a int to a bool
- Parameters:
int (int32) –
- Return type:
- classmethod conv_int_to_byte(int) uint8 ¶
Converts an integer to a byte (if the integer is too large, returns the low 8 bits)
- Parameters:
int (int32) –
- Return type:
uint8
- classmethod conv_int_to_double(int) double ¶
Converts an integer to a float
- Parameters:
int (int32) –
- Return type:
double
- classmethod conv_int_to_float(int: int) float ¶
deprecated: ‘conv_int_to_float’ was renamed to ‘conv_int_to_double’.
- classmethod conv_int_to_int64(int) int64 ¶
Converts an integer to a 64 bit integer
- Parameters:
int (int32) –
- Return type:
int64
- classmethod conv_int_to_int_vector(int) IntVector ¶
Converts an integer to an IntVector
- Parameters:
int (int32) –
- Return type:
- classmethod conv_int_to_vector(int) Vector ¶
Converts an integer to a FVector
- Parameters:
int (int32) –
- Return type:
- classmethod conv_linear_color_to_color(linear_color, use_srgb=True) Color ¶
Quantizes the linear color and returns the result as a FColor with optional sRGB conversion and quality as goal.
- Parameters:
linear_color (LinearColor) –
use_srgb (bool) –
- Return type:
- classmethod conv_linear_color_to_vector(linear_color) Vector ¶
Converts a LinearColor to a vector
- Parameters:
linear_color (LinearColor) –
- Return type:
- classmethod conv_matrix_to_rotator(matrix) Rotator ¶
Converts a Matrix to a Rotator (Assumes Matrix represents a transform)
- classmethod conv_matrix_to_transform(matrix) Transform ¶
Converts a Matrix to a Transform (Assumes Matrix represents a transform)
- classmethod conv_rotator_to_quaternion(rot) Quat ¶
Converts to Quaternion representation of this Rotator.
- classmethod conv_transform_to_matrix(transform) Matrix ¶
Converts a Transform to a Matrix with scale
- classmethod conv_vector4_to_quaterion(vec: Vector4) Quat ¶
deprecated: ‘conv_vector4_to_quaterion’ was renamed to ‘conv_vector4_to_quaternion’.
- classmethod conv_vector4_to_quaternion(vec) Quat ¶
Return the Quaternion orientation corresponding to the direction in which the vector points. Similar to the FRotator version, returns a result without roll such that it preserves the up vector. note: If you don’t care about preserving the up vector and just want the most direct rotation, you can use the faster ‘FindBetweenVectors(ForwardVector, YourVector)’ or ‘FindBetweenNormals(…)’ if you know the vector is of unit length.
- classmethod conv_vector4_to_rotator(vec) Rotator ¶
Return the FRotator orientation corresponding to the direction in which the vector points. Sets Yaw and Pitch to the proper numbers, and sets Roll to zero because the roll can’t be determined from a vector.
- classmethod conv_vector4_to_vector(vector4) Vector ¶
Converts a Vector4 to a Vector (dropping the W element)
- classmethod conv_vector_to_linear_color(vec) LinearColor ¶
Converts a vector to LinearColor
- Parameters:
vec (Vector) –
- Return type:
- classmethod conv_vector_to_quaterion(vec: Vector) Quat ¶
deprecated: ‘conv_vector_to_quaterion’ was renamed to ‘conv_vector_to_quaternion’.
- classmethod conv_vector_to_quaternion(vec) Quat ¶
Return the Quaternion orientation corresponding to the direction in which the vector points. Similar to the FRotator version, returns a result without roll such that it preserves the up vector. note: If you don’t care about preserving the up vector and just want the most direct rotation, you can use the faster ‘FindBetweenVectors(ForwardVector, YourVector)’ or ‘FindBetweenNormals(…)’ if you know the vector is of unit length.
- classmethod conv_vector_to_rotator(vec) Rotator ¶
Return the FRotator orientation corresponding to the direction in which the vector points. Sets Yaw and Pitch to the proper numbers, and sets Roll to zero because the roll can’t be determined from a vector.
- classmethod conv_vector_to_transform(location) Transform ¶
Converts a vector to a transform. Uses vector as location
- classmethod conv_vector_to_vector2d(vector) Vector2D ¶
Converts a Vector to a Vector2D using the Vector’s (X, Y) coordinates
- classmethod convert_transform_to_relative(a: Transform, relative_to: Transform) Transform ¶
deprecated: ‘convert_transform_to_relative’ was renamed to ‘make_relative_transform’.
- classmethod cos(a) double ¶
Returns the cosine of A (expects Radians)
- Parameters:
a (double) –
- Return type:
double
- classmethod create_vector_from_yaw_pitch(yaw, pitch, length=1.000000) Vector ¶
Creates a directional vector from rotation values {Pitch, Yaw} supplied in degrees with specified Length
- classmethod cross_product2d(a, b) double ¶
Returns the cross product of two 2d vectors - see http://mathworld.wolfram.com/CrossProduct.html
- classmethod cross_vector_vector(a, b) Vector ¶
Returns the cross product of two 3d vectors - see http://mathworld.wolfram.com/CrossProduct.html
- classmethod date_time_from_iso_string(iso_string) DateTime or None ¶
Converts a date string in ISO-8601 format to a DateTime object
- classmethod date_time_from_string(date_time_string) DateTime or None ¶
Converts a date string to a DateTime object
- classmethod days_in_month(year, month) int32 ¶
Returns the number of days in the given year and month
- Parameters:
year (int32) –
month (int32) –
- Return type:
int32
- classmethod days_in_year(year) int32 ¶
Returns the number of days in the given year
- Parameters:
year (int32) –
- Return type:
int32
- classmethod deg_acos(a) double ¶
Returns the inverse cos (arccos) of A (result is in Degrees)
- Parameters:
a (double) –
- Return type:
double
- classmethod deg_asin(a) double ¶
Returns the inverse sin (arcsin) of A (result is in Degrees)
- Parameters:
a (double) –
- Return type:
double
- classmethod deg_atan(a) double ¶
Returns the inverse tan (atan) (result is in Degrees)
- Parameters:
a (double) –
- Return type:
double
- classmethod deg_atan2(y, x) double ¶
Returns the inverse tan (atan2) of A/B (result is in Degrees)
- Parameters:
y (double) –
x (double) –
- Return type:
double
- classmethod deg_cos(a) double ¶
Returns the cos of A (expects Degrees)
- Parameters:
a (double) –
- Return type:
double
- classmethod deg_sin(a) double ¶
Returns the sin of A (expects Degrees)
- Parameters:
a (double) –
- Return type:
double
- classmethod deg_tan(a) double ¶
Returns the tan of A (expects Degrees)
- Parameters:
a (double) –
- Return type:
double
- classmethod degrees_to_radians(a) double ¶
Returns radians value based on the input degrees
- Parameters:
a (double) –
- Return type:
double
- classmethod distance2d(v1, v2) double ¶
Distance between two 2D points.
- classmethod distance_squared2d(v1, v2) double ¶
Squared distance between two 2D points.
- classmethod divide_byte_byte(a, b=1) uint8 ¶
Division (A / B)
- Parameters:
a (uint8) –
b (uint8) –
- Return type:
uint8
- classmethod divide_double_double(a, b=1.000000) double ¶
Division (A / B)
- Parameters:
a (double) –
b (double) –
- Return type:
double
- classmethod divide_float_float(a: float, b: float = 1.0) float ¶
deprecated: ‘divide_float_float’ was renamed to ‘divide_double_double’.
- classmethod divide_int64_int64(a, b=1) int64 ¶
Division (A / B)
- Parameters:
a (int64) –
b (int64) –
- Return type:
int64
- classmethod divide_int_int(a, b=1) int32 ¶
Division (A / B)
- Parameters:
a (int32) –
b (int32) –
- Return type:
int32
- classmethod divide_linear_color_linear_color(a, b) LinearColor ¶
Element-wise multiplication of two linear colors (R/R, G/G, B/B, A/A)
- Parameters:
a (LinearColor) –
b (LinearColor) –
- Return type:
- classmethod divide_vector2d_vector2d(a, b) Vector2D ¶
Element-wise Vector divide (Result = {A.x/B.x, A.y/B.y})
- classmethod divide_vector4_vector4(a, b) Vector4 ¶
Element-wise Vector divide (Result = {A.x/B.x, A.y/B.y, A.z/B.z, A.w/B.w})
- classmethod divide_vector_vector(a, b=[1.000000, 1.000000, 1.000000]) Vector ¶
Element-wise Vector division (Result = {A.x/B.x, A.y/B.y, A.z/B.z})
- classmethod dot_product2d(a, b) double ¶
Returns the dot product of two 2d vectors - see http://mathworld.wolfram.com/DotProduct.html
- classmethod dot_vector_vector(a, b) double ¶
Returns the dot product of two 3d vectors - see http://mathworld.wolfram.com/DotProduct.html
- classmethod dynamic_weighted_moving_average_f_rotator(current_sample, previous_sample, max_distance, min_weight, max_weight) Rotator ¶
Calculates the new value in a weighted moving average series using the previous value and a weight range. The weight range is used to dynamically adjust based upon distance between the samples This allows you to smooth a value more aggressively for small noise and let large movements be smoothed less (or vice versa)
- Parameters:
current_sample (Rotator) – The value to blend with the previous sample to get a new weighted value
previous_sample (Rotator) – The last value from the series
max_distance (float) – Distance to use as the blend between min weight or max weight
min_weight (float) – The weight use when the distance is small
max_weight (float) – The weight use when the distance is large
- Returns:
the next value in the series
- Return type:
- classmethod dynamic_weighted_moving_average_f_vector(current_sample, previous_sample, max_distance, min_weight, max_weight) Vector ¶
Calculates the new value in a weighted moving average series using the previous value and a weight range. The weight range is used to dynamically adjust based upon distance between the samples This allows you to smooth a value more aggressively for small noise and let large movements be smoothed less (or vice versa)
- Parameters:
current_sample (Vector) – The value to blend with the previous sample to get a new weighted value
previous_sample (Vector) – The last value from the series
max_distance (float) – Distance to use as the blend between min weight or max weight
min_weight (float) – The weight use when the distance is small
max_weight (float) – The weight use when the distance is large
- Returns:
the next value in the series
- Return type:
- classmethod dynamic_weighted_moving_average_float(current_sample, previous_sample, max_distance, min_weight, max_weight) float ¶
Calculates the new value in a weighted moving average series using the previous value and a weight range. The weight range is used to dynamically adjust based upon distance between the samples This allows you to smooth a value more aggressively for small noise and let large movements be smoothed less (or vice versa)
- Parameters:
current_sample (float) – The value to blend with the previous sample to get a new weighted value
previous_sample (float) – The last value from the series
max_distance (float) – Distance to use as the blend between min weight or max weight
min_weight (float) – The weight use when the distance is small
max_weight (float) – The weight use when the distance is large
- Returns:
the next value in the series
- Return type:
- classmethod equal_equal_byte_byte(a, b) bool ¶
Returns true if A is equal to B (A == B)
- Parameters:
a (uint8) –
b (uint8) –
- Return type:
- classmethod equal_equal_date_time_date_time(a, b) bool ¶
Returns true if the values are equal (A == B)
- classmethod equal_equal_double_double(a, b) bool ¶
Returns true if A is exactly equal to B (A == B)
- Parameters:
a (double) –
b (double) –
- Return type:
- classmethod equal_equal_float_float(a: float, b: float) bool ¶
deprecated: ‘equal_equal_float_float’ was renamed to ‘equal_equal_double_double’.
- classmethod equal_equal_int64_int64(a, b) bool ¶
Returns true if A is equal to B (A == B)
- Parameters:
a (int64) –
b (int64) –
- Return type:
- classmethod equal_equal_int_int(a, b) bool ¶
Returns true if A is equal to B (A == B)
- Parameters:
a (int32) –
b (int32) –
- Return type:
- classmethod equal_equal_linear_color_linear_color(a, b) bool ¶
Returns true if linear color A is equal to linear color B (A == B) within a specified error tolerance
- Parameters:
a (LinearColor) –
b (LinearColor) –
- Return type:
- classmethod equal_equal_matrix_matrix(a, b, tolerance=0.000100) bool ¶
Checks whether another Matrix is equal to this, within specified tolerance.
- classmethod equal_equal_quat_quat(a, b, tolerance=0.000100) bool ¶
Returns true if Quaternion A is equal to Quaternion B (A == B) within a specified error tolerance
- classmethod equal_equal_rotator_rotator(a, b, error_tolerance=0.000100) bool ¶
Returns true if rotator A is equal to rotator B (A == B) within a specified error tolerance
- classmethod equal_equal_timespan_timespan(a, b) bool ¶
Returns true if the values are equal (A == B)
- classmethod equal_equal_transform_transform(a, b) bool ¶
Returns true if transform A is equal to transform B
- classmethod equal_equal_vector2d_vector2d(a, b, error_tolerance=0.000100) bool ¶
Returns true if vector2D A is equal to vector2D B (A == B) within a specified error tolerance
- classmethod equal_equal_vector4_vector4(a, b, error_tolerance=0.000100) bool ¶
Returns true if vector A is equal to vector B (A == B) within a specified error tolerance
- classmethod equal_equal_vector_vector(a, b, error_tolerance=0.000100) bool ¶
Returns true if vector A is equal to vector B (A == B) within a specified error tolerance
- classmethod equal_exactly_vector2d_vector2d(a, b) bool ¶
Returns true if vector A is equal to vector B (A == B)
- classmethod equal_exactly_vector4_vector4(a, b) bool ¶
Returns true if vector A is equal to vector B (A == B)
- classmethod equal_exactly_vector_vector(a, b) bool ¶
Returns true if vector A is equal to vector B (A == B)
- classmethod equal_int_point_int_point(a, b) bool ¶
Returns true if IntPoint A is equal to IntPoint B (A == B)
- classmethod exp(a) double ¶
Returns exponential(e) to the power A (e^A)
- Parameters:
a (double) –
- Return type:
double
- classmethod f_ceil(a) int32 ¶
Rounds A up towards positive infinity / up to the next integer (e.g., -1.6 becomes -1 and 1.6 becomes 2)
- Parameters:
a (double) –
- Return type:
int32
- classmethod f_ceil64(a) int64 ¶
Rounds A up towards positive infinity / up to the next integer (e.g., -1.6 becomes -1 and 1.6 becomes 2)
- Parameters:
a (double) –
- Return type:
int64
- classmethod f_clamp(value, min=0.000000, max=1.000000) double ¶
Returns Value clamped between A and B (inclusive)
- Parameters:
value (double) –
min (double) –
max (double) –
- Return type:
double
- classmethod f_floor(a) int32 ¶
Rounds A down towards negative infinity / down to the previous integer (e.g., -1.6 becomes -2 and 1.6 becomes 1)
- Parameters:
a (double) –
- Return type:
int32
- classmethod f_floor64(a) int64 ¶
Rounds A down towards negative infinity / down to the previous integer (e.g., -1.6 becomes -2 and 1.6 becomes 1)
- Parameters:
a (double) –
- Return type:
int64
- classmethod f_interp_ease_in_out(a, b, alpha, exponent) double ¶
Interpolate between A and B, applying an ease in/out function. Exp controls the degree of the curve.
- Parameters:
a (double) –
b (double) –
alpha (double) –
exponent (double) –
- Return type:
double
- classmethod f_interp_to(current, target, delta_time, interp_speed) double ¶
Tries to reach Target based on distance from Current position, giving a nice smooth feeling when tracking a position.
- Parameters:
current (double) – Actual position
target (double) – Target position
delta_time (double) – Time since last tick
interp_speed (double) – Interpolation speed, if the speed given is 0, then jump to the target.
- Returns:
New interpolated position
- Return type:
double
- classmethod f_interp_to_constant(current, target, delta_time, interp_speed) double ¶
Tries to reach Target at a constant rate.
- Parameters:
current (double) – Actual position
target (double) – Target position
delta_time (double) – Time since last tick
interp_speed (double) – Interpolation speed
- Returns:
New interpolated position
- Return type:
double
- classmethod f_max(a, b) double ¶
Returns the maximum value of A and B
- Parameters:
a (double) –
b (double) –
- Return type:
double
- classmethod f_min(a, b) double ¶
Returns the minimum value of A and B
- Parameters:
a (double) –
b (double) –
- Return type:
double
- classmethod f_mod(dividend, divisor) -> (int32, remainder=double)¶
Returns the number of times Divisor will go into Dividend (i.e., Dividend divided by Divisor), as well as the remainder
- Parameters:
dividend (double) –
divisor (double) –
- Returns:
remainder (double):
- Return type:
double
- classmethod f_mod64(dividend, divisor) -> (int64, remainder=double)¶
Returns the number of times Divisor will go into Dividend (i.e., Dividend divided by Divisor), as well as the remainder
- Parameters:
dividend (double) –
divisor (double) –
- Returns:
remainder (double):
- Return type:
double
- classmethod f_rand_from_stream(stream: RandomStream) float ¶
deprecated: ‘f_rand_from_stream’ was renamed to ‘random_float_from_stream’.
- classmethod f_rand_range(min: float, max: float) float ¶
deprecated: ‘f_rand_range’ was renamed to ‘random_float_in_range’.
- classmethod f_rand_range_from_stream(stream: RandomStream, min: float, max: float) float ¶
deprecated: ‘f_rand_range_from_stream’ was renamed to ‘random_float_in_range_from_stream’.
- classmethod f_trunc(a) int32 ¶
Rounds A towards zero, truncating the fractional part (e.g., -1.6 becomes -1 and 1.6 becomes 1)
- Parameters:
a (double) –
- Return type:
int32
- classmethod f_trunc64(a) int64 ¶
Rounds A towards zero, truncating the fractional part (e.g., -1.6 becomes -1 and 1.6 becomes 1)
- Parameters:
a (double) –
- Return type:
int64
- classmethod f_trunc_vector(vector) IntVector ¶
Rounds A to an integer with truncation towards zero for each element in a vector. (e.g. -1.7 truncated to -1, 2.8 truncated to 2)
- classmethod f_wrap(value, min=0.000000, max=1.000000) double ¶
Returns Value wrapped from A and B (inclusive)
- Parameters:
value (double) –
min (double) –
max (double) –
- Return type:
double
- classmethod find_closest_point_on_line(point, line_origin, line_direction) Vector ¶
Find the closest point on an infinite line to a given point.
- classmethod find_closest_point_on_segment(point, segment_start, segment_end) Vector ¶
Find the closest point on a segment to a given point.
- classmethod find_look_at_rotation(start, target) Rotator ¶
Find a rotation for an object at Start location to point at Target location.
- classmethod find_nearest_points_on_line_segments(segment1_start, segment1_end, segment2_start, segment2_end) -> (segment1_point=Vector, segment2_point=Vector)¶
Find closest points between 2 segments.
- Parameters:
- Returns:
segment1_point (Vector): Closest point on segment 1 to segment 2.
segment2_point (Vector): Closest point on segment 2 to segment 1.
- Return type:
tuple
- classmethod find_relative_look_at_rotation(start_transform, target_location) Rotator ¶
Find a local rotation (range of [-180, 180]) for an object with StartTransform to point at TargetLocation. Useful for getting LookAt Azimuth or Pawn Aim Offset.
- classmethod float_spring_interp(current, target, spring_state, stiffness, critical_damping_factor, delta_time, mass=1.000000, target_velocity_amount=1.000000, clamp=False, min_value=-1.000000, max_value=1.000000, initialize_from_target=False) -> (float, spring_state=FloatSpringState)¶
Uses a simple spring model to interpolate a float from Current to Target.
- Parameters:
current (float) – Current value
target (float) – Target value
spring_state (FloatSpringState) – Data related to spring model (velocity, error, etc..) - Create a unique variable per spring
stiffness (float) – How stiff the spring model is (more stiffness means more oscillation around the target value)
critical_damping_factor (float) – How much damping to apply to the spring (0 means no damping, 1 means critically damped which means no oscillation)
delta_time (float) – Time difference since the last update
mass (float) – Multiplier that acts like mass on a spring
target_velocity_amount (float) – If 1 then the target velocity will be calculated and used, which results following the target more closely/without lag. Values down to zero (recommended when using this to smooth data) will progressively disable this effect.
clamp (bool) – Whether to use the Min/Max values to clamp the motion
min_value (float) – Clamps the minimum output value and cancels the velocity if it reaches this limit
max_value (float) – Clamps the maximum output value and cancels the velocity if it reaches this limit
initialize_from_target (bool) – If set then the current value will be set from the target on the first update
- Returns:
spring_state (FloatSpringState): Data related to spring model (velocity, error, etc..) - Create a unique variable per spring
- Return type:
- classmethod fraction(a) double ¶
Returns the fractional part of a float.
- Parameters:
a (double) –
- Return type:
double
- classmethod from_days(days) Timespan ¶
Returns a time span that represents the specified number of days
- classmethod from_hours(hours) Timespan ¶
Returns a time span that represents the specified number of hours
- classmethod from_milliseconds(milliseconds) Timespan ¶
Returns a time span that represents the specified number of milliseconds
- classmethod from_minutes(minutes) Timespan ¶
Returns a time span that represents the specified number of minutes
- classmethod from_seconds(seconds) Timespan ¶
Returns a time span that represents the specified number of seconds
- classmethod get_abs2d(a) Vector2D ¶
Get a copy of this vector with absolute value of each component.
- classmethod get_abs_max2d(a) double ¶
Get the maximum absolute value of the vector’s components.
- Parameters:
a (Vector2D) –
- Returns:
The maximum absolute value of the vector’s components.
- Return type:
double
- classmethod get_axes(a) -> (x=Vector, y=Vector, z=Vector)¶
Get the reference frame direction vectors (axes) described by this rotation
- Parameters:
a (Rotator) –
- Returns:
x (Vector):
y (Vector):
z (Vector):
- Return type:
tuple
- classmethod get_day(a) int32 ¶
Returns the day component of A (1 to 31)
- Parameters:
a (DateTime) –
- Return type:
int32
- classmethod get_day_of_year(a) int32 ¶
Returns the day of year of A
- Parameters:
a (DateTime) –
- Return type:
int32
- classmethod get_days(a) int32 ¶
Returns the days component of A
- Parameters:
a (Timespan) –
- Return type:
int32
- classmethod get_direction_unit_vector(from_, to) Vector ¶
Find the unit direction vector from one position to another or (0,0,0) if positions are the same.
- classmethod get_direction_vector(from_: Vector, to: Vector) Vector ¶
deprecated: ‘get_direction_vector’ was renamed to ‘get_direction_unit_vector’.
- classmethod get_hour(a) int32 ¶
Returns the hour component of A (24h format)
- Parameters:
a (DateTime) –
- Return type:
int32
- classmethod get_hour12(a) int32 ¶
Returns the hour component of A (12h format)
- Parameters:
a (DateTime) –
- Return type:
int32
- classmethod get_hours(a) int32 ¶
Returns the hours component of A
- Parameters:
a (Timespan) –
- Return type:
int32
- classmethod get_max2d(a) double ¶
Get the maximum value of the vector’s components.
- Parameters:
a (Vector2D) –
- Returns:
The maximum value of the vector’s components.
- Return type:
double
- classmethod get_max_element(a) double ¶
Find the maximum element (X, Y or Z) of a vector
- Parameters:
a (Vector) –
- Return type:
double
- classmethod get_millisecond(a) int32 ¶
Returns the millisecond component of A
- Parameters:
a (DateTime) –
- Return type:
int32
- classmethod get_milliseconds(a) int32 ¶
Returns the milliseconds component of A
- Parameters:
a (Timespan) –
- Return type:
int32
- classmethod get_min2d(a) double ¶
Get the minimum value of the vector’s components.
- Parameters:
a (Vector2D) –
- Returns:
The minimum value of the vector’s components.
- Return type:
double
- classmethod get_min_element(a) double ¶
Find the minimum element (X, Y or Z) of a vector
- Parameters:
a (Vector) –
- Return type:
double
- classmethod get_minute(a) int32 ¶
Returns the minute component of A
- Parameters:
a (DateTime) –
- Return type:
int32
- classmethod get_minutes(a) int32 ¶
Returns the minutes component of A
- Parameters:
a (Timespan) –
- Return type:
int32
- classmethod get_month(a) int32 ¶
Returns the month component of A
- Parameters:
a (DateTime) –
- Return type:
int32
- classmethod get_pi() double ¶
Returns the value of PI
- Return type:
double
- classmethod get_point_distance_to_line(point, line_origin, line_direction) float ¶
Find the distance from a point to the closest point on an infinite line.
- Parameters:
- Returns:
The distance from the given point to the closest point on the line.
- Return type:
- classmethod get_point_distance_to_segment(point, segment_start, segment_end) float ¶
Find the distance from a point to the closest point on a segment.
- classmethod get_reflection_vector(direction, surface_normal) Vector ¶
Given a direction vector and a surface normal, returns the vector reflected across the surface normal. Produces a result like shining a laser at a mirror!
- classmethod get_second(a) int32 ¶
Returns the second component of A
- Parameters:
a (DateTime) –
- Return type:
int32
- classmethod get_seconds(a) int32 ¶
Returns the seconds component of A
- Parameters:
a (Timespan) –
- Return type:
int32
- classmethod get_slope_degree_angles(my_right_y_axis, floor_normal, up_vector) -> (out_slope_pitch_degree_angle=float, out_slope_roll_degree_angle=float)¶
Returns Slope Pitch and Roll angles in degrees based on the following information: outparam: OutSlopePitchDegreeAngle Slope Pitch angle (degrees) outparam: OutSlopeRollDegreeAngle Slope Roll angle (degrees)
- Parameters:
- Returns:
out_slope_pitch_degree_angle (float):
out_slope_roll_degree_angle (float):
- Return type:
tuple
- classmethod get_tau() double ¶
Returns the value of TAU (= 2 * PI)
- Return type:
double
- classmethod get_year(a) int32 ¶
Returns the year component of A
- Parameters:
a (DateTime) –
- Return type:
int32
- classmethod greater_byte_byte(a, b) bool ¶
Returns true if A is greater than B (A > B)
- Parameters:
a (uint8) –
b (uint8) –
- Return type:
- classmethod greater_double_double(a, b) bool ¶
Returns true if A is greater than B (A > B)
- Parameters:
a (double) –
b (double) –
- Return type:
- classmethod greater_equal_byte_byte(a, b) bool ¶
Returns true if A is greater than or equal to B (A >= B)
- Parameters:
a (uint8) –
b (uint8) –
- Return type:
- classmethod greater_equal_date_time_date_time(a, b) bool ¶
Returns true if A is greater than or equal to B (A >= B)
- classmethod greater_equal_double_double(a, b) bool ¶
Returns true if A is greater than or equal to B (A >= B)
- Parameters:
a (double) –
b (double) –
- Return type:
- classmethod greater_equal_float_float(a: float, b: float) bool ¶
deprecated: ‘greater_equal_float_float’ was renamed to ‘greater_equal_double_double’.
- classmethod greater_equal_int64_int64(a, b) bool ¶
Returns true if A is greater than or equal to B (A >= B)
- Parameters:
a (int64) –
b (int64) –
- Return type:
- classmethod greater_equal_int_int(a, b) bool ¶
Returns true if A is greater than or equal to B (A >= B)
- Parameters:
a (int32) –
b (int32) –
- Return type:
- classmethod greater_equal_timespan_timespan(a, b) bool ¶
Returns true if A is greater than or equal to B (A >= B)
- classmethod greater_float_float(a: float, b: float) bool ¶
deprecated: ‘greater_float_float’ was renamed to ‘greater_double_double’.
- classmethod greater_greater_vector_rotator(a, b) Vector ¶
Returns result of vector A rotated by Rotator B
- classmethod greater_int64_int64(a, b) bool ¶
Returns true if A is greater than B (A > B)
- Parameters:
a (int64) –
b (int64) –
- Return type:
- classmethod greater_int_int(a, b) bool ¶
Returns true if A is greater than B (A > B)
- Parameters:
a (int32) –
b (int32) –
- Return type:
- classmethod grid_snap_float(location, grid_size) double ¶
- Snaps a value to the nearest grid multiple. E.g.,
Location = 5.1, GridSize = 10.0 : return value = 10.0
If GridSize is 0 Location is returned if GridSize is very small precision issues may occur.
- Parameters:
location (double) –
grid_size (double) –
- Return type:
double
- classmethod hsv_to_rgb(h, s, v, a=1.000000) LinearColor ¶
Make a color from individual color components (HSV space; Hue is [0..360) while Saturation and Value are 0..1)
- Parameters:
- Return type:
- classmethod hsv_to_rgb_linear(hsv) LinearColor ¶
Converts a HSV linear color (where H is in R, S is in G, and V is in B) to linear RGB
- Parameters:
hsv (LinearColor) –
- Return type:
- classmethod hsv_to_rgb_vector(hsv) LinearColor ¶
Converts a HSV linear color (where H is in R (0..360), S is in G (0..1), and V is in B (0..1)) to RGB
- Parameters:
hsv (LinearColor) –
- Returns:
rgb (LinearColor):
- Return type:
- classmethod hypotenuse(width, height) double ¶
Returns the hypotenuse of a right-angled triangle given the width and height.
- Parameters:
width (double) –
height (double) –
- Return type:
double
- classmethod in_range_float_float(value, min=0.000000, max=1.000000, inclusive_min=True, inclusive_max=True) bool ¶
Returns true if value is between Min and Max (V >= Min && V <= Max) If InclusiveMin is true, value needs to be equal or larger than Min, else it needs to be larger If InclusiveMax is true, value needs to be smaller or equal than Max, else it needs to be smaller
- classmethod in_range_int64_int64(value, min=0, max=10, inclusive_min=True, inclusive_max=True) bool ¶
Returns true if value is between Min and Max (V >= Min && V <= Max) If InclusiveMin is true, value needs to be equal or larger than Min, else it needs to be larger If InclusiveMax is true, value needs to be smaller or equal than Max, else it needs to be smaller
- classmethod in_range_int_int(value, min=0, max=10, inclusive_min=True, inclusive_max=True) bool ¶
Returns true if value is between Min and Max (V >= Min && V <= Max) If InclusiveMin is true, value needs to be equal or larger than Min, else it needs to be larger If InclusiveMax is true, value needs to be smaller or equal than Max, else it needs to be smaller
- classmethod inverse_lerp(value: float, range_min: float, range_max: float) float ¶
deprecated: ‘inverse_lerp’ was renamed to ‘normalize_to_range’.
- classmethod inverse_transform_direction(t, direction) Vector ¶
Transform a direction vector by the inverse of the supplied transform - will not change its length. For example, if T was an object’s transform, this would transform a direction from world space to local space.
- classmethod inverse_transform_location(t, location) Vector ¶
Transform a position by the inverse of the supplied transform. For example, if T was an object’s transform, this would transform a position from world space to local space.
- classmethod inverse_transform_position(t: Transform, location: Vector) Vector ¶
deprecated: ‘inverse_transform_position’ was renamed to ‘inverse_transform_location’.
- classmethod inverse_transform_rotation(t, rotation) Rotator ¶
Transform a rotator by the inverse of the supplied transform. For example, if T was an object’s transform, this would transform a rotation from world space to local space.
- classmethod invert_transform(t) Transform ¶
Returns the inverse of the given transform T.
Example: Given a LocalToWorld transform, WorldToLocal will be returned.
- classmethod is_leap_year(year) bool ¶
Returns whether given year is a leap year
- Parameters:
year (int32) –
- Return type:
- classmethod is_nearly_zero2d(a, tolerance=0.000100) bool ¶
Checks whether vector is near to zero within a specified tolerance.
- classmethod is_point_in_box(point, box_origin, box_extent) bool ¶
Determines whether the given point is in a box. Includes points on the box.
- classmethod is_point_in_box_box(point, box) bool ¶
Determines whether the given point is in a box. Includes points on the box.
- classmethod is_point_in_box_with_transform(point, box_world_transform, box_extent) bool ¶
Determines whether a given point is in a box with a given transform. Includes points on the box.
- classmethod is_point_in_box_with_transform_box(point, box_world_transform, box_extent) bool ¶
Determines whether a given point is in a box with a given transform. Includes points on the box.
- classmethod lerp(a, b, alpha) double ¶
Linearly interpolates between A and B based on Alpha (100% of A when Alpha=0 and 100% of B when Alpha=1)
- Parameters:
a (double) –
b (double) –
alpha (double) –
- Return type:
double
- classmethod less_byte_byte(a, b) bool ¶
Returns true if A is less than B (A < B)
- Parameters:
a (uint8) –
b (uint8) –
- Return type:
- classmethod less_double_double(a, b) bool ¶
Returns true if A is Less than B (A < B)
- Parameters:
a (double) –
b (double) –
- Return type:
- classmethod less_equal_byte_byte(a, b) bool ¶
Returns true if A is less than or equal to B (A <= B)
- Parameters:
a (uint8) –
b (uint8) –
- Return type:
- classmethod less_equal_date_time_date_time(a, b) bool ¶
Returns true if A is less than or equal to B (A <= B)
- classmethod less_equal_double_double(a, b) bool ¶
Returns true if A is Less than or equal to B (A <= B)
- Parameters:
a (double) –
b (double) –
- Return type:
- classmethod less_equal_float_float(a: float, b: float) bool ¶
deprecated: ‘less_equal_float_float’ was renamed to ‘less_equal_double_double’.
- classmethod less_equal_int64_int64(a, b) bool ¶
Returns true if A is less than or equal to B (A <= B)
- Parameters:
a (int64) –
b (int64) –
- Return type:
- classmethod less_equal_int_int(a, b) bool ¶
Returns true if A is less than or equal to B (A <= B)
- Parameters:
a (int32) –
b (int32) –
- Return type:
- classmethod less_equal_timespan_timespan(a, b) bool ¶
Returns true if A is less than or equal to B (A <= B)
- classmethod less_float_float(a: float, b: float) bool ¶
deprecated: ‘less_float_float’ was renamed to ‘less_double_double’.
- classmethod less_int64_int64(a, b) bool ¶
Returns true if A is less than B (A < B)
- Parameters:
a (int64) –
b (int64) –
- Return type:
- classmethod less_int_int(a, b) bool ¶
Returns true if A is less than B (A < B)
- Parameters:
a (int32) –
b (int32) –
- Return type:
- classmethod less_less_vector_rotator(a, b) Vector ¶
Returns result of vector A rotated by the inverse of Rotator B
- classmethod line_plane_intersection(line_start, line_end, a_plane) (t=float, intersection=Vector) or None ¶
Computes the intersection point between a line and a plane.
- Parameters:
- Returns:
True if the intersection test was successful.
t (float): The t of the intersection between the line and the plane
intersection (Vector): The point of intersection between the line and the plane
- Return type:
tuple or None
- classmethod line_plane_intersection_origin_normal(line_start, line_end, plane_origin, plane_normal) (t=float, intersection=Vector) or None ¶
Computes the intersection point between a line and a plane.
- Parameters:
- Returns:
True if the intersection test was successful.
t (float): The t of the intersection between the line and the plane
intersection (Vector): The point of intersection between the line and the plane
- Return type:
tuple or None
- classmethod linear_color_desaturated(color, desaturation) LinearColor ¶
Returns a desaturated color, with 0 meaning no desaturation and 1 == full desaturation
- Parameters:
color (LinearColor) –
desaturation (float) –
- Returns:
Desaturated color
- Return type:
- classmethod linear_color_distance(c1, c2) float ¶
Euclidean distance between two color points.
- Parameters:
c1 (LinearColor) –
c2 (LinearColor) –
- Return type:
- classmethod linear_color_get_luminance(color) float ¶
Returns the perceived brightness of a color on a display taking into account the impact on the human eye per color channel: green > red > blue.
- Parameters:
color (LinearColor) –
- Return type:
- classmethod linear_color_get_max(color) float ¶
Returns the maximum color channel value in this color structure
- Parameters:
color (LinearColor) –
- Returns:
The maximum color channel value
- Return type:
- classmethod linear_color_get_min(color) float ¶
Returns the minimum color channel value in this color structure
- Parameters:
color (LinearColor) –
- Returns:
The minimum color channel value
- Return type:
- classmethod linear_color_is_near_equal(a, b, tolerance=0.000100) bool ¶
Returns true if linear color A is equal to linear color B (A == B) within a specified error tolerance
- Parameters:
a (LinearColor) –
b (LinearColor) –
tolerance (float) –
- Return type:
- classmethod linear_color_lerp(a, b, alpha) LinearColor ¶
Linearly interpolates between A and B based on Alpha (100% of A when Alpha=0 and 100% of B when Alpha=1)
- Parameters:
a (LinearColor) –
b (LinearColor) –
alpha (float) –
- Return type:
- classmethod linear_color_lerp_using_hsv(a, b, alpha) LinearColor ¶
Linearly interpolates between two colors by the specified Alpha amount (100% of A when Alpha=0 and 100% of B when Alpha=1). The interpolation is performed in HSV color space taking the shortest path to the new color’s hue. This can give better results than a normal lerp, but is much more expensive. The incoming colors are in RGB space, and the output color will be RGB. The alpha value will also be interpolated.
- Parameters:
a (LinearColor) – The color and alpha to interpolate from as linear RGBA
b (LinearColor) – The color and alpha to interpolate to as linear RGBA
alpha (float) – Scalar interpolation amount (usually between 0.0 and 1.0 inclusive)
- Returns:
The interpolated color in linear RGB space along with the interpolated alpha value
- Return type:
- classmethod linear_color_quantize(color) Color ¶
Quantizes the linear color and returns the result as an 8-bit color. This bypasses the SRGB conversion. deprecated: Use LinearColor_QuantizeRound instead for correct color conversion.
- Parameters:
color (LinearColor) –
- Return type:
- classmethod linear_color_quantize_round(color) Color ¶
Quantizes the linear color with rounding and returns the result as an 8-bit color. This bypasses the SRGB conversion.
- Parameters:
color (LinearColor) –
- Return type:
- classmethod linear_color_set(out_color, color) LinearColor ¶
Assign contents of InColor
- Parameters:
out_color (LinearColor) –
color (LinearColor) –
- Returns:
out_color (LinearColor):
- Return type:
- classmethod linear_color_set_from_hsv(out_color, h, s, v, a=1.000000) LinearColor ¶
Assigns an HSV color to a linear space RGB color
- Parameters:
out_color (LinearColor) –
h (float) –
s (float) –
v (float) –
a (float) –
- Returns:
out_color (LinearColor):
- Return type:
- classmethod linear_color_set_from_pow22(out_color, color) LinearColor ¶
Assigns an FColor coming from an observed Pow(1/2.2) output, into a linear color.
- Parameters:
out_color (LinearColor) –
color (Color) – The Pow(1/2.2) color that needs to be converted into linear space.
- Returns:
out_color (LinearColor):
- Return type:
- classmethod linear_color_set_from_srgb(out_color, srgb) LinearColor ¶
Assigns an FColor coming from an observed sRGB output, into a linear color.
- Parameters:
out_color (LinearColor) –
srgb (Color) – The sRGB color that needs to be converted into linear space.
- Returns:
out_color (LinearColor):
- Return type:
- classmethod linear_color_set_random_hue(out_color) LinearColor ¶
Sets to a random color. Choses a quite nice color based on a random hue.
- Parameters:
out_color (LinearColor) –
- Returns:
out_color (LinearColor):
- Return type:
- classmethod linear_color_set_rgba(out_color, r, g, b, a=1.000000) LinearColor ¶
Assign individual linear RGBA components.
- Parameters:
out_color (LinearColor) –
r (float) –
g (float) –
b (float) –
a (float) –
- Returns:
out_color (LinearColor):
- Return type:
- classmethod linear_color_set_temperature(out_color, temperature) LinearColor ¶
Converts temperature in Kelvins of a black body radiator to RGB chromaticity.
- Parameters:
out_color (LinearColor) –
temperature (float) –
- Returns:
out_color (LinearColor):
- Return type:
- classmethod linear_color_to_new_opacity(color, opacity) LinearColor ¶
Returns a copy of this color using the specified opacity/alpha.
- Parameters:
color (LinearColor) –
opacity (float) –
- Return type:
- classmethod linear_color_to_rgbe(linear_color) Color ¶
Converts from linear to 8-bit RGBE as outlined in Gregory Ward’s Real Pixels article, Graphics Gems II, page 80.
- Parameters:
linear_color (LinearColor) –
- Return type:
- classmethod log(a, base=1.000000) double ¶
Returns log of A base B (if B^R == A, returns R)
- Parameters:
a (double) –
base (double) –
- Return type:
double
- classmethod loge(a) double ¶
Returns natural log of A (if e^R == A, returns R)
- Parameters:
a (double) –
- Return type:
double
- classmethod make_plane_from_point_and_normal(point, normal) Plane ¶
Creates a plane with a facing direction of Normal at the given Point
- classmethod make_pulsating_value(current_time, pulses_per_second=1.000000, phase=0.000000) float ¶
Simple function to create a pulsating scalar value
- classmethod make_relative_transform(a, relative_to) Transform ¶
Computes a relative transform of one transform compared to another.
Example: ChildOffset = MakeRelativeTransform(Child.GetActorTransform(), Parent.GetActorTransform()) This computes the relative transform of the Child from the Parent.
- classmethod make_rot_from_x(x) Rotator ¶
Builds a rotator given only a XAxis. Y and Z are unspecified but will be orthonormal. XAxis need not be normalized.
- classmethod make_rot_from_xy(x, y) Rotator ¶
Builds a matrix with given X and Y axes. X will remain fixed, Y may be changed minimally to enforce orthogonality. Z will be computed. Inputs need not be normalized.
- classmethod make_rot_from_xz(x, z) Rotator ¶
Builds a matrix with given X and Z axes. X will remain fixed, Z may be changed minimally to enforce orthogonality. Y will be computed. Inputs need not be normalized.
- classmethod make_rot_from_y(y) Rotator ¶
Builds a rotation matrix given only a YAxis. X and Z are unspecified but will be orthonormal. YAxis need not be normalized.
- classmethod make_rot_from_yx(y, x) Rotator ¶
Builds a matrix with given Y and X axes. Y will remain fixed, X may be changed minimally to enforce orthogonality. Z will be computed. Inputs need not be normalized.
- classmethod make_rot_from_yz(y, z) Rotator ¶
Builds a matrix with given Y and Z axes. Y will remain fixed, Z may be changed minimally to enforce orthogonality. X will be computed. Inputs need not be normalized.
- classmethod make_rot_from_z(z) Rotator ¶
Builds a rotation matrix given only a ZAxis. X and Y are unspecified but will be orthonormal. ZAxis need not be normalized.
- classmethod make_rot_from_zx(z, x) Rotator ¶
Builds a matrix with given Z and X axes. Z will remain fixed, X may be changed minimally to enforce orthogonality. Y will be computed. Inputs need not be normalized.
- classmethod make_rot_from_zy(z, y) Rotator ¶
Builds a matrix with given Z and Y axes. Z will remain fixed, Y may be changed minimally to enforce orthogonality. X will be computed. Inputs need not be normalized.
- classmethod make_rotation_from_axes(forward, right, up) Rotator ¶
Build a reference frame from three axes
- classmethod map_range(value: float, range_a: float, range_b: float, out_range_a: float, out_range_b: float) float ¶
deprecated: ‘map_range’ was renamed to ‘map_range_unclamped’.
- classmethod map_range_clamped(value, range_a, range_b, out_range_a, out_range_b) double ¶
Returns Value mapped from one range into another where the Value is clamped to the Input Range. (e.g. 0.5 normalized from the range 0->1 to 0->50 would result in 25)
- Parameters:
value (double) –
range_a (double) –
range_b (double) –
out_range_a (double) –
out_range_b (double) –
- Return type:
double
- classmethod map_range_unclamped(value, range_a, range_b, out_range_a, out_range_b) double ¶
Returns Value mapped from one range into another. (e.g. 20 normalized from the range 10->50 to 20->40 would result in 25)
- Parameters:
value (double) –
range_a (double) –
range_b (double) –
out_range_a (double) –
out_range_b (double) –
- Return type:
double
- classmethod matrix_apply_scale(m, scale) Matrix ¶
Apply Scale to this matrix (Assumes Matrix represents a transform)
- classmethod matrix_concatenate_translation(m, translation) Matrix ¶
Returns a matrix with an additional translation concatenated. (Assumes Matrix represents a transform)
- classmethod matrix_get_column(m, column) Vector ¶
get a column of this matrix
- Parameters:
m (Matrix) –
column (MatrixColumns) –
- Returns:
vector of the column
- Return type:
- classmethod matrix_get_frustum_bottom_plane(m) Plane or None ¶
Get the bottom plane of the Frustum of this matrix (Assumes Matrix represents a View Projection Matrix)
- classmethod matrix_get_frustum_far_plane(m) Plane or None ¶
Get the far plane of the Frustum of this matrix (Assumes Matrix represents a View Projection Matrix)
- classmethod matrix_get_frustum_left_plane(m) Plane or None ¶
Get the left plane of the Frustum of this matrix (Assumes Matrix represents a View Projection Matrix)
- classmethod matrix_get_frustum_near_plane(m) Plane or None ¶
Get the near plane of the Frustum of this matrix (Assumes Matrix represents a View Projection Matrix)
- classmethod matrix_get_frustum_right_plane(m) Plane or None ¶
Get the right plane of the Frustum of this matrix (Assumes Matrix represents a View Projection Matrix)
- classmethod matrix_get_frustum_top_plane(m) Plane or None ¶
Get the top plane of the Frustum of this matrix (Assumes Matrix represents a View Projection Matrix)
- classmethod matrix_get_matrix_without_scale(m, tolerance=0.000000) Matrix ¶
Returns matrix after RemoveScaling with error Tolerance (Assumes Matrix represents a transform)
- classmethod matrix_get_origin(matrix) Vector ¶
Get the origin of the co-ordinate system (Assumes Matrix represents a transform)
- classmethod matrix_get_rotator(m) Rotator ¶
Get the rotator representation of this matrix (Assumes Matrix represents a transform)
- classmethod matrix_get_scale_vector(m, tolerance=0.000000) Vector ¶
return a 3D scale vector calculated from this matrix (where each component is the magnitude of a row vector) with error Tolerance. (Assumes Matrix represents a transform)
- classmethod matrix_get_scaled_axes(m) -> (x=Vector, y=Vector, z=Vector)¶
get axes of this matrix scaled by the scale of the matrix (Assumes Matrix represents a transform)
- Parameters:
m (Matrix) –
- Returns:
x (Vector): axes returned to this param
y (Vector): axes returned to this param
z (Vector): axes returned to this param
- Return type:
tuple
- classmethod matrix_get_scaled_axis(m, axis) Vector ¶
get axis of this matrix scaled by the scale of the matrix (Assumes Matrix represents a transform)
- classmethod matrix_get_unit_axes(m) -> (x=Vector, y=Vector, z=Vector)¶
get unit length axes of this matrix (Assumes Matrix represents a transform)
- Parameters:
m (Matrix) –
- Returns:
x (Vector): axes returned to this param
y (Vector): axes returned to this param
z (Vector): axes returned to this param
- Return type:
tuple
- classmethod matrix_get_unit_axis(m, axis) Vector ¶
get unit length axis of this matrix (Assumes Matrix represents a transform)
- classmethod matrix_inverse_transform_position(m, v) Vector ¶
Inverts the matrix and then transforms V - correctly handles scaling in this matrix. (Assumes Matrix represents a transform)
- classmethod matrix_inverse_transform_vector(m, v) Vector ¶
Transform a direction vector by the inverse of this matrix - will not take into account translation part. If you want to transform a surface normal (or plane) and correctly account for non-uniform scaling you should use TransformByUsingAdjointT with adjoint of matrix inverse. (Assumes Matrix represents a transform)
- classmethod matrix_mirror(m, mirror_axis, flip_axis) Matrix ¶
Utility for mirroring this transform across a certain plane, and flipping one of the axis as well. (Assumes Matrix represents a transform)
- classmethod matrix_remove_scaling(m, tolerance=0.000000) Matrix ¶
Remove any scaling from this matrix (ie magnitude of each row is 1) with error Tolerance (Assumes Matrix represents a transform)
- classmethod matrix_remove_translation(m) Matrix ¶
Remove any translation from this matrix (Assumes Matrix represents a transform)
- classmethod matrix_scale_translation(m, scale3d) Matrix ¶
Scale the translation part of the matrix by the supplied vector. (Assumes Matrix represents a transform)
- classmethod matrix_set_axis(m, axis, axis_vector) Matrix ¶
set an axis of this matrix (Assumes Matrix represents a transform)
- classmethod matrix_set_column(m, column, value) Matrix ¶
Matrix Set Column
- Parameters:
m (Matrix) –
column (MatrixColumns) –
value (Vector) –
- Returns:
m (Matrix):
- Return type:
- classmethod matrix_set_origin(m, new_origin) Matrix ¶
Set the origin of the coordinate system to the given vector (Assumes Matrix represents a transform)
- classmethod matrix_to_quat(m) Quat ¶
Transform a rotation matrix into a quaternion. (Assumes Matrix represents a transform) warning: rotation part will need to be unit length for this to be right!
- classmethod matrix_transform_position(m, v) Vector4 ¶
Transform a location - will take into account translation part of the FMatrix. (Assumes Matrix represents a transform)
- classmethod matrix_transform_vector(m, v) Vector4 ¶
Transform a direction vector - will not take into account translation part of the FMatrix. If you want to transform a surface normal (or plane) and correctly account for non-uniform scaling you should use TransformByUsingAdjointT. (Assumes Matrix represents a transform)
- classmethod matrix_transform_vector4(m, v) Vector4 ¶
Transform a vector by the matrix. (Assumes Matrix represents a transform)
- classmethod max(a, b) int32 ¶
Returns the maximum value of A and B
- Parameters:
a (int32) –
b (int32) –
- Return type:
int32
- classmethod max_int64(a, b) int64 ¶
Returns the maximum value of A and B
- Parameters:
a (int64) –
b (int64) –
- Return type:
int64
- classmethod max_of_byte_array(byte_array) -> (index_of_max_value=int32, max_value=uint8)¶
Returns max of all array entries and the index at which it was found. Returns value of 0 and index of -1 if the supplied array is empty.
- Parameters:
byte_array (Array[uint8]) –
- Returns:
index_of_max_value (int32):
max_value (uint8):
- Return type:
tuple
- classmethod max_of_float_array(float_array) -> (index_of_max_value=int32, max_value=float)¶
Returns max of all array entries and the index at which it was found. Returns value of 0 and index of -1 if the supplied array is empty.
- classmethod max_of_int_array(int_array) -> (index_of_max_value=int32, max_value=int32)¶
Returns max of all array entries and the index at which it was found. Returns value of 0 and index of -1 if the supplied array is empty.
- Parameters:
int_array (Array[int32]) –
- Returns:
index_of_max_value (int32):
max_value (int32):
- Return type:
tuple
- classmethod median_of_int_array(int_array) float ¶
Returns median of all array entries. Returns value of 0 if the supplied array is empty.
- classmethod min(a, b) int32 ¶
Returns the minimum value of A and B
- Parameters:
a (int32) –
b (int32) –
- Return type:
int32
- classmethod min_area_rectangle(world_context_object, points, sample_surface_normal, debug_draw=False) -> (out_rect_center=Vector, out_rect_rotation=Rotator, out_rect_length_x=float, out_rect_length_y=float)¶
Finds the minimum area rectangle that encloses a set of coplanar points. Uses the exhaustive search algorithm in http://www.geometrictools.com/Documentation/MinimumAreaRectangle.pdf
- Parameters:
world_context_object (Object) – Pointer to world context; only used when debug draw is enabled
points (Array[Vector]) – Points to enclose in the rectangle; need to be within the same plane for correct results
sample_surface_normal (Vector) – Normal indicating the surface direction for the points
debug_draw (bool) – Draws the output rectangle for debugging purposes provided the world context is set as well
- Returns:
out_rect_center (Vector): Translation for the output rectangle from the origin
out_rect_rotation (Rotator): Rotation for the output rectangle from the XY plane
out_rect_length_x (float): Length of the output rectangle along the X axis before rotation
out_rect_length_y (float): Length of the output rectangle along the Y axis before rotation
- Return type:
tuple
- classmethod min_int64(a, b) int64 ¶
Returns the minimum value of A and B
- Parameters:
a (int64) –
b (int64) –
- Return type:
int64
- classmethod min_of_byte_array(byte_array) -> (index_of_min_value=int32, min_value=uint8)¶
Returns min of all array entries and the index at which it was found. Returns value of 0 and index of -1 if the supplied array is empty.
- Parameters:
byte_array (Array[uint8]) –
- Returns:
index_of_min_value (int32):
min_value (uint8):
- Return type:
tuple
- classmethod min_of_float_array(float_array) -> (index_of_min_value=int32, min_value=float)¶
Returns min of all array entries and the index at which it was found. Returns value of 0 and index of -1 if the supplied array is empty.
- classmethod min_of_int_array(int_array) -> (index_of_min_value=int32, min_value=int32)¶
Returns min of all array entries and the index at which it was found. Returns value of 0 and index of -1 if the supplied array is empty.
- Parameters:
int_array (Array[int32]) –
- Returns:
index_of_min_value (int32):
min_value (int32):
- Return type:
tuple
- classmethod minimum_area_rectangle(world_context_object, verts, sample_surface_normal, debug_draw=False) -> (out_rect_center=Vector, out_rect_rotation=Rotator, out_side_length_x=float, out_side_length_y=float)¶
Minimum Area Rectangle deprecated: Use ‘Min Area Rectangle’ instead; this deprecated version incorrectly returns the average of all input points as the rectangle center.
- classmethod mirror_vector_by_normal(vect, normal) Vector ¶
Given a direction vector and a surface normal, returns the vector reflected across the surface normal. Produces a result like shining a laser at a mirror!
- classmethod multiply_by_pi(value) double ¶
Multiplies the input value by pi.
- Parameters:
value (double) –
- Return type:
double
- classmethod multiply_byte_byte(a, b) uint8 ¶
Multiplication (A * B)
- Parameters:
a (uint8) –
b (uint8) –
- Return type:
uint8
- classmethod multiply_double_double(a, b) double ¶
Multiplication (A * B)
- Parameters:
a (double) –
b (double) –
- Return type:
double
- classmethod multiply_float_float(a: float, b: float) float ¶
deprecated: ‘multiply_float_float’ was renamed to ‘multiply_double_double’.
- classmethod multiply_int64_int64(a, b) int64 ¶
Multiplication (A * B)
- Parameters:
a (int64) –
b (int64) –
- Return type:
int64
- classmethod multiply_int_float(a, b) double ¶
Multiplication (A * B)
- Parameters:
a (int32) –
b (double) –
- Return type:
double
- classmethod multiply_int_int(a, b) int32 ¶
Multiplication (A * B)
- Parameters:
a (int32) –
b (int32) –
- Return type:
int32
- classmethod multiply_linear_color_float(a, b) LinearColor ¶
Element-wise multiplication of a linear color by a float (F*R, F*G, F*B, F*A)
- Parameters:
a (LinearColor) –
b (float) –
- Return type:
- classmethod multiply_linear_color_linear_color(a, b) LinearColor ¶
Element-wise multiplication of two linear colors (R*R, G*G, B*B, A*A)
- Parameters:
a (LinearColor) –
b (LinearColor) –
- Return type:
- classmethod multiply_matrix_float(a, b) Matrix ¶
Multiplies all values of the matrix by a float. If your Matrix represents a Transform that you wish to scale you should use Apply Scale instead
- classmethod multiply_multiply_float_float(base, exp) double ¶
Power (Base to the Exp-th power)
- Parameters:
base (double) –
exp (double) –
- Return type:
double
- classmethod multiply_quat_quat(a, b) Quat ¶
Gets the result of multiplying two quaternions (A * B).
Order matters when composing quaternions: C = A * B will yield a quaternion C that logically first applies B then A to any subsequent transformation (right first, then left).
- classmethod multiply_rotator_float(a, b) Rotator ¶
Returns rotator representing rotator A scaled by B
- classmethod multiply_vector2d_vector2d(a, b) Vector2D ¶
Element-wise Vector multiplication (Result = {A.x*B.x, A.y*B.y})
- classmethod multiply_vector4_vector4(a, b) Vector4 ¶
Element-wise Vector multiplication (Result = {A.x*B.x, A.y*B.y, A.z*B.z, A.w*B.w})
- classmethod multiply_vector_vector(a, b) Vector ¶
Element-wise Vector multiplication (Result = {A.x*B.x, A.y*B.y, A.z*B.z})
- classmethod nearly_equal_float_float(a, b, error_tolerance=0.000001) bool ¶
Returns true if A is nearly equal to B (|A - B| < ErrorTolerance)
- Parameters:
a (double) –
b (double) –
error_tolerance (double) –
- Return type:
- classmethod nearly_equal_rotator_rotator(a: Rotator, b: Rotator, error_tolerance: float = 0.0001) bool ¶
deprecated: ‘nearly_equal_rotator_rotator’ was renamed to ‘equal_equal_rotator_rotator’.
- classmethod nearly_equal_transform_transform(a, b, location_tolerance=0.000100, rotation_tolerance=0.000100, scale3d_tolerance=0.000100) bool ¶
Returns true if transform A is nearly equal to B
- Parameters:
a (Transform) –
b (Transform) –
location_tolerance (float) – How close position of transforms need to be to be considered equal
rotation_tolerance (float) – How close rotations of transforms need to be to be considered equal
scale3d_tolerance (float) – How close scale of transforms need to be to be considered equal
- Return type:
- classmethod nearly_equal_vector_vector(a: Vector, b: Vector, error_tolerance: float = 0.0001) bool ¶
deprecated: ‘nearly_equal_vector_vector’ was renamed to ‘equal_equal_vector_vector’.
- classmethod normal(a, tolerance=0.000100) Vector ¶
Gets a normalized unit copy of the vector, ensuring it is safe to do so based on the length. Returns zero vector if vector length is too small to safely normalize.
- classmethod normal_safe2d(a, tolerance=0.000000) Vector2D ¶
Gets a normalized copy of the vector, checking it is safe to do so based on the length. Returns zero vector if vector length is too small to safely normalize.
- classmethod normalize2d(a, tolerance=0.000000) Vector2D ¶
Normalize this vector in-place if it is large enough, set it to (0,0) otherwise. see: NormalSafe2D()
- classmethod normalize_to_range(value, range_min, range_max) double ¶
Returns Value normalized to the given range. (e.g. 20 normalized to the range 10->50 would result in 0.25)
- Parameters:
value (double) –
range_min (double) –
range_max (double) –
- Return type:
double
- classmethod not_equal_byte_byte(a, b) bool ¶
Returns true if A is not equal to B (A != B)
- Parameters:
a (uint8) –
b (uint8) –
- Return type:
- classmethod not_equal_date_time_date_time(a, b) bool ¶
Returns true if the values are not equal (A != B)
- classmethod not_equal_double_double(a, b) bool ¶
Returns true if A does not equal B (A != B)
- Parameters:
a (double) –
b (double) –
- Return type:
- classmethod not_equal_exactly_vector2d_vector2d(a, b) bool ¶
Returns true if vector2D A is not equal to vector2D B (A != B) within a specified error tolerance
- classmethod not_equal_exactly_vector4_vector4(a, b) bool ¶
Returns true if vector A is not equal to vector B (A != B) within a specified error tolerance
- classmethod not_equal_exactly_vector_vector(a, b) bool ¶
Returns true if vector A is not equal to vector B (A != B)
- classmethod not_equal_float_float(a: float, b: float) bool ¶
deprecated: ‘not_equal_float_float’ was renamed to ‘not_equal_double_double’.
- classmethod not_equal_int64_int64(a, b) bool ¶
Returns true if A is not equal to B (A != B)
- Parameters:
a (int64) –
b (int64) –
- Return type:
- classmethod not_equal_int_int(a, b) bool ¶
Returns true if A is not equal to B (A != B)
- Parameters:
a (int32) –
b (int32) –
- Return type:
- classmethod not_equal_int_point_int_point(a, b) bool ¶
Returns true if IntPoint A is NOT equal to IntPoint B (A != B)
- classmethod not_equal_linear_color_linear_color(a, b) bool ¶
Returns true if linear color A is not equal to linear color B (A != B) within a specified error tolerance
- Parameters:
a (LinearColor) –
b (LinearColor) –
- Return type:
- classmethod not_equal_matrix_matrix(a, b, tolerance=0.000100) bool ¶
Checks whether another Matrix is not equal to this, within specified tolerance.
- classmethod not_equal_quat_quat(a, b, error_tolerance=0.000100) bool ¶
Returns true if Quat A is not equal to Quat B (A != B) within a specified error tolerance
- classmethod not_equal_rotator_rotator(a, b, error_tolerance=0.000100) bool ¶
Returns true if rotator A is not equal to rotator B (A != B) within a specified error tolerance
- classmethod not_equal_timespan_timespan(a, b) bool ¶
Returns true if the values are not equal (A != B)
- classmethod not_equal_vector2d_vector2d(a, b, error_tolerance=0.000100) bool ¶
Returns true if vector2D A is not equal to vector2D B (A != B) within a specified error tolerance
- classmethod not_equal_vector4_vector4(a, b, error_tolerance=0.000100) bool ¶
Returns true if vector A is not equal to vector B (A != B) within a specified error tolerance
- classmethod not_equal_vector_vector(a, b, error_tolerance=0.000100) bool ¶
Returns true if vector A is not equal to vector B (A != B) within a specified error tolerance
- classmethod not_int(a) int32 ¶
Bitwise NOT (~A)
- Parameters:
a (int32) –
- Return type:
int32
- classmethod not_int64(a) int64 ¶
Bitwise NOT (~A)
- Parameters:
a (int64) –
- Return type:
int64
- classmethod or_int64_int64(a, b) int64 ¶
Bitwise OR (A | B)
- Parameters:
a (int64) –
b (int64) –
- Return type:
int64
- classmethod or_int_int(a, b) int32 ¶
Bitwise OR (A | B)
- Parameters:
a (int32) –
b (int32) –
- Return type:
int32
- classmethod percent_byte_byte(a, b=1) uint8 ¶
Modulo (A % B)
- Parameters:
a (uint8) –
b (uint8) –
- Return type:
uint8
- classmethod percent_int64_int64(a, b=1) int64 ¶
Modulo (A % B)
- Parameters:
a (int64) –
b (int64) –
- Return type:
int64
- classmethod percent_int_int(a, b=1) int32 ¶
Modulo (A % B)
- Parameters:
a (int32) –
b (int32) –
- Return type:
int32
- classmethod perlin_noise1d(value) float ¶
Generates a 1D Perlin noise from the given value. Returns a continuous random value between -1.0 and 1.0.
- classmethod points_are_coplanar(points, tolerance=0.100000) bool ¶
Determines whether a given set of points are coplanar, with a tolerance. Any three points or less are always coplanar.
- classmethod project_on_to(v: Vector, target: Vector) Vector ¶
deprecated: ‘project_on_to’ was renamed to ‘project_vector_on_to_vector’.
- classmethod project_point_on_to_plane(point, plane_base, plane_normal) Vector ¶
Projects/snaps a point onto a plane defined by a point on the plane and a plane normal.
- classmethod project_vector_on_to_plane(v, plane_normal) Vector ¶
Projects a vector onto a plane defined by a normalized vector (PlaneNormal).
- classmethod project_vector_on_to_vector(v, target) Vector ¶
Projects one vector (V) onto another (Target) and returns the projected vector. If Target is nearly zero in length, returns the zero vector.
- classmethod quat_angular_distance(a, b) float ¶
Find the angular distance/difference between two rotation quaternions.
- classmethod quat_enforce_shortest_arc_with(a, b) Quat ¶
Modify the quaternion to ensure that the delta between it and B represents the shortest possible rotation angle.
- classmethod quat_euler(q) Vector ¶
Convert a Quaternion into floating-point Euler angles (in degrees).
- classmethod quat_exp(q) Quat ¶
Used in combination with Log(). Assumes a quaternion with W=0 and V=theta*v (where |v| = 1). Exp(q) = (sin(theta)*v, cos(theta))
- classmethod quat_find_between_normals(start_normal, end_normal) Quat ¶
Generates the ‘smallest’ (geodesic) rotation around a sphere between two normals (assumed to be unit length).
- classmethod quat_find_between_vectors(start, end) Quat ¶
Generates the ‘smallest’ (geodesic) rotation around a sphere between two vectors of arbitrary length.
- classmethod quat_get_axis_x(q) Vector ¶
Get the forward direction (X axis) after it has been rotated by this Quaternion.
- classmethod quat_get_axis_y(q) Vector ¶
Get the right direction (Y axis) after it has been rotated by this Quaternion.
- classmethod quat_get_axis_z(q) Vector ¶
Get the up direction (Z axis) after it has been rotated by this Quaternion.
- classmethod quat_get_rotation_axis(q) Vector ¶
Get the axis of rotation of the Quaternion. This is the axis around which rotation occurs to transform the canonical coordinate system to the target orientation. For the identity Quaternion which has no such rotation, FVector(1,0,0) is returned.
- classmethod quat_is_finite(q) bool ¶
Determine if all the values are finite (not NaN nor Inf) in this Quat.
- classmethod quat_is_identity(q, tolerance=0.000100) bool ¶
Checks whether this Quaternion is an Identity Quaternion. Assumes Quaternion tested is normalized.
- classmethod quat_is_non_finite(q) bool ¶
Determine if there are any non-finite values (NaN or Inf) in this Quat.
- classmethod quat_make_from_euler(euler) Quat ¶
Convert a vector of floating-point Euler angles (in degrees) into a Quaternion.
- classmethod quat_normalize(q, tolerance=0.000100) Quat ¶
Normalize this quaternion if it is large enough as compared to the supplied tolerance. If it is too small then set it to the identity quaternion.
- classmethod quat_normalized(q, tolerance=0.000100) Quat ¶
Get a normalized copy of this quaternion. If it is too small, returns an identity quaternion.
- classmethod quat_set_from_euler(q, euler) Quat ¶
Convert a vector of floating-point Euler angles (in degrees) into a Quaternion.
- classmethod quat_slerp(a, b, alpha) Quat ¶
Spherical interpolation between Quaternions. Result is normalized.
- classmethod quat_vector_forward(q) Vector ¶
Get the forward direction (X axis) after it has been rotated by this Quaternion.
- classmethod quat_vector_right(q) Vector ¶
Get the right direction (Y axis) after it has been rotated by this Quaternion.
- classmethod quat_vector_up(q) Vector ¶
Get the up direction (Z axis) after it has been rotated by this Quaternion.
- classmethod quaternion_spring_interp(current, target, spring_state, stiffness, critical_damping_factor, delta_time, mass=1.000000, target_velocity_amount=1.000000, initialize_from_target=False) -> (Quat, spring_state=QuaternionSpringState)¶
Uses a simple spring model to interpolate a quaternion from Current to Target.
- Parameters:
current (Quat) – Current value
target (Quat) – Target value
spring_state (QuaternionSpringState) – Data related to spring model (velocity, error, etc..) - Create a unique variable per spring
stiffness (float) – How stiff the spring model is (more stiffness means more oscillation around the target value)
critical_damping_factor (float) – How much damping to apply to the spring (0 means no damping, 1 means critically damped which means no oscillation)
delta_time (float) – Time difference since the last update
mass (float) – Multiplier that acts like mass on a spring
target_velocity_amount (float) – If 1 then the target velocity will be calculated and used, which results following the target more closely/without lag. Values down to zero (recommended when using this to smooth data) will progressively disable this effect.
initialize_from_target (bool) – If set then the current value will be set from the target on the first update
- Returns:
spring_state (QuaternionSpringState): Data related to spring model (velocity, error, etc..) - Create a unique variable per spring
- Return type:
- classmethod r_interp_to(current, target, delta_time, interp_speed) Rotator ¶
Tries to reach Target rotation based on Current rotation, giving a nice smooth feeling when rotating to Target rotation.
- classmethod r_interp_to_constant(current, target, delta_time, interp_speed) Rotator ¶
Tries to reach Target rotation at a constant rate.
- classmethod r_lerp(a, b, alpha, shortest_path) Rotator ¶
Linearly interpolates between A and B based on Alpha (100% of A when Alpha=0 and 100% of B when Alpha=1)
- classmethod radians_to_degrees(a) double ¶
Returns degrees value based on the input radians
- Parameters:
a (double) –
- Return type:
double
- classmethod rand_bool_from_stream(stream: RandomStream) bool ¶
deprecated: ‘rand_bool_from_stream’ was renamed to ‘random_bool_from_stream’.
- classmethod rand_from_stream(stream: RandomStream, max: int) int ¶
deprecated: ‘rand_from_stream’ was renamed to ‘random_integer_from_stream’.
- classmethod rand_range(min: int, max: int) int ¶
deprecated: ‘rand_range’ was renamed to ‘random_integer_in_range’.
- classmethod rand_range_from_stream(stream: RandomStream, min: int, max: int) int ¶
deprecated: ‘rand_range_from_stream’ was renamed to ‘random_integer_in_range_from_stream’.
- classmethod random_bool_from_stream(stream) bool ¶
Returns a random bool
- Parameters:
stream (RandomStream) –
- Return type:
- classmethod random_bool_with_weight(weight=0.500000) bool ¶
- Get a random chance with the specified weight. Range of weight is 0.0 - 1.0 E.g.,
Weight = .6 return value = True 60% of the time
- classmethod random_bool_with_weight_from_stream(random_stream, weight=0.500000) bool ¶
- Get a random chance with the specified weight. Range of weight is 0.0 - 1.0 E.g.,
Weight = .6 return value = True 60% of the time
- Parameters:
random_stream (RandomStream) –
weight (float) –
- Return type:
- classmethod random_float() double ¶
Returns a random float between 0 and 1
- Return type:
double
- classmethod random_float_from_stream(stream) float ¶
Returns a random float between 0 and 1
- Parameters:
stream (RandomStream) –
- Return type:
- classmethod random_float_in_range(min, max) double ¶
Generate a random number between Min and Max
- Parameters:
min (double) –
max (double) –
- Return type:
double
- classmethod random_float_in_range_from_stream(stream, min, max) float ¶
Generate a random number between Min and Max
- Parameters:
stream (RandomStream) –
min (float) –
max (float) –
- Return type:
- classmethod random_integer(max) int32 ¶
Returns a uniformly distributed random number between 0 and Max - 1
- Parameters:
max (int32) –
- Return type:
int32
- classmethod random_integer64(max) int64 ¶
Returns a uniformly distributed random number between 0 and Max - 1
- Parameters:
max (int64) –
- Return type:
int64
- classmethod random_integer64_in_range(min, max) int64 ¶
Return a random integer64 between Min and Max (>= Min and <= Max)
- Parameters:
min (int64) –
max (int64) –
- Return type:
int64
- classmethod random_integer_from_stream(stream, max) int32 ¶
Returns a uniformly distributed random number between 0 and Max - 1
- Parameters:
stream (RandomStream) –
max (int32) –
- Return type:
int32
- classmethod random_integer_in_range(min, max) int32 ¶
Return a random integer between Min and Max (>= Min and <= Max)
- Parameters:
min (int32) –
max (int32) –
- Return type:
int32
- classmethod random_integer_in_range_from_stream(stream, min, max) int32 ¶
Return a random integer between Min and Max (>= Min and <= Max)
- Parameters:
stream (RandomStream) –
min (int32) –
max (int32) –
- Return type:
int32
- classmethod random_point_in_bounding_box(center, half_size) Vector ¶
Returns a random point within the specified bounding box using the first vector as an origin and the second as the box extents.
- classmethod random_point_in_bounding_box_box(box) Vector ¶
Returns a random point within the specified bounding box.
- classmethod random_point_in_bounding_box_from_stream(stream, center, half_size) Vector ¶
Returns a random point within the specified bounding box using the first vector as an origin and the second as the half size of the AABB.
- Parameters:
stream (RandomStream) –
center (Vector) –
half_size (Vector) –
- Return type:
- classmethod random_point_in_bounding_box_from_stream_box(stream, box) Vector ¶
Returns a random point within the specified bounding box.
- Parameters:
stream (RandomStream) –
box (Box) –
- Return type:
- classmethod random_rotator(roll=False) Rotator ¶
Generates a random rotation, with optional random roll.
- classmethod random_rotator_from_stream(stream, roll) Rotator ¶
Create a random rotation
- Parameters:
stream (RandomStream) –
roll (bool) –
- Return type:
- classmethod random_unit_vector_from_stream(stream) Vector ¶
Returns a random vector with length of 1.0
- Parameters:
stream (RandomStream) –
- Return type:
- classmethod random_unit_vector_in_cone(cone_dir: Vector, cone_half_angle_in_radians: float) Vector ¶
deprecated: ‘random_unit_vector_in_cone’ was renamed to ‘random_unit_vector_in_cone_in_radians’.
- classmethod random_unit_vector_in_cone_in_degrees(cone_dir, cone_half_angle_in_degrees) Vector ¶
Returns a random vector with length of 1, within the specified cone, with uniform random distribution.
- classmethod random_unit_vector_in_cone_in_degrees_from_stream(stream, cone_dir, cone_half_angle_in_degrees) Vector ¶
Returns a random vector with length of 1, within the specified cone, with uniform random distribution.
- Parameters:
stream (RandomStream) – The random stream from which to obtain the vector.
cone_dir (Vector) – The base “center” direction of the cone.
cone_half_angle_in_degrees (float) – The half-angle of the cone (from ConeDir to edge), in degrees.
- Return type:
- classmethod random_unit_vector_in_cone_in_radians(cone_dir, cone_half_angle_in_radians) Vector ¶
Returns a random vector with length of 1, within the specified cone, with uniform random distribution.
- classmethod random_unit_vector_in_cone_in_radians_from_stream(stream, cone_dir, cone_half_angle_in_radians) Vector ¶
Returns a random vector with length of 1, within the specified cone, with uniform random distribution.
- Parameters:
stream (RandomStream) – The random stream from which to obtain the vector.
cone_dir (Vector) – The base “center” direction of the cone.
cone_half_angle_in_radians (float) – The half-angle of the cone (from ConeDir to edge), in radians.
- Return type:
- classmethod random_unit_vector_in_cone_with_yaw_and_pitch(cone_dir: Vector, max_yaw_in_degrees: float, max_pitch_in_degrees: float) Vector ¶
deprecated: ‘random_unit_vector_in_cone_with_yaw_and_pitch’ was renamed to ‘random_unit_vector_in_elliptical_cone_in_degrees’.
- classmethod random_unit_vector_in_elliptical_cone_in_degrees(cone_dir, max_yaw_in_degrees, max_pitch_in_degrees) Vector ¶
Returns a random vector with length of 1, within the specified cone, with uniform random distribution. The shape of the cone can be modified according to the yaw and pitch angles.
- classmethod random_unit_vector_in_elliptical_cone_in_degrees_from_stream(stream, cone_dir, max_yaw_in_degrees, max_pitch_in_degrees) Vector ¶
Returns a random vector with length of 1, within the specified cone, with uniform random distribution. The shape of the cone can be modified according to the yaw and pitch angles.
- Parameters:
stream (RandomStream) – The random stream from which to obtain the vector.
cone_dir (Vector) –
max_yaw_in_degrees (float) – The yaw angle of the cone (from ConeDir to horizontal edge), in degrees.
max_pitch_in_degrees (float) – The pitch angle of the cone (from ConeDir to vertical edge), in degrees.
- Return type:
- classmethod random_unit_vector_in_elliptical_cone_in_radians(cone_dir, max_yaw_in_radians, max_pitch_in_radians) Vector ¶
Returns a random vector with length of 1, within the specified cone, with uniform random distribution. The shape of the cone can be modified according to the yaw and pitch angles.
- classmethod random_unit_vector_in_elliptical_cone_in_radians_from_stream(stream, cone_dir, max_yaw_in_radians, max_pitch_in_radians) Vector ¶
Returns a random vector with length of 1, within the specified cone, with uniform random distribution. The shape of the cone can be modified according to the yaw and pitch angles.
- Parameters:
stream (RandomStream) – The random stream from which to obtain the vector.
cone_dir (Vector) –
max_yaw_in_radians (float) – The yaw angle of the cone (from ConeDir to horizontal edge), in radians.
max_pitch_in_radians (float) – The pitch angle of the cone (from ConeDir to vertical edge), in radians.
- Return type:
- classmethod reset_float_spring_state(spring_state) FloatSpringState ¶
Resets the state of a float spring
- Parameters:
spring_state (FloatSpringState) –
- Returns:
spring_state (FloatSpringState):
- Return type:
- classmethod reset_quaternion_spring_state(spring_state) QuaternionSpringState ¶
Resets the state of a quaternion spring
- Parameters:
spring_state (QuaternionSpringState) –
- Returns:
spring_state (QuaternionSpringState):
- Return type:
- classmethod reset_random_stream(stream) None ¶
Reset a random stream
- Parameters:
stream (RandomStream) –
- classmethod reset_vector_spring_state(spring_state) VectorSpringState ¶
Resets the state of a vector spring
- Parameters:
spring_state (VectorSpringState) –
- Returns:
spring_state (VectorSpringState):
- Return type:
- classmethod rgb_linear_to_hsv(rgb) LinearColor ¶
Converts a RGB linear color to HSV (where H is in R, S is in G, and V is in B)
- Parameters:
rgb (LinearColor) –
- Return type:
- classmethod rgb_to_hsv(color) -> (h=float, s=float, v=float, a=float)¶
Breaks apart a color into individual HSV components (as well as alpha) (Hue is [0..360) while Saturation and Value are 0..1)
- Parameters:
color (LinearColor) –
- Returns:
h (float):
s (float):
v (float):
a (float):
- Return type:
tuple
- classmethod rgb_to_hsv_vector(rgb) LinearColor ¶
Converts a RGB linear color to HSV (where H is in R (0..360), S is in G (0..1), and V is in B (0..1))
- Parameters:
rgb (LinearColor) –
- Returns:
hsv (LinearColor):
- Return type:
- classmethod rot_rand(roll: bool = False) Rotator ¶
deprecated: ‘rot_rand’ was renamed to ‘random_rotator’.
- classmethod rot_rand_from_stream(stream: RandomStream, roll: bool) Rotator ¶
deprecated: ‘rot_rand_from_stream’ was renamed to ‘random_rotator_from_stream’.
- classmethod rotate_angle_axis(vect, angle_deg, axis) Vector ¶
Returns result of vector A rotated by AngleDeg around Axis
- classmethod rotator_from_axis_and_angle(axis, angle) Rotator ¶
Create a rotation from an this axis and supplied angle (in degrees)
- classmethod round(a) int32 ¶
Rounds A to the nearest integer (e.g., -1.6 becomes -2 and 1.6 becomes 2)
- Parameters:
a (double) –
- Return type:
int32
- classmethod round64(a) int64 ¶
Rounds A to the nearest integer (e.g., -1.6 becomes -2 and 1.6 becomes 2)
- Parameters:
a (double) –
- Return type:
int64
- classmethod safe_divide(a, b) double ¶
This functions returns 0 if B (the denominator) is zero
- Parameters:
a (double) –
b (double) –
- Return type:
double
- classmethod seed_random_stream(stream) RandomStream ¶
Create a new random seed for a random stream
- Parameters:
stream (RandomStream) –
- Returns:
stream (RandomStream):
- Return type:
- classmethod select_class(a, b, select_a)¶
If bPickA is true, A is returned, otherwise B is
- classmethod select_color(a, b, pick_a) LinearColor ¶
If bPickA is true, A is returned, otherwise B is
- Parameters:
a (LinearColor) –
b (LinearColor) –
pick_a (bool) –
- Return type:
- classmethod select_float(a, b, pick_a) double ¶
If bPickA is true, A is returned, otherwise B is
- Parameters:
a (double) –
b (double) –
pick_a (bool) –
- Return type:
double
- classmethod select_int(a, b, pick_a) int32 ¶
If bPickA is true, A is returned, otherwise B is
- Parameters:
a (int32) –
b (int32) –
pick_a (bool) –
- Return type:
int32
- classmethod select_transform(a, b, pick_a) Transform ¶
If bPickA is true, A is returned, otherwise B is
- classmethod set_float_spring_state_velocity(spring_state, velocity) FloatSpringState ¶
Sets the state velocity of a float spring
- Parameters:
spring_state (FloatSpringState) –
velocity (float) –
- Returns:
spring_state (FloatSpringState):
- Return type:
- classmethod set_quaternion_spring_state_angular_velocity(spring_state, angular_velocity) QuaternionSpringState ¶
Sets the state angular velocity of a quaternion spring
- Parameters:
spring_state (QuaternionSpringState) –
angular_velocity (Vector) –
- Returns:
spring_state (QuaternionSpringState):
- Return type:
- classmethod set_random_stream_seed(stream, new_seed) RandomStream ¶
Set the seed of a random stream to a specific number
- Parameters:
stream (RandomStream) –
new_seed (int32) –
- Returns:
stream (RandomStream):
- Return type:
- classmethod set_vector_spring_state_velocity(spring_state, velocity) VectorSpringState ¶
Sets the state velocity of a vector spring
- Parameters:
spring_state (VectorSpringState) –
velocity (Vector) –
- Returns:
spring_state (VectorSpringState):
- Return type:
- classmethod sign_of_float(a) double ¶
Sign (float, returns -1 if A < 0, 0 if A is zero, and +1 if A > 0)
- Parameters:
a (double) –
- Return type:
double
- classmethod sign_of_integer(a) int32 ¶
Sign (integer, returns -1 if A < 0, 0 if A is zero, and +1 if A > 0)
- Parameters:
a (int32) –
- Return type:
int32
- classmethod sign_of_integer64(a) int64 ¶
Sign (integer64, returns -1 if A < 0, 0 if A is zero, and +1 if A > 0)
- Parameters:
a (int64) –
- Return type:
int64
- classmethod sin(a) double ¶
Returns the sine of A (expects Radians)
- Parameters:
a (double) –
- Return type:
double
- classmethod spherical2d_to_unit_cartesian(a) Vector ¶
Converts spherical coordinates on the unit sphere into a Cartesian unit length vector.
- classmethod sqrt(a) double ¶
Returns square root of A
- Parameters:
a (double) –
- Return type:
double
- classmethod square(a) double ¶
Returns square of A (A*A)
- Parameters:
a (double) –
- Return type:
double
- classmethod subtract_byte_byte(a, b=1) uint8 ¶
Subtraction (A - B)
- Parameters:
a (uint8) –
b (uint8) –
- Return type:
uint8
- classmethod subtract_double_double(a, b=1.000000) double ¶
Subtraction (A - B)
- Parameters:
a (double) –
b (double) –
- Return type:
double
- classmethod subtract_float_float(a: float, b: float = 1.0) float ¶
deprecated: ‘subtract_float_float’ was renamed to ‘subtract_double_double’.
- classmethod subtract_int64_int64(a, b=1) int64 ¶
Subtraction (A - B)
- Parameters:
a (int64) –
b (int64) –
- Return type:
int64
- classmethod subtract_int_int(a, b=1) int32 ¶
Subtraction (A - B)
- Parameters:
a (int32) –
b (int32) –
- Return type:
int32
- classmethod subtract_linear_color_linear_color(a, b) LinearColor ¶
Element-wise subtraction of two linear colors (R-R, G-G, B-B, A-A)
- Parameters:
a (LinearColor) –
b (LinearColor) –
- Return type:
- classmethod subtract_vector2d_vector2d(a, b) Vector2D ¶
Returns subtraction of Vector B from Vector A (A - B)
- classmethod subtract_vector4_vector4(a, b) Vector4 ¶
Returns subtraction of Vector B from Vector A (A - B)
- classmethod t_interp_to(current, target, delta_time, interp_speed) Transform ¶
Tries to reach Target transform based on distance from Current position, giving a nice smooth feeling when tracking a position.
- classmethod t_lerp(a, b, alpha, interp_mode=LerpInterpolationMode.QUAT_INTERP) Transform ¶
Linearly interpolates between A and B based on Alpha (100% of A when Alpha=0 and 100% of B when Alpha=1).
- Parameters:
a (Transform) –
b (Transform) –
alpha (float) –
interp_mode (LerpInterpolationMode) –
- Return type:
- classmethod tan(a) double ¶
Returns the tan of A (expects Radians)
- Parameters:
a (double) –
- Return type:
double
- classmethod timespan_from_string(timespan_string) Timespan or None ¶
Converts a time span string to a Timespan object
- classmethod timespan_ratio(a, b) float ¶
Returns the ratio between two time spans (A / B), handles zero values
- classmethod to_direction_and_length2d(a) -> (out_dir=Vector2D, out_length=double)¶
Util to convert this vector into a unit direction vector and its original length.
- Parameters:
a (Vector2D) –
- Returns:
out_dir (Vector2D): Reference passed in to store unit direction vector.
out_length (double): Reference passed in to store length of the vector.
- Return type:
tuple
- classmethod to_rounded2d(a) Vector2D ¶
Get this vector as a vector where each component has been rounded to the nearest int.
- classmethod to_sign2d(a) Vector2D ¶
Get a copy of the vector as sign only. Each component is set to +1 or -1, with the sign of zero treated as +1.
- classmethod transform_determinant(transform) float ¶
Calculates the determinant of the transform (converts to FMatrix internally)
- classmethod transform_direction(t, direction) Vector ¶
Transform a direction vector by the supplied transform - will not change its length. For example, if T was an object’s transform, this would transform a direction from local space to world space.
- classmethod transform_location(t, location) Vector ¶
Transform a position by the supplied transform. For example, if T was an object’s transform, this would transform a position from local space to world space.
- classmethod transform_position(t: Transform, location: Vector) Vector ¶
deprecated: ‘transform_position’ was renamed to ‘transform_location’.
- classmethod transform_rotation(t, rotation) Rotator ¶
Transform a rotator by the supplied transform. For example, if T was an object’s transform, this would transform a rotation from local space to world space.
- classmethod transform_vector4(matrix, vec4) Vector4 ¶
Transform the input vector4 by a provided matrix4x4 and returns the resulting vector4.
- classmethod v_interp_to(current, target, delta_time, interp_speed) Vector ¶
Tries to reach Target based on distance from Current position, giving a nice smooth feeling when tracking a position.
- classmethod v_interp_to_constant(current, target, delta_time, interp_speed) Vector ¶
Tries to reach Target at a constant rate.
- classmethod v_lerp(a, b, alpha) Vector ¶
Linearly interpolates between A and B based on Alpha (100% of A when Alpha=0 and 100% of B when Alpha=1)
- classmethod v_rand_from_stream(stream: RandomStream) Vector ¶
deprecated: ‘v_rand_from_stream’ was renamed to ‘random_unit_vector_from_stream’.
- classmethod v_size(a) double ¶
Returns the length of the vector
- Parameters:
a (Vector) –
- Return type:
double
- classmethod v_size2d(a) double ¶
Returns the length of a 2D Vector.
- Parameters:
a (Vector2D) –
- Return type:
double
- classmethod v_size2d_squared(a) double ¶
Returns the squared length of a 2D Vector.
- Parameters:
a (Vector2D) –
- Return type:
double
- classmethod v_size_squared(a) double ¶
Returns the squared length of the vector
- Parameters:
a (Vector) –
- Return type:
double
- classmethod v_size_xy(a) double ¶
Returns the length of the vector’s XY components.
- Parameters:
a (Vector) –
- Return type:
double
- classmethod v_size_xy_squared(a) double ¶
Returns the squared length of the vector’s XY components.
- Parameters:
a (Vector) –
- Return type:
double
- classmethod vector2d_interp_to(current, target, delta_time, interp_speed) Vector2D ¶
Tries to reach Target based on distance from Current position, giving a nice smooth feeling when tracking a position.
- classmethod vector2d_interp_to_constant(current, target, delta_time, interp_speed) Vector2D ¶
Tries to reach Target at a constant rate.
- classmethod vector4_cross_product3(a, b) Vector4 ¶
Returns the cross product of two vectors - see http://mathworld.wolfram.com/CrossProduct.html
- classmethod vector4_dot_product(a, b) double ¶
Returns the dot product of two vectors - see http://mathworld.wolfram.com/DotProduct.html
- classmethod vector4_dot_product3(a, b) double ¶
Returns the dot product of two vectors - see http://mathworld.wolfram.com/DotProduct.html The W element is ignored.
- classmethod vector4_is_nearly_zero3(a, tolerance=0.000100) bool ¶
Checks whether vector is near to zero within a specified tolerance. The W element is ignored.
- classmethod vector4_is_normal3(a) bool ¶
Determines if vector is normalized / unit (length 1). The W element is ignored.
- classmethod vector4_is_unit3(a, squared_lenth_tolerance=0.000100) bool ¶
Determines if vector is normalized / unit (length 1) within specified squared tolerance. The W element is ignored.
- classmethod vector4_mirror_by_vector3(direction, surface_normal) Vector4 ¶
Given a direction vector and a surface normal, returns the vector reflected across the surface normal. Produces a result like shining a laser at a mirror! The W element is ignored.
- classmethod vector4_negated(a) Vector4 ¶
Gets a negated copy of the vector. Equivalent to -Vector for scripts.
- classmethod vector4_normal3(a, tolerance=0.000100) Vector4 ¶
Gets a normalized unit copy of the vector, ensuring it is safe to do so based on the length. The W element is ignored and the returned vector has W=0. Returns zero vector if vector length is too small to safely normalize.
- classmethod vector4_normal_unsafe3(a) Vector4 ¶
Calculates normalized unit version of vector without checking for zero length. The W element is ignored and the returned vector has W=0.
- classmethod vector4_normalize3(a, tolerance=0.000000) Vector4 ¶
Normalize this vector in-place if it is large enough or set it to (0,0,0,0) otherwise. The W element is ignored and the returned vector has W=0.
- classmethod vector4_size(a) double ¶
Returns the length of the vector.
- Parameters:
a (Vector4) –
- Return type:
double
- classmethod vector4_size3(a) double ¶
Returns the length of the vector. The W element is ignored.
- Parameters:
a (Vector4) –
- Return type:
double
- classmethod vector4_size_squared(a) double ¶
Returns the squared length of the vector.
- Parameters:
a (Vector4) –
- Return type:
double
- classmethod vector4_size_squared3(a) double ¶
Returns the squared length of the vector. The W element is ignored.
- Parameters:
a (Vector4) –
- Return type:
double
- classmethod vector_add_bounded(a, add_vect, radius) Vector ¶
Add a vector to this and clamp the result to an axis aligned cube centered at the origin.
- classmethod vector_bounded_to_box(vect, box_min, box_max) Vector ¶
Get a copy of this vector, clamped inside of the specified axis aligned cube.
- classmethod vector_bounded_to_cube(vect, radius) Vector ¶
Get a copy of this vector, clamped inside of an axis aligned cube centered at the origin.
- classmethod vector_clamp_size2d(a, min, max) Vector ¶
Create a copy of this vector, with the 2D magnitude/size/length clamped between Min and Max. Z is unchanged.
- classmethod vector_clamp_size_max(a, max) Vector ¶
Create a copy of this vector, with its maximum magnitude/size/length clamped to MaxSize.
- classmethod vector_clamp_size_max2d(a, max) Vector ¶
Create a copy of this vector, with the maximum 2D magnitude/size/length clamped to MaxSize. Z is unchanged.
- classmethod vector_component_max(a, b) Vector ¶
Find the maximum elements (X, Y and Z) between the two vector’s components
- classmethod vector_component_min(a, b) Vector ¶
Find the minimum elements (X, Y and Z) between the two vector’s components
- classmethod vector_cosine_angle2d(a, b) double ¶
Returns the cosine of the angle between this vector and another projected onto the XY plane (no Z).
- classmethod vector_distance(v1, v2) double ¶
Distance between two points.
- classmethod vector_distance2d(v1, v2) double ¶
Euclidean distance between two points in the XY plane (ignoring Z).
- classmethod vector_distance2d_squared(v1, v2) double ¶
Squared euclidean distance between two points in the XY plane (ignoring Z).
- classmethod vector_distance_squared(v1, v2) double ¶
Squared distance between two points.
- classmethod vector_get_abs(a) Vector ¶
Get a copy of this vector with absolute value of each component.
- classmethod vector_get_abs_max(a) double ¶
Find the maximum absolute element (abs(X), abs(Y) or abs(Z)) of a vector
- Parameters:
a (Vector) –
- Return type:
double
- classmethod vector_get_abs_min(a) double ¶
Find the minimum absolute element (abs(X), abs(Y) or abs(Z)) of a vector
- Parameters:
a (Vector) –
- Return type:
double
- classmethod vector_get_sign_vector(a) Vector ¶
Get a copy of the vector as sign only. Each component is set to +1 or -1, with the sign of zero treated as +1.
- classmethod vector_heading_angle(a) double ¶
Convert a direction vector into a ‘heading’ angle.
- Parameters:
a (Vector) –
- Returns:
‘Heading’ angle between +/-PI radians. 0 is pointing down +X.
- Return type:
double
- classmethod vector_is_nearly_zero(a, tolerance=0.000100) bool ¶
Checks whether vector is near to zero within a specified tolerance.
- classmethod vector_is_uniform(a, tolerance=0.000100) bool ¶
Checks whether all components of this vector are the same, within a tolerance.
- classmethod vector_is_unit(a, squared_lenth_tolerance=0.000100) bool ¶
Determines if vector is normalized / unit (length 1) within specified squared tolerance.
- classmethod vector_normal2d(a, tolerance=0.000100) Vector ¶
Gets a normalized unit copy of the 2D components of the vector, ensuring it is safe to do so. Z is set to zero. Returns zero vector if vector length is too small to normalize.
- classmethod vector_normal_unsafe(a) Vector ¶
Calculates normalized unit version of vector without checking for zero length.
- classmethod vector_normalize(a, tolerance=0.000000) Vector ¶
Normalize this vector in-place if it is large enough or set it to (0,0,0) otherwise.
- classmethod vector_project_on_to_normal(v, normal) Vector ¶
Gets a copy of this vector projected onto the input vector, which is assumed to be unit length.
- classmethod vector_reciprocal(a) Vector ¶
Gets the reciprocal of this vector, avoiding division by zero. Zero components are set to BIG_NUMBER.
- classmethod vector_slerp_normals(normal_a, normal_b, alpha) Vector ¶
Interpolate from normalized vector A to normalized vector B along a spherical path.
- Parameters:
- Returns:
Vector after interpolating between A and B along a spherical path.
- Return type:
- classmethod vector_slerp_vector_to_direction(vector, direction, alpha) Vector ¶
Interpolate from a vector to the direction of another vector along a spherical path.
- Parameters:
- Returns:
Vector after interpolating between Vector and Direction along a spherical path. The magnitude will remain the length of the starting vector.
- Return type:
- classmethod vector_snapped_to_grid(vect, grid_size) Vector ¶
Gets a copy of this vector snapped to a grid.
- classmethod vector_spring_interp(current, target, spring_state, stiffness, critical_damping_factor, delta_time, mass=1.000000, target_velocity_amount=1.000000, clamp=False, min_value=[-1.000000, -1.000000, -1.000000], max_value=[1.000000, 1.000000, 1.000000], initialize_from_target=False) -> (Vector, spring_state=VectorSpringState)¶
Uses a simple spring model to interpolate a vector from Current to Target.
- Parameters:
current (Vector) – Current value
target (Vector) – Target value
spring_state (VectorSpringState) – Data related to spring model (velocity, error, etc..) - Create a unique variable per spring
stiffness (float) – How stiff the spring model is (more stiffness means more oscillation around the target value)
critical_damping_factor (float) – How much damping to apply to the spring (0 means no damping, 1 means critically damped which means no oscillation)
delta_time (float) – Time difference since the last update
mass (float) – Multiplier that acts like mass on a spring
target_velocity_amount (float) – If 1 then the target velocity will be calculated and used, which results following the target more closely/without lag. Values down to zero (recommended when using this to smooth data) will progressively disable this effect.
clamp (bool) – Whether to use the Min/Max values to clamp the motion
min_value (Vector) – Clamps the minimum output value and cancels the velocity if it reaches this limit
max_value (Vector) – Clamps the maximum output value and cancels the velocity if it reaches this limit
initialize_from_target (bool) – If set then the current value will be set from the target on the first update
- Returns:
spring_state (VectorSpringState): Data related to spring model (velocity, error, etc..) - Create a unique variable per spring
- Return type:
- classmethod vector_to_degrees(a) Vector ¶
Converts a vector containing radian values to a vector containing degree values.
- classmethod vector_to_radians(a) Vector ¶
Converts a vector containing degree values to a vector containing radian values.
- classmethod vector_unit_cartesian_to_spherical(a) Vector2D ¶
Converts a Cartesian unit vector into spherical coordinates on the unit sphere.
- classmethod vector_unwind_euler(a) Vector ¶
When this vector contains Euler angles (degrees), ensure that angles are between +/-180
- classmethod weighted_moving_average_f_rotator(current_sample, previous_sample, weight) Rotator ¶
Calculates the new value in a weighted moving average series using the previous value and the weight
- classmethod weighted_moving_average_f_vector(current_sample, previous_sample, weight) Vector ¶
Calculates the new value in a weighted moving average series using the previous value and the weight
- classmethod weighted_moving_average_float(current_sample, previous_sample, weight) float ¶
Calculates the new value in a weighted moving average series using the previous value and the weight
- classmethod wrap(value, min=0, max=100) int32 ¶
Returns Value between A and B (inclusive) that wraps around
- Parameters:
value (int32) –
min (int32) –
max (int32) –
- Return type:
int32
- classmethod xor_int64_int64(a, b) int64 ¶
Bitwise XOR (A ^ B)
- Parameters:
a (int64) –
b (int64) –
- Return type:
int64
- classmethod xor_int_int(a, b) int32 ¶
Bitwise XOR (A ^ B)
- Parameters:
a (int32) –
b (int32) –
- Return type:
int32