getWorldPosition method

Vector3 getWorldPosition(
  1. Vector3? target
)
inherited

target — the result will be copied into this Vector3.

Returns a vector representing the position of the object in world space.

Implementation

Vector3 getWorldPosition(Vector3? target) {
  if (target == null) {
    console.error('Object3D: .getWorldPosition() target is now required');
    target = Vector3.zero();
  }

  updateWorldMatrix(true, false);
  target.setFromMatrixPosition(matrixWorld);
  return target;
}