-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Labels
bugSomething isn't workingSomething isn't workingenhancementNew feature or requestNew feature or request
Description
Note: ArMarkerControls is a dervied class from ArBaseControls
This happens because i implemented the code in this way
AR.js-threejs/src/ArBaseControls.ts
Lines 3 to 14 in 9c8e08b
| export class ArBaseControls extends EventDispatcher implements IArBaseControls { | |
| static id: number; | |
| private _id; | |
| protected object3d: Object3D; | |
| /** | |
| * THe ArBaseControls constructor, you need to pass a Theee.js Object3d to it. | |
| * @param object3d the Threejs Object3D to pass. | |
| */ | |
| constructor(object3d: Object3D) { | |
| super() | |
| this._id = ArBaseControls.id++; |
original AR.js code here:
const ArBaseControls = function (object3d) {
this.id = ArBaseControls.id++;
this.object3d = object3d;
this.object3d.matrixAutoUpdate = false;
this.object3d.visible = false;
// Events to honor
// this.dispatchEvent({ type: 'becameVisible' })
// this.dispatchEvent({ type: 'markerVisible' }) // replace markerFound
// this.dispatchEvent({ type: 'becameUnVisible' })
};
ArBaseControls.id = 0;https://github.com/AR-js-org/AR.js/blob/be7c9083df5a651c2ab978ddd7c1a33409c4d40b/three.js/src/threex/threex-arbasecontrols.js#L3-L16
I think this is a bad idea. The _id (should be re-named id) should simply be incremented and not added by the static id property. I will fix this.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingenhancementNew feature or requestNew feature or request