Sets the position and rotation of a given object.