AR.js-threejs icon indicating copy to clipboard operation
AR.js-threejs copied to clipboard

Removing inject `_this` object.

Open kalwalt opened this issue 2 years ago • 1 comments

In various part of the code we can found var _this = this because otherwise the this object is unvailable, because the use of nested functions example in ArToolkitContext in the init function: https://github.com/AR-js-org/AR.js-threejs/blob/9c8e08bac13f921d513c91451a32fcd006a32715/src/ArToolkitContext.ts#L138 and then after: https://github.com/AR-js-org/AR.js-threejs/blob/9c8e08bac13f921d513c91451a32fcd006a32715/src/ArToolkitContext.ts#L144-L153 maybe we can rewrite these functions?

kalwalt avatar Jan 25 '23 18:01 kalwalt

maybe intead of using the _this variable trick we can use bind() ?

kalwalt avatar Mar 29 '24 16:03 kalwalt