Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature-basic-classes #1

Closed
wants to merge 7 commits into from
Closed

feature-basic-classes #1

wants to merge 7 commits into from

Conversation

kalwalt
Copy link
Member

@kalwalt kalwalt commented Dec 16, 2024

Testing basic classes

This pull request includes several changes to improve the AR.js core library, including updates to dependencies, class structures, and configuration files. The most important changes are grouped by theme below.

Dependency and Configuration Updates:

  • Updated the main field in package.json to reference dist/ARjs-core.js instead of dist/ar-core.js.
  • Moved dependencies to devDependencies and added worker-loader to devDependencies in package.json.

Class and Method Updates:

  • Renamed baseUrl to baseURL and added an addEventListener method in the Context class in src/arjs-context.js. [1] [2]
  • Added a new ArBaseControls class in src/threex-arbasecontrols.js and extended it in ArSmoothedControls class in src/threex-arsmoothedcontrols.js. [1] [2]
  • Added a new Anchor class in src/new-api/arjs-anchor.js.

Worker and Session Management:

  • Added a new worker script for handling NFT markers in src/arjs-markercontrols-nft.worker.js.
  • Commented out the import of three and removed sanity checks in the Session class in src/new-api/arjs-session.js. [1] [2]

Webpack Configuration:

  • Updated the output library name to ARjsCore and added a rule for handling worker files in webpack.config.js. [1] [2]I will try to implement the basic core classes without three.js to be imported in system-arjs.js (Aframe)

@kalwalt kalwalt self-assigned this Dec 16, 2024
@kalwalt kalwalt added the enhancement New feature or request label Dec 16, 2024
@kalwalt
Copy link
Member Author

kalwalt commented Dec 22, 2024

With this code i tried to partially remove Threee.js code, You can see that i imported gl-matrix and converted the code using this library instead. Anyway for the multiple three.js instance issue occuring with aframe-ar.js this is not needed, the solution i think is as i written in #2 is to avoid importing three.js in the project. So we have to develop the basic classes without import three.js. Let say we have arjs-core-context.js that do not import three.js and then we import the context class into arjs-context.js file while importing three.js:

// inside arjs-core-context.js
// note we don't import three.js here...

export default class Context {

// all the code of the Context class with three.js
}

// inside arjs-context.js
import * as THREE from 'three'
import Context as _Context from './arjs-core-context.js

export default class Context;

@kalwalt
Copy link
Member Author

kalwalt commented Dec 23, 2024

Based on what was said in the previous comment i think the code in this PR shouldn't be merged. Anyway the classes implemented are that needed to be imported in system-arjs.js (Aframe) and related code. I will use as reference but i will close it to recreate another one from the main branch.

@kalwalt kalwalt closed this Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant