文档

Unity Engine

Unity Engine

ToRotation2D

Transform a 3D rotation into a 2D angle using the selected transform plane.
阅读时间1 分钟最后更新于 4 天前

Definition

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

ToRotation2D(Quaternion, TransformPlane, TransformPlaneCustom)

Transform a 3D rotation into a 2D angle using the selected transform plane.
public static float ToRotation2D(Quaternion rotation, PhysicsWorld.TransformPlane transformPlane, in PhysicsWorld.TransformPlaneCustom transformPlaneCustom)

Parameters

rotation

The 3D rotation to transform.

transformPlane

The transform plane to use.

transformPlaneCustom

The custom transform plane, used when transformPlane is TransformPlane.Custom.

Returns

Type

Description

floatThe transformed rotation in radians.

ToRotation2D(Quaternion, TransformPlane)

Transform a 3D rotation into a 2D angle using the selected transform plane.
public static float ToRotation2D(Quaternion quaternion, PhysicsWorld.TransformPlane transformPlane = TransformPlane.XY)

Parameters

quaternion

The 3D rotation to transform.

transformPlane

The transform plane to use.

Returns

Type

Description

floatThe transformed rotation in radians.

ToRotation2D(Quaternion, PhysicsWorld)

Transform a 3D rotation into a 2D angle using the specified world's transform plane.
public static float ToRotation2D(Quaternion rotation, PhysicsWorld world)

Parameters

rotation

The 3D rotation to transform.

The world whose transform plane is used.

Returns

Type

Description

floatThe transformed rotation in radians.

ToRotation2D(Transform, PhysicsWorld)

Transform a Transform's world rotation into a 2D angle using the specified world's transform plane.
public static float ToRotation2D(Transform transform, PhysicsWorld world)

Parameters

transform

The Transform whose world rotation is transformed.

The world whose transform plane is used.

Returns

Type

Description

floatThe transformed rotation in radians.