기술 자료

Unity Engine

Unity Engine

ToPositionAndNormal(out Vector2, out Vector2)

Decompose the plane into a point lying on the plane and the plane's normal direction. The position is the point on the plane closest to the world origin.
읽는 시간 1분최근 업데이트: 9일 전

Definition

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

ToPositionAndNormal(Vector2, Vector2)

public readonly void ToPositionAndNormal(out Vector2 position, out Vector2 normal)

Parameters

position

The point on the plane closest to the world origin.

normal

The plane normal, the same as PhysicsPlane.normal.

Remarks

Use this to pass a plane to APIs that take a position and a normal, such as PhysicsBody.BuoyancyInput.surfacePosition and PhysicsBody.BuoyancyInput.surfaceNormal.