pex-gl / pex-renderer

Physically based renderer (PBR) and scene graph for PEX.
https://pex-gl.github.io/pex-renderer/examples/index.html
MIT License
234 stars 16 forks source link

Geometry.set(falsyValue) throws an error #245

Closed dmnsgn closed 1 year ago

dmnsgn commented 4 years ago

Trying to get ctx from null

Geometry.prototype.set = function(opts) {
  const ctx = opts.ctx || this.ctx

Solution: default to opts = {}

vorg commented 4 years ago

What's the default parameters support in the browsers?

When would you call geometry.set(null) ?

dmnsgn commented 4 years ago

Pretty good: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Default_parameters#Browser_compatibility

geometry.set(null) unintentionally of course in Nodes. But could be used to clean buffers pr something maybe (thinking out loud)?

dmnsgn commented 1 year ago

v4 components don't have .set() anymore.