Skip to content

Commit bbd5434

Browse files
committed
Merge branch 'dev' into features-other-classes
2 parents 4a391eb + 7ddc08c commit bbd5434

File tree

14 files changed

+64
-19
lines changed

14 files changed

+64
-19
lines changed

README.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,28 @@
11
# AR.js-threejs
22

3-
Testing repository for the AR.js core module. I'm converting AR.js code to the Typescript langauge but providing the same classes and structures as much as possible.
3+
Testing repository for the AR.js core module. I'm converting AR.js code to the Typescript language but providing the same classes and structures as much as possible.
4+
The module export two namespaces as in the old implementation: **THREEx** and **ARjs**.
5+
6+
## List of classes in the namespaces
7+
### THREEx:
8+
- [x] ArBaseControls
9+
- [x] ArClickability
10+
- [x] ArMarkerCloak
11+
- [x] ArMarkerHelper
12+
- [x] ArMarkerControls
13+
- [x] ArSmoothedControls
14+
- [x] ArToolkitContext
15+
- [x] ArToolkitSource
16+
- [x] ArToolkitProfile
17+
- [x] ArVideoinwebgl
18+
- [x] HittestingPlane
19+
20+
### ARjs:
21+
22+
- [x] Source
23+
- [x] Context
24+
- [x] Profile
25+
- [x] Utils
426

527
## Examples
6-
For now, you can find one **example** in vanilla JS and another one in Typescript in the **example-ts** folder. More examples will be added in a near future.
28+
For now, you can find two vanilla JS examples in the **examples** folder and another one in Typescript in the **example-ts** folder. More examples will be added in a near future.

dist/ar.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example-ts/dist/bundle.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example-ts/package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example-ts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "example-ts",
3-
"version": "0.1.0",
3+
"version": "0.2.0",
44
"description": "simple ar.js-threejs typescript example",
55
"main": "index.ts",
66
"scripts": {

examples/basic.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<body style='font-family: Monospace;'>
1010
<div style='position: absolute; top: 10px; width:100%; text-align: center; z-index: 1;'>
11-
<a href="https://github.com/AR-js-org/AR.js/" target="_blank">AR.js</a> - three.js camera transform
11+
<a href="https://github.com/AR-js-org/AR.js-threejs/" target="_blank">AR.js</a> - three.js camera transform
1212
<br />
1313
Contact me any time at <a href='https://twitter.com/nicolocarp' target='_blank'>@nicolocarp</a>
1414
</div>

package-lock.json

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ar-js-org/ar.js-threejs",
3-
"version": "0.1.1",
3+
"version": "0.2.0",
44
"description": "AR.js (THREEx, ARjs) modular package - Typescript version",
55
"main": "dist/ar.js",
66
"types": "types/index.d.ts",

src/ArMarkerCloak.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,8 @@ export class ArMarkerCloak {
173173
opacity: 0.5,
174174
side: THREE.DoubleSide,
175175
});
176-
var geometry = new THREE.PlaneGeometry(1, 1);
177-
var orthoMesh = new THREE.Mesh(geometry, material);
176+
var ortoGeometry = new THREE.PlaneGeometry(1, 1);
177+
var orthoMesh = new THREE.Mesh(ortoGeometry, material);
178178
this.orthoMesh = orthoMesh;
179179
//return;
180180
}

src/ArToolkitContext.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export class ArToolkitContext implements IArToolkitContext {
114114
removeEventListener = EventDispatcher.prototype.removeEventListener;
115115

116116
static baseURL = "https://ar-js-org.github.io/AR.js/three.js/";
117-
static REVISION = "3.4.3-threejs-0.1.1";
117+
static REVISION = "3.4.3-threejs-0.2.0";
118118

119119
/**
120120
* Create a default Camera

src/CommonInterfaces/THREEx-interfaces.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,15 @@ export interface IDefaultMarkerParameters {
9797
markersAreaEnabled: boolean
9898
}
9999

100+
export interface ISmoothedControlsParameters {
101+
lerpPosition: number,
102+
lerpQuaternion: number,
103+
lerpScale: number,
104+
lerpStepDelay: number,
105+
minVisibleDelay: number,
106+
minUnvisibleDelay: number
107+
}
108+
100109
export interface ISourceParameters {
101110
sourceType?: string,
102111
sourceUrl?: string,

src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ import { HitTestingPlane as _HitTestingPlane } from "./HitTestingPlane";
1111
import { Context as _Context } from "./Context";
1212
import { Profile as _Profile } from "./Profile";
1313
import { Source as _Source } from "./Source";
14-
1514
import { Anchor as _Anchor } from "./new-api/Anchor";
1615
import { Session as _Session } from "./new-api/Session";
1716
import { SessionDebugUI as _SessionDebugUI } from "./new-api/SessionDebugUI";
1817
import { AnchorDebugUI as _AnchorDebugUI } from "./new-api/SessionDebugUI";
1918
import { Utils as _Utils } from "./new-api/Utils";
2019
import { HitTesting as _HitTesting } from "./new-api/HitTesting";
2120

21+
2222
export namespace THREEx {
2323
export const ArClickability = _ArClickability;
2424
export const ArSmoothedControls = _ArSmoothedControls;
@@ -34,6 +34,7 @@ export namespace THREEx {
3434

3535
export namespace ARjs {
3636
export const Anchor = _Anchor;
37+
export const Context = _Context;
3738
export const Profile = _Profile;
3839
export const Session = _Session;
3940
export const SessionDebugUI = _SessionDebugUI;

types/CommonInterfaces/THREEx-interfaces.d.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ export interface IArSmoothedControls {
1313
parameters: ISmoothedControlsParameters;
1414
update(targetObject3d: any): void;
1515
}
16+
export interface IArSmoothedControls {
17+
parameters: ISmoothedControlsParameters;
18+
update(targetObject3d: any): void;
19+
}
1620
export interface IArToolkitContext {
1721
parameters: IContextParameters;
1822
arController: any;
@@ -88,6 +92,14 @@ export interface IDefaultMarkerParameters {
8892
changeMatrixMode: string;
8993
markersAreaEnabled: boolean;
9094
}
95+
export interface ISmoothedControlsParameters {
96+
lerpPosition: number;
97+
lerpQuaternion: number;
98+
lerpScale: number;
99+
lerpStepDelay: number;
100+
minVisibleDelay: number;
101+
minUnvisibleDelay: number;
102+
}
91103
export interface ISourceParameters {
92104
sourceType?: string;
93105
sourceUrl?: string;

types/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export declare namespace THREEx {
2828
}
2929
export declare namespace ARjs {
3030
const Anchor: typeof _Anchor;
31+
const Context: typeof _ArToolkitContext;
3132
const Profile: typeof _ArToolkitProfile;
3233
const Session: typeof _Session;
3334
const SessionDebugUI: typeof _SessionDebugUI;

0 commit comments

Comments
 (0)