ドキュメント

Unity Engine

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. The transform to transform from is reduced to its position on the plane and its rotation about the plane normal, the two values a physics body is built from, so its scale and any rotation off the plane do not affect the result. The transform to transform to is described as it is seen on the plane, the same way PhysicsMath.GetRelativeMatrix2D places it.
読み終わるまでの所要時間 2 分最終更新 3日前

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. The transform to transform from is reduced to its position on the plane and its rotation about the plane normal, the two values a physics body is built from, so its scale and any rotation off the plane do not affect the result. The transform to transform to is described as it is seen on the plane, the same way PhysicsMath.GetRelativeMatrix2D places it.
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 direction transformTo's X axis points on the plane, relative to transformFrom, in radians.

scale

The lengths of transformTo's X and Y axes as seen on the plane, with a negative Y when it appears mirrored. Scale is not relative.

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.