@zappar/zappar-threejs
Advanced tools
Comparing version 0.3.8 to 0.3.11
# Changelog | ||
## [0.3.11] - 2021-04-07 | ||
- Updated ThreeJs to 0.127.0 | ||
### Fixed | ||
- Fallback to getInverse for threejs versions before 0.123.x | ||
## [0.3.9-0.3.10] - 2021-03-12 | ||
- @zappar/zappar-threejs-for-aframe is now deployed alongside @zappar/zappar-threejs | ||
## [0.3.8] - 2021-03-08 | ||
@@ -4,0 +14,0 @@ |
@@ -1,3 +0,2 @@ | ||
import * as THREE from "three"; | ||
import { WebGLRenderer } from "three"; | ||
import { THREE } from "./three"; | ||
import * as Zappar from "@zappar/zappar"; | ||
@@ -29,3 +28,3 @@ import { InstantWorldAnchor } from "@zappar/zappar/lib/instantworldtracker"; | ||
pipeline: Zappar.Pipeline; | ||
backgroundTexture: THREE.Texture; | ||
backgroundTexture: import("three").Texture; | ||
rawPose: Float32Array; | ||
@@ -50,3 +49,3 @@ poseMode: CameraPoseMode; | ||
get currentMirrorMode(): CameraMirrorMode; | ||
updateFrame(renderer: WebGLRenderer): void; | ||
updateFrame(renderer: THREE.WebGLRenderer): void; | ||
updateMatrixWorld(force?: boolean): void; | ||
@@ -53,0 +52,0 @@ private _getOriginPose; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Camera = exports.CameraMirrorMode = exports.CameraPoseMode = void 0; | ||
const THREE = require("three"); | ||
const three_1 = require("./three"); | ||
const Zappar = require("@zappar/zappar"); | ||
@@ -19,6 +19,6 @@ const defaultpipeline_1 = require("./defaultpipeline"); | ||
})(CameraMirrorMode = exports.CameraMirrorMode || (exports.CameraMirrorMode = {})); | ||
class Camera extends THREE.Camera { | ||
class Camera extends three_1.THREE.Camera { | ||
constructor(opts) { | ||
super(); | ||
this.backgroundTexture = new THREE.Texture(); | ||
this.backgroundTexture = new three_1.THREE.Texture(); | ||
this.poseMode = CameraPoseMode.Default; | ||
@@ -31,4 +31,4 @@ this.rearCameraMirrorMode = CameraMirrorMode.None; | ||
this._hasSetCSSScaleX = false; | ||
this._emptyScene = new THREE.Scene(); | ||
this._emptyTarget = new THREE.WebGLRenderTarget(2, 2); | ||
this._emptyScene = new three_1.THREE.Scene(); | ||
this._emptyTarget = new three_1.THREE.WebGLRenderTarget(2, 2); | ||
// use pipeline from option/inside option object, else construct one | ||
@@ -52,3 +52,3 @@ this.pipeline = opts instanceof Zappar.Pipeline ? opts : (opts === null || opts === void 0 ? void 0 : opts.pipeline) || defaultpipeline_1.getDefaultPipeline(); | ||
}); | ||
const immediate = new THREE.ImmediateRenderObject(new THREE.MeshBasicMaterial()); | ||
const immediate = new three_1.THREE.ImmediateRenderObject(new three_1.THREE.MeshBasicMaterial()); | ||
this._emptyScene.add(immediate); | ||
@@ -106,3 +106,3 @@ } | ||
else { | ||
this.projectionMatrix.getInverse(this.projectionMatrix); | ||
this.projectionMatrixInverse.getInverse(this.projectionMatrix); | ||
} | ||
@@ -144,6 +144,6 @@ // Get the pose of the camera from the Zappar library | ||
// texture on a fullscreen quad with 0,0 -> 1,1 UV coordinates | ||
const view = new THREE.Matrix4(); | ||
const view = new three_1.THREE.Matrix4(); | ||
view.fromArray(this.pipeline.cameraFrameTextureMatrix(r.domElement.width, r.domElement.height, this._currentMirrorMode === CameraMirrorMode.Poses)); | ||
// ThreeJS's Texture object uses a 3x3 matrix, so convert from our 4x4 matrix | ||
const textureMatrix3 = new THREE.Matrix3(); | ||
const textureMatrix3 = new three_1.THREE.Matrix3(); | ||
textureMatrix3.setFromMatrix4(view); | ||
@@ -150,0 +150,0 @@ textureMatrix3.elements[6] = view.elements[12]; |
@@ -1,2 +0,2 @@ | ||
import * as THREE from "three"; | ||
import { THREE } from "./three"; | ||
import { FaceTracker, FaceAnchor } from "@zappar/zappar"; | ||
@@ -3,0 +3,0 @@ import { Camera } from "./camera"; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.FaceAnchorGroup = void 0; | ||
const THREE = require("three"); | ||
const three_1 = require("./three"); | ||
const camera_1 = require("./camera"); | ||
class FaceAnchorGroup extends THREE.Group { | ||
class FaceAnchorGroup extends three_1.THREE.Group { | ||
constructor(_camera, faceTracker, anchorId) { | ||
@@ -8,0 +8,0 @@ super(); |
@@ -1,2 +0,2 @@ | ||
import * as THREE from "three"; | ||
import { THREE } from "./three"; | ||
import { FaceMesh, FaceAnchor } from "@zappar/zappar"; | ||
@@ -3,0 +3,0 @@ import { FaceAnchorGroup } from "./faceanchorgroup"; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.FaceBufferGeometry = void 0; | ||
const THREE = require("three"); | ||
const three_1 = require("three"); | ||
const three_1 = require("./three"); | ||
const facemeshloader_1 = require("./facemeshloader"); | ||
let faceMeshSingleton; | ||
class FaceBufferGeometry extends THREE.BufferGeometry { | ||
class FaceBufferGeometry extends three_1.THREE.BufferGeometry { | ||
constructor(faceMesh) { | ||
@@ -27,3 +26,3 @@ super(); | ||
return; | ||
this.setIndex(new THREE.Uint16BufferAttribute(this._faceMesh.indices, 1)); | ||
this.setIndex(new three_1.THREE.Uint16BufferAttribute(this._faceMesh.indices, 1)); | ||
this._hasSetIndices = true; | ||
@@ -36,3 +35,3 @@ } | ||
return; | ||
this.setAttribute("uv", new three_1.BufferAttribute(this._faceMesh.uvs, 2)); | ||
this.setAttribute("uv", new three_1.THREE.BufferAttribute(this._faceMesh.uvs, 2)); | ||
this._hasSetUVs = true; | ||
@@ -46,3 +45,3 @@ } | ||
if (!this._calculateNormals) { | ||
// TODO - deprecated | ||
// TODO - deprecated | ||
this.removeAttribute("normal"); | ||
@@ -70,3 +69,3 @@ delete this._normals; | ||
this._vertices = new Float32Array(this._faceMesh.vertices.length); | ||
this._verticesAttribute = new three_1.BufferAttribute(this._vertices, 3); | ||
this._verticesAttribute = new three_1.THREE.BufferAttribute(this._vertices, 3); | ||
this.setAttribute("position", this._verticesAttribute); | ||
@@ -82,3 +81,3 @@ } | ||
this._normals = new Float32Array(this._faceMesh.normals.length); | ||
this._normalsAttribute = new three_1.BufferAttribute(this._normals, 3); | ||
this._normalsAttribute = new three_1.THREE.BufferAttribute(this._normals, 3); | ||
this.setAttribute("normal", this._normalsAttribute); | ||
@@ -85,0 +84,0 @@ } |
@@ -1,2 +0,2 @@ | ||
import * as THREE from "three"; | ||
import { THREE } from "./three"; | ||
import { FaceTracker, FaceAnchor, FaceLandmarkName, FaceLandmark } from "@zappar/zappar"; | ||
@@ -3,0 +3,0 @@ import { Camera } from "./camera"; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.FaceLandmarkGroup = void 0; | ||
const THREE = require("three"); | ||
const three_1 = require("./three"); | ||
const zappar_1 = require("@zappar/zappar"); | ||
const camera_1 = require("./camera"); | ||
const gl_matrix_1 = require("gl-matrix"); | ||
class FaceLandmarkGroup extends THREE.Group { | ||
class FaceLandmarkGroup extends three_1.THREE.Group { | ||
constructor(_camera, faceTracker, landmark) { | ||
@@ -10,0 +10,0 @@ super(); |
@@ -1,2 +0,2 @@ | ||
import * as THREE from "three"; | ||
import { THREE } from "./three"; | ||
import { FaceMesh } from "@zappar/zappar"; | ||
@@ -3,0 +3,0 @@ export interface FaceMeshLoaderOptions { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.FaceMeshLoader = void 0; | ||
const THREE = require("three"); | ||
const three_1 = require("./three"); | ||
const zappar_1 = require("@zappar/zappar"); | ||
class FaceMeshLoader extends THREE.Loader { | ||
class FaceMeshLoader extends three_1.THREE.Loader { | ||
constructor(manager) { | ||
@@ -8,0 +8,0 @@ super(manager); |
@@ -1,2 +0,2 @@ | ||
import * as THREE from "three"; | ||
import { THREE } from "./three"; | ||
import { FaceTracker } from "./defaultpipeline"; | ||
@@ -3,0 +3,0 @@ export declare class FaceTrackerLoader extends THREE.Loader { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.FaceTrackerLoader = void 0; | ||
const THREE = require("three"); | ||
const three_1 = require("./three"); | ||
const defaultpipeline_1 = require("./defaultpipeline"); | ||
class FaceTrackerLoader extends THREE.Loader { | ||
class FaceTrackerLoader extends three_1.THREE.Loader { | ||
constructor(manager) { | ||
@@ -8,0 +8,0 @@ super(manager); |
@@ -1,2 +0,2 @@ | ||
import * as THREE from "three"; | ||
import { THREE } from "./three"; | ||
import * as Zappar from "@zappar/zappar"; | ||
@@ -3,0 +3,0 @@ import { FaceAnchorGroup } from "./faceanchorgroup"; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.HeadMaskMesh = void 0; | ||
const THREE = require("three"); | ||
const three_1 = require("./three"); | ||
const Zappar = require("@zappar/zappar"); | ||
const facebuffergeometry_1 = require("./facebuffergeometry"); | ||
const three_1 = require("three"); | ||
class HeadMaskMesh extends THREE.Mesh { | ||
class HeadMaskMesh extends three_1.THREE.Mesh { | ||
constructor(onLoad, onError) { | ||
@@ -16,3 +15,3 @@ super(); | ||
this.geometry = this._faceBufferGeometry; | ||
this.material = new three_1.MeshBasicMaterial({ | ||
this.material = new three_1.THREE.MeshBasicMaterial({ | ||
colorWrite: false | ||
@@ -19,0 +18,0 @@ }); |
@@ -1,2 +0,2 @@ | ||
import * as THREE from "three"; | ||
import { THREE } from "./three"; | ||
import { HeadMaskMesh } from "./headmaskmesh"; | ||
@@ -3,0 +3,0 @@ export declare class HeadMaskMeshLoader extends THREE.Loader { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.HeadMaskMeshLoader = void 0; | ||
const THREE = require("three"); | ||
const three_1 = require("./three"); | ||
const headmaskmesh_1 = require("./headmaskmesh"); | ||
class HeadMaskMeshLoader extends THREE.Loader { | ||
class HeadMaskMeshLoader extends three_1.THREE.Loader { | ||
constructor(manager) { | ||
@@ -8,0 +8,0 @@ super(manager); |
@@ -1,2 +0,2 @@ | ||
import * as THREE from "three"; | ||
import { THREE } from "./three"; | ||
import { ImageTracker, ImageAnchor } from "@zappar/zappar"; | ||
@@ -3,0 +3,0 @@ import { Camera } from "./camera"; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ImageAnchorGroup = void 0; | ||
const THREE = require("three"); | ||
const three_1 = require("./three"); | ||
const camera_1 = require("./camera"); | ||
class ImageAnchorGroup extends THREE.Group { | ||
class ImageAnchorGroup extends three_1.THREE.Group { | ||
constructor(_camera, imageTracker, anchorId) { | ||
@@ -8,0 +8,0 @@ super(); |
@@ -1,2 +0,2 @@ | ||
import * as THREE from "three"; | ||
import { THREE } from "./three"; | ||
import { ImageTracker } from "./defaultpipeline"; | ||
@@ -3,0 +3,0 @@ export declare class ImageTrackerLoader extends THREE.Loader { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ImageTrackerLoader = void 0; | ||
const THREE = require("three"); | ||
const three_1 = require("./three"); | ||
const defaultpipeline_1 = require("./defaultpipeline"); | ||
class ImageTrackerLoader extends THREE.Loader { | ||
class ImageTrackerLoader extends three_1.THREE.Loader { | ||
constructor(manager) { | ||
@@ -8,0 +8,0 @@ super(manager); |
@@ -1,2 +0,2 @@ | ||
import * as THREE from "three"; | ||
import { THREE } from "./three"; | ||
import { InstantWorldTracker } from "@zappar/zappar"; | ||
@@ -3,0 +3,0 @@ import { Camera } from "./camera"; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.InstantWorldAnchorGroup = void 0; | ||
const THREE = require("three"); | ||
const three_1 = require("./three"); | ||
const camera_1 = require("./camera"); | ||
class InstantWorldAnchorGroup extends THREE.Group { | ||
class InstantWorldAnchorGroup extends three_1.THREE.Group { | ||
constructor(_camera, instantTracker) { | ||
@@ -8,0 +8,0 @@ super(); |
@@ -1,2 +0,2 @@ | ||
import { LoadingManager as Manager } from 'three'; | ||
import { THREE } from "./three"; | ||
declare type OnProgress = ((url: string, loaded: number, total: number) => void) | undefined; | ||
@@ -35,3 +35,3 @@ declare type OnLoad = (() => void) | undefined; | ||
} | ||
export declare class LoadingManager extends Manager { | ||
export declare class LoadingManager extends THREE.LoadingManager { | ||
ui: UI; | ||
@@ -38,0 +38,0 @@ private onStartCallback; |
@@ -5,4 +5,3 @@ "use strict"; | ||
exports.LoadingManager = exports.DefaultLoaderUI = void 0; | ||
const three_1 = require("three"); | ||
const THREE = require("three"); | ||
const three_1 = require("./three"); | ||
class UI { | ||
@@ -119,10 +118,10 @@ constructor(style) { | ||
super(options === null || options === void 0 ? void 0 : options.style); | ||
THREE.DefaultLoadingManager.onStart = () => { | ||
three_1.THREE.DefaultLoadingManager.onStart = () => { | ||
this.initialize(); | ||
}; | ||
THREE.DefaultLoadingManager.onLoad = () => { | ||
three_1.THREE.DefaultLoadingManager.onLoad = () => { | ||
var _a; | ||
(_a = options === null || options === void 0 ? void 0 : options.onLoad) === null || _a === void 0 ? void 0 : _a.call(options); | ||
}; | ||
THREE.DefaultLoadingManager.onProgress = (_url, itemsLoaded, itemsTotal) => { | ||
three_1.THREE.DefaultLoadingManager.onProgress = (_url, itemsLoaded, itemsTotal) => { | ||
this.updateLoader(itemsLoaded / itemsTotal * 100); | ||
@@ -133,3 +132,3 @@ }; | ||
exports.DefaultLoaderUI = DefaultLoaderUI; | ||
class LoadingManager extends three_1.LoadingManager { | ||
class LoadingManager extends three_1.THREE.LoadingManager { | ||
constructor(options) { | ||
@@ -136,0 +135,0 @@ super(() => { var _a; return (_a = options === null || options === void 0 ? void 0 : options.onLoad) === null || _a === void 0 ? void 0 : _a.call(options); }, (url, loaded, total) => { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.skipVersionLog = void 0; | ||
const VERSION = "0.3.8"; | ||
const VERSION = "0.3.11"; | ||
console.log(`Zappar for ThreeJS v${VERSION}`); | ||
@@ -6,0 +6,0 @@ let skipping = false; |
{ | ||
"name": "@zappar/zappar-threejs", | ||
"version": "0.3.8", | ||
"version": "0.3.11", | ||
"description": "ThreeJS wrappers for Zappar's computer vision library", | ||
@@ -36,3 +36,3 @@ "main": "lib/index.js", | ||
"@types/pngjs": "^6.0.0", | ||
"@types/three": "^0.126.0", | ||
"@types/three": "^0.127.0", | ||
"@typescript-eslint/eslint-plugin": "^4.11.1", | ||
@@ -49,3 +49,3 @@ "@typescript-eslint/parser": "^4.11.1", | ||
"puppeteer": "^7.1.0", | ||
"three": "^0.126.1", | ||
"three": "^0.127.0", | ||
"ts-jest": "^26.5.1", | ||
@@ -60,3 +60,3 @@ "ts-loader": "^8.0.13", | ||
"peerDependencies": { | ||
"three": "0.113.0 - 0.126.1" | ||
"three": "0.113.0 - 0.127.0" | ||
}, | ||
@@ -63,0 +63,0 @@ "dependencies": { |
@@ -64,3 +64,3 @@ # Zappar for ThreeJS | ||
<!-- Added by: zapparadmin, at: Mon Mar 8 15:17:27 GMT 2021 --> | ||
<!-- Added by: zapparadmin, at: Wed Apr 7 12:03:54 BST 2021 --> | ||
@@ -98,3 +98,3 @@ <!--te--> | ||
Download the bundle from: | ||
https://libs.zappar.com/zappar-threejs/0.3.8/zappar-threejs.zip | ||
https://libs.zappar.com/zappar-threejs/0.3.11/zappar-threejs.zip | ||
@@ -111,3 +111,3 @@ | ||
```html | ||
<script src="https://libs.zappar.com/zappar-threejs/0.3.8/zappar-threejs.js"></script> | ||
<script src="https://libs.zappar.com/zappar-threejs/0.3.11/zappar-threejs.js"></script> | ||
``` | ||
@@ -114,0 +114,0 @@ |
Sorry, the diff of this file is too big to display
6320963
42
1088