Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


GetRelativePose2D

Get the relative transformation pose (translation, rotation and scale) between the two specified transform matrix using the specified transform plane to transform into 2D space.
Read time 1 minuteLast updated 12 days ago

Definition

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

GetRelativePose2D(Matrix4x4, Matrix4x4, TransformPlane, TransformPlaneCustom, Vector2, float, Vector2)

Get the relative transformation pose (translation, rotation and scale) between the two specified transform matrix using the specified transform plane to transform into 2D space.
public static void GetRelativePose2D(in Matrix4x4 transformFrom, in Matrix4x4 transformTo, PhysicsWorld.TransformPlane transformPlane, in PhysicsWorld.TransformPlaneCustom transformPlaneCustom, out Vector2 translation, out float rotation, out Vector2 scale)

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).

translation

The 2D relative translation.

rotation

The 2D relative rotation.

scale

The 2D relative scale. Scale is not relative and always uses the transformTo lossyScale.

GetRelativePose2D(Matrix4x4, Matrix4x4, PhysicsWorld, Vector2, float, Vector2)

Get the relative transformation pose (translation, rotation and scale) between the two specified transform matrix using the specified world's transform plane to transform into 2D space.
public static void GetRelativePose2D(in Matrix4x4 transformFrom, in Matrix4x4 transformTo, PhysicsWorld world, out Vector2 translation, out float rotation, out Vector2 scale)

Parameters

transformFrom

The transform used as a reference to transform from.

transformTo

The transform used as a reference to transform to.

The world whose transform plane is used.

translation

The 2D relative translation.

rotation

The 2D relative rotation.

scale

The 2D relative scale. Scale is not relative and always uses the transformTo lossyScale.