Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


GetPositionAndRotation3D(Transform, TransformWriteMode, TransformPlane, out Vector3, out Quaternion)

Get the full 3D position and rotation of the body given the specified PhysicsWorld.TransformWriteMode and PhysicsWorld.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.
Read time 1 minuteLast updated 14 days ago

Definition

GetPositionAndRotation3D(Transform, TransformWriteMode, TransformPlane, Vector3, Quaternion)

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

Parameters

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.