Skip to content

Commit

Permalink
👮‍♂️ Add camera type check, closes #45
Browse files Browse the repository at this point in the history
  • Loading branch information
marcofugaro committed Jan 30, 2023
1 parent 3e9aa7a commit d4a1aab
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/ProjectedMaterial.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ export default class ProjectedMaterial extends THREE.MeshPhysicalMaterial {
throw new Error('Invalid camera set to the ProjectedMaterial')
}

if (camera.type !== this.#camera.type) {
throw new Error(
'Cannot change camera type after the material has been created. Use another material.'
)
}

this.#camera = camera

this.#saveDimensions()
Expand Down

0 comments on commit d4a1aab

Please sign in to comment.