Skip to content

Commit

Permalink
Fix teleport node target (BabylonJS#14529)
Browse files Browse the repository at this point in the history
  • Loading branch information
deltakosh authored Nov 16, 2023
1 parent ad37093 commit 9287342
Showing 1 changed file with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,32 @@ export class NodeMaterialTeleportInBlock extends NodeMaterialBlock {
return this._endpoints;
}

/**
* Gets or sets the target of the block
*/
public get target() {
const input = this._inputs[0];
if (input.isConnected) {
const block = input.connectedPoint!.ownerBlock;
if (block.target !== NodeMaterialBlockTargets.VertexAndFragment) {
return block.target;
}

if (input.connectedPoint!.target !== NodeMaterialBlockTargets.VertexAndFragment) {
return input.connectedPoint!.target;
}
}

return this._target;
}

public set target(value: NodeMaterialBlockTargets) {
if ((this._target & value) !== 0) {
return;
}
this._target = value;
}

/**
* Create a new NodeMaterialTeleportInBlock
* @param name defines the block name
Expand Down

0 comments on commit 9287342

Please sign in to comment.