Version: Unity 6.3 Beta (6000.3)
LanguageEnglish
  • C#

PhysicsBody.GetPositionAndRotation3D

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public void GetPositionAndRotation3D(Transform transform, LowLevelPhysics2D.PhysicsWorld.TransformWriteMode transformWriteMode, LowLevelPhysics2D.PhysicsWorld.TransformPlane transformPlane, out Vector3 position, out Quaternion rotation);

Parameters

Parameter Description
transform The Transform object to be used as a reference when converting from 2D position/rotation to 3D position/rotation, usually the same as the TransformObject assigned to the PhysicsBody.
transformWriteMode The transform write mode to use, usually the one currently assigned to the world is used.
transformPlane The transform plane to use, usually the one currently assigned to the world is used.
position The calculated output position.
rotation The calculated output rotation.

Description

Get the full 3D position and rotation of the body given the specified TransformWriteMode and TransformPlane. Usually both the write-mode and transform-plane of the world the body is in would be used. This can only be called when a PhysicsBody.transformObject is assigned. Without this, an exception is thrown. See PhysicsWorld.transformWriteMode and PhysicsWorld.transformPlane.