unreal.Matrix
¶
- class unreal.Matrix(x_plane=[0.0, 0.0, 0.0, 0.0], y_plane=[0.0, 0.0, 0.0, 0.0], z_plane=[0.0, 0.0, 0.0, 0.0], w_plane=[0.0, 0.0, 0.0, 0.0])¶
Bases:
unreal.StructBase
A 4x4 matrix. note: The full C++ class is located here: EngineSourceRuntimeCorePublicMathMatrix.h
C++ Source:
Module: CoreUObject
File: NoExportTypes.h
Editor Properties: (see get_editor_property/set_editor_property)
w_plane
(Plane): [Read-Write] WPlanex_plane
(Plane): [Read-Write] XPlaney_plane
(Plane): [Read-Write] YPlanez_plane
(Plane): [Read-Write] ZPlane
- __add__(other)¶
Overloads:
Matrix
Gets the result of adding a matrix to this.@param Other The Matrix to add. @return The result of addition.
- __eq__(other)¶
Overloads:
Matrix
Checks whether another Matrix is equal to this, within specified tolerance.@param Other The other Matrix. @param Tolerance Error Tolerance. @return true if two Matrix are equal, within specified tolerance, otherwise false.
- __iadd__(other)¶
Overloads:
Matrix
Gets the result of adding a matrix to this.@param Other The Matrix to add. @return The result of addition.
- __imul__(other)¶
Overloads:
Matrix
Gets the result of multiplying a Matrix to this.@param Other The matrix to multiply this by. @return The result of multiplication.
float
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
- __mul__(other)¶
Overloads:
Matrix
Gets the result of multiplying a Matrix to this.@param Other The matrix to multiply this by. @return The result of multiplication.
float
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
- __ne__(other)¶
Overloads:
Matrix
Checks whether another Matrix is not equal to this, within specified tolerance.@param Other The other Matrix. @return true if two Matrix are not equal, within specified tolerance, otherwise false.
- concatenate_translation(translation) → Matrix¶
Returns a matrix with an additional translation concatenated. (Assumes Matrix represents a transform)
- equals(b, tolerance=0.0001) → bool¶
Checks whether another Matrix is equal to this, within specified tolerance.
- get_column(column) → Vector¶
get a column of this matrix
- Parameters
column (MatrixColumns) –
- Returns
vector of the column
- Return type
- get_frustum_bottom_plane() → Plane or None¶
Get the bottom plane of the Frustum of this matrix (Assumes Matrix represents a View Projection Matrix)
- get_frustum_far_plane() → Plane or None¶
Get the far plane of the Frustum of this matrix (Assumes Matrix represents a View Projection Matrix)
- get_frustum_left_plane() → Plane or None¶
Get the left plane of the Frustum of this matrix (Assumes Matrix represents a View Projection Matrix)
- get_frustum_near_plane() → Plane or None¶
Get the near plane of the Frustum of this matrix (Assumes Matrix represents a View Projection Matrix)
- get_frustum_right_plane() → Plane or None¶
Get the right plane of the Frustum of this matrix (Assumes Matrix represents a View Projection Matrix)
- get_frustum_top_plane() → Plane or None¶
Get the top plane of the Frustum of this matrix (Assumes Matrix represents a View Projection Matrix)
- get_matrix_without_scale(tolerance=0.0) → Matrix¶
Returns matrix after RemoveScaling with error Tolerance (Assumes Matrix represents a transform)
- get_maximum_axis_scale() → float¶
- Returns
the maximum magnitude of any row of the matrix. (Assumes Matrix represents a transform)
- Return type
- get_origin() → Vector¶
Get the origin of the co-ordinate system (Assumes Matrix represents a transform)
- Returns
co-ordinate system origin
- Return type
- get_rot_determinant() → float¶
- Returns
the determinant of rotation 3x3 matrix (Assumes Top Left 3x3 Submatrix represents a Rotation)
- Return type
- get_rotator() → Rotator¶
Get the rotator representation of this matrix (Assumes Matrix represents a transform)
- Returns
rotator representation of this matrix
- Return type
- get_scale_vector(tolerance=0.0) → 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)
- get_scaled_axes() -> (x=Vector, y=Vector, z=Vector)¶
get axes of this matrix scaled by the scale of the matrix (Assumes Matrix represents a transform)
- 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
- get_scaled_axis(axis) → Vector¶
get axis of this matrix scaled by the scale of the matrix (Assumes Matrix represents a transform)
- get_unit_axes() -> (x=Vector, y=Vector, z=Vector)¶
get unit length axes of this matrix (Assumes Matrix represents a transform)
- 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
- get_unit_axis(axis) → Vector¶
get unit length axis of this matrix (Assumes Matrix represents a transform)
- inverse_transform_position(v) → Vector¶
Inverts the matrix and then transforms V - correctly handles scaling in this matrix. (Assumes Matrix represents a transform)
- inverse_transform_vector(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)
- mirror(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)
- multiply_float(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
- not_equal(b, tolerance=0.0001) → bool¶
Checks whether another Matrix is not equal to this, within specified tolerance.
- remove_scaling(tolerance=0.0) → None¶
Remove any scaling from this matrix (ie magnitude of each row is 1) with error Tolerance (Assumes Matrix represents a transform)
- Parameters
tolerance (float) –
- remove_translation() → Matrix¶
Remove any translation from this matrix (Assumes Matrix represents a transform)
- Returns
- Return type
- rotator() → Rotator¶
Convert a Matrix to a Rotator (Assumes Matrix represents a transform)
- Returns
- Return type
- scale_translation(scale3d) → Matrix¶
Scale the translation part of the matrix by the supplied vector. (Assumes Matrix represents a transform)
- set_axis(axis, axis_vector) → None¶
set an axis of this matrix (Assumes Matrix represents a transform)
- set_column(column, value) → None¶
Matrix Set Column
- Parameters
column (MatrixColumns) –
value (Vector) –
- set_origin(new_origin) → None¶
Set the origin of the coordinate system to the given vector (Assumes Matrix represents a transform)
- Parameters
new_origin (Vector) –
- to_quat() → 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!
- Returns
- Return type
- transform() → Transform¶
Convert a Matrix to a Transform (Assumes Matrix represents a transform)
- Returns
- Return type
- transform_position(v) → Vector4¶
Transform a location - will take into account translation part of the FMatrix. (Assumes Matrix represents a transform)
- transform_vector(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)