position property

Vector3 get position

This node's position relative to its parent.

The getter returns a copy, so editing it does not move the node, and debug builds throw on such an edit. Assign to move the node (node.position = Vector3(0, 1, 0), or node.position += ...). Setting leaves rotation and scale alone.

Implementation

Vector3 get position {
  assert(_debugCheckTransformHandouts());
  final trs = _localTransformTrs;
  final value = trs != null
      ? trs.translation.clone()
      : _localTransform.getTranslation();
  assert(_debugRecordHandout('position', value, value.clone()));
  return value;
}
set position (Vector3 value)

Implementation

set position(Vector3 value) {
  assert(_debugForgetHandout('position'));
  _localTransformTrs?.translation.setFrom(value);
  _localTransform.setTranslation(value);
  markTransformDirty();
}