@zappar/zappar-threejs
Advanced tools
Comparing version 2.0.6 to 2.1.0
# Changelog | ||
## [2.1.0] - 2023-03-08 | ||
### Changed | ||
- Module is now built as `ESNext` (was `CommonJs`). | ||
## [2.0.6] - 2022-11-14 | ||
@@ -4,0 +10,0 @@ |
@@ -1,12 +0,9 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Camera = exports.CameraMirrorMode = exports.CameraPoseMode = void 0; | ||
const Zappar = require("@zappar/zappar"); | ||
const three_1 = require("./three"); | ||
const defaultpipeline_1 = require("./defaultpipeline"); | ||
const cameraTexture_1 = require("./cameraTexture"); | ||
import * as Zappar from "@zappar/zappar"; | ||
import { THREE } from "./three"; | ||
import { getDefaultPipeline, CameraSource } from "./defaultpipeline"; | ||
import { CameraTexture } from "./cameraTexture"; | ||
/** | ||
* The pose modes that determine how the camera moves around in the scene. | ||
*/ | ||
var CameraPoseMode; | ||
export var CameraPoseMode; | ||
(function (CameraPoseMode) { | ||
@@ -30,7 +27,7 @@ /** | ||
CameraPoseMode[CameraPoseMode["AnchorOrigin"] = 2] = "AnchorOrigin"; | ||
})(CameraPoseMode = exports.CameraPoseMode || (exports.CameraPoseMode = {})); | ||
})(CameraPoseMode || (CameraPoseMode = {})); | ||
/** | ||
* The mirror modes that may be used. | ||
*/ | ||
var CameraMirrorMode; | ||
export var CameraMirrorMode; | ||
(function (CameraMirrorMode) { | ||
@@ -52,3 +49,3 @@ /** | ||
CameraMirrorMode[CameraMirrorMode["CSS"] = 2] = "CSS"; | ||
})(CameraMirrorMode = exports.CameraMirrorMode || (exports.CameraMirrorMode = {})); | ||
})(CameraMirrorMode || (CameraMirrorMode = {})); | ||
/** | ||
@@ -77,3 +74,3 @@ * The directions that the camera can face. | ||
*/ | ||
class Camera extends three_1.THREE.Camera { | ||
export class Camera extends THREE.Camera { | ||
/** | ||
@@ -112,3 +109,3 @@ * Constructs a new Camera. | ||
this.renderHeight = 0; | ||
this.pipeline = opts instanceof Zappar.Pipeline ? opts : (opts === null || opts === void 0 ? void 0 : opts.pipeline) || (0, defaultpipeline_1.getDefaultPipeline)(); | ||
this.pipeline = opts instanceof Zappar.Pipeline ? opts : (opts === null || opts === void 0 ? void 0 : opts.pipeline) || getDefaultPipeline(); | ||
this.rawPose = this.pipeline.cameraPoseDefault(); | ||
@@ -120,8 +117,8 @@ if (opts && !(opts instanceof Zappar.Pipeline)) { | ||
this.userCameraSource = this.cameraSourceFromOpts(opts.userCameraSource, true); | ||
this.backgroundTexture = opts.backgroundTexture ? opts.backgroundTexture : new cameraTexture_1.CameraTexture(); | ||
this.backgroundTexture = opts.backgroundTexture ? opts.backgroundTexture : new CameraTexture(); | ||
} | ||
else { | ||
this.rearCameraSource = new defaultpipeline_1.CameraSource(Zappar.cameraDefaultDeviceID(), this.pipeline); | ||
this.userCameraSource = new defaultpipeline_1.CameraSource(Zappar.cameraDefaultDeviceID(true), this.pipeline); | ||
this.backgroundTexture = new cameraTexture_1.CameraTexture(); | ||
this.rearCameraSource = new CameraSource(Zappar.cameraDefaultDeviceID(), this.pipeline); | ||
this.userCameraSource = new CameraSource(Zappar.cameraDefaultDeviceID(true), this.pipeline); | ||
this.backgroundTexture = new CameraTexture(); | ||
} | ||
@@ -141,3 +138,3 @@ this.matrixAutoUpdate = false; | ||
? new Zappar.HTMLElementSource(this.pipeline, cameraSource) | ||
: new defaultpipeline_1.CameraSource(cameraSource || Zappar.cameraDefaultDeviceID(frontFacing), this.pipeline); | ||
: new CameraSource(cameraSource || Zappar.cameraDefaultDeviceID(frontFacing), this.pipeline); | ||
} | ||
@@ -275,2 +272,1 @@ /** | ||
} | ||
exports.Camera = Camera; |
@@ -1,6 +0,3 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.CameraEnvironmentMap = void 0; | ||
const three_1 = require("./three"); | ||
class CameraEnvironmentMap { | ||
import { THREE } from "./three"; | ||
export class CameraEnvironmentMap { | ||
/** | ||
@@ -10,11 +7,11 @@ * Constructs a new Camera Environment Map. | ||
constructor() { | ||
this.cubeMapScene = new three_1.THREE.Scene(); | ||
this.renderTarget = new three_1.THREE.WebGLCubeRenderTarget(256, { | ||
format: three_1.THREE.RGBAFormat, | ||
this.cubeMapScene = new THREE.Scene(); | ||
this.renderTarget = new THREE.WebGLCubeRenderTarget(256, { | ||
format: THREE.RGBAFormat, | ||
generateMipmaps: true, | ||
minFilter: three_1.THREE.LinearMipmapLinearFilter, | ||
minFilter: THREE.LinearMipmapLinearFilter, | ||
}); | ||
this.cubeCamera = new three_1.THREE.CubeCamera(0.1, 1000, this.renderTarget); | ||
this.sphereMaterial = new three_1.THREE.MeshBasicMaterial({ side: three_1.THREE.DoubleSide }); | ||
this.sphereGroup = new three_1.THREE.Group(); | ||
this.cubeCamera = new THREE.CubeCamera(0.1, 1000, this.renderTarget); | ||
this.sphereMaterial = new THREE.MeshBasicMaterial({ side: THREE.DoubleSide }); | ||
this.sphereGroup = new THREE.Group(); | ||
/** | ||
@@ -25,3 +22,3 @@ * The resulting map texture. Set this as your `scene.environment` or as a material's `envMap`. | ||
this.cubeMapScene.add(this.cubeCamera); | ||
const sphere = new three_1.THREE.Mesh(new three_1.THREE.SphereGeometry(10, 16, 12), this.sphereMaterial); | ||
const sphere = new THREE.Mesh(new THREE.SphereGeometry(10, 16, 12), this.sphereMaterial); | ||
sphere.rotation.set(0, -0.5 * Math.PI, 0); | ||
@@ -52,2 +49,1 @@ this.sphereGroup.add(sphere); | ||
} | ||
exports.CameraEnvironmentMap = CameraEnvironmentMap; |
@@ -1,13 +0,10 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.CameraTexture = void 0; | ||
const camera_1 = require("./camera"); | ||
const three_1 = require("./three"); | ||
import { CameraMirrorMode } from "./camera"; | ||
import { THREE } from "./three"; | ||
/** | ||
* Creates a texture to be used internally by `ZapparThree.Camera`. | ||
*/ | ||
class CameraTexture extends three_1.THREE.Texture { | ||
export class CameraTexture extends THREE.Texture { | ||
constructor() { | ||
super(...arguments); | ||
this.MirrorMode = camera_1.CameraMirrorMode.None; | ||
this.MirrorMode = CameraMirrorMode.None; | ||
this.isVideoTexture = true; | ||
@@ -39,6 +36,6 @@ } | ||
// texture on a fullscreen quad with 0,0 -> 1,1 UV coordinates | ||
const view = new three_1.THREE.Matrix4(); | ||
view.fromArray(pipeline.cameraFrameTextureMatrix(renderer.domElement.width, renderer.domElement.height, this.MirrorMode === camera_1.CameraMirrorMode.Poses)); | ||
const view = new THREE.Matrix4(); | ||
view.fromArray(pipeline.cameraFrameTextureMatrix(renderer.domElement.width, renderer.domElement.height, this.MirrorMode === CameraMirrorMode.Poses)); | ||
// ThreeJS's Texture object uses a 3x3 matrix, so convert from our 4x4 matrix | ||
const textureMatrix3 = new three_1.THREE.Matrix3(); | ||
const textureMatrix3 = new THREE.Matrix3(); | ||
textureMatrix3.setFromMatrix4(view); | ||
@@ -56,2 +53,1 @@ // eslint-disable-next-line prefer-destructuring | ||
} | ||
exports.CameraTexture = CameraTexture; |
@@ -1,6 +0,3 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.glContextLost = exports.glContextSet = exports.HTMLElementSource = exports.CameraSource = exports.InstantWorldTracker = exports.FaceTracker = exports.BarcodeFinder = exports.ImageTracker = exports.getDefaultPipeline = exports.onFrameUpdate = void 0; | ||
const Zappar = require("@zappar/zappar"); | ||
const event_1 = require("@zappar/zappar/lib/event"); | ||
import * as Zappar from "@zappar/zappar"; | ||
import { Event } from "@zappar/zappar/lib/event"; | ||
let defaultPipeline; | ||
@@ -10,14 +7,13 @@ /** | ||
*/ | ||
exports.onFrameUpdate = new event_1.Event(); | ||
export const onFrameUpdate = new Event(); | ||
/** | ||
* @returns - The default Pipeline used by the library. This function constructs a new Pipeline during its first invocation. | ||
*/ | ||
function getDefaultPipeline() { | ||
export function getDefaultPipeline() { | ||
if (!defaultPipeline) { | ||
defaultPipeline = new Zappar.Pipeline(); | ||
defaultPipeline.onFrameUpdate.bind(() => exports.onFrameUpdate.emit()); | ||
defaultPipeline.onFrameUpdate.bind(() => onFrameUpdate.emit()); | ||
} | ||
return defaultPipeline; | ||
} | ||
exports.getDefaultPipeline = getDefaultPipeline; | ||
/** | ||
@@ -27,3 +23,3 @@ * Attaches content to a known image as it moves around in the camera view. | ||
*/ | ||
class ImageTracker extends Zappar.ImageTracker { | ||
export class ImageTracker extends Zappar.ImageTracker { | ||
/** | ||
@@ -39,7 +35,6 @@ * Constructs a new ImageTracker. | ||
} | ||
exports.ImageTracker = ImageTracker; | ||
/** | ||
* Detects barcodes in the images from the camera. | ||
*/ | ||
class BarcodeFinder extends Zappar.BarcodeFinder { | ||
export class BarcodeFinder extends Zappar.BarcodeFinder { | ||
/** | ||
@@ -53,3 +48,2 @@ * Constructs a new BarcodeFinder. | ||
} | ||
exports.BarcodeFinder = BarcodeFinder; | ||
/** | ||
@@ -59,3 +53,3 @@ * Attaches content to a face as it moves around in the camera view. | ||
*/ | ||
class FaceTracker extends Zappar.FaceTracker { | ||
export class FaceTracker extends Zappar.FaceTracker { | ||
/** | ||
@@ -69,3 +63,2 @@ * Constructs a new FaceTracker. | ||
} | ||
exports.FaceTracker = FaceTracker; | ||
/** | ||
@@ -75,3 +68,3 @@ * Attaches content to a point on a surface in front of the user as it moves around in the camera view. | ||
*/ | ||
class InstantWorldTracker extends Zappar.InstantWorldTracker { | ||
export class InstantWorldTracker extends Zappar.InstantWorldTracker { | ||
/** | ||
@@ -85,3 +78,2 @@ * Constructs a new InstantWorldTracker. | ||
} | ||
exports.InstantWorldTracker = InstantWorldTracker; | ||
/** | ||
@@ -91,3 +83,3 @@ * Creates a source of frames from a device camera. | ||
*/ | ||
class CameraSource extends Zappar.CameraSource { | ||
export class CameraSource extends Zappar.CameraSource { | ||
/** | ||
@@ -103,3 +95,2 @@ * Constructs a new CameraSource. | ||
} | ||
exports.CameraSource = CameraSource; | ||
/** | ||
@@ -109,3 +100,3 @@ * Creates a source of frames from a HTML <video> or <img> element. | ||
*/ | ||
class HTMLElementSource extends Zappar.HTMLElementSource { | ||
export class HTMLElementSource extends Zappar.HTMLElementSource { | ||
/** | ||
@@ -120,3 +111,2 @@ * Constructs a new HTMLElementSource. | ||
} | ||
exports.HTMLElementSource = HTMLElementSource; | ||
/** | ||
@@ -129,6 +119,5 @@ * Sets the WebGL context used for the processing and upload of camera textures. | ||
*/ | ||
function glContextSet(gl) { | ||
export function glContextSet(gl) { | ||
getDefaultPipeline().glContextSet(gl); | ||
} | ||
exports.glContextSet = glContextSet; | ||
/** | ||
@@ -139,5 +128,4 @@ * Informs the pipeline that the GL context is lost and should not be used. | ||
*/ | ||
function glContextLost() { | ||
export function glContextLost() { | ||
getDefaultPipeline().glContextLost(); | ||
} | ||
exports.glContextLost = glContextLost; |
@@ -1,6 +0,3 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.FaceBufferGeometry = void 0; | ||
const three_1 = require("../three"); | ||
const facemeshloader_1 = require("../loaders/facemeshloader"); | ||
import { THREE } from "../three"; | ||
import { FaceMeshLoader } from "../loaders/facemeshloader"; | ||
let faceMeshSingleton; | ||
@@ -11,3 +8,3 @@ /** | ||
*/ | ||
class FaceBufferGeometry extends three_1.THREE.BufferGeometry { | ||
export class FaceBufferGeometry extends THREE.BufferGeometry { | ||
/** | ||
@@ -23,8 +20,8 @@ * Constructs a new FaceBufferGeometry. | ||
this.setIndex([]); | ||
this.setAttribute("position", new three_1.THREE.Float32BufferAttribute([], 3)); | ||
this.setAttribute("normal", new three_1.THREE.Float32BufferAttribute([], 3)); | ||
this.setAttribute("uv", new three_1.THREE.Float32BufferAttribute([], 2)); | ||
this.setAttribute("position", new THREE.Float32BufferAttribute([], 3)); | ||
this.setAttribute("normal", new THREE.Float32BufferAttribute([], 3)); | ||
this.setAttribute("uv", new THREE.Float32BufferAttribute([], 2)); | ||
if (!faceMesh) { | ||
if (!faceMeshSingleton) { | ||
faceMeshSingleton = new facemeshloader_1.FaceMeshLoader().load(); | ||
faceMeshSingleton = new FaceMeshLoader().load(); | ||
} | ||
@@ -41,3 +38,3 @@ // eslint-disable-next-line no-param-reassign | ||
return; | ||
this.setIndex(new three_1.THREE.Uint16BufferAttribute(this._faceMesh.indices, 1)); | ||
this.setIndex(new THREE.Uint16BufferAttribute(this._faceMesh.indices, 1)); | ||
this.hasSetIndices = true; | ||
@@ -50,3 +47,3 @@ } | ||
return; | ||
this.setAttribute("uv", new three_1.THREE.BufferAttribute(this._faceMesh.uvs, 2)); | ||
this.setAttribute("uv", new THREE.BufferAttribute(this._faceMesh.uvs, 2)); | ||
this.hasSetUVs = true; | ||
@@ -103,3 +100,3 @@ } | ||
this.vertices = new Float32Array(this._faceMesh.vertices.length); | ||
this.verticesAttribute = new three_1.THREE.BufferAttribute(this.vertices, 3); | ||
this.verticesAttribute = new THREE.BufferAttribute(this.vertices, 3); | ||
this.setAttribute("position", this.verticesAttribute); | ||
@@ -115,3 +112,3 @@ } | ||
this.normals = new Float32Array(this._faceMesh.normals.length); | ||
this.normalsAttribute = new three_1.THREE.BufferAttribute(this.normals, 3); | ||
this.normalsAttribute = new THREE.BufferAttribute(this.normals, 3); | ||
this.setAttribute("normal", this.normalsAttribute); | ||
@@ -124,2 +121,1 @@ } | ||
} | ||
exports.FaceBufferGeometry = FaceBufferGeometry; |
@@ -1,5 +0,2 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.TargetImagePreviewBufferGeometry = void 0; | ||
const three_1 = require("../three"); | ||
import { THREE } from "../three"; | ||
/** | ||
@@ -9,3 +6,3 @@ * A THREE.BufferGeometry that fits to the target image. | ||
*/ | ||
class TargetImagePreviewBufferGeometry extends three_1.THREE.BufferGeometry { | ||
export class TargetImagePreviewBufferGeometry extends THREE.BufferGeometry { | ||
/** | ||
@@ -23,5 +20,5 @@ * Constructs a new TargetImagePreviewBufferGeometry. | ||
this.setIndex([]); | ||
this.setAttribute("position", new three_1.THREE.Float32BufferAttribute([], 3)); | ||
this.setAttribute("normal", new three_1.THREE.Float32BufferAttribute([], 3)); | ||
this.setAttribute("uv", new three_1.THREE.Float32BufferAttribute([], 2)); | ||
this.setAttribute("position", new THREE.Float32BufferAttribute([], 3)); | ||
this.setAttribute("normal", new THREE.Float32BufferAttribute([], 3)); | ||
this.setAttribute("uv", new THREE.Float32BufferAttribute([], 2)); | ||
if (this.imageTarget.preview.vertices.length === 0) { | ||
@@ -34,3 +31,3 @@ throw new Error("No vertices found in the image target."); | ||
this.vertices = new Float32Array((_a = this.imageTarget) === null || _a === void 0 ? void 0 : _a.preview.vertices.length); | ||
this.verticesAttribute = new three_1.THREE.BufferAttribute(this.vertices, 3); | ||
this.verticesAttribute = new THREE.BufferAttribute(this.vertices, 3); | ||
this.setAttribute("position", this.verticesAttribute); | ||
@@ -52,3 +49,3 @@ } | ||
return; | ||
this.setIndex(new three_1.THREE.Uint16BufferAttribute(this.imageTarget.preview.indices, 1)); | ||
this.setIndex(new THREE.Uint16BufferAttribute(this.imageTarget.preview.indices, 1)); | ||
this.hasSetIndices = true; | ||
@@ -64,3 +61,3 @@ } | ||
return; | ||
this.setAttribute("uv", new three_1.THREE.BufferAttribute(this.imageTarget.preview.uvs, 2)); | ||
this.setAttribute("uv", new THREE.BufferAttribute(this.imageTarget.preview.uvs, 2)); | ||
this.hasSetUVs = true; | ||
@@ -75,2 +72,1 @@ } | ||
} | ||
exports.TargetImagePreviewBufferGeometry = TargetImagePreviewBufferGeometry; |
@@ -1,16 +0,2 @@ | ||
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.setOptions = void 0; | ||
var index_standalone_1 = require("@zappar/zappar/lib/index-standalone"); | ||
Object.defineProperty(exports, "setOptions", { enumerable: true, get: function () { return index_standalone_1.setOptions; } }); | ||
__exportStar(require("./index"), exports); | ||
export { setOptions } from "@zappar/zappar/lib/index-standalone"; | ||
export * from "./index"; |
@@ -1,68 +0,20 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.SequenceSource = exports.loadedPromise = exports.loaded = exports.browserIncompatibleUI = exports.browserIncompatible = exports.permissionRequestUI = exports.permissionDeniedUI = exports.permissionRequest = exports.permissionGranted = exports.permissionDenied = exports.setLogLevel = exports.LogLevel = exports.Pipeline = exports.FaceLandmarkName = exports.FaceLandmark = exports.FaceMesh = exports.getDefaultPipeline = exports.glContextLost = exports.glContextSet = exports.onFrameUpdate = exports.HTMLElementSource = exports.CameraSource = exports.FaceTracker = exports.BarcodeFinder = exports.InstantWorldTracker = exports.ImageTracker = exports.TargetImagePreviewMesh = exports.TargetImagePreviewBufferGeometry = exports.CameraEnvironmentMap = exports.DefaultLoaderUI = exports.LoadingManager = exports.LibraryLoader = exports.HeadMaskMeshLoader = exports.HeadMaskMesh = exports.FaceMeshLoader = exports.FaceBufferGeometry = exports.FaceTrackerLoader = exports.FaceLandmarkGroup = exports.FaceAnchorGroup = exports.InstantWorldAnchorGroup = exports.ImageTrackerLoader = exports.ImageAnchorGroup = exports.CameraMirrorMode = exports.CameraPoseMode = exports.Camera = void 0; | ||
const version_1 = require("./version"); | ||
console.log(`Zappar for ThreeJS v${version_1.VERSION}`); | ||
var camera_1 = require("./camera"); | ||
Object.defineProperty(exports, "Camera", { enumerable: true, get: function () { return camera_1.Camera; } }); | ||
Object.defineProperty(exports, "CameraPoseMode", { enumerable: true, get: function () { return camera_1.CameraPoseMode; } }); | ||
Object.defineProperty(exports, "CameraMirrorMode", { enumerable: true, get: function () { return camera_1.CameraMirrorMode; } }); | ||
var imageanchorgroup_1 = require("./trackers/imageanchorgroup"); | ||
Object.defineProperty(exports, "ImageAnchorGroup", { enumerable: true, get: function () { return imageanchorgroup_1.ImageAnchorGroup; } }); | ||
var imagetrackerloader_1 = require("./loaders/imagetrackerloader"); | ||
Object.defineProperty(exports, "ImageTrackerLoader", { enumerable: true, get: function () { return imagetrackerloader_1.ImageTrackerLoader; } }); | ||
var instantworldanchorgroup_1 = require("./trackers/instantworldanchorgroup"); | ||
Object.defineProperty(exports, "InstantWorldAnchorGroup", { enumerable: true, get: function () { return instantworldanchorgroup_1.InstantWorldAnchorGroup; } }); | ||
var faceanchorgroup_1 = require("./trackers/faceanchorgroup"); | ||
Object.defineProperty(exports, "FaceAnchorGroup", { enumerable: true, get: function () { return faceanchorgroup_1.FaceAnchorGroup; } }); | ||
var facelandmarkgroup_1 = require("./trackers/facelandmarkgroup"); | ||
Object.defineProperty(exports, "FaceLandmarkGroup", { enumerable: true, get: function () { return facelandmarkgroup_1.FaceLandmarkGroup; } }); | ||
var facetrackerloader_1 = require("./loaders/facetrackerloader"); | ||
Object.defineProperty(exports, "FaceTrackerLoader", { enumerable: true, get: function () { return facetrackerloader_1.FaceTrackerLoader; } }); | ||
var facebuffergeometry_1 = require("./geometry/facebuffergeometry"); | ||
Object.defineProperty(exports, "FaceBufferGeometry", { enumerable: true, get: function () { return facebuffergeometry_1.FaceBufferGeometry; } }); | ||
var facemeshloader_1 = require("./loaders/facemeshloader"); | ||
Object.defineProperty(exports, "FaceMeshLoader", { enumerable: true, get: function () { return facemeshloader_1.FaceMeshLoader; } }); | ||
var headmaskmesh_1 = require("./mesh/headmaskmesh"); | ||
Object.defineProperty(exports, "HeadMaskMesh", { enumerable: true, get: function () { return headmaskmesh_1.HeadMaskMesh; } }); | ||
var headmaskmeshloader_1 = require("./loaders/headmaskmeshloader"); | ||
Object.defineProperty(exports, "HeadMaskMeshLoader", { enumerable: true, get: function () { return headmaskmeshloader_1.HeadMaskMeshLoader; } }); | ||
var libraryloader_1 = require("./loaders/libraryloader"); | ||
Object.defineProperty(exports, "LibraryLoader", { enumerable: true, get: function () { return libraryloader_1.LibraryLoader; } }); | ||
var loadingmanager_1 = require("./loaders/loadingmanager"); | ||
Object.defineProperty(exports, "LoadingManager", { enumerable: true, get: function () { return loadingmanager_1.LoadingManager; } }); | ||
Object.defineProperty(exports, "DefaultLoaderUI", { enumerable: true, get: function () { return loadingmanager_1.DefaultLoaderUI; } }); | ||
var cameraenvironmentmap_1 = require("./cameraenvironmentmap"); | ||
Object.defineProperty(exports, "CameraEnvironmentMap", { enumerable: true, get: function () { return cameraenvironmentmap_1.CameraEnvironmentMap; } }); | ||
var targetimagepreviewbuffergeometry_1 = require("./geometry/targetimagepreviewbuffergeometry"); | ||
Object.defineProperty(exports, "TargetImagePreviewBufferGeometry", { enumerable: true, get: function () { return targetimagepreviewbuffergeometry_1.TargetImagePreviewBufferGeometry; } }); | ||
var targetimagepreviewmesh_1 = require("./mesh/targetimagepreviewmesh"); | ||
Object.defineProperty(exports, "TargetImagePreviewMesh", { enumerable: true, get: function () { return targetimagepreviewmesh_1.TargetImagePreviewMesh; } }); | ||
var defaultpipeline_1 = require("./defaultpipeline"); | ||
Object.defineProperty(exports, "ImageTracker", { enumerable: true, get: function () { return defaultpipeline_1.ImageTracker; } }); | ||
Object.defineProperty(exports, "InstantWorldTracker", { enumerable: true, get: function () { return defaultpipeline_1.InstantWorldTracker; } }); | ||
Object.defineProperty(exports, "BarcodeFinder", { enumerable: true, get: function () { return defaultpipeline_1.BarcodeFinder; } }); | ||
Object.defineProperty(exports, "FaceTracker", { enumerable: true, get: function () { return defaultpipeline_1.FaceTracker; } }); | ||
Object.defineProperty(exports, "CameraSource", { enumerable: true, get: function () { return defaultpipeline_1.CameraSource; } }); | ||
Object.defineProperty(exports, "HTMLElementSource", { enumerable: true, get: function () { return defaultpipeline_1.HTMLElementSource; } }); | ||
Object.defineProperty(exports, "onFrameUpdate", { enumerable: true, get: function () { return defaultpipeline_1.onFrameUpdate; } }); | ||
Object.defineProperty(exports, "glContextSet", { enumerable: true, get: function () { return defaultpipeline_1.glContextSet; } }); | ||
Object.defineProperty(exports, "glContextLost", { enumerable: true, get: function () { return defaultpipeline_1.glContextLost; } }); | ||
Object.defineProperty(exports, "getDefaultPipeline", { enumerable: true, get: function () { return defaultpipeline_1.getDefaultPipeline; } }); | ||
var zappar_1 = require("@zappar/zappar"); | ||
Object.defineProperty(exports, "FaceMesh", { enumerable: true, get: function () { return zappar_1.FaceMesh; } }); | ||
Object.defineProperty(exports, "FaceLandmark", { enumerable: true, get: function () { return zappar_1.FaceLandmark; } }); | ||
Object.defineProperty(exports, "FaceLandmarkName", { enumerable: true, get: function () { return zappar_1.FaceLandmarkName; } }); | ||
Object.defineProperty(exports, "Pipeline", { enumerable: true, get: function () { return zappar_1.Pipeline; } }); | ||
Object.defineProperty(exports, "LogLevel", { enumerable: true, get: function () { return zappar_1.LogLevel; } }); | ||
Object.defineProperty(exports, "setLogLevel", { enumerable: true, get: function () { return zappar_1.setLogLevel; } }); | ||
Object.defineProperty(exports, "permissionDenied", { enumerable: true, get: function () { return zappar_1.permissionDenied; } }); | ||
Object.defineProperty(exports, "permissionGranted", { enumerable: true, get: function () { return zappar_1.permissionGranted; } }); | ||
Object.defineProperty(exports, "permissionRequest", { enumerable: true, get: function () { return zappar_1.permissionRequest; } }); | ||
Object.defineProperty(exports, "permissionDeniedUI", { enumerable: true, get: function () { return zappar_1.permissionDeniedUI; } }); | ||
Object.defineProperty(exports, "permissionRequestUI", { enumerable: true, get: function () { return zappar_1.permissionRequestUI; } }); | ||
Object.defineProperty(exports, "browserIncompatible", { enumerable: true, get: function () { return zappar_1.browserIncompatible; } }); | ||
Object.defineProperty(exports, "browserIncompatibleUI", { enumerable: true, get: function () { return zappar_1.browserIncompatibleUI; } }); | ||
Object.defineProperty(exports, "loaded", { enumerable: true, get: function () { return zappar_1.loaded; } }); | ||
Object.defineProperty(exports, "loadedPromise", { enumerable: true, get: function () { return zappar_1.loadedPromise; } }); | ||
Object.defineProperty(exports, "SequenceSource", { enumerable: true, get: function () { return zappar_1.SequenceSource; } }); | ||
import { VERSION } from "./version"; | ||
console.log(`Zappar for ThreeJS v${VERSION}`); | ||
export { Camera, CameraPoseMode, CameraMirrorMode } from "./camera"; | ||
export { ImageAnchorGroup } from "./trackers/imageanchorgroup"; | ||
export { ImageTrackerLoader } from "./loaders/imagetrackerloader"; | ||
export { InstantWorldAnchorGroup } from "./trackers/instantworldanchorgroup"; | ||
export { FaceAnchorGroup } from "./trackers/faceanchorgroup"; | ||
export { FaceLandmarkGroup } from "./trackers/facelandmarkgroup"; | ||
export { FaceTrackerLoader } from "./loaders/facetrackerloader"; | ||
export { FaceBufferGeometry } from "./geometry/facebuffergeometry"; | ||
export { FaceMeshLoader } from "./loaders/facemeshloader"; | ||
export { HeadMaskMesh } from "./mesh/headmaskmesh"; | ||
export { HeadMaskMeshLoader } from "./loaders/headmaskmeshloader"; | ||
export { LibraryLoader } from "./loaders/libraryloader"; | ||
export { LoadingManager, DefaultLoaderUI } from "./loaders/loadingmanager"; | ||
export { CameraEnvironmentMap } from "./cameraenvironmentmap"; | ||
export { TargetImagePreviewBufferGeometry } from "./geometry/targetimagepreviewbuffergeometry"; | ||
export { TargetImagePreviewMesh } from "./mesh/targetimagepreviewmesh"; | ||
export { ImageTracker, InstantWorldTracker, BarcodeFinder, FaceTracker, CameraSource, HTMLElementSource, onFrameUpdate, glContextSet, glContextLost, getDefaultPipeline, } from "./defaultpipeline"; | ||
export { FaceMesh, FaceLandmark, FaceLandmarkName, Pipeline, LogLevel, setLogLevel, permissionDenied, permissionGranted, permissionRequest, permissionDeniedUI, permissionRequestUI, browserIncompatible, browserIncompatibleUI, loaded, loadedPromise, SequenceSource, } from "@zappar/zappar"; |
@@ -1,7 +0,4 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.FaceMeshLoader = void 0; | ||
/* eslint-disable class-methods-use-this */ | ||
const zappar_1 = require("@zappar/zappar"); | ||
const three_1 = require("../three"); | ||
import { FaceMesh } from "@zappar/zappar"; | ||
import { THREE } from "../three"; | ||
/** | ||
@@ -11,3 +8,3 @@ * Loader for adaptive face mesh data. | ||
*/ | ||
class FaceMeshLoader extends three_1.THREE.Loader { | ||
export class FaceMeshLoader extends THREE.Loader { | ||
/** | ||
@@ -21,3 +18,3 @@ * Loads the data for a face mesh. | ||
load(options, onLoad, onProgress, onError) { | ||
const trk = new zappar_1.FaceMesh(); | ||
const trk = new FaceMesh(); | ||
let p; | ||
@@ -55,3 +52,3 @@ const itemFilename = `__zappar_threejs_face_mesh_${JSON.stringify(options || "default")}`; | ||
loadFace(options, onLoad, onProgress, onError) { | ||
const trk = new zappar_1.FaceMesh(); | ||
const trk = new FaceMesh(); | ||
let p; | ||
@@ -87,3 +84,3 @@ const itemFilename = `__zappar_threejs_face_mesh_face_${JSON.stringify(options || "default")}`; | ||
loadFullHeadSimplified(options, onLoad, onProgress, onError) { | ||
const trk = new zappar_1.FaceMesh(); | ||
const trk = new FaceMesh(); | ||
let p; | ||
@@ -115,2 +112,1 @@ const itemFilename = `__zappar_threejs_face_mesh_full_head_${JSON.stringify(options || "default")}`; | ||
} | ||
exports.FaceMeshLoader = FaceMeshLoader; |
@@ -1,7 +0,4 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.FaceTrackerLoader = void 0; | ||
/* eslint-disable class-methods-use-this */ | ||
const three_1 = require("../three"); | ||
const defaultpipeline_1 = require("../defaultpipeline"); | ||
import { THREE } from "../three"; | ||
import { FaceTracker } from "../defaultpipeline"; | ||
/** | ||
@@ -11,3 +8,3 @@ * Loader for face tracking model data. | ||
*/ | ||
class FaceTrackerLoader extends three_1.THREE.Loader { | ||
export class FaceTrackerLoader extends THREE.Loader { | ||
/** | ||
@@ -22,3 +19,3 @@ * Loads face tracking model data. | ||
load(customModel, onLoad, onProgress, onError) { | ||
const trk = new defaultpipeline_1.FaceTracker(); | ||
const trk = new FaceTracker(); | ||
const p = customModel ? trk.loadModel(customModel) : trk.loadDefaultModel(); | ||
@@ -41,2 +38,1 @@ const itemFilename = typeof customModel === "string" ? customModel : "__zappar_threejs_face_tracker_default"; | ||
} | ||
exports.FaceTrackerLoader = FaceTrackerLoader; |
@@ -1,7 +0,4 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.HeadMaskMeshLoader = void 0; | ||
/* eslint-disable class-methods-use-this */ | ||
const three_1 = require("../three"); | ||
const headmaskmesh_1 = require("../mesh/headmaskmesh"); | ||
import { THREE } from "../three"; | ||
import { HeadMaskMesh } from "../mesh/headmaskmesh"; | ||
const itemFilename = "__zappar_threejs_head_mask_mesh"; | ||
@@ -12,3 +9,3 @@ /** | ||
*/ | ||
class HeadMaskMeshLoader extends three_1.THREE.Loader { | ||
export class HeadMaskMeshLoader extends THREE.Loader { | ||
/** | ||
@@ -22,3 +19,3 @@ * Loads a HeadMaskMesh. | ||
this.manager.itemStart(itemFilename); | ||
return new headmaskmesh_1.HeadMaskMesh(() => { | ||
return new HeadMaskMesh(() => { | ||
onLoad === null || onLoad === void 0 ? void 0 : onLoad(); | ||
@@ -37,2 +34,1 @@ this.manager.itemEnd(itemFilename); | ||
} | ||
exports.HeadMaskMeshLoader = HeadMaskMeshLoader; |
@@ -1,7 +0,4 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ImageTrackerLoader = void 0; | ||
/* eslint-disable class-methods-use-this */ | ||
const three_1 = require("../three"); | ||
const defaultpipeline_1 = require("../defaultpipeline"); | ||
import { THREE } from "../three"; | ||
import { ImageTracker } from "../defaultpipeline"; | ||
/** | ||
@@ -11,3 +8,3 @@ * Loader for image trackers. | ||
*/ | ||
class ImageTrackerLoader extends three_1.THREE.Loader { | ||
export class ImageTrackerLoader extends THREE.Loader { | ||
/** | ||
@@ -22,3 +19,3 @@ * Loads an image tracker. | ||
load(zpt, onLoad, onProgress, onError) { | ||
const trk = new defaultpipeline_1.ImageTracker(); | ||
const trk = new ImageTracker(); | ||
trk | ||
@@ -42,2 +39,1 @@ .loadTarget(zpt) | ||
} | ||
exports.ImageTrackerLoader = ImageTrackerLoader; |
@@ -1,7 +0,4 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.LibraryLoader = void 0; | ||
/* eslint-disable class-methods-use-this */ | ||
const __1 = require(".."); | ||
const three_1 = require("../three"); | ||
import { loadedPromise } from ".."; | ||
import { THREE } from "../three"; | ||
const itemFilename = "__zappar_threejs_library"; | ||
@@ -13,3 +10,3 @@ /** | ||
*/ | ||
class LibraryLoader extends three_1.THREE.Loader { | ||
export class LibraryLoader extends THREE.Loader { | ||
/** | ||
@@ -22,3 +19,3 @@ * Resolves once the library is loaded and ready to process data. | ||
this.manager.itemStart(itemFilename); | ||
(0, __1.loadedPromise)() | ||
loadedPromise() | ||
.then(() => { | ||
@@ -39,2 +36,1 @@ onLoad === null || onLoad === void 0 ? void 0 : onLoad(); | ||
} | ||
exports.LibraryLoader = LibraryLoader; |
@@ -1,7 +0,4 @@ | ||
"use strict"; | ||
/* eslint-disable guard-for-in */ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.LoadingManager = exports.DefaultLoaderUI = void 0; | ||
const three_1 = require("../three"); | ||
const libraryloader_1 = require("./libraryloader"); | ||
import { THREE } from "../three"; | ||
import { LibraryLoader } from "./libraryloader"; | ||
class UI { | ||
@@ -120,3 +117,3 @@ constructor(style) { | ||
*/ | ||
class DefaultLoaderUI extends UI { | ||
export class DefaultLoaderUI extends UI { | ||
/** | ||
@@ -129,10 +126,10 @@ * Constructs a new DefaultLoaderUI. | ||
super(options === null || options === void 0 ? void 0 : options.style); | ||
three_1.THREE.DefaultLoadingManager.onStart = () => { | ||
THREE.DefaultLoadingManager.onStart = () => { | ||
this.initialize(); | ||
}; | ||
three_1.THREE.DefaultLoadingManager.onLoad = () => { | ||
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_1.THREE.DefaultLoadingManager.onProgress = (_url, itemsLoaded, itemsTotal) => { | ||
THREE.DefaultLoadingManager.onProgress = (_url, itemsLoaded, itemsTotal) => { | ||
this.updateLoader((itemsLoaded / itemsTotal) * 100); | ||
@@ -142,3 +139,2 @@ }; | ||
} | ||
exports.DefaultLoaderUI = DefaultLoaderUI; | ||
/** | ||
@@ -148,3 +144,3 @@ * A LoadingManager with a user friendly interface. | ||
*/ | ||
class LoadingManager extends three_1.THREE.LoadingManager { | ||
export class LoadingManager extends THREE.LoadingManager { | ||
/** | ||
@@ -185,5 +181,4 @@ * Constructs a new LoadingManager. | ||
}; | ||
new libraryloader_1.LibraryLoader(this).load(); | ||
new LibraryLoader(this).load(); | ||
} | ||
} | ||
exports.LoadingManager = LoadingManager; |
@@ -1,7 +0,4 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.HeadMaskMesh = void 0; | ||
const Zappar = require("@zappar/zappar"); | ||
const three_1 = require("../three"); | ||
const facebuffergeometry_1 = require("../geometry/facebuffergeometry"); | ||
import * as Zappar from "@zappar/zappar"; | ||
import { THREE } from "../three"; | ||
import { FaceBufferGeometry } from "../geometry/facebuffergeometry"; | ||
/** | ||
@@ -16,3 +13,3 @@ * A THREE.Mesh that fits the user's head and fills the depth buffer, | ||
*/ | ||
class HeadMaskMesh extends three_1.THREE.Mesh { | ||
export class HeadMaskMesh extends THREE.Mesh { | ||
/** | ||
@@ -28,5 +25,5 @@ * Constructs a new head mask mesh. | ||
this.faceMesh = new Zappar.FaceMesh(); | ||
this.faceBufferGeometry = new facebuffergeometry_1.FaceBufferGeometry(this.faceMesh); | ||
this.faceBufferGeometry = new FaceBufferGeometry(this.faceMesh); | ||
this.geometry = this.faceBufferGeometry; | ||
this.material = new three_1.THREE.MeshBasicMaterial({ | ||
this.material = new THREE.MeshBasicMaterial({ | ||
colorWrite: false, | ||
@@ -70,2 +67,1 @@ }); | ||
} | ||
exports.HeadMaskMesh = HeadMaskMesh; |
@@ -1,6 +0,3 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.TargetImagePreviewMesh = void 0; | ||
const __1 = require(".."); | ||
const three_1 = require("../three"); | ||
import { TargetImagePreviewBufferGeometry } from ".."; | ||
import { THREE } from "../three"; | ||
/** | ||
@@ -11,9 +8,8 @@ * A THREE.Mesh that fits the target image. | ||
*/ | ||
class TargetImagePreviewMesh extends three_1.THREE.Mesh { | ||
constructor(target, material = new three_1.THREE.MeshBasicMaterial({ | ||
map: new three_1.THREE.TextureLoader().load(target.image.src), | ||
export class TargetImagePreviewMesh extends THREE.Mesh { | ||
constructor(target, material = new THREE.MeshBasicMaterial({ | ||
map: new THREE.TextureLoader().load(target.image.src), | ||
})) { | ||
super(new __1.TargetImagePreviewBufferGeometry(target), material); | ||
super(new TargetImagePreviewBufferGeometry(target), material); | ||
} | ||
} | ||
exports.TargetImagePreviewMesh = TargetImagePreviewMesh; |
@@ -1,10 +0,7 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.THREE = void 0; | ||
/* eslint-disable tsdoc/syntax */ | ||
// eslint-disable-next-line no-restricted-imports | ||
const three = require("three"); | ||
import * as three from "three"; | ||
/** | ||
* THREE import which gets converted to AFRAME.THREE for @zappar/three-for-aframe. | ||
*/ | ||
exports.THREE = three; | ||
export const THREE = three; |
@@ -1,6 +0,3 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.FaceAnchorGroup = void 0; | ||
const three_1 = require("../three"); | ||
const camera_1 = require("../camera"); | ||
import { THREE } from "../three"; | ||
import { CameraMirrorMode } from "../camera"; | ||
/** | ||
@@ -10,3 +7,3 @@ * A THREE.Group which attaches content to a face as it moves around in the camera view. | ||
*/ | ||
class FaceAnchorGroup extends three_1.THREE.Group { | ||
export class FaceAnchorGroup extends THREE.Group { | ||
/** | ||
@@ -41,3 +38,3 @@ * Constructs a new FaceAnchorGroup. | ||
if (this.currentAnchor) { | ||
this.matrix.fromArray(this.currentAnchor.pose(this.camera.rawPose, this.camera.currentMirrorMode === camera_1.CameraMirrorMode.Poses)); | ||
this.matrix.fromArray(this.currentAnchor.pose(this.camera.rawPose, this.camera.currentMirrorMode === CameraMirrorMode.Poses)); | ||
this.matrix.decompose(this.position, this.quaternion, this.scale); | ||
@@ -48,2 +45,1 @@ } | ||
} | ||
exports.FaceAnchorGroup = FaceAnchorGroup; |
@@ -1,8 +0,5 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.FaceLandmarkGroup = void 0; | ||
const zappar_1 = require("@zappar/zappar"); | ||
const gl_matrix_1 = require("gl-matrix"); | ||
const three_1 = require("../three"); | ||
const camera_1 = require("../camera"); | ||
import { FaceLandmark } from "@zappar/zappar"; | ||
import { mat4 } from "gl-matrix"; | ||
import { THREE } from "../three"; | ||
import { CameraMirrorMode } from "../camera"; | ||
/** | ||
@@ -13,3 +10,3 @@ * A THREE.Group which attaches content to a known point (landmark) on a face as it moves around in the camera view. | ||
*/ | ||
class FaceLandmarkGroup extends three_1.THREE.Group { | ||
export class FaceLandmarkGroup extends THREE.Group { | ||
/** | ||
@@ -25,4 +22,4 @@ * Constructs a new FaceLandmarkGroup. | ||
this.faceTracker = faceTracker; | ||
this.pose = gl_matrix_1.mat4.create(); | ||
this.landmark = new zappar_1.FaceLandmark(landmark); | ||
this.pose = mat4.create(); | ||
this.landmark = new FaceLandmark(landmark); | ||
// We'll be updating this Group's matrix ourselves from the Zappar library | ||
@@ -37,4 +34,4 @@ this.matrixAutoUpdate = false; | ||
if (this.currentAnchor) { | ||
this.landmark.updateFromFaceAnchor(this.currentAnchor, this.camera.currentMirrorMode === camera_1.CameraMirrorMode.Poses); | ||
gl_matrix_1.mat4.multiply(this.pose, this.currentAnchor.pose(this.camera.rawPose, this.camera.currentMirrorMode === camera_1.CameraMirrorMode.Poses), this.landmark.pose); | ||
this.landmark.updateFromFaceAnchor(this.currentAnchor, this.camera.currentMirrorMode === CameraMirrorMode.Poses); | ||
mat4.multiply(this.pose, this.currentAnchor.pose(this.camera.rawPose, this.camera.currentMirrorMode === CameraMirrorMode.Poses), this.landmark.pose); | ||
this.matrix.fromArray(this.pose); | ||
@@ -52,2 +49,1 @@ this.matrix.decompose(this.position, this.quaternion, this.scale); | ||
} | ||
exports.FaceLandmarkGroup = FaceLandmarkGroup; |
@@ -1,6 +0,3 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ImageAnchorGroup = void 0; | ||
const three_1 = require("../three"); | ||
const camera_1 = require("../camera"); | ||
import { THREE } from "../three"; | ||
import { CameraMirrorMode } from "../camera"; | ||
/** | ||
@@ -10,3 +7,3 @@ * A THREE.Group that attaches content to a known image as it moves around in the camera view. | ||
*/ | ||
class ImageAnchorGroup extends three_1.THREE.Group { | ||
export class ImageAnchorGroup extends THREE.Group { | ||
/** | ||
@@ -41,3 +38,3 @@ * Constructs a new ImageAnchorGroup. | ||
if (this.currentAnchor) { | ||
this.matrix.fromArray(this.currentAnchor.pose(this.camera.rawPose, this.camera.currentMirrorMode === camera_1.CameraMirrorMode.Poses)); | ||
this.matrix.fromArray(this.currentAnchor.pose(this.camera.rawPose, this.camera.currentMirrorMode === CameraMirrorMode.Poses)); | ||
this.matrix.decompose(this.position, this.quaternion, this.scale); | ||
@@ -48,2 +45,1 @@ } | ||
} | ||
exports.ImageAnchorGroup = ImageAnchorGroup; |
@@ -1,6 +0,3 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.InstantWorldAnchorGroup = void 0; | ||
const three_1 = require("../three"); | ||
const camera_1 = require("../camera"); | ||
import { THREE } from "../three"; | ||
import { CameraMirrorMode } from "../camera"; | ||
/** | ||
@@ -10,3 +7,3 @@ * A THREE.Group which attaches content to a point on a surface in front of the user as it moves around in the camera view. | ||
*/ | ||
class InstantWorldAnchorGroup extends three_1.THREE.Group { | ||
export class InstantWorldAnchorGroup extends THREE.Group { | ||
/** | ||
@@ -37,3 +34,3 @@ * Constructs a new InstantWorldAnchorGroup. | ||
updateMatrixWorld(force) { | ||
this.matrix.fromArray(this.instantTracker.anchor.pose(this.camera.rawPose, this.camera.currentMirrorMode === camera_1.CameraMirrorMode.Poses)); | ||
this.matrix.fromArray(this.instantTracker.anchor.pose(this.camera.rawPose, this.camera.currentMirrorMode === CameraMirrorMode.Poses)); | ||
this.matrix.decompose(this.position, this.quaternion, this.scale); | ||
@@ -43,2 +40,1 @@ super.updateMatrixWorld(force); | ||
} | ||
exports.InstantWorldAnchorGroup = InstantWorldAnchorGroup; |
/** | ||
* SDK version. | ||
*/ | ||
export declare const VERSION = "2.0.6"; | ||
export declare const VERSION = "2.1.0"; |
@@ -1,7 +0,4 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.VERSION = void 0; | ||
/** | ||
* SDK version. | ||
*/ | ||
exports.VERSION = "2.0.6"; | ||
export const VERSION = "2.1.0"; |
{ | ||
"name": "@zappar/zappar-threejs", | ||
"version": "2.0.6", | ||
"version": "2.1.0", | ||
"description": "ThreeJS wrappers for Zappar's computer vision library", | ||
@@ -81,3 +81,3 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"@zappar/zappar": "2.0.0" | ||
"@zappar/zappar": "2.1.0" | ||
}, | ||
@@ -84,0 +84,0 @@ "husky": { |
@@ -71,3 +71,3 @@ # Zappar for ThreeJS | ||
<!-- Added by: zapparadmin, at: Mon Nov 14 13:53:36 GMT 2022 --> | ||
<!-- Added by: zapparadmin, at: Wed Feb 8 14:20:00 GMT 2023 --> | ||
@@ -103,3 +103,3 @@ <!--te--> | ||
Download the bundle from: | ||
<https://libs.zappar.com/zappar-threejs/2.0.6/zappar-threejs.zip> | ||
<https://libs.zappar.com/zappar-threejs/2.1.0/zappar-threejs.zip> | ||
@@ -117,3 +117,3 @@ Unzip into your web project and reference from your HTML like this: | ||
```html | ||
<script src="https://libs.zappar.com/zappar-threejs/2.0.6/zappar-threejs.js"></script> | ||
<script src="https://libs.zappar.com/zappar-threejs/2.1.0/zappar-threejs.js"></script> | ||
``` | ||
@@ -120,0 +120,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
7735419
2176
+ Added@zappar/zappar@2.1.0(transitive)
- Removed@zappar/zappar@2.0.0(transitive)
Updated@zappar/zappar@2.1.0