public copy()

in packages/sdk/src/actor/actor.ts [718:744]


	public copy(from: Partial<ActorLike>): this {
		// Pause change detection while we copy the values into the actor.
		const wasObserving = this.internal.observing;
		this.internal.observing = false;

		if (!from) { return this; }
		if (from.id) { this._id = from.id; }
		if (from.parentId) { this._parentId = from.parentId; }
		if (from.name) { this._name = from.name; }
		if (from.tag) { this._tag = from.tag; }
		if (from.exclusiveToUser || from.parentId) {
			this._exclusiveToUser = this.parent && this.parent.exclusiveToUser || from.exclusiveToUser;
		}
		if (from.owner) { this._owner = from.owner; }
		if (from.transform) { this._transform.copy(from.transform); }
		if (from.attachment) { this.attach(from.attachment.userId, from.attachment.attachPoint); }
		if (from.appearance) { this._appearance.copy(from.appearance); }
		if (from.light) { this.enableLight(from.light); }
		if (from.rigidBody) { this.enableRigidBody(from.rigidBody); }
		if (from.collider) { this._setCollider(from.collider); }
		if (from.text) { this.enableText(from.text); }
		if (from.lookAt) { this.enableLookAt(from.lookAt.actorId, from.lookAt.mode); }
		if (from.grabbable !== undefined) { this._grabbable = from.grabbable; }

		this.internal.observing = wasObserving;
		return this;
	}