Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


GetRelativeMatrix2D(in Matrix4x4, in Matrix4x4, TransformPlane, in TransformPlaneCustom, bool)

Get the relative transformation matrix between the two specified transform matrix using the specified transform plane to transform into 2D space i.e. XY position and Z rotation.
Read time 1 minuteLast updated 14 days ago

Definition

  • Type: Method
  • Namespace: Unity.U2D.Physics
  • Assembly: UnityEngine.PhysicsCore2DModule

GetRelativeMatrix2D(Matrix4x4, Matrix4x4, TransformPlane, TransformPlaneCustom, bool)

public static Matrix4x4 GetRelativeMatrix2D(in Matrix4x4 transformFrom, in Matrix4x4 transformTo, PhysicsWorld.TransformPlane transformPlane, in PhysicsWorld.TransformPlaneCustom transformPlaneCustom, bool useScale = true)

Parameters

transformFrom

The transform used as a reference to transform from.

transformTo

The transform used as a reference to transform to.

transformPlane

The transform plane to use.

transformPlaneCustom

The custom transform plane to use (if required).

useScale

If the returned matrix should include scale. Scale is not relative and always uses the transformTo lossyScale.

Returns

Type

Description

Matrix4x4The calculated relative transformation matrix.