AR-js-org / AR.js-threejs

An experimental Typescript module for AR.js
MIT License
30 stars 2 forks source link

ArBaseControls should be an abstract class? #6

Closed kalwalt closed 3 months ago

kalwalt commented 1 year ago

ArBaseControls in the original repository: https://github.com/AR-js-org/AR.js/blob/master/three.js/src/threex/threex-arbasecontrols.js#L1-L38 See this two lines of code:

//////////////////////////////////////////////////////////////////////////////
//      Functions
//////////////////////////////////////////////////////////////////////////////
/**
 * error catching function for update()
 */
ArBaseControls.prototype.update = function () {
  console.assert(false, "you need to implement your own update");
};

/**
 * error catching function for name()
 */
ArBaseControls.prototype.name = function () {
  console.assert(false, "you need to implement your own .name()");
  return "Not yet implemented - name()";
};

https://github.com/AR-js-org/AR.js/blob/be7c9083df5a651c2ab978ddd7c1a33409c4d40b/three.js/src/threex/threex-arbasecontrols.js#L26-L36 This suggest me that ArBaseControls should be an abstract class and these two methods virtual to be implemented in ArMarkerControls.

kalwalt commented 3 months ago

This was done in PR #12