Showing preview only (7,767K chars total). Download the full file or copy to clipboard to get everything.
Repository: mozilla/webxr-polyfill
Branch: master
Commit: 4ba29e108b9b
Files: 136
Total size: 18.1 MB
Directory structure:
gitextract_kgg3nd5t/
├── .gitignore
├── CODE_OF_CONDUCT.md
├── CODING.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── dist-footer.js
├── dist-header.js
├── examples/
│ ├── ar_anchors/
│ │ └── index.html
│ ├── ar_simplest/
│ │ └── index.html
│ ├── boombox/
│ │ └── index.html
│ ├── common.css
│ ├── common.js
│ ├── face_tracking/
│ │ ├── DuckyMesh.glb
│ │ ├── glasses/
│ │ │ └── glasses.gltf
│ │ └── index.html
│ ├── hit_test/
│ │ └── index.html
│ ├── image_detection/
│ │ ├── DuckyMesh.glb
│ │ └── index.html
│ ├── libs/
│ │ ├── loaders/
│ │ │ └── BinaryLoader.js
│ │ ├── postprocessing/
│ │ │ ├── BloomPass.js
│ │ │ ├── EffectComposer.js
│ │ │ ├── FilmPass.js
│ │ │ ├── MaskPass.js
│ │ │ ├── RenderPass.js
│ │ │ └── ShaderPass.js
│ │ ├── shaders/
│ │ │ ├── ConvolutionShader.js
│ │ │ ├── CopyShader.js
│ │ │ ├── FilmShader.js
│ │ │ └── FocusShader.js
│ │ ├── stats.js
│ │ ├── three-gltf-loader.js
│ │ ├── three-mtl-loader.js
│ │ ├── three-obj-loader.js
│ │ └── three.js
│ ├── light/
│ │ └── index.html
│ ├── models/
│ │ ├── Axis.mtl
│ │ ├── Axis.obj
│ │ ├── BoomBox/
│ │ │ ├── README.md
│ │ │ ├── glTF/
│ │ │ │ └── BoomBox.gltf
│ │ │ ├── glTF-Binary/
│ │ │ │ └── BoomBox.glb
│ │ │ └── glTF-pbrSpecularGlossiness/
│ │ │ └── BoomBox.gltf
│ │ ├── TeapotBufferGeometry.js
│ │ ├── female02/
│ │ │ ├── Female02_bin.js
│ │ │ ├── Female02_slim.js
│ │ │ ├── female02.mtl
│ │ │ ├── female02.obj
│ │ │ ├── female02_vertex_colors.obj
│ │ │ └── readme.txt
│ │ └── male02/
│ │ ├── 01_-_Default1noCulling.dds
│ │ ├── Male02_bin.js
│ │ ├── Male02_dds.js
│ │ ├── Male02_slim.js
│ │ ├── male-02-1noCulling.dds
│ │ ├── male02.mtl
│ │ ├── male02.obj
│ │ ├── male02_dds.mtl
│ │ ├── orig_02_-_Defaul1noCulling.dds
│ │ └── readme.txt
│ ├── opencv-aruco/
│ │ ├── createMarker.html
│ │ ├── index.html
│ │ ├── opencv.js
│ │ ├── opencv_js.wasm
│ │ └── worker.js
│ ├── opencv-face/
│ │ ├── haarcascade_eye.xml
│ │ ├── haarcascade_frontalface_default.xml
│ │ ├── haarcascade_profileface.xml
│ │ ├── index.html
│ │ ├── old-rotate-resize.js
│ │ ├── opencv.js
│ │ ├── opencv_js.wasm
│ │ └── worker.js
│ ├── peoples/
│ │ └── index.html
│ ├── persistence/
│ │ └── index.html
│ ├── reticle/
│ │ └── index.html
│ ├── sensing/
│ │ └── index.html
│ ├── simplecv/
│ │ ├── index.html
│ │ ├── webxr-worker.js
│ │ └── worker.js
│ ├── textures/
│ │ └── Park2/
│ │ └── readme.txt
│ └── vr_simplest/
│ └── index.html
├── index.html
├── package.json
├── polyfill/
│ ├── Reality.js
│ ├── XRAnchor.js
│ ├── XRAnchorOffset.js
│ ├── XRCoordinateSystem.js
│ ├── XRDisplay.js
│ ├── XRFaceAnchor.js
│ ├── XRFieldOfView.js
│ ├── XRImageAnchor.js
│ ├── XRLayer.js
│ ├── XRLightEstimate.js
│ ├── XRPlaneAnchor.js
│ ├── XRPointCloud.js
│ ├── XRPolyfill.js
│ ├── XRPresentationFrame.js
│ ├── XRSession.js
│ ├── XRSessionCreateParameters.js
│ ├── XRStageBounds.js
│ ├── XRStageBoundsPoint.js
│ ├── XRVideoFrame.js
│ ├── XRView.js
│ ├── XRViewPose.js
│ ├── XRViewport.js
│ ├── XRWebGLLayer.js
│ ├── XRWorkerPolyfill.js
│ ├── display/
│ │ ├── FlatDisplay.js
│ │ └── HeadMountedDisplay.js
│ ├── fill/
│ │ ├── DeviceOrientationTracker.js
│ │ ├── Euler.js
│ │ ├── EventHandlerBase.js
│ │ ├── MatrixMath.js
│ │ ├── Quaternion.js
│ │ ├── Vector3.js
│ │ ├── base64-binary.js
│ │ ├── gl-matrix/
│ │ │ ├── common.js
│ │ │ ├── mat2.js
│ │ │ ├── mat2d.js
│ │ │ ├── mat3.js
│ │ │ ├── mat4.js
│ │ │ ├── quat.js
│ │ │ ├── vec2.js
│ │ │ ├── vec3.js
│ │ │ └── vec4.js
│ │ ├── gl-matrix-min.js
│ │ └── gl-matrix.js
│ ├── platform/
│ │ ├── ARCoreCameraRenderer.js
│ │ └── ARKitWrapper.js
│ └── reality/
│ ├── CameraReality.js
│ └── VirtualReality.js
├── tests/
│ ├── CoordinatesTest.js
│ ├── Test.js
│ └── index.html
├── viewer.html
└── webpack.config.js
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
node_modules/
dist/
================================================
FILE: CODE_OF_CONDUCT.md
================================================
# Community Participation Guidelines
This repository is governed by Mozilla's code of conduct and etiquette guidelines.
For more details, please read the
[Mozilla Community Participation Guidelines](https://www.mozilla.org/about/governance/policies/participation/).
## How to Report
For more information on how to report violations of the Community Participation Guidelines, please read our '[How to Report](https://www.mozilla.org/about/governance/policies/participation/reporting/)' page.
<!--
## Project Specific Etiquette
In some cases, there will be additional project etiquette i.e.: (https://bugzilla.mozilla.org/page.cgi?id=etiquette.html).
Please update for your project.
-->
================================================
FILE: CODING.md
================================================
# How to code against the WebXR APIs
Working examples of this type of code can be found in the [examples directory](https://github.com/mozilla/webxr-polyfill/tree/master/examples).
## Session setup
The basic pattern is to iterate through the `XRDisplay` instances to find the one that you want to use, based on whether it's external and whether it is a pass-through display. Once you have a display, you ask it for an `XRSession` that is either for rendering a `Reality` or rendering an augmentation on top of a `Reality`.
let displays = null // A list of XRDisplay
let display = null // The display we'll use
let session = null // The XRSession we'll use
let canvas = document.createElement('canvas') // The canvas into which we'll render
let anchoredNodes = [] // An array of { anchorOffset: XRAnchorOffset, node: <scene node like THREE.Group> }
// Get displays and then request a session
navigator.XR.getDisplays().then(disps => {
if(disps.length == 0) {
// No displays are available
return
}
displays = disps
}).catch(err => {
console.error('Error getting XR displays', err)
})
Once you have the displays, you look for one that will support the type of session that you want to start:
// Set up the options for the type of session we want
let sessionInitOptions = {
exclusive: false, // True if you want only this session to have access to the display
type: 'augmentation' // do you want the session to create a 'reality' or offer an 'augmentation' on an existing `Reality`
outputContext: new XRPresentationContext(canvas) // Then canvas into which we'll render
}
// Now test each display
for(let disp of displays){
if(display.supportsSession(sessionInitOptions)){
display = disp
break
}
}
Once you have a display and the user has chosen to start using it, you ask the display for an `XRSession` and request the first frame:
display.requestSession(sessionInitOptions).then(sess => {
session = sess
session.depthNear = 0.1
session.depthFar = 1000.0
session.requestFrame(handleFrame)
)}
## Per-frame rendering
The scene, camera, and renderer objects below are representative APIs that have equivalents in most WebGL libs like Three.js:
function handleFrame(frame){
// Set up for the next frame
session.requestFrame(frame => { handleFrame(frame) })
// Get the pose for the head
let headCoordinateSystem = frame.getCoordinateSystem(XRCoordinateSystem.HEAD_MODEL)
let headPose = frame.getDsiplayPose(frame.getCoordinateSystem(headCoordinateSystem)
// XXX Below we will add code here to add and manage anchors
// Displays can have one or more views. A magic window display has one, a headset has two (one for each eye), so iterate through each.
for(const view of frame.views){
// Each XRView has its own projection matrix, so set the camera to use that
camera.projectionMatrix = view.projectionMatrix
// Rotate the scene around the camera using the head pose
scene.matrix = headPose.getViewMatrix(view)
// Set up the renderer to the XRView's viewport and then render
const viewport = view.getViewport(session.baseLayer)
renderer.setViewport(viewport.x, viewport.y, viewport.width, viewport.height)
renderer.render(scene, camera)
}
}
## Finding and updating anchors
Anchors are places in space that the AR system is tracking for you. They could be a surface like a floor or table, a feature like a door knob, or just a point in space relative to the world coordinate system. When you place virtual objects in XR, you find an `XRAnchor` to attach it to, possibly with an `XRAnchorOffset` to indicate a position relative to the anchor.
The reason that you use anchors instead of just placing objects in a global coordinate system is that AR systems may change their relative position over time as they sense the world. A table may shift. The system may refine its estimate of the location of the floor or a wall.
First, let's add an anchor just floated in space a meter in front of the current head position.
This code uses the `XRPresentationFrame`, so it would live in the `handleFrame` method above, where the '// XXX' comment is:
const sceneNode = createSceneNode() // if using Three.js, could be an Object3D or a Group
let anchorUID = frame.addAnchor(headCoordinateSystem, [0, 0, -1])
scene.add(sceneNode) // Now the node is in the scene
// Save this info for update during each frame
anchoredNodes.push({
anchorOffset: new XRAnchorOffset(anchor.uid),
node: sceneNode
})
Now search for an anchor on a surface like a floor or table:
frame.findAnchor(x, y).then(anchorOffset => {
if(anchorOffset === null){
// no surface was found to place the anchor
return
}
const node = createSceneNode()
// Add the node to the scene
scene.add(node)
// Save this info for update during each frame
anchoredNodes.push({
anchorOffset: anchorOffset,
node: node
})
})
You now have a couple of anchored nodes save in `anchoredNodes`, so during each frame use the most recent anchor info to update the node position:
for(let anchoredNode of anchoredNodes){
// Get the updated anchor info
const anchor = frame.getAnchor(anchoredNode.anchorOffset.anchorUID)
// Get the offset coordinates relative to the anchor's coordinate system
let offsetTransform = anchoredNode.anchorOffset.getOffsetTransform(anchor.coordinateSystem)
// Now use the offset transform to position the anchored node in the scene
anchoredNode.node.matrix = offsetTransform
}
================================================
FILE: CONTRIBUTING.md
================================================
Contributing to webxr-polyfill
======================
This is an open source project and we love to receive contributions from the community. There are many ways to contribute, from writing documentation, submitting bug reports and feature requests or writing code.
We would also love to hear how you are using this code and to receive contributions that make it easier to deploy and integrate.
Bug reports
-----------
If you think you have found a bug, first make sure that you are testing against the [master branch](https://github.com/mozilla/webxr-polyfill) - your issue may already have been fixed. If not, search our [issues list](https://github.com/mozilla/webxr-polyfill/issues) on GitHub in the event a similar issue has already been opened.
It is very helpful if you can provide enough information to replicate the bug. In other words, provide a small test case which we can run to confirm your bug. It makes it easier to find the problem and resolve it.
Provide as much information as you can. The easier it is for us to recreate your problem, the faster we can fix it.
Feature requests
----------------
If you are looking for a feature that doesn't exist currently, you are probably not alone.
Open an issue on our [issues list](https://github.com/mozilla/webxr-polyfill/issues) on GitHub which describes the feature you would like to see, the value it provides, and how it should work.
If you attach diagrams or mockups, it would be super nice ;-).
Contributing code and documentation changes
-------------------------------------------
If you have a bugfix or new feature that you would like to contribute, please search through our issues and see if one exists, or open an issue about it first. Explain what you would like to do. It is possible someone has already begun to work on it, or that there are existing issues that you should know about before implementing the change.
We enjoy working with contributors to get their code accepted. There are many approaches to fixing a problem and it is important to find the best approach before writing too much code.
The process is described below.
### Fork and clone the repository
You will need to fork the main [repository](https://github.com/mozilla/webxr-polyfill) and clone it to your local machine. See
[github help page](https://help.github.com/articles/fork-a-repo) for help.
Push your local changes to your forked copy of the repository and [submit a pull request](https://help.github.com/articles/using-pull-requests). In the pull request, describe what your changes do and mention the number of the issue where discussion has taken place, eg "Closes #123".
Then sit back and wait. There will probably be discussion about the pull request, and if any changes are needed, we would love to work with you to get your pull request merged.
================================================
FILE: LICENSE
================================================
Mozilla Public License Version 2.0
==================================
1. Definitions
--------------
1.1. "Contributor"
means each individual or legal entity that creates, contributes to
the creation of, or owns Covered Software.
1.2. "Contributor Version"
means the combination of the Contributions of others (if any) used
by a Contributor and that particular Contributor's Contribution.
1.3. "Contribution"
means Covered Software of a particular Contributor.
1.4. "Covered Software"
means Source Code Form to which the initial Contributor has attached
the notice in Exhibit A, the Executable Form of such Source Code
Form, and Modifications of such Source Code Form, in each case
including portions thereof.
1.5. "Incompatible With Secondary Licenses"
means
(a) that the initial Contributor has attached the notice described
in Exhibit B to the Covered Software; or
(b) that the Covered Software was made available under the terms of
version 1.1 or earlier of the License, but not also under the
terms of a Secondary License.
1.6. "Executable Form"
means any form of the work other than Source Code Form.
1.7. "Larger Work"
means a work that combines Covered Software with other material, in
a separate file or files, that is not Covered Software.
1.8. "License"
means this document.
1.9. "Licensable"
means having the right to grant, to the maximum extent possible,
whether at the time of the initial grant or subsequently, any and
all of the rights conveyed by this License.
1.10. "Modifications"
means any of the following:
(a) any file in Source Code Form that results from an addition to,
deletion from, or modification of the contents of Covered
Software; or
(b) any new file in Source Code Form that contains any Covered
Software.
1.11. "Patent Claims" of a Contributor
means any patent claim(s), including without limitation, method,
process, and apparatus claims, in any patent Licensable by such
Contributor that would be infringed, but for the grant of the
License, by the making, using, selling, offering for sale, having
made, import, or transfer of either its Contributions or its
Contributor Version.
1.12. "Secondary License"
means either the GNU General Public License, Version 2.0, the GNU
Lesser General Public License, Version 2.1, the GNU Affero General
Public License, Version 3.0, or any later versions of those
licenses.
1.13. "Source Code Form"
means the form of the work preferred for making modifications.
1.14. "You" (or "Your")
means an individual or a legal entity exercising rights under this
License. For legal entities, "You" includes any entity that
controls, is controlled by, or is under common control with You. For
purposes of this definition, "control" means (a) the power, direct
or indirect, to cause the direction or management of such entity,
whether by contract or otherwise, or (b) ownership of more than
fifty percent (50%) of the outstanding shares or beneficial
ownership of such entity.
2. License Grants and Conditions
--------------------------------
2.1. Grants
Each Contributor hereby grants You a world-wide, royalty-free,
non-exclusive license:
(a) under intellectual property rights (other than patent or trademark)
Licensable by such Contributor to use, reproduce, make available,
modify, display, perform, distribute, and otherwise exploit its
Contributions, either on an unmodified basis, with Modifications, or
as part of a Larger Work; and
(b) under Patent Claims of such Contributor to make, use, sell, offer
for sale, have made, import, and otherwise transfer either its
Contributions or its Contributor Version.
2.2. Effective Date
The licenses granted in Section 2.1 with respect to any Contribution
become effective for each Contribution on the date the Contributor first
distributes such Contribution.
2.3. Limitations on Grant Scope
The licenses granted in this Section 2 are the only rights granted under
this License. No additional rights or licenses will be implied from the
distribution or licensing of Covered Software under this License.
Notwithstanding Section 2.1(b) above, no patent license is granted by a
Contributor:
(a) for any code that a Contributor has removed from Covered Software;
or
(b) for infringements caused by: (i) Your and any other third party's
modifications of Covered Software, or (ii) the combination of its
Contributions with other software (except as part of its Contributor
Version); or
(c) under Patent Claims infringed by Covered Software in the absence of
its Contributions.
This License does not grant any rights in the trademarks, service marks,
or logos of any Contributor (except as may be necessary to comply with
the notice requirements in Section 3.4).
2.4. Subsequent Licenses
No Contributor makes additional grants as a result of Your choice to
distribute the Covered Software under a subsequent version of this
License (see Section 10.2) or under the terms of a Secondary License (if
permitted under the terms of Section 3.3).
2.5. Representation
Each Contributor represents that the Contributor believes its
Contributions are its original creation(s) or it has sufficient rights
to grant the rights to its Contributions conveyed by this License.
2.6. Fair Use
This License is not intended to limit any rights You have under
applicable copyright doctrines of fair use, fair dealing, or other
equivalents.
2.7. Conditions
Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
in Section 2.1.
3. Responsibilities
-------------------
3.1. Distribution of Source Form
All distribution of Covered Software in Source Code Form, including any
Modifications that You create or to which You contribute, must be under
the terms of this License. You must inform recipients that the Source
Code Form of the Covered Software is governed by the terms of this
License, and how they can obtain a copy of this License. You may not
attempt to alter or restrict the recipients' rights in the Source Code
Form.
3.2. Distribution of Executable Form
If You distribute Covered Software in Executable Form then:
(a) such Covered Software must also be made available in Source Code
Form, as described in Section 3.1, and You must inform recipients of
the Executable Form how they can obtain a copy of such Source Code
Form by reasonable means in a timely manner, at a charge no more
than the cost of distribution to the recipient; and
(b) You may distribute such Executable Form under the terms of this
License, or sublicense it under different terms, provided that the
license for the Executable Form does not attempt to limit or alter
the recipients' rights in the Source Code Form under this License.
3.3. Distribution of a Larger Work
You may create and distribute a Larger Work under terms of Your choice,
provided that You also comply with the requirements of this License for
the Covered Software. If the Larger Work is a combination of Covered
Software with a work governed by one or more Secondary Licenses, and the
Covered Software is not Incompatible With Secondary Licenses, this
License permits You to additionally distribute such Covered Software
under the terms of such Secondary License(s), so that the recipient of
the Larger Work may, at their option, further distribute the Covered
Software under the terms of either this License or such Secondary
License(s).
3.4. Notices
You may not remove or alter the substance of any license notices
(including copyright notices, patent notices, disclaimers of warranty,
or limitations of liability) contained within the Source Code Form of
the Covered Software, except that You may alter any license notices to
the extent required to remedy known factual inaccuracies.
3.5. Application of Additional Terms
You may choose to offer, and to charge a fee for, warranty, support,
indemnity or liability obligations to one or more recipients of Covered
Software. However, You may do so only on Your own behalf, and not on
behalf of any Contributor. You must make it absolutely clear that any
such warranty, support, indemnity, or liability obligation is offered by
You alone, and You hereby agree to indemnify every Contributor for any
liability incurred by such Contributor as a result of warranty, support,
indemnity or liability terms You offer. You may include additional
disclaimers of warranty and limitations of liability specific to any
jurisdiction.
4. Inability to Comply Due to Statute or Regulation
---------------------------------------------------
If it is impossible for You to comply with any of the terms of this
License with respect to some or all of the Covered Software due to
statute, judicial order, or regulation then You must: (a) comply with
the terms of this License to the maximum extent possible; and (b)
describe the limitations and the code they affect. Such description must
be placed in a text file included with all distributions of the Covered
Software under this License. Except to the extent prohibited by statute
or regulation, such description must be sufficiently detailed for a
recipient of ordinary skill to be able to understand it.
5. Termination
--------------
5.1. The rights granted under this License will terminate automatically
if You fail to comply with any of its terms. However, if You become
compliant, then the rights granted under this License from a particular
Contributor are reinstated (a) provisionally, unless and until such
Contributor explicitly and finally terminates Your grants, and (b) on an
ongoing basis, if such Contributor fails to notify You of the
non-compliance by some reasonable means prior to 60 days after You have
come back into compliance. Moreover, Your grants from a particular
Contributor are reinstated on an ongoing basis if such Contributor
notifies You of the non-compliance by some reasonable means, this is the
first time You have received notice of non-compliance with this License
from such Contributor, and You become compliant prior to 30 days after
Your receipt of the notice.
5.2. If You initiate litigation against any entity by asserting a patent
infringement claim (excluding declaratory judgment actions,
counter-claims, and cross-claims) alleging that a Contributor Version
directly or indirectly infringes any patent, then the rights granted to
You by any and all Contributors for the Covered Software under Section
2.1 of this License shall terminate.
5.3. In the event of termination under Sections 5.1 or 5.2 above, all
end user license agreements (excluding distributors and resellers) which
have been validly granted by You or Your distributors under this License
prior to termination shall survive termination.
************************************************************************
* *
* 6. Disclaimer of Warranty *
* ------------------------- *
* *
* Covered Software is provided under this License on an "as is" *
* basis, without warranty of any kind, either expressed, implied, or *
* statutory, including, without limitation, warranties that the *
* Covered Software is free of defects, merchantable, fit for a *
* particular purpose or non-infringing. The entire risk as to the *
* quality and performance of the Covered Software is with You. *
* Should any Covered Software prove defective in any respect, You *
* (not any Contributor) assume the cost of any necessary servicing, *
* repair, or correction. This disclaimer of warranty constitutes an *
* essential part of this License. No use of any Covered Software is *
* authorized under this License except under this disclaimer. *
* *
************************************************************************
************************************************************************
* *
* 7. Limitation of Liability *
* -------------------------- *
* *
* Under no circumstances and under no legal theory, whether tort *
* (including negligence), contract, or otherwise, shall any *
* Contributor, or anyone who distributes Covered Software as *
* permitted above, be liable to You for any direct, indirect, *
* special, incidental, or consequential damages of any character *
* including, without limitation, damages for lost profits, loss of *
* goodwill, work stoppage, computer failure or malfunction, or any *
* and all other commercial damages or losses, even if such party *
* shall have been informed of the possibility of such damages. This *
* limitation of liability shall not apply to liability for death or *
* personal injury resulting from such party's negligence to the *
* extent applicable law prohibits such limitation. Some *
* jurisdictions do not allow the exclusion or limitation of *
* incidental or consequential damages, so this exclusion and *
* limitation may not apply to You. *
* *
************************************************************************
8. Litigation
-------------
Any litigation relating to this License may be brought only in the
courts of a jurisdiction where the defendant maintains its principal
place of business and such litigation shall be governed by laws of that
jurisdiction, without reference to its conflict-of-law provisions.
Nothing in this Section shall prevent a party's ability to bring
cross-claims or counter-claims.
9. Miscellaneous
----------------
This License represents the complete agreement concerning the subject
matter hereof. If any provision of this License is held to be
unenforceable, such provision shall be reformed only to the extent
necessary to make it enforceable. Any law or regulation which provides
that the language of a contract shall be construed against the drafter
shall not be used to construe this License against a Contributor.
10. Versions of the License
---------------------------
10.1. New Versions
Mozilla Foundation is the license steward. Except as provided in Section
10.3, no one other than the license steward has the right to modify or
publish new versions of this License. Each version will be given a
distinguishing version number.
10.2. Effect of New Versions
You may distribute the Covered Software under the terms of the version
of the License under which You originally received the Covered Software,
or under the terms of any subsequent version published by the license
steward.
10.3. Modified Versions
If you create software not governed by this License, and you want to
create a new license for such software, you may create and use a
modified version of this License if you rename the license and remove
any references to the name of the license steward (except to note that
such modified license differs from this License).
10.4. Distributing Source Code Form that is Incompatible With Secondary
Licenses
If You choose to distribute Source Code Form that is Incompatible With
Secondary Licenses under the terms of this version of the License, the
notice described in Exhibit B of this License must be attached.
Exhibit A - Source Code Form License Notice
-------------------------------------------
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
If it is not possible or desirable to put the notice in a particular
file, then You may include the notice in a location (such as a LICENSE
file in a relevant directory) where a recipient would be likely to look
for such a notice.
You may add additional accurate notices of copyright ownership.
Exhibit B - "Incompatible With Secondary Licenses" Notice
---------------------------------------------------------
This Source Code Form is "Incompatible With Secondary Licenses", as
defined by the Mozilla Public License, v. 2.0.
================================================
FILE: README.md
================================================
# (deprecated, experimental) WebXR polyfill with examples
The API for "WebXR" implemented in this repository is based on a [proposed draft proposal for WebXR](https://github.com/mozilla/webxr-api) we created as a starting point for discussing WebXR in the fall of 2017, to explore what it might mean to expand WebVR to include AR/MR capabilities.
We initially created this polyfill when the community group was calling the specification "WebVR", so using "WebXR" was not confusing. Now that the community group is working towards changing the name of the spec, this repo may be confusing to newcomers.
We're working to bring this repo's master branch in line with the community group's draft spec. But that work is not yet complete.
The WebVR community has shifted WebVR in this direction. The group is now called the [Immersive Web Community Group](https://github.com/immersive-web/) and the WebVR specification has now become the [WebXR Device API](https://github.com/immersive-web/webxr). You should consider that spec as ground-truth for WebXR, and it is what you will likely see appearing in browsers through the rest of 2018 and into 2019.
We will continue to experiment with extensions to, and new ideas for, WebXR in this library. Soon, we expect it to be integrated directly in our [WebXR Viewer iOS app](https://github.com/mozilla-mobile/webxr-ios) and no longer be included directly in any web pages.
## WebXR library with examples
This repository holds an implementation of a non-compliant version of WebXR, along with sample code demonstrating how to use the API.
## WARNING
THIS SOFTWARE IS NON-STANDARD AND PRERELEASE, IS *NOT* READY FOR PRODUCTION USE, AND *WILL* SOON HAVE BREAKING CHANGES.
NOTHING IN THIS REPO COMES WITH ANY WARRENTY WHATSOEVER. DO NOT USE IT FOR ANYTHING EXCEPT EXPERIMENTS.
There may be pieces of the library that are stubbed out and throw 'Not implemented' when called.
## Running the examples
The master branch of this repo is automatically built and hosted at https://examples.webxrexperiments.com
The develop branch is hosted at https://develop.examples.webxrexperiments.com
## Building and Running the examples
Clone this repo and then change directories into webxr-polyfill/
<a href="https://docs.npmjs.com/getting-started/installing-node">Install npm</a> and then run the following:
npm install # downloads webpack and an http server
npm start # builds the polyfill in dist/webxr-polyfill.js and start the http server in the current directory
Using one of the supported browsers listed below, go to http://YOUR_HOST_NAME:8080/
## Portable builds
To build the WebXR polyfill into a single file that you can use in a different codebase:
npm run build
The resulting file will be in dist/webxr-polyfill.js
## Writing your own XR apps
The WebXR polyfill is not dependent on any external libraries, but examples/common.js has a handy base class, XRExampleBase, that wraps all of the boilerplate of starting a WebXR session and rendering into a WebGL layer using Three.js.
Look in [examples/ar_simplest/index.html](https://github.com/mozilla/webxr-polyfill/blob/master/examples/ar_simplest/index.html) for an example of how to extend [XRExampleBase](https://github.com/mozilla/webxr-polyfill/blob/master/examples/common.js) and how to start up an app.
If you run these apps on Mozilla's [ARKit based iOS app](https://github.com/mozilla-mobile/webxr-ios) then they will use the class in [polyfill/platform/ARKitWrapper.js](https://github.com/mozilla/webxr-polyfill/blob/master/polyfill/platform/ARKitWrapper.js) to get pose and anchor data out of ARKit.
If you run these apps on Google's old ARCore backed experimental browser then they will use the class in [polyfill/platform/ARCoreCameraRenderer.js](https://github.com/mozilla/webxr-polyfill/blob/master/polyfill/platform/ARCoreCameraRenderer.js) to use data out of ARCore.
If you run these apps on desktop Firefox or Chrome with a WebVR 1.1 supported VR headset, the headset will be exposed as a WebXR XRDisplay.
If you run these apps on a device with no VR or AR tracking, the apps will use the 3dof orientation provided by Javascript orientation events.
## Supported Displays
- Flat Display (AR only, needs VR)
- WebVR 1.1 HMD (VR only, needs AR)
- Cardboard (NOT YET)
- Hololens (NOT YET)
## Supported Realities
- Camera Reality (ARKit on Mozilla iOS Test App, WebARonARCore on Android, WebARonARKit on iOS, WebRTC video stream (PARTIAL))
- Virtual Reality (Desktop Firefox with Vive and Rift, Daydream (NOT TESTED), GearVR (Not Tested), Edge with MS MR headsets (NOT TESTED))
- Passthrough Reality (NOT YET)
## Supported Browsers
- Mozilla [WebXR Playground](https://github.com/mozilla/webxr-ios) iOS App using ARKit
- Google [ARCore Test Chrome on Android](https://github.com/google-ar/WebARonARCore)
- Google [ARKit Test Chrome on iOS](https://github.com/google-ar/WebARonARKit)
- Desktop Firefox with WebVR 1.1 HMDs
- Mobile Safari, Chrome, and Firefox (PARTIAL, Daydream NOT TESTED)
- GearVR Internet (NOT TESTED)
================================================
FILE: dist-footer.js
================================================
XRDisplay = window.XRDisplay
XRSession = window.XRSession
XRSessionCreateParameters = window.XRSessionCreateParameters
Reality = window.Reality
XRPointCloud = window.XRPointCloud
XRLightEstimate = window.XRLightEstimate
XRAnchor = window.XRAnchor;
XRPlaneAnchor = window.XRPlaneAnchor;
XRFaceAnchor = window.XRFaceAnchor;
XRImageAnchor = window.XRImageAnchor;
XRAnchorOffset = window.XRAnchorOffset;
XRStageBounds = window.XRStageBounds;
XRStageBoundsPoint = window.XRStageBoundsPoint;
XRPresentationFrame = window.XRPresentationFrame;
XRView = window.XRView;
XRViewport = window.XRViewport;
XRCoordinateSystem = window.XRCoordinateSystem;
XRViewPose = window.XRViewPose;
XRLayer = window.XRLayer;
XRWebGLLayer = window.XRWebGLLayer;
XRVideoFrame = window.XRVideoFrame;
================================================
FILE: dist-header.js
================================================
/* if there is a navigator.xr, clear it out */
if(typeof navigator.xr != 'undefined') {
if(typeof XRDisplay != 'undefined') { XRDisplay = null }
if(typeof XRSession != 'undefined') { XRSession = null }
if(typeof XRSessionCreateParameters != 'undefined') { XRSessionCreateParameters = null }
if(typeof Reality != 'undefined') { Reality = null }
if(typeof XRPointCloud != 'undefined') { XRPointCloud = null }
if(typeof XRLightEstimate != 'undefined') { XRLightEstimate = null }
if(typeof XRAnchor != 'undefined') { XRAnchor = null }
if(typeof XRPlaneAnchor != 'undefined') { XRPlaneAnchor = null }
if(typeof XRFaceAnchor != 'undefined') { XRFaceAnchor = null }
if(typeof XRImageAnchor != 'undefined') { XRImageAnchor = null }
if(typeof XRAnchorOffset != 'undefined') { XRAnchorOffset = null }
if(typeof XRStageBounds != 'undefined') { XRStageBounds = null }
if(typeof XRStageBoundsPoint != 'undefined') { XRStageBoundsPoint = null }
if(typeof XRPresentationFrame != 'undefined') { XRPresentationFrame = null }
if(typeof XRView != 'undefined') { XRView = null }
if(typeof XRViewport != 'undefined') { XRViewport = null }
if(typeof XRCoordinateSystem != 'undefined') { XRCoordinateSystem = null }
if(typeof XRViewPose != 'undefined') { XRViewPose = null }
if(typeof XRLayer != 'undefined') { XRLayer = null }
if(typeof XRWebGLLayer != 'undefined') { XRWebGLLayer = null }
if(typeof XRVideoFrame != 'undefined') { XRVideoFrame = null }
//navigator.xr = null;
}
================================================
FILE: examples/ar_anchors/index.html
================================================
<html>
<head>
<title>AR anchor example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<style>
body, html {
padding: 0;
margin: 0;
width: 100%;
height: 100%;
-webkit-user-select: none;
user-select: none;
}
#target {
width: 100%;
height: 100%;
position: absolute;
}
.add-object-button {
position: absolute;
bottom: 20px;
left: 50%;
transform: translate(-50%, -50%);
font-size: 2em;
padding: 10px;
}
.common-message {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-size: 20px;
}
</style>
<link rel="stylesheet" href="../common.css"/>
<script src="../libs/three.js"></script>
<!--
<script type="module" src="../../polyfill/XRPolyfill.js"></script>
<script nomodule src="../../dist/webxr-polyfill.js"></script>
-->
<script src="../../dist/webxr-polyfill.js"></script>
<script src="../common.js"></script>
</head>
<body>
<div id="target" />
<div onclick="hideMe(this)" id="description">
<h2>Anchors</h2>
<h5>(click to dismiss)</h5>
<p>Position boxes by tapping. The box positions are updated using ARKit anchors.</p>
</div>
<script>
class ARAnchorExample extends XRExampleBase {
constructor(domElement){
super(domElement, false)
this.anchorsToAdd = [] // { node, x, y, z }
this.addObjectButton = document.createElement('button')
this.addObjectButton.setAttribute('class', 'add-object-button')
this.addObjectButton.innerText = 'Add Box'
this.el.appendChild(this.addObjectButton)
this.addObjectButton.addEventListener('click', ev => {
this.addAnchoredModel(this.createSceneGraphNode(), 0, 0, -0.75)
})
}
// Called during construction
initializeScene(){
this.scene.add(new THREE.AmbientLight('#FFF', 0.2))
let directionalLight = new THREE.DirectionalLight('#FFF', 0.6)
directionalLight.position.set(0, 10, 0)
this.scene.add(directionalLight)
}
createSceneGraphNode(){
let geometry = new THREE.BoxBufferGeometry(0.1, 0.1, 0.1)
let material = new THREE.MeshPhongMaterial({ color: '#FF9999' })
return new THREE.Mesh(geometry, material)
}
/*
addAnchoredModel creates an anchor at (x,y,z) relative to the camera and positions the sceneGraphNode on the anchor from that point on
*/
addAnchoredModel(sceneGraphNode, x, y, z){
// Save this info for use during the next render frame
this.anchorsToAdd.push({
node: sceneGraphNode,
x: x, y: y, z: z
})
}
// Called once per frame
updateScene(frame){
const headCoordinateSystem = frame.getCoordinateSystem(XRCoordinateSystem.HEAD_MODEL)
// Create anchors and start tracking them
for(let anchorToAdd of this.anchorsToAdd){
// Create the anchor and tell the base class to update the node with its position
const anchorUID = frame.addAnchor(headCoordinateSystem, [anchorToAdd.x, anchorToAdd.y, anchorToAdd.z])
this.addAnchoredNode(new XRAnchorOffset(anchorUID), anchorToAdd.node)
}
this.anchorsToAdd = []
}
}
window.addEventListener('DOMContentLoaded', () => {
setTimeout(() => {
try {
window.pageApp = new ARAnchorExample(document.getElementById('target'))
} catch(e) {
console.error('page error', e)
}
}, 1000)
})
</script>
</body>
</html>
================================================
FILE: examples/ar_simplest/index.html
================================================
<html>
<head>
<title>AR simplest example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<style>
body, html {
padding: 0;
margin: 0;
width: 100%;
height: 100%;
-webkit-user-select: none;
user-select: none;
}
#target {
width: 100%;
height: 100%;
position: absolute;
}
.common-message {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-size: 20px;
}
</style>
<link rel="stylesheet" href="../common.css"/>
<script src="../libs/three.min.js"></script>
<script src="../models/TeapotBufferGeometry.js"></script>
<!--
<script type="module" src="../../polyfill/XRPolyfill.js"></script>
<script nomodule src="../../dist/webxr-polyfill.js"></script>
-->
<script src="../../dist/webxr-polyfill.js"></script>
<script src="../common.js"></script>
</head>
<body>
<div id="target" />
<div onclick="hideMe(this)" id="description">
<h2>Simplest AR</h2>
<h5>(click to dismiss)</h5>
<p>This example displays the Utah Teapot positioned in front of the viewer at head height.</p>
</div>
<script>
/*
ARSimplestExample shows how to populate the content scene
*/
class ARSimplestExample extends XRExampleBase {
constructor(domElement){
super(domElement, false)
}
// Called during construction to allow the app to populate the THREE.Scene
initializeScene(){
// Add a teapot at about eye level
const geometry = new THREE.TeapotBufferGeometry(0.1)
const materialColor = new THREE.Color()
materialColor.setRGB(1.0, 1.0, 1.0)
const material = new THREE.MeshLambertMaterial({
color: materialColor,
side: THREE.DoubleSide
})
const mesh = new THREE.Mesh(geometry, material)
mesh.position.set(0, 1.4, -1)
this.floorGroup.add(mesh)
// Add a box on the floor
const box = new THREE.Mesh(
new THREE.BoxBufferGeometry(0.1, 0.1, 0.1),
new THREE.MeshPhongMaterial({ color: '#DDFFDD' })
)
box.position.set(0, 0.05, 0)
var axesHelper = AxesHelper( 0.2 );
this.floorGroup.add( axesHelper );
this.floorGroup.add(box)
// Add some lights to the scene
this.scene.add(new THREE.AmbientLight('#FFF', 0.2))
const directionalLight = new THREE.DirectionalLight('#FFF', 0.6)
directionalLight.position.set(0, 10, 0)
this.scene.add(directionalLight)
}
}
function AxesHelper( size ) {
size = size || 1;
var vertices = [
0, 0, 0, size, 0, 0,
0, 0, 0, 0, size, 0,
0, 0, 0, 0, 0, size
];
var colors = [
1, 0, 0, 1, 0.6, 0,
0, 1, 0, 0.6, 1, 0,
0, 0, 1, 0, 0.6, 1
];
var geometry = new THREE.BufferGeometry();
geometry.addAttribute( 'position', new THREE.Float32BufferAttribute( vertices, 3 ) );
geometry.addAttribute( 'color', new THREE.Float32BufferAttribute( colors, 3 ) );
var material = new THREE.LineBasicMaterial( { vertexColors: THREE.VertexColors } );
return new THREE.LineSegments(geometry, material);
}
window.addEventListener('DOMContentLoaded', () => {
setTimeout(() => {
try {
window.pageApp = new ARSimplestExample(document.getElementById('target'))
} catch(e) {
console.error('page error', e)
}
}, 1000)
})
</script>
</body>
</html>
================================================
FILE: examples/boombox/index.html
================================================
<html>
<head>
<title>Boombox</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<style>
body, html {
padding: 0;
margin: 0;
width: 100%;
height: 100%;
-webkit-user-select: none;
user-select: none;
}
#target {
width: 100%;
height: 100%;
position: absolute;
}
.common-message {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-size: 20px;
}
</style>
<link rel="stylesheet" href="../common.css"/>
<script src="../libs/three.min.js"></script>
<script src="../libs/three-gltf-loader.js"></script>
<!--
<script type="module" src="../../polyfill/XRPolyfill.js"></script>
<script nomodule src="../../dist/webxr-polyfill.js"></script>
-->
<script src="../../dist/webxr-polyfill.js"></script>
<script src="../common.js"></script>
</head>
<body>
<div id="target" />
<div onclick="hideMe(this)" id="description">
<h2>Boombox</h2>
<h5>(click to dismiss)</h5>
<p>Shows a boombox in a VR environment.</p>
</div>
<script>
/*
ARSimplestExample shows how to populate the content scene
*/
class ARSimplestExample extends XRExampleBase {
constructor(domElement){
super(domElement, false)
}
// Called during construction to allow the app to populate the THREE.Scene
initializeScene(){
// Add a box on the floor
const box = new THREE.Mesh(
new THREE.BoxBufferGeometry(0.1, 0.1, 0.1),
new THREE.MeshPhongMaterial({ color: '#DDFFDD' })
)
box.position.set(0, 0, 0)
this.floorGroup.add(box)
this.scene.background = new THREE.Color(0x222222)
// Add some lights to the scene
this.scene.add(new THREE.AmbientLight('#FFF', 0.2))
const directionalLight = new THREE.DirectionalLight('#FFF', 0.6)
directionalLight.position.set(0, 10, 0)
this.scene.add(directionalLight)
// Create the environment map
const path = '../textures/Park2/'
const format = '.jpg'
this.envMap = new THREE.CubeTextureLoader().load([
path + 'posx' + format, path + 'negx' + format,
path + 'posy' + format, path + 'negy' + format,
path + 'posz' + format, path + 'negz' + format
])
this.envMap.format = THREE.RGBFormat
this.scene.background = this.envMap
// Add the boom box
loadGLTF('../models/BoomBox/glTF-pbrSpecularGlossiness/BoomBox.gltf').then(gltf => {
gltf.scene.scale.set(15, 15, 15)
gltf.scene.position.set(0, 1, -1.2)
gltf.scene.quaternion.setFromAxisAngle(new THREE.Vector3(0, 1, 0), Math.PI)
gltf.scene.traverse(node => {
if (node.material && (node.material.isMeshStandardMaterial || (node.material.isShaderMaterial && node.material.envMap !== undefined))){
node.material.envMap = this.envMap
node.material.needsUpdate = true
}
})
this.floorGroup.add(gltf.scene)
}).catch((...params) =>{
console.error('could not load gltf', ...params)
})
}
}
window.addEventListener('DOMContentLoaded', () => {
setTimeout(() => {
try {
window.pageApp = new ARSimplestExample(document.getElementById('target'))
} catch(e) {
console.error('page error', e)
}
}, 1000)
})
</script>
</body>
</html>
================================================
FILE: examples/common.css
================================================
#description {
pointer-events: auto;
font-family: sans-serif;
padding: 1em;
background-color:rgba(255,255,255,0.7);
-webkit-backdrop-filter: blur(5px);
backdrop-filter: blur(5px);
position:absolute;
bottom: 0px;
left:0px;
right: 0px;
}
================================================
FILE: examples/common.js
================================================
/*
XRExampleBase holds all of the common XR setup, rendering, and teardown code for a THREE.js based app
It also holds a list of THREE nodes and XRAnchorOffsets which it uses to update the nodes' poses
Extending classes should be able to focus mainly on rendering their scene and handling user input
Parameters:
domElement: an element used to show error messages
createVirtualReality: if true, create a new empty reality for this app
WebVR 1.1 displays require that the call to requestPresent be a direct result of an input event like a click.
If you're trying to use a WebVR 1.1 display then you'll need to pass false in the shouldStartPresenting parameter
of the constructor and then call this.startPresenting() inside an input event handler.
*/
class XRExampleBase {
constructor(domElement, createVirtualReality=true, shouldStartPresenting=true, useComputerVision=false, worldSensing=false, alignEUS=true){
this.el = domElement
this.createVirtualReality = createVirtualReality
this.shouldStartPresenting = shouldStartPresenting
this.useComputerVision = useComputerVision
this.alignEUS = alignEUS
this.worldSensing = worldSensing
this._boundHandleFrame = this._handleFrame.bind(this) // Useful for setting up the requestAnimationFrame callback
// Set during the XR.getDisplays call below
this.displays = null
// Set during this.startSession below
this.display = null
this.session = null
this.scene = new THREE.Scene() // The scene will be rotated and oriented around the camera using the head pose
this.camera = new THREE.PerspectiveCamera(70, 1024, 1024, 0.1, 1000) // These values will be overwritten by the projection matrix from ARKit or ARCore
this.scene.add(this.camera)
// Create a canvas and context for the session layer
this.glCanvas = document.createElement('canvas')
this.glContext = this.glCanvas.getContext('webgl')
if(this.glContext === null){
this.showMessage('Could not create a WebGL canvas')
throw new Error('Could not create GL context')
}
// Set up the THREE renderer with the session's layer's glContext
this.renderer = new THREE.WebGLRenderer({
canvas: this.glCanvas,
context: this.glContext,
antialias: false,
alpha: true
})
this.renderer.setPixelRatio(1)
this.renderer.autoClear = false
this.renderer.setClearColor('#000', 0)
this.requestedFloor = false
this.floorGroup = new THREE.Group() // This group will eventually be be anchored to the floor (see findFloorAnchor below)
// an array of info that we'll use in _handleFrame to update the nodes using anchors
this.anchoredNodes = [] // { XRAnchorOffset, Three.js Object3D }
// Give extending classes the opportunity to initially populate the scene
this.initializeScene()
if(typeof navigator.XR === 'undefined'){
this.showMessage('No WebXR API found, usually because the WebXR polyfill has not loaded')
return
}
// Get displays and then request a session
navigator.XR.getDisplays().then(displays => {
if(displays.length == 0) {
this.showMessage('No displays are available')
return
}
this.displays = displays
this._startSession()
}).catch(err => {
console.error('Error getting XR displays', err)
this.showMessage('Could not get XR displays')
})
}
_startSession(){
let sessionInitParameters = {
exclusive: this.createVirtualReality,
type: this.createVirtualReality ? XRSession.REALITY : XRSession.AUGMENTATION,
videoFrames: this.useComputerVision, //computer_vision_data
alignEUS: this.alignEUS,
worldSensing: this.worldSensing
}
for(let display of this.displays){
if(display.supportsSession(sessionInitParameters)){
this.display = display
break
}
}
if(this.display === null){
this.showMessage('Could not find a display for this type of session')
return
}
this.display.requestSession(sessionInitParameters).then(session => {
this.session = session
this.session.depthNear = 0.1
this.session.depthFar = 1000.0
// Handle session lifecycle events
this.session.addEventListener('focus', ev => { this.handleSessionFocus(ev) })
this.session.addEventListener('blur', ev => { this.handleSessionBlur(ev) })
this.session.addEventListener('end', ev => { this.handleSessionEnded(ev) })
this.newSession();
if(this.shouldStartPresenting){
// VR Displays need startPresenting called due to input events like a click
this.startPresenting()
}
}).catch(err => {
console.error('Error requesting session', err)
this.showMessage('Could not initiate the session')
})
}
/*
Clients should override to be called when a new session is created
*/
newSession() {}
/*
Empties this.el, adds a div with the message text, and shows a button to test rendering the scene to this.el
*/
showMessage(messageText){
let messages = document.getElementsByClassName('common-message')
if(messages.length > 0){
var message = messages[0]
} else {
var message = document.createElement('div')
message.setAttribute('class', 'common-message')
this.el.append(message)
}
let div = document.createElement('div')
div.innerHTML = messageText
message.appendChild(div)
}
/*
WebVR 1.1 displays require that the call to requestPresent be a direct result of an input event like a click.
If you're trying to set up a VR display, you'll need to pass false in the shouldStartPresenting parameter of the constructor
and then call this.startPresenting() inside an input event handler.
*/
startPresenting(){
if(this.session === null){
this.showMessage('Can not start presenting without a session')
throw new Error('Can not start presenting without a session')
}
// Set the session's base layer into which the app will render
this.session.baseLayer = new XRWebGLLayer(this.session, this.glContext)
// Handle layer focus events
this.session.baseLayer.addEventListener('focus', ev => { this.handleLayerFocus(ev) })
this.session.baseLayer.addEventListener('blur', ev => { this.handleLayerBlur(ev) })
this.session.requestFrame(this._boundHandleFrame)
}
// Extending classes can react to these events
handleSessionFocus(ev){}
handleSessionBlur(ev){}
handleSessionEnded(ev){}
handleLayerFocus(ev){}
handleLayerBlur(ev){}
/*
* set up the video processing
*/
setVideoWorker(worker){
this.session.setVideoFrameHandler(worker)
}
// request the next frame
// buffers is an optional parameter, suggesting buffers that could be used
requestVideoFrame() {
this.session.requestVideoFrame();
}
/*
Extending classes should override this to set up the scene during class construction
*/
initializeScene(){}
/*
Extending classes that need to update the layer during each frame should override this method
*/
updateScene(frame){}
_handleFrame(frame){
const nextFrameRequest = this.session.requestFrame(this._boundHandleFrame)
const headPose = frame.getDisplayPose(frame.getCoordinateSystem(XRCoordinateSystem.HEAD_MODEL))
// If we haven't already, request the floor anchor offset
if(this.requestedFloor === false){
this.requestedFloor = true
frame.findFloorAnchor('first-floor-anchor').then(anchorOffset => {
if(anchorOffset === null){
console.log('could not find the floor anchor')
const headCoordinateSystem = frame.getCoordinateSystem(XRCoordinateSystem.EYE_LEVEL)
const anchorUID = frame.addAnchor(headCoordinateSystem, [0,-1,0])
anchorOffset = new XRAnchorOffset(anchorUID)
}
this.addAnchoredNode(anchorOffset, this.floorGroup)
}).catch(err => {
console.error('error finding the floor anchor', err)
})
}
// Update anchored node positions in the scene graph
for(let anchoredNode of this.anchoredNodes){
this.updateNodeFromAnchorOffset(frame, anchoredNode.node, anchoredNode.anchorOffset)
}
// Let the extending class update the scene before each render
this.updateScene(frame)
// Prep THREE.js for the render of each XRView
this.renderer.autoClear = false
this.renderer.setSize(this.session.baseLayer.framebufferWidth, this.session.baseLayer.framebufferHeight, false)
this.renderer.clear()
this.camera.matrixAutoUpdate = false
// this.camera.matrix.fromArray(headPose.poseModelMatrix)
// this.camera.updateMatrixWorld()
// Render each view into this.session.baseLayer.context
for(const view of frame.views){
// Each XRView has its own projection matrix, so set the camera to use that
this.camera.matrix.fromArray(view.viewMatrix)
this.camera.updateMatrixWorld()
this.camera.projectionMatrix.fromArray(view.projectionMatrix)
// Set up the renderer to the XRView's viewport and then render
this.renderer.clearDepth()
const viewport = view.getViewport(this.session.baseLayer)
this.renderer.setViewport(viewport.x, viewport.y, viewport.width, viewport.height)
this.doRender()
}
// this.camera.matrixAutoUpdate = false
// // Render each view into this.session.baseLayer.context
// for(const view of frame.views){
// // Each XRView has its own projection matrix, so set the camera to use that
// this.camera.matrixWorldInverse.fromArray(view.viewMatrix)
// this.camera.matrixWorld.fromArray(this.camera.matrixWorldInverse)
// this.camera.projectionMatrix.fromArray(view.projectionMatrix)
// this.camera.matrix.fromArray(headPose.poseModelMatrix)
// this.camera.updateMatrixWorld(true)
// // Set up the renderer to the XRView's viewport and then render
// this.renderer.clearDepth()
// const viewport = view.getViewport(this.session.baseLayer)
// this.renderer.setViewport(viewport.x, viewport.y, viewport.width, viewport.height)
// this.doRender()
// }
}
doRender(){
this.renderer.render(this.scene, this.camera)
}
/*
Add a node to the scene and keep its pose updated using the anchorOffset
*/
addAnchoredNode(anchorOffset, node){
this.anchoredNodes.push({
anchorOffset: anchorOffset,
node: node
})
this.scene.add(node)
}
/*
Remove a node from the scene
*/
removeAnchoredNode(node) {
for (var i = 0; i < this.anchoredNodes.length; i++) {
if (node === this.anchoredNodes[i].node) {
this.anchoredNodes.splice(i,1);
this.scene.remove(node)
return;
}
}
}
/*
Extending classes should override this to get notified when an anchor for node is removed
*/
anchoredNodeRemoved(node) {}
/*
Get the anchor data from the frame and use it and the anchor offset to update the pose of the node, this must be an Object3D
*/
updateNodeFromAnchorOffset(frame, node, anchorOffset){
const anchor = frame.getAnchor(anchorOffset.anchorUID)
if(anchor === null){
throttledConsoleLog('Unknown anchor uid', anchorOffset.anchorUID)
this.anchoredNodeRemoved(node);
this.removeAnchoredNode(node);
return
}
node.matrixAutoUpdate = false
node.matrix.fromArray(anchorOffset.getOffsetTransform(anchor.coordinateSystem))
node.updateMatrixWorld(true)
}
}
/*
If you want to just put virtual things on surfaces, extend this app and override `createSceneGraphNode`
*/
class ThingsOnSurfacesApp extends XRExampleBase {
constructor(domElement){
super(domElement, false)
this._tapEventData = null // Will be filled in on touch start and used in updateScene
this.el.addEventListener('touchstart', this._onTouchStart.bind(this), false)
}
// Return a THREE.Object3D of some sort to be placed when a surface is found
createSceneGraphNode(){
throw new Error('Extending classes should implement createSceneGraphNode')
/*
For example:
let geometry = new THREE.BoxBufferGeometry(0.1, 0.1, 0.1)
let material = new THREE.MeshPhongMaterial({ color: '#99FF99' })
return new THREE.Mesh(geometry, material)
*/
}
// Called once per frame, before render, to give the app a chance to update this.scene
updateScene(frame){
// If we have tap data, attempt a hit test for a surface
if(this._tapEventData !== null){
const x = this._tapEventData[0]
const y = this._tapEventData[1]
this._tapEventData = null
// Attempt a hit test using the normalized screen coordinates
frame.findAnchor(x, y).then(anchorOffset => {
if(anchorOffset === null){
console.log('miss')
return
}
console.log('hit', anchorOffset)
this.addAnchoredNode(anchorOffset, this.createSceneGraphNode())
}).catch(err => {
console.error('Error in hit test', err)
})
}
}
// Save screen taps as normalized coordinates for use in this.updateScene
_onTouchStart(ev){
if (!ev.touches || ev.touches.length === 0) {
console.error('No touches on touch event', ev)
return
}
//save screen coordinates normalized to -1..1 (0,0 is at center and 1,1 is at top right)
this._tapEventData = [
ev.touches[0].clientX / window.innerWidth,
ev.touches[0].clientY / window.innerHeight
]
}
}
function fillInGLTFScene(path, scene, position=[0, 0, -2], scale=[1, 1, 1]){
let ambientLight = new THREE.AmbientLight('#FFF', 1)
scene.add(ambientLight)
let directionalLight = new THREE.DirectionalLight('#FFF', 0.6)
scene.add(directionalLight)
loadGLTF(path).then(gltf => {
gltf.scene.scale.set(...scale)
gltf.scene.position.set(...position)
//gltf.scene.quaternion.setFromAxisAngle(new THREE.Vector3(0, 0, 1), Math.PI / -2)
scene.add(gltf.scene)
}).catch((...params) =>{
console.error('could not load gltf', ...params)
})
}
function loadGLTF(url){
return new Promise((resolve, reject) => {
let loader = new THREE.GLTFLoader()
loader.load(url, (gltf) => {
if(gltf === null){
reject()
}
if(gltf.animations && gltf.animations.length){
let mixer = new THREE.AnimationMixer(gltf.scene)
for(let animation of gltf.animations){
mixer.clipAction(animation).play()
}
}
resolve(gltf)
})
})
}
function loadObj(baseURL, geometry){
return new Promise(function(resolve, reject){
const mtlLoader = new THREE.MTLLoader()
mtlLoader.setPath(baseURL)
const mtlName = geometry.split('.')[geometry.split(':').length - 1] + '.mtl'
mtlLoader.load(mtlName, (materials) => {
materials.preload()
let objLoader = new THREE.OBJLoader()
objLoader.setMaterials(materials)
objLoader.setPath(baseURL)
objLoader.load(geometry, (obj) => {
resolve(obj)
}, () => {} , (...params) => {
console.error('Failed to load obj', ...params)
reject(...params)
})
})
})
}
function requestFullScreen(){
if (document.body.requestFullscreen) {
document.body.requestFullscreen()
} else if (document.body.msRequestFullscreen) {
document.body.msRequestFullscreen()
} else if (document.body.mozRequestFullScreen) {
document.body.mozRequestFullScreen()
} else if (document.body.webkitRequestFullscreen) {
document.body.webkitRequestFullscreen()
}
}
function exitFullScreen(){
if (document.exitFullscreen) {
document.exitFullscreen();
} else if (document.mozCancelFullScreen) {
document.mozCancelFullScreen()
} else if (document.webkitExitFullscreen) {
document.webkitExitFullscreen()
} else if (document.msExitFullscreen) {
document.msExitFullscreen()
}
}
/*
Rate limit a function call. Wait is the minimum number of milliseconds between calls.
If leading is true, the first call to the throttled function is immediately called.
If trailing is true, once the wait time has passed the function is called.
This code is cribbed from https://github.com/jashkenas/underscore
*/
window.throttle = function(func, wait, leading=true, trailing=true) {
var timeout, context, args, result
var previous = 0
var later = function() {
previous = leading === false ? 0 : Date.now()
timeout = null
result = func.apply(context, args)
if (!timeout) context = args = null
}
var throttled = function() {
var now = Date.now()
if (!previous && leading === false) previous = now
var remaining = wait - (now - previous)
context = this
args = arguments
if (remaining <= 0 || remaining > wait) {
if (timeout) {
clearTimeout(timeout)
timeout = null
}
previous = now
result = func.apply(context, args)
if (!timeout) context = args = null
} else if (!timeout && trailing !== false) {
timeout = setTimeout(later, remaining)
}
return result
}
throttled.cancel = function() {
clearTimeout(timeout)
previous = 0
timeout = context = args = null
}
return throttled
}
window.throttledConsoleLog = throttle((...params) => {
console.log(...params)
}, 1000)
function hideMe(elem) { elem.style.display = 'none' }
================================================
FILE: examples/face_tracking/glasses/glasses.gltf
================================================
{
"accessors": [
{
"bufferView": 2,
"componentType": 5126,
"count": 248,
"max": [
15.589937210083008,
5.319068431854248,
-4.0812702178955078
],
"min": [
-15.589941024780273,
-2.73935866355896,
-35.524684906005859
],
"type": "VEC3"
},
{
"bufferView": 2,
"byteOffset": 2976,
"componentType": 5126,
"count": 248,
"max": [
0.96116697788238525,
0.99999320507049561,
1
],
"min": [
-0.96116697788238525,
-0.99999785423278809,
-0.9985383152961731
],
"type": "VEC3"
},
{
"bufferView": 3,
"componentType": 5126,
"count": 248,
"max": [
0.99998939037322998,
0.96386855840682983,
0.59339630603790283,
1
],
"min": [
-0.99998939037322998,
-0.99564743041992188,
-0.95187783241271973,
-1
],
"type": "VEC4"
},
{
"bufferView": 1,
"componentType": 5126,
"count": 248,
"max": [
0.71463245153427124,
0.7478339672088623
],
"min": [
0.47121205925941467,
0.00023278793378267437
],
"type": "VEC2"
},
{
"bufferView": 0,
"componentType": 5125,
"count": 648,
"max": [
247
],
"min": [
0
],
"type": "SCALAR"
},
{
"bufferView": 2,
"byteOffset": 5952,
"componentType": 5126,
"count": 132,
"max": [
13.816923141479492,
5.4677014350891113,
-0.95277941226959229
],
"min": [
-13.816925048828125,
-3.0395243167877197,
-3.8222718238830566
],
"type": "VEC3"
},
{
"bufferView": 2,
"byteOffset": 7536,
"componentType": 5126,
"count": 132,
"max": [
0.3650696873664856,
0.19587248563766479,
0.99650496244430542
],
"min": [
-0.3650696873664856,
-0.19587248563766479,
-0.99650496244430542
],
"type": "VEC3"
},
{
"bufferView": 3,
"byteOffset": 3968,
"componentType": 5126,
"count": 132,
"max": [
0.050754040479660034,
-0.98062723875045776,
0.053826514631509781,
1
],
"min": [
-0.05075131356716156,
-0.99997633695602417,
-0.19064761698246002,
1
],
"type": "VEC4"
},
{
"bufferView": 1,
"byteOffset": 1984,
"componentType": 5126,
"count": 132,
"max": [
0.901009202003479,
0.99976730346679688
],
"min": [
0.25119039416313171,
0.00023278793378267437
],
"type": "VEC2"
},
{
"bufferView": 0,
"byteOffset": 2592,
"componentType": 5125,
"count": 552,
"max": [
131
],
"min": [
0
],
"type": "SCALAR"
},
{
"bufferView": 2,
"byteOffset": 9120,
"componentType": 5126,
"count": 604,
"max": [
15.295004844665527,
5.9854044914245605,
-0.64784759283065796
],
"min": [
-15.295004844665527,
-3.5821621417999268,
-5.3981013298034668
],
"type": "VEC3"
},
{
"bufferView": 2,
"byteOffset": 16368,
"componentType": 5126,
"count": 604,
"max": [
0.99990367889404297,
1,
0.99932527542114258
],
"min": [
-0.99990367889404297,
-1,
-0.99880260229110718
],
"type": "VEC3"
},
{
"bufferView": 3,
"byteOffset": 6080,
"componentType": 5126,
"count": 604,
"max": [
0.79950982332229614,
0.99962127208709717,
1,
1
],
"min": [
-0.79951024055480957,
-0.037466175854206085,
-1,
1
],
"type": "VEC4"
},
{
"bufferView": 1,
"byteOffset": 3040,
"componentType": 5126,
"count": 604,
"max": [
0.4707464873790741,
0.73155510425567627
],
"min": [
0.00023278793378267437,
0.00023278793378267437
],
"type": "VEC2"
},
{
"bufferView": 0,
"byteOffset": 4800,
"componentType": 5125,
"count": 1812,
"max": [
603
],
"min": [
0
],
"type": "SCALAR"
}
],
"asset": {
"extras": {
"author": "person-x (https://sketchfab.com/person-x)",
"license": "CC-BY-4.0 (http://creativecommons.org/licenses/by/4.0/)",
"source": "https://sketchfab.com/models/5c78f100eea749c895d69fe2ed728197",
"title": "Glasses"
},
"generator": "Sketchfab-3.19.4",
"version": "2.0"
},
"bufferViews": [
{
"buffer": 0,
"byteLength": 12048,
"byteOffset": 0,
"name": "floatBufferViews",
"target": 34963
},
{
"buffer": 0,
"byteLength": 7872,
"byteOffset": 12048,
"byteStride": 8,
"name": "floatBufferViews",
"target": 34962
},
{
"buffer": 0,
"byteLength": 23616,
"byteOffset": 19920,
"byteStride": 12,
"name": "floatBufferViews",
"target": 34962
},
{
"buffer": 0,
"byteLength": 15744,
"byteOffset": 43536,
"byteStride": 16,
"name": "floatBufferViews",
"target": 34962
}
],
"buffers": [
{
"byteLength": 59280,
"uri": "glasses.bin"
}
],
"images": [
{
"uri": "textures/Glasses1_metallicRoughness.png"
},
{
"uri": "textures/Glasses1_normal.png"
},
{
"uri": "textures/Glasses1_baseColor.jpg"
},
{
"uri": "textures/Glasses2_metallicRoughness.png"
},
{
"uri": "textures/Glasses2_normal.png"
},
{
"uri": "textures/Glasses2_baseColor.jpg"
},
{
"uri": "textures/Lenses_metallicRoughness.png"
},
{
"uri": "textures/Lenses_normal.png"
},
{
"uri": "textures/Lenses_baseColor.jpg"
}
],
"materials": [
{
"doubleSided": true,
"emissiveFactor": [
0,
0,
0
],
"name": "Glasses2",
"normalTexture": {
"index": 4,
"scale": 1,
"texCoord": 0
},
"occlusionTexture": {
"index": 3,
"strength": 1,
"texCoord": 0
},
"pbrMetallicRoughness": {
"baseColorFactor": [
1,
1,
1,
1
],
"baseColorTexture": {
"index": 5,
"texCoord": 0
},
"metallicFactor": 1,
"metallicRoughnessTexture": {
"index": 3,
"texCoord": 0
},
"roughnessFactor": 1
}
},
{
"alphaMode": "BLEND",
"doubleSided": true,
"emissiveFactor": [
0,
0,
0
],
"name": "Lenses",
"normalTexture": {
"index": 7,
"scale": 1,
"texCoord": 0
},
"occlusionTexture": {
"index": 6,
"strength": 1,
"texCoord": 0
},
"pbrMetallicRoughness": {
"baseColorFactor": [
1,
1,
1,
0.83536585370000005
],
"baseColorTexture": {
"index": 8,
"texCoord": 0
},
"metallicFactor": 1,
"metallicRoughnessTexture": {
"index": 6,
"texCoord": 0
},
"roughnessFactor": 1
}
},
{
"doubleSided": true,
"emissiveFactor": [
0,
0,
0
],
"name": "Glasses1",
"normalTexture": {
"index": 1,
"scale": 1,
"texCoord": 0
},
"occlusionTexture": {
"index": 0,
"strength": 1,
"texCoord": 0
},
"pbrMetallicRoughness": {
"baseColorFactor": [
1,
1,
1,
1
],
"baseColorTexture": {
"index": 2,
"texCoord": 0
},
"metallicFactor": 1,
"metallicRoughnessTexture": {
"index": 0,
"texCoord": 0
},
"roughnessFactor": 1
}
}
],
"meshes": [
{
"name": "Glasses_Glasses2_0",
"primitives": [
{
"attributes": {
"NORMAL": 1,
"POSITION": 0,
"TANGENT": 2,
"TEXCOORD_0": 3
},
"indices": 4,
"material": 0,
"mode": 4
}
]
},
{
"name": "Glasses_Lenses_0",
"primitives": [
{
"attributes": {
"NORMAL": 6,
"POSITION": 5,
"TANGENT": 7,
"TEXCOORD_0": 8
},
"indices": 9,
"material": 1,
"mode": 4
}
]
},
{
"name": "Glasses_Glasses1_0",
"primitives": [
{
"attributes": {
"NORMAL": 11,
"POSITION": 10,
"TANGENT": 12,
"TEXCOORD_0": 13
},
"indices": 14,
"material": 2,
"mode": 4
}
]
}
],
"nodes": [
{
"children": [
1
],
"name": "RootNode (gltf orientation matrix)",
"rotation": [
-0.70710678118654746,
-0,
-0,
0.70710678118654757
]
},
{
"children": [
2
],
"name": "RootNode (model correction matrix)"
},
{
"children": [
3
],
"matrix": [
1,
0,
0,
0,
0,
0,
1,
0,
0,
-1,
0,
0,
0,
0,
0,
1
],
"name": "3c96b4c605144760a4b7d953fa4e9a15.fbx"
},
{
"children": [
4
],
"name": "RootNode"
},
{
"children": [
5,
6,
7
],
"matrix": [
9.3455562591552734,
0,
0,
0,
0,
9.3455562591552468,
-7.0556988371126668e-07,
0,
0,
7.0556988371126668e-07,
9.3455562591552468,
0,
0,
0,
0,
1
],
"name": "Glasses"
},
{
"mesh": 0,
"name": "Glasses_Glasses2_0"
},
{
"mesh": 1,
"name": "Glasses_Lenses_0"
},
{
"mesh": 2,
"name": "Glasses_Glasses1_0"
}
],
"samplers": [
{
"magFilter": 9729,
"minFilter": 9987,
"wrapS": 10497,
"wrapT": 10497
}
],
"scene": 0,
"scenes": [
{
"name": "OSG_Scene",
"nodes": [
0
]
}
],
"textures": [
{
"sampler": 0,
"source": 0
},
{
"sampler": 0,
"source": 1
},
{
"sampler": 0,
"source": 2
},
{
"sampler": 0,
"source": 3
},
{
"sampler": 0,
"source": 4
},
{
"sampler": 0,
"source": 5
},
{
"sampler": 0,
"source": 6
},
{
"sampler": 0,
"source": 7
},
{
"sampler": 0,
"source": 8
}
]
}
================================================
FILE: examples/face_tracking/index.html
================================================
<html>
<head>
<title>ARKit face tracking example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<style>
body, html {
padding: 0;
margin: 0;
overflow: hidden;
position: fixed;
width: 100%;
height: 100vh;
-webkit-user-select: none;
user-select: none;
}
#gui { position: absolute; top: 5%; right: 2px }
#target {
width: 100%;
height: 100%;
position: absolute;
}
</style>
<link rel="stylesheet" href="../common.css"/>
<script src="../libs/three.js"></script>
<script src="../libs/dat.gui.min.js"></script>
<script src="../libs/three-gltf-loader.js"></script>
<!--
<script type="module" src="../../polyfill/XRPolyfill.js"></script>
<script nomodule src="../../dist/webxr-polyfill.js"></script>
-->
<script src="../../dist/webxr-polyfill.js"></script>
<script src="../common.js"></script>
</head>
<body>
<div id="target" />
<div onclick="hideMe(this)" id="description">
<h2>ARKit face tracking Example</h2>
<h5>(click to dismiss)</h5>
<p>This detects and tracks your face using ARKit and places a 3D model on it.
(Glasses model by <a href="https://sketchfab.com/models/5c78f100eea749c895d69fe2ed728197#">person-x</a>)
</p>
</div>
<script>
class ARKitFaceTrackingExample extends XRExampleBase {
constructor(domElement){
super(domElement, false, true, false, true)
// A message at the bottom of the screen that shows whether a surface has been found
this._messageEl = document.createElement('div')
this.el.appendChild(this._messageEl)
this._messageEl.style.position = 'absolute'
this._messageEl.style.bottom = '10px'
this._messageEl.style.left = '10px'
this._messageEl.style.color = 'white'
this._messageEl.style['font-size'] = '16px'
// add dat.GUI to the left HUD. We hid it in stereo viewing, so we don't need to
// figure out how to duplicate it.
this.params = {
face: 'occlusion',
ducky: false,
glasses: true
};
var gui = new dat.GUI({ autoPlace: false });
document.body.appendChild(gui.domElement);
gui.add( this.params, 'face', { 'Occlusion Only': 'occlusion', 'Oclussion & Mesh': 'both', 'Transparent Mesh': 'transparent' } );
gui.add( this.params, 'ducky' );
gui.add( this.params, 'glasses' );
gui.domElement.id = 'gui';
gui.open();
this.gui = gui
}
// Called during construction to allow the app to populate this.scene
initializeScene() {
// Add a box at the scene origin
let box = new THREE.Mesh(
new THREE.BoxBufferGeometry(0.1, 0.1, 0.1),
new THREE.MeshPhongMaterial({color: '#DDFFDD'})
)
box.position.set(0, 0.05, 0)
var axesHelper = AxesHelper( 0.2 );
this.floorGroup.add( axesHelper );
this.floorGroup.add(box)
// Add a few lights
this.ambientLight = new THREE.AmbientLight('#FFF', 0.2)
this.scene.add(this.ambientLight);
this.directionalLight = new THREE.DirectionalLight('#FFF', 0.6)
this.directionalLight.position.set(0, 10, 0)
this.scene.add(this.directionalLight)
this.duckyCreated = false
this.glassesCreated = false;
this.faceMesh = new THREE.Group();
this.transparentMesh = new THREE.Group()
this.meshOcclusion = new THREE.Group()
this.ducky = new THREE.Group()
this.ducky.name = "Duck group"
loadGLTF('./DuckyMesh.glb').then(gltf => {
this.duckyNode = gltf.scene
this.duckyNode.position.set(0, -0.25, -0.2)
this.duckyNode.scale.set(3,3,3)
this.ducky.add(this.duckyNode)
this.duckyCreated = true
}).catch((...params) =>{
console.error('could not load gltf', ...params)
})
this.glasses = new THREE.Group()
this.glasses.name = "Glasses group"
loadGLTF('./glasses/glasses.gltf').then(gltf => {
this.glassesNode = gltf.scene
this.glassesNode.position.set(0, 0.01, 0.06)
this.glassesNode.scale.set(0.0005,0.0005,0.0005)
this.glasses.add(this.glassesNode)
this.glassesCreated = true
}).catch((...params) =>{
console.error('could not load gltf', ...params)
})
this.listenerSetup = false
}
// Called once per frame, before render, to give the app a chance to update this.scene
updateScene(frame){
if(frame.hasLightEstimate){
// intensity is 1 for "normal"
this.ambientLight.intensity = frame.lightEstimate * (2/10);
this.directionalLight.intensity = frame.lightEstimate * (8/10);
}
if (!this.listenerSetup) {
this.listenerSetup = true
this.session.addEventListener(XRSession.NEW_WORLD_ANCHOR, this._handleNewWorldAnchor.bind(this))
this.session.addEventListener(XRSession.UPDATE_WORLD_ANCHOR, this._handleUpdateWorldAnchor.bind(this))
this.session.addEventListener(XRSession.REMOVE_WORLD_ANCHOR, this._handleRemoveWorldAnchor.bind(this))
}
if (this.params.ducky) {
if (this.ducky.parent != this.faceMesh) {
this.faceMesh.add(this.ducky)
}
} else {
this.faceMesh.remove(this.ducky)
}
if (this.params.glasses) {
if (this.glasses.parent != this.faceMesh) {
this.faceMesh.add(this.glasses)
}
} else {
this.faceMesh.remove(this.glasses)
}
if (this.material) {
if (this.params.face == "occlusion") {
this.material.colorWrite = false; // only update the depth
this.wireMaterial.colorWrite = false; // only update the depth
this.material.transparent = false;
} else if (this.params.face == "transparent") {
this.material.colorWrite = true; // only update the depth
this.wireMaterial.colorWrite = true; // only update the depth
this.material.transparent = true;
} else {
this.material.colorWrite = true; // only update the depth
this.wireMaterial.colorWrite = true; // only update the depth
this.material.transparent = false;
}
}
}
_handleRemoveWorldAnchor(event) {
let anchor = event.detail
if (anchor instanceof XRFaceAnchor) {
if (anchor.geometry !== null) {
this.faceMesh.remove(this.transparentMesh)
this.transparentMesh = null
this.removeAnchoredNode(this.faceMesh);
}
}
}
_handleUpdateWorldAnchor(event) {
let anchor = event.detail
if (anchor instanceof XRFaceAnchor) {
if (anchor.geometry !== null) {
let currentVertexIndex = 0
var position = this.faceMesh.geometry.attributes.position;
for (let vertex of anchor.geometry.vertices) {
position.setXYZ(currentVertexIndex++, vertex.x, vertex.y, vertex.z)
}
//this.faceMesh.geometry.verticesNeedUpdate = true;
position.needsUpdate = true;
}
}
}
_handleNewWorldAnchor(event) {
let anchor = event.detail
if (anchor instanceof XRFaceAnchor) {
if (anchor.geometry !== null) {
if (!this.meshOcclusionMesh) {
let vertexCount = anchor.geometry.vertexCount
let vertices = new Float32Array( vertexCount * 3 );
let currentVertexIndex = 0
for (let vertex of anchor.geometry.vertices) {
vertices[currentVertexIndex++] = vertex.x
vertices[currentVertexIndex++] = vertex.y
vertices[currentVertexIndex++] = vertex.z
}
let geometry = new THREE.BufferGeometry()
let triangleIndices = anchor.geometry.triangleIndices
let verticesBufferAttribute = new THREE.BufferAttribute( vertices, 3 )
verticesBufferAttribute.dynamic = true
geometry.addAttribute( 'position', verticesBufferAttribute );
geometry.setIndex(triangleIndices)
// transparent mesh
this.wireMaterial = new THREE.MeshPhongMaterial({color: '#999999', wireframe: true})
this.material = new THREE.MeshPhongMaterial({color: '#999900', transparent: true, opacity: 0.5})
var mesh = new THREE.Mesh(geometry, this.material)
mesh.renderOrder = -2
this.transparentMesh.add(mesh)
mesh = new THREE.Mesh(geometry, this.wireMaterial)
mesh.renderOrder = -2
this.transparentMesh.add(mesh)
this.faceMesh.geometry = geometry; // for later use
this.faceMesh.add(this.transparentMesh)
this.addAnchoredNode(new XRAnchorOffset(anchor.uid), this.faceMesh)
}
}
}
}
}
function AxesHelper( size ) {
size = size || 1;
var vertices = [
0, 0, 0, size, 0, 0,
0, 0, 0, 0, size, 0,
0, 0, 0, 0, 0, size
];
var colors = [
1, 0, 0, 1, 0.6, 0,
0, 1, 0, 0.6, 1, 0,
0, 0, 1, 0, 0.6, 1
];
var geometry = new THREE.BufferGeometry();
geometry.addAttribute( 'position', new THREE.Float32BufferAttribute( vertices, 3 ) );
geometry.addAttribute( 'color', new THREE.Float32BufferAttribute( colors, 3 ) );
var material = new THREE.LineBasicMaterial( { vertexColors: THREE.VertexColors } );
return new THREE.LineSegments(geometry, material);
}
window.addEventListener('DOMContentLoaded', () => {
setTimeout(() => {
try {
window.pageApp = new ARKitFaceTrackingExample(document.getElementById('target'))
} catch(e) {
console.error('page error', e)
}
}, 1000)
})
</script>
</body>
</html>
================================================
FILE: examples/hit_test/index.html
================================================
<html>
<head>
<title>Hit test example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<style>
body, html {
padding: 0;
margin: 0;
overflow: hidden;
position: fixed;
width: 100%;
height: 100vh;
-webkit-user-select: none;
user-select: none;
}
#target {
width: 100%;
height: 100%;
position: absolute;
}
.common-message {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-size: 20px;
}
</style>
<link rel="stylesheet" href="../common.css"/>
<script src="../libs/three.min.js"></script>
<!--
<script type="module" src="../../polyfill/XRPolyfill.js"></script>
<script nomodule src="../../dist/webxr-polyfill.js"></script>
-->
<script src="../../dist/webxr-polyfill.js"></script>
<script src="../common.js"></script>
</head>
<body>
<div id="target" />
<div onclick="hideMe(this)" id="description">
<h2>Hit Test</h2>
<h5>(click to dismiss)</h5>
<p>Find anchors by searching on tap events.</p>
</div>
<script>
/*
HitTestExample shows how to find surfaces or other features and place content relative to them.
In a production application, you would not create a separate anchor for every user action because
your application would quickly slow down tracking so many anchors. Instead, find an anchor
for groups of content that are positioned relative to some surface or other feature.
*/
class HitTestExample extends XRExampleBase {
constructor(domElement){
super(domElement, false)
// A message at the bottom of the screen that shows whether a surface has been found
this._messageEl = document.createElement('div')
this.el.appendChild(this._messageEl)
this._messageEl.style.position = 'absolute'
this._messageEl.style.bottom = '10px'
this._messageEl.style.left = '10px'
this._messageEl.style.color = 'white'
this._messageEl.style['font-size'] = '16px'
this.el.addEventListener('touchstart', this._onTouchStart.bind(this), false)
}
// Called during construction to allow the app to populate this.scene
initializeScene(){
// Add a box at the scene origin
let box = new THREE.Mesh(
new THREE.BoxBufferGeometry(0.1, 0.1, 0.1),
new THREE.MeshPhongMaterial({ color: '#DDFFDD' })
)
box.position.set(0, 0.05, 0)
var axesHelper = AxesHelper( 0.2 );
this.floorGroup.add( axesHelper );
this.floorGroup.add(box)
// Add a few lights
this.scene.add(new THREE.AmbientLight('#FFF', 0.2))
let directionalLight = new THREE.DirectionalLight('#FFF', 0.6)
directionalLight.position.set(0, 10, 0)
this.scene.add(directionalLight)
}
// Called once per frame, before render, to give the app a chance to update this.scene
updateScene(frame){
}
// Save screen taps as normalized coordinates for use in this.updateScene
_onTouchStart(ev){
if (!ev.touches || ev.touches.length === 0) {
console.error('No touches on touch event', ev)
return
}
const x = ev.touches[0].clientX / window.innerWidth
const y = ev.touches[0].clientY / window.innerHeight
// Attempt a hit test using the normalized screen coordinates
this.session.hitTest(x, y).then(anchorOffset => {
if(anchorOffset === null){
this._messageEl.innerHTML = 'miss'
} else {
this._messageEl.innerHTML = 'hit'
this.addAnchoredNode(anchorOffset, this._createSceneGraphNode())
}
}).catch(err => {
console.error('Error in hit test', err)
})
}
// Creates a box used to indicate the location of an anchor offset
_createSceneGraphNode(){
let group = new THREE.Group()
let geometry = new THREE.BoxBufferGeometry(0.1, 0.1, 0.1)
let material = new THREE.MeshPhongMaterial({ color: '#99FF99' })
let mesh = new THREE.Mesh(geometry, material)
mesh.position.set(0, 0.05, 0)
group.add(mesh)
return group
}
}
function AxesHelper( size ) {
size = size || 1;
var vertices = [
0, 0, 0, size, 0, 0,
0, 0, 0, 0, size, 0,
0, 0, 0, 0, 0, size
];
var colors = [
1, 0, 0, 1, 0.6, 0,
0, 1, 0, 0.6, 1, 0,
0, 0, 1, 0, 0.6, 1
];
var geometry = new THREE.BufferGeometry();
geometry.addAttribute( 'position', new THREE.Float32BufferAttribute( vertices, 3 ) );
geometry.addAttribute( 'color', new THREE.Float32BufferAttribute( colors, 3 ) );
var material = new THREE.LineBasicMaterial( { vertexColors: THREE.VertexColors } );
return new THREE.LineSegments(geometry, material);
}
window.addEventListener('DOMContentLoaded', () => {
setTimeout(() => {
try {
window.pageApp = new HitTestExample(document.getElementById('target'))
} catch(e) {
console.error('page error', e)
}
}, 1000)
})
</script>
</body>
</html>
================================================
FILE: examples/image_detection/index.html
================================================
<html>
<head>
<title>ARKit 1.5 image detection example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<style>
body, html {
padding: 0;
margin: 0;
overflow: hidden;
position: fixed;
width: 100%;
height: 100vh;
-webkit-user-select: none;
user-select: none;
}
#target {
width: 100%;
height: 100%;
position: absolute;
}
.reset-button {
position: absolute;
bottom: 20px;
left: 50%;
transform: translate(-50%, -50%);
font-size: 2em;
padding: 10px;
}
.common-message {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-size: 20px;
}
</style>
<link rel="stylesheet" href="../common.css"/>
<script src="../libs/three.min.js"></script>
<script src="../libs/three-gltf-loader.js"></script>
<!--
<script type="module" src="../../polyfill/XRPolyfill.js"></script>
<script nomodule src="../../dist/webxr-polyfill.js"></script>
-->
<script src="../../dist/webxr-polyfill.js"></script>
<script src="../common.js"></script>
</head>
<body>
<div id="target" />
<div id="hubs" style="width: 100px; display: none">
<img id="hubs-image" src="hubs.png" >
</div>
<div onclick="hideMe(this)" id="description">
<h2>ARKit 1.5 Image Detection Example</h2>
<h5>(click to dismiss)</h5>
<p>This sample automatically creates and activates a reference image, and places an anchored ducky when it's detected. Print hubs.png so that it's 20cm wide.</p>
</div>
<script>
class ARKitImageDetectionExample extends XRExampleBase {
constructor(domElement){
super(domElement, false, true, false, true)
// A message at the bottom of the screen that shows whether a surface has been found
this._messageEl = document.createElement('div')
this.el.appendChild(this._messageEl)
this._messageEl.style.position = 'absolute'
this._messageEl.style.bottom = '10px'
this._messageEl.style.left = '10px'
this._messageEl.style.color = 'white'
this._messageEl.style['font-size'] = '16px'
}
// Called during construction to allow the app to populate this.scene
initializeScene(){
// Add a box at the scene origin
let box = new THREE.Mesh(
new THREE.BoxBufferGeometry(0.1, 0.1, 0.1),
new THREE.MeshPhongMaterial({ color: '#DDFFDD' })
)
box.position.set(0, 0.05, 0)
var axesHelper = AxesHelper( 0.2 );
this.floorGroup.add( axesHelper );
this.floorGroup.add(box)
// Add a few lights
this.scene.add(new THREE.AmbientLight('#FFF', 0.2))
let directionalLight = new THREE.DirectionalLight('#FFF', 0.6)
directionalLight.position.set(0, 10, 0)
this.scene.add(directionalLight)
this.duckyCreated = false
this.imageDetectionCreationRequested = false
this.imageActivateDetection = false;
this.imageActivated = false;
loadGLTF('./DuckyMesh.glb').then(gltf => {
this.ducky = new THREE.Group()
this.ducky.name = "Duck group"
this.duckyNode = gltf.scene
this.duckyNode.position.set(0, -0.01, 0)
this.ducky.add(this.duckyNode)
this.duckyCreated = true
}).catch((...params) =>{
console.error('could not load gltf', ...params)
})
}
// Called once per frame, before render, to give the app a chance to update this.scene
updateScene(frame){
let hubsImageName = 'hubs'
if (!this.listenerSetup) {
this.listenerSetup = true
this.session.addEventListener(XRSession.REMOVE_WORLD_ANCHOR, this._handleRemoveWorldAnchor.bind(this))
}
if (!this.imageDetectionCreationRequested && this.duckyCreated) {
this.imageDetectionCreationRequested = true
let hubsImageData = this.getImageData('hubs-image')
this.session.createImageAnchor(hubsImageName, hubsImageData.data, hubsImageData.width, hubsImageData.height, 0.2).then(() => {
this.resetButton = document.createElement('button')
this.resetButton.setAttribute('class', 'reset-button')
this.resetButton.innerText = 'Reset'
this.el.appendChild(this.resetButton)
this.resetButton.addEventListener('click', ev => {
this.imageActivateDetection = true;
this.removeAnchoredNode(this.ducky)
})
// ready to go!
this.imageActivateDetection = true;
}).catch(error => {
console.error(`error creating ducky: ${error}`)
})
}
if (!this.imageActivated && this.imageActivateDetection) {
this.imageActivated = true;
this.imageActivateDetection = false;
this.session.activateDetectionImage(hubsImageName).then(imageAnchorTransform => {
this.imageActivated = false;
const headCoordinateSystem = frame.getCoordinateSystem(XRCoordinateSystem.TRACKER)
let model = new THREE.Matrix4();
let tempPos = new THREE.Vector3();
let tempQuat = new THREE.Quaternion();
let tempScale = new THREE.Vector3();
model.fromArray(imageAnchorTransform);
model.decompose(tempPos, tempQuat, tempScale);
const anchorUID = frame.addAnchor(headCoordinateSystem, [tempPos.x, tempPos.y, tempPos.z], [tempQuat.x, tempQuat.y, tempQuat.z, tempQuat.w])
// var markerbox = new THREE.Object3D();
// var markerboxGeom = new THREE.Mesh(
// new THREE.BoxBufferGeometry(0.2, 0.01, 0.145),
// new THREE.MeshPhongMaterial({ color: Math.random() * 0xffffff}) //'#2D5FFD' })
// )
// markerboxGeom.position.set(0, 0.005, 0);
// markerbox.add(markerboxGeom)
// markerbox.add(this.ducky)
// this.addAnchoredNode(new XRAnchorOffset(anchorUID), markerbox)
// uncomment the above and comment this line, if you want to see how well
// the 3D content lines up with the image
this.addAnchoredNode(new XRAnchorOffset(anchorUID), this.ducky)
}).catch(error => {
this.imageActivated = false;
console.error(`error activating ducky: ${error}`)
})
}
}
_handleRemoveWorldAnchor(event) {
let anchor = event.detail
if (anchor instanceof XRImageAnchor) {
this.imageActivated = false;
this.imageActivateDetection = true;
this.removeAnchoredNode(this.ducky)
}
}
getImageData(imageID) {
let canvas = document.createElement('canvas');
let context = canvas.getContext('2d');
let img = document.getElementById(imageID);
canvas.width = img.width;
canvas.height = img.height;
context.drawImage(img, 0, 0 );
return context.getImageData(0, 0, img.width, img.height);
}
}
function AxesHelper( size ) {
size = size || 1;
var vertices = [
0, 0, 0, size, 0, 0,
0, 0, 0, 0, size, 0,
0, 0, 0, 0, 0, size
];
var colors = [
1, 0, 0, 1, 0.6, 0,
0, 1, 0, 0.6, 1, 0,
0, 0, 1, 0, 0.6, 1
];
var geometry = new THREE.BufferGeometry();
geometry.addAttribute( 'position', new THREE.Float32BufferAttribute( vertices, 3 ) );
geometry.addAttribute( 'color', new THREE.Float32BufferAttribute( colors, 3 ) );
var material = new THREE.LineBasicMaterial( { vertexColors: THREE.VertexColors } );
return new THREE.LineSegments(geometry, material);
}
window.addEventListener('DOMContentLoaded', () => {
setTimeout(() => {
try {
window.pageApp = new ARKitImageDetectionExample(document.getElementById('target'))
} catch(e) {
console.error('page error', e)
}
}, 1000)
})
</script>
</body>
</html>
================================================
FILE: examples/libs/loaders/BinaryLoader.js
================================================
/**
* @author alteredq / http://alteredqualia.com/
*/
THREE.BinaryLoader = function ( manager ) {
if ( typeof manager === 'boolean' ) {
console.warn( 'THREE.BinaryLoader: showStatus parameter has been removed from constructor.' );
manager = undefined;
}
this.manager = ( manager !== undefined ) ? manager : THREE.DefaultLoadingManager;
};
THREE.BinaryLoader.prototype = {
constructor: THREE.BinaryLoader,
crossOrigin: 'Anonymous',
// Load models generated by slim OBJ converter with BINARY option (converter_obj_three_slim.py -t binary)
// - binary models consist of two files: JS and BIN
// - parameters
// - url (required)
// - callback (required)
// - texturePath (optional: if not specified, textures will be assumed to be in the same folder as JS model file)
// - binaryPath (optional: if not specified, binary file will be assumed to be in the same folder as JS model file)
load: function ( url, onLoad, onProgress, onError ) {
// todo: unify load API to for easier SceneLoader use
var texturePath = this.texturePath || THREE.Loader.prototype.extractUrlBase( url );
var binaryPath = this.binaryPath || THREE.Loader.prototype.extractUrlBase( url );
// #1 load JS part via web worker
var scope = this;
var jsonloader = new THREE.FileLoader( this.manager );
jsonloader.load( url, function ( data ) {
var json = JSON.parse( data );
var bufferUrl = binaryPath + json.buffers;
var bufferLoader = new THREE.FileLoader( scope.manager );
bufferLoader.setResponseType( 'arraybuffer' );
bufferLoader.load( bufferUrl, function ( bufData ) {
// IEWEBGL needs this ???
//buffer = ( new Uint8Array( xhr.responseBody ) ).buffer;
//// iOS and other XMLHttpRequest level 1 ???
scope.parse( bufData, onLoad, texturePath, json.materials );
}, onProgress, onError );
}, onProgress, onError );
},
setBinaryPath: function ( value ) {
this.binaryPath = value;
},
setCrossOrigin: function ( value ) {
this.crossOrigin = value;
},
setTexturePath: function ( value ) {
this.texturePath = value;
},
parse: function ( data, callback, texturePath, jsonMaterials ) {
var Model = function ( texturePath ) {
var scope = this,
currentOffset = 0,
md,
normals = [],
uvs = [],
start_tri_flat, start_tri_smooth, start_tri_flat_uv, start_tri_smooth_uv,
start_quad_flat, start_quad_smooth, start_quad_flat_uv, start_quad_smooth_uv,
tri_size, quad_size,
len_tri_flat, len_tri_smooth, len_tri_flat_uv, len_tri_smooth_uv,
len_quad_flat, len_quad_smooth, len_quad_flat_uv;
THREE.Geometry.call( this );
md = parseMetaData( data, currentOffset );
currentOffset += md.header_bytes;
/*
md.vertex_index_bytes = Uint32Array.BYTES_PER_ELEMENT;
md.material_index_bytes = Uint16Array.BYTES_PER_ELEMENT;
md.normal_index_bytes = Uint32Array.BYTES_PER_ELEMENT;
md.uv_index_bytes = Uint32Array.BYTES_PER_ELEMENT;
*/
// buffers sizes
tri_size = md.vertex_index_bytes * 3 + md.material_index_bytes;
quad_size = md.vertex_index_bytes * 4 + md.material_index_bytes;
len_tri_flat = md.ntri_flat * ( tri_size );
len_tri_smooth = md.ntri_smooth * ( tri_size + md.normal_index_bytes * 3 );
len_tri_flat_uv = md.ntri_flat_uv * ( tri_size + md.uv_index_bytes * 3 );
len_tri_smooth_uv = md.ntri_smooth_uv * ( tri_size + md.normal_index_bytes * 3 + md.uv_index_bytes * 3 );
len_quad_flat = md.nquad_flat * ( quad_size );
len_quad_smooth = md.nquad_smooth * ( quad_size + md.normal_index_bytes * 4 );
len_quad_flat_uv = md.nquad_flat_uv * ( quad_size + md.uv_index_bytes * 4 );
// read buffers
currentOffset += init_vertices( currentOffset );
currentOffset += init_normals( currentOffset );
currentOffset += handlePadding( md.nnormals * 3 );
currentOffset += init_uvs( currentOffset );
start_tri_flat = currentOffset;
start_tri_smooth = start_tri_flat + len_tri_flat + handlePadding( md.ntri_flat * 2 );
start_tri_flat_uv = start_tri_smooth + len_tri_smooth + handlePadding( md.ntri_smooth * 2 );
start_tri_smooth_uv = start_tri_flat_uv + len_tri_flat_uv + handlePadding( md.ntri_flat_uv * 2 );
start_quad_flat = start_tri_smooth_uv + len_tri_smooth_uv + handlePadding( md.ntri_smooth_uv * 2 );
start_quad_smooth = start_quad_flat + len_quad_flat + handlePadding( md.nquad_flat * 2 );
start_quad_flat_uv = start_quad_smooth + len_quad_smooth + handlePadding( md.nquad_smooth * 2 );
start_quad_smooth_uv = start_quad_flat_uv + len_quad_flat_uv + handlePadding( md.nquad_flat_uv * 2 );
// have to first process faces with uvs
// so that face and uv indices match
init_triangles_flat_uv( start_tri_flat_uv );
init_triangles_smooth_uv( start_tri_smooth_uv );
init_quads_flat_uv( start_quad_flat_uv );
init_quads_smooth_uv( start_quad_smooth_uv );
// now we can process untextured faces
init_triangles_flat( start_tri_flat );
init_triangles_smooth( start_tri_smooth );
init_quads_flat( start_quad_flat );
init_quads_smooth( start_quad_smooth );
this.computeFaceNormals();
function handlePadding( n ) {
return ( n % 4 ) ? ( 4 - n % 4 ) : 0;
}
function parseMetaData( data, offset ) {
var metaData = {
'signature' : parseString( data, offset, 12 ),
'header_bytes' : parseUChar8( data, offset + 12 ),
'vertex_coordinate_bytes' : parseUChar8( data, offset + 13 ),
'normal_coordinate_bytes' : parseUChar8( data, offset + 14 ),
'uv_coordinate_bytes' : parseUChar8( data, offset + 15 ),
'vertex_index_bytes' : parseUChar8( data, offset + 16 ),
'normal_index_bytes' : parseUChar8( data, offset + 17 ),
'uv_index_bytes' : parseUChar8( data, offset + 18 ),
'material_index_bytes' : parseUChar8( data, offset + 19 ),
'nvertices' : parseUInt32( data, offset + 20 ),
'nnormals' : parseUInt32( data, offset + 20 + 4 * 1 ),
'nuvs' : parseUInt32( data, offset + 20 + 4 * 2 ),
'ntri_flat' : parseUInt32( data, offset + 20 + 4 * 3 ),
'ntri_smooth' : parseUInt32( data, offset + 20 + 4 * 4 ),
'ntri_flat_uv' : parseUInt32( data, offset + 20 + 4 * 5 ),
'ntri_smooth_uv' : parseUInt32( data, offset + 20 + 4 * 6 ),
'nquad_flat' : parseUInt32( data, offset + 20 + 4 * 7 ),
'nquad_smooth' : parseUInt32( data, offset + 20 + 4 * 8 ),
'nquad_flat_uv' : parseUInt32( data, offset + 20 + 4 * 9 ),
'nquad_smooth_uv' : parseUInt32( data, offset + 20 + 4 * 10 )
};
/*
console.log( "signature: " + metaData.signature );
console.log( "header_bytes: " + metaData.header_bytes );
console.log( "vertex_coordinate_bytes: " + metaData.vertex_coordinate_bytes );
console.log( "normal_coordinate_bytes: " + metaData.normal_coordinate_bytes );
console.log( "uv_coordinate_bytes: " + metaData.uv_coordinate_bytes );
console.log( "vertex_index_bytes: " + metaData.vertex_index_bytes );
console.log( "normal_index_bytes: " + metaData.normal_index_bytes );
console.log( "uv_index_bytes: " + metaData.uv_index_bytes );
console.log( "material_index_bytes: " + metaData.material_index_bytes );
console.log( "nvertices: " + metaData.nvertices );
console.log( "nnormals: " + metaData.nnormals );
console.log( "nuvs: " + metaData.nuvs );
console.log( "ntri_flat: " + metaData.ntri_flat );
console.log( "ntri_smooth: " + metaData.ntri_smooth );
console.log( "ntri_flat_uv: " + metaData.ntri_flat_uv );
console.log( "ntri_smooth_uv: " + metaData.ntri_smooth_uv );
console.log( "nquad_flat: " + metaData.nquad_flat );
console.log( "nquad_smooth: " + metaData.nquad_smooth );
console.log( "nquad_flat_uv: " + metaData.nquad_flat_uv );
console.log( "nquad_smooth_uv: " + metaData.nquad_smooth_uv );
var total = metaData.header_bytes
+ metaData.nvertices * metaData.vertex_coordinate_bytes * 3
+ metaData.nnormals * metaData.normal_coordinate_bytes * 3
+ metaData.nuvs * metaData.uv_coordinate_bytes * 2
+ metaData.ntri_flat * ( metaData.vertex_index_bytes*3 + metaData.material_index_bytes )
+ metaData.ntri_smooth * ( metaData.vertex_index_bytes*3 + metaData.material_index_bytes + metaData.normal_index_bytes*3 )
+ metaData.ntri_flat_uv * ( metaData.vertex_index_bytes*3 + metaData.material_index_bytes + metaData.uv_index_bytes*3 )
+ metaData.ntri_smooth_uv * ( metaData.vertex_index_bytes*3 + metaData.material_index_bytes + metaData.normal_index_bytes*3 + metaData.uv_index_bytes*3 )
+ metaData.nquad_flat * ( metaData.vertex_index_bytes*4 + metaData.material_index_bytes )
+ metaData.nquad_smooth * ( metaData.vertex_index_bytes*4 + metaData.material_index_bytes + metaData.normal_index_bytes*4 )
+ metaData.nquad_flat_uv * ( metaData.vertex_index_bytes*4 + metaData.material_index_bytes + metaData.uv_index_bytes*4 )
+ metaData.nquad_smooth_uv * ( metaData.vertex_index_bytes*4 + metaData.material_index_bytes + metaData.normal_index_bytes*4 + metaData.uv_index_bytes*4 );
console.log( "total bytes: " + total );
*/
return metaData;
}
function parseString( data, offset, length ) {
var charArray = new Uint8Array( data, offset, length );
var text = "";
for ( var i = 0; i < length; i ++ ) {
text += String.fromCharCode( charArray[ i ] );
}
return text;
}
function parseUChar8( data, offset ) {
var charArray = new Uint8Array( data, offset, 1 );
return charArray[ 0 ];
}
function parseUInt32( data, offset ) {
var intArray = new Uint32Array( data, offset, 1 );
return intArray[ 0 ];
}
function init_vertices( start ) {
var nElements = md.nvertices;
var coordArray = new Float32Array( data, start, nElements * 3 );
var i, x, y, z;
for ( i = 0; i < nElements; i ++ ) {
x = coordArray[ i * 3 ];
y = coordArray[ i * 3 + 1 ];
z = coordArray[ i * 3 + 2 ];
scope.vertices.push( new THREE.Vector3( x, y, z ) );
}
return nElements * 3 * Float32Array.BYTES_PER_ELEMENT;
}
function init_normals( start ) {
var nElements = md.nnormals;
if ( nElements ) {
var normalArray = new Int8Array( data, start, nElements * 3 );
var i, x, y, z;
for ( i = 0; i < nElements; i ++ ) {
x = normalArray[ i * 3 ];
y = normalArray[ i * 3 + 1 ];
z = normalArray[ i * 3 + 2 ];
normals.push( x / 127, y / 127, z / 127 );
}
}
return nElements * 3 * Int8Array.BYTES_PER_ELEMENT;
}
function init_uvs( start ) {
var nElements = md.nuvs;
if ( nElements ) {
var uvArray = new Float32Array( data, start, nElements * 2 );
var i, u, v;
for ( i = 0; i < nElements; i ++ ) {
u = uvArray[ i * 2 ];
v = uvArray[ i * 2 + 1 ];
uvs.push( u, v );
}
}
return nElements * 2 * Float32Array.BYTES_PER_ELEMENT;
}
function init_uvs3( nElements, offset ) {
var i, uva, uvb, uvc, u1, u2, u3, v1, v2, v3;
var uvIndexBuffer = new Uint32Array( data, offset, 3 * nElements );
for ( i = 0; i < nElements; i ++ ) {
uva = uvIndexBuffer[ i * 3 ];
uvb = uvIndexBuffer[ i * 3 + 1 ];
uvc = uvIndexBuffer[ i * 3 + 2 ];
u1 = uvs[ uva * 2 ];
v1 = uvs[ uva * 2 + 1 ];
u2 = uvs[ uvb * 2 ];
v2 = uvs[ uvb * 2 + 1 ];
u3 = uvs[ uvc * 2 ];
v3 = uvs[ uvc * 2 + 1 ];
scope.faceVertexUvs[ 0 ].push( [
new THREE.Vector2( u1, v1 ),
new THREE.Vector2( u2, v2 ),
new THREE.Vector2( u3, v3 )
] );
}
}
function init_uvs4( nElements, offset ) {
var i, uva, uvb, uvc, uvd, u1, u2, u3, u4, v1, v2, v3, v4;
var uvIndexBuffer = new Uint32Array( data, offset, 4 * nElements );
for ( i = 0; i < nElements; i ++ ) {
uva = uvIndexBuffer[ i * 4 ];
uvb = uvIndexBuffer[ i * 4 + 1 ];
uvc = uvIndexBuffer[ i * 4 + 2 ];
uvd = uvIndexBuffer[ i * 4 + 3 ];
u1 = uvs[ uva * 2 ];
v1 = uvs[ uva * 2 + 1 ];
u2 = uvs[ uvb * 2 ];
v2 = uvs[ uvb * 2 + 1 ];
u3 = uvs[ uvc * 2 ];
v3 = uvs[ uvc * 2 + 1 ];
u4 = uvs[ uvd * 2 ];
v4 = uvs[ uvd * 2 + 1 ];
scope.faceVertexUvs[ 0 ].push( [
new THREE.Vector2( u1, v1 ),
new THREE.Vector2( u2, v2 ),
new THREE.Vector2( u4, v4 )
] );
scope.faceVertexUvs[ 0 ].push( [
new THREE.Vector2( u2, v2 ),
new THREE.Vector2( u3, v3 ),
new THREE.Vector2( u4, v4 )
] );
}
}
function init_faces3_flat( nElements, offsetVertices, offsetMaterials ) {
var i, a, b, c, m;
var vertexIndexBuffer = new Uint32Array( data, offsetVertices, 3 * nElements );
var materialIndexBuffer = new Uint16Array( data, offsetMaterials, nElements );
for ( i = 0; i < nElements; i ++ ) {
a = vertexIndexBuffer[ i * 3 ];
b = vertexIndexBuffer[ i * 3 + 1 ];
c = vertexIndexBuffer[ i * 3 + 2 ];
m = materialIndexBuffer[ i ];
scope.faces.push( new THREE.Face3( a, b, c, null, null, m ) );
}
}
function init_faces4_flat( nElements, offsetVertices, offsetMaterials ) {
var i, a, b, c, d, m;
var vertexIndexBuffer = new Uint32Array( data, offsetVertices, 4 * nElements );
var materialIndexBuffer = new Uint16Array( data, offsetMaterials, nElements );
for ( i = 0; i < nElements; i ++ ) {
a = vertexIndexBuffer[ i * 4 ];
b = vertexIndexBuffer[ i * 4 + 1 ];
c = vertexIndexBuffer[ i * 4 + 2 ];
d = vertexIndexBuffer[ i * 4 + 3 ];
m = materialIndexBuffer[ i ];
scope.faces.push( new THREE.Face3( a, b, d, null, null, m ) );
scope.faces.push( new THREE.Face3( b, c, d, null, null, m ) );
}
}
function init_faces3_smooth( nElements, offsetVertices, offsetNormals, offsetMaterials ) {
var i, a, b, c, m;
var na, nb, nc;
var vertexIndexBuffer = new Uint32Array( data, offsetVertices, 3 * nElements );
var normalIndexBuffer = new Uint32Array( data, offsetNormals, 3 * nElements );
var materialIndexBuffer = new Uint16Array( data, offsetMaterials, nElements );
for ( i = 0; i < nElements; i ++ ) {
a = vertexIndexBuffer[ i * 3 ];
b = vertexIndexBuffer[ i * 3 + 1 ];
c = vertexIndexBuffer[ i * 3 + 2 ];
na = normalIndexBuffer[ i * 3 ];
nb = normalIndexBuffer[ i * 3 + 1 ];
nc = normalIndexBuffer[ i * 3 + 2 ];
m = materialIndexBuffer[ i ];
var nax = normals[ na * 3 ],
nay = normals[ na * 3 + 1 ],
naz = normals[ na * 3 + 2 ],
nbx = normals[ nb * 3 ],
nby = normals[ nb * 3 + 1 ],
nbz = normals[ nb * 3 + 2 ],
ncx = normals[ nc * 3 ],
ncy = normals[ nc * 3 + 1 ],
ncz = normals[ nc * 3 + 2 ];
scope.faces.push( new THREE.Face3( a, b, c, [
new THREE.Vector3( nax, nay, naz ),
new THREE.Vector3( nbx, nby, nbz ),
new THREE.Vector3( ncx, ncy, ncz )
], null, m ) );
}
}
function init_faces4_smooth( nElements, offsetVertices, offsetNormals, offsetMaterials ) {
var i, a, b, c, d, m;
var na, nb, nc, nd;
var vertexIndexBuffer = new Uint32Array( data, offsetVertices, 4 * nElements );
var normalIndexBuffer = new Uint32Array( data, offsetNormals, 4 * nElements );
var materialIndexBuffer = new Uint16Array( data, offsetMaterials, nElements );
for ( i = 0; i < nElements; i ++ ) {
a = vertexIndexBuffer[ i * 4 ];
b = vertexIndexBuffer[ i * 4 + 1 ];
c = vertexIndexBuffer[ i * 4 + 2 ];
d = vertexIndexBuffer[ i * 4 + 3 ];
na = normalIndexBuffer[ i * 4 ];
nb = normalIndexBuffer[ i * 4 + 1 ];
nc = normalIndexBuffer[ i * 4 + 2 ];
nd = normalIndexBuffer[ i * 4 + 3 ];
m = materialIndexBuffer[ i ];
var nax = normals[ na * 3 ],
nay = normals[ na * 3 + 1 ],
naz = normals[ na * 3 + 2 ],
nbx = normals[ nb * 3 ],
nby = normals[ nb * 3 + 1 ],
nbz = normals[ nb * 3 + 2 ],
ncx = normals[ nc * 3 ],
ncy = normals[ nc * 3 + 1 ],
ncz = normals[ nc * 3 + 2 ],
ndx = normals[ nd * 3 ],
ndy = normals[ nd * 3 + 1 ],
ndz = normals[ nd * 3 + 2 ];
scope.faces.push( new THREE.Face3( a, b, d, [
new THREE.Vector3( nax, nay, naz ),
new THREE.Vector3( nbx, nby, nbz ),
new THREE.Vector3( ndx, ndy, ndz )
], null, m ) );
scope.faces.push( new THREE.Face3( b, c, d, [
new THREE.Vector3( nbx, nby, nbz ),
new THREE.Vector3( ncx, ncy, ncz ),
new THREE.Vector3( ndx, ndy, ndz )
], null, m ) );
}
}
function init_triangles_flat( start ) {
var nElements = md.ntri_flat;
if ( nElements ) {
var offsetMaterials = start + nElements * Uint32Array.BYTES_PER_ELEMENT * 3;
init_faces3_flat( nElements, start, offsetMaterials );
}
}
function init_triangles_flat_uv( start ) {
var nElements = md.ntri_flat_uv;
if ( nElements ) {
var offsetUvs = start + nElements * Uint32Array.BYTES_PER_ELEMENT * 3;
var offsetMaterials = offsetUvs + nElements * Uint32Array.BYTES_PER_ELEMENT * 3;
init_faces3_flat( nElements, start, offsetMaterials );
init_uvs3( nElements, offsetUvs );
}
}
function init_triangles_smooth( start ) {
var nElements = md.ntri_smooth;
if ( nElements ) {
var offsetNormals = start + nElements * Uint32Array.BYTES_PER_ELEMENT * 3;
var offsetMaterials = offsetNormals + nElements * Uint32Array.BYTES_PER_ELEMENT * 3;
init_faces3_smooth( nElements, start, offsetNormals, offsetMaterials );
}
}
function init_triangles_smooth_uv( start ) {
var nElements = md.ntri_smooth_uv;
if ( nElements ) {
var offsetNormals = start + nElements * Uint32Array.BYTES_PER_ELEMENT * 3;
var offsetUvs = offsetNormals + nElements * Uint32Array.BYTES_PER_ELEMENT * 3;
var offsetMaterials = offsetUvs + nElements * Uint32Array.BYTES_PER_ELEMENT * 3;
init_faces3_smooth( nElements, start, offsetNormals, offsetMaterials );
init_uvs3( nElements, offsetUvs );
}
}
function init_quads_flat( start ) {
var nElements = md.nquad_flat;
if ( nElements ) {
var offsetMaterials = start + nElements * Uint32Array.BYTES_PER_ELEMENT * 4;
init_faces4_flat( nElements, start, offsetMaterials );
}
}
function init_quads_flat_uv( start ) {
var nElements = md.nquad_flat_uv;
if ( nElements ) {
var offsetUvs = start + nElements * Uint32Array.BYTES_PER_ELEMENT * 4;
var offsetMaterials = offsetUvs + nElements * Uint32Array.BYTES_PER_ELEMENT * 4;
init_faces4_flat( nElements, start, offsetMaterials );
init_uvs4( nElements, offsetUvs );
}
}
function init_quads_smooth( start ) {
var nElements = md.nquad_smooth;
if ( nElements ) {
var offsetNormals = start + nElements * Uint32Array.BYTES_PER_ELEMENT * 4;
var offsetMaterials = offsetNormals + nElements * Uint32Array.BYTES_PER_ELEMENT * 4;
init_faces4_smooth( nElements, start, offsetNormals, offsetMaterials );
}
}
function init_quads_smooth_uv( start ) {
var nElements = md.nquad_smooth_uv;
if ( nElements ) {
var offsetNormals = start + nElements * Uint32Array.BYTES_PER_ELEMENT * 4;
var offsetUvs = offsetNormals + nElements * Uint32Array.BYTES_PER_ELEMENT * 4;
var offsetMaterials = offsetUvs + nElements * Uint32Array.BYTES_PER_ELEMENT * 4;
init_faces4_smooth( nElements, start, offsetNormals, offsetMaterials );
init_uvs4( nElements, offsetUvs );
}
}
};
Model.prototype = Object.create( THREE.Geometry.prototype );
Model.prototype.constructor = Model;
var geometry = new Model( texturePath );
var materials = THREE.Loader.prototype.initMaterials( jsonMaterials, texturePath, this.crossOrigin );
callback( geometry, materials );
}
};
================================================
FILE: examples/libs/postprocessing/BloomPass.js
================================================
/**
* @author alteredq / http://alteredqualia.com/
*/
THREE.BloomPass = function ( strength, kernelSize, sigma, resolution ) {
THREE.Pass.call( this );
strength = ( strength !== undefined ) ? strength : 1;
kernelSize = ( kernelSize !== undefined ) ? kernelSize : 25;
sigma = ( sigma !== undefined ) ? sigma : 4.0;
resolution = ( resolution !== undefined ) ? resolution : 256;
// render targets
var pars = { minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter, format: THREE.RGBAFormat };
this.renderTargetX = new THREE.WebGLRenderTarget( resolution, resolution, pars );
this.renderTargetX.texture.name = "BloomPass.x";
this.renderTargetY = new THREE.WebGLRenderTarget( resolution, resolution, pars );
this.renderTargetY.texture.name = "BloomPass.y";
// copy material
if ( THREE.CopyShader === undefined )
console.error( "THREE.BloomPass relies on THREE.CopyShader" );
var copyShader = THREE.CopyShader;
this.copyUniforms = THREE.UniformsUtils.clone( copyShader.uniforms );
this.copyUniforms[ "opacity" ].value = strength;
this.materialCopy = new THREE.ShaderMaterial( {
uniforms: this.copyUniforms,
vertexShader: copyShader.vertexShader,
fragmentShader: copyShader.fragmentShader,
blending: THREE.AdditiveBlending,
transparent: true
} );
// convolution material
if ( THREE.ConvolutionShader === undefined )
console.error( "THREE.BloomPass relies on THREE.ConvolutionShader" );
var convolutionShader = THREE.ConvolutionShader;
this.convolutionUniforms = THREE.UniformsUtils.clone( convolutionShader.uniforms );
this.convolutionUniforms[ "uImageIncrement" ].value = THREE.BloomPass.blurX;
this.convolutionUniforms[ "cKernel" ].value = THREE.ConvolutionShader.buildKernel( sigma );
this.materialConvolution = new THREE.ShaderMaterial( {
uniforms: this.convolutionUniforms,
vertexShader: convolutionShader.vertexShader,
fragmentShader: convolutionShader.fragmentShader,
defines: {
"KERNEL_SIZE_FLOAT": kernelSize.toFixed( 1 ),
"KERNEL_SIZE_INT": kernelSize.toFixed( 0 )
}
} );
this.needsSwap = false;
this.camera = new THREE.OrthographicCamera( - 1, 1, 1, - 1, 0, 1 );
this.scene = new THREE.Scene();
this.quad = new THREE.Mesh( new THREE.PlaneBufferGeometry( 2, 2 ), null );
this.quad.frustumCulled = false; // Avoid getting clipped
this.scene.add( this.quad );
};
THREE.BloomPass.prototype = Object.assign( Object.create( THREE.Pass.prototype ), {
constructor: THREE.BloomPass,
render: function ( renderer, writeBuffer, readBuffer, delta, maskActive ) {
if ( maskActive ) renderer.context.disable( renderer.context.STENCIL_TEST );
// Render quad with blured scene into texture (convolution pass 1)
this.quad.material = this.materialConvolution;
this.convolutionUniforms[ "tDiffuse" ].value = readBuffer.texture;
this.convolutionUniforms[ "uImageIncrement" ].value = THREE.BloomPass.blurX;
renderer.render( this.scene, this.camera, this.renderTargetX, true );
// Render quad with blured scene into texture (convolution pass 2)
this.convolutionUniforms[ "tDiffuse" ].value = this.renderTargetX.texture;
this.convolutionUniforms[ "uImageIncrement" ].value = THREE.BloomPass.blurY;
renderer.render( this.scene, this.camera, this.renderTargetY, true );
// Render original scene with superimposed blur to texture
this.quad.material = this.materialCopy;
this.copyUniforms[ "tDiffuse" ].value = this.renderTargetY.texture;
if ( maskActive ) renderer.context.enable( renderer.context.STENCIL_TEST );
renderer.render( this.scene, this.camera, readBuffer, this.clear );
}
} );
THREE.BloomPass.blurX = new THREE.Vector2( 0.001953125, 0.0 );
THREE.BloomPass.blurY = new THREE.Vector2( 0.0, 0.001953125 );
================================================
FILE: examples/libs/postprocessing/EffectComposer.js
================================================
/**
* @author alteredq / http://alteredqualia.com/
*/
THREE.EffectComposer = function ( renderer, renderTarget ) {
this.renderer = renderer;
if ( renderTarget === undefined ) {
var parameters = {
minFilter: THREE.LinearFilter,
magFilter: THREE.LinearFilter,
format: THREE.RGBAFormat,
stencilBuffer: false
};
var size = renderer.getSize();
renderTarget = new THREE.WebGLRenderTarget( size.width, size.height, parameters );
renderTarget.texture.name = 'EffectComposer.rt1';
}
this.renderTarget1 = renderTarget;
this.renderTarget2 = renderTarget.clone();
this.renderTarget2.texture.name = 'EffectComposer.rt2';
this.writeBuffer = this.renderTarget1;
this.readBuffer = this.renderTarget2;
this.passes = [];
// dependencies
if ( THREE.CopyShader === undefined ) {
console.error( 'THREE.EffectComposer relies on THREE.CopyShader' );
}
if ( THREE.ShaderPass === undefined ) {
console.error( 'THREE.EffectComposer relies on THREE.ShaderPass' );
}
this.copyPass = new THREE.ShaderPass( THREE.CopyShader );
};
Object.assign( THREE.EffectComposer.prototype, {
swapBuffers: function() {
var tmp = this.readBuffer;
this.readBuffer = this.writeBuffer;
this.writeBuffer = tmp;
},
addPass: function ( pass ) {
this.passes.push( pass );
var size = this.renderer.getSize();
pass.setSize( size.width, size.height );
},
insertPass: function ( pass, index ) {
this.passes.splice( index, 0, pass );
},
render: function ( delta ) {
var maskActive = false;
var pass, i, il = this.passes.length;
for ( i = 0; i < il; i ++ ) {
pass = this.passes[ i ];
if ( pass.enabled === false ) continue;
pass.render( this.renderer, this.writeBuffer, this.readBuffer, delta, maskActive );
if ( pass.needsSwap ) {
if ( maskActive ) {
var context = this.renderer.context;
context.stencilFunc( context.NOTEQUAL, 1, 0xffffffff );
this.copyPass.render( this.renderer, this.writeBuffer, this.readBuffer, delta );
context.stencilFunc( context.EQUAL, 1, 0xffffffff );
}
this.swapBuffers();
}
if ( THREE.MaskPass !== undefined ) {
if ( pass instanceof THREE.MaskPass ) {
maskActive = true;
} else if ( pass instanceof THREE.ClearMaskPass ) {
maskActive = false;
}
}
}
},
reset: function ( renderTarget ) {
if ( renderTarget === undefined ) {
var size = this.renderer.getSize();
renderTarget = this.renderTarget1.clone();
renderTarget.setSize( size.width, size.height );
}
this.renderTarget1.dispose();
this.renderTarget2.dispose();
this.renderTarget1 = renderTarget;
this.renderTarget2 = renderTarget.clone();
this.writeBuffer = this.renderTarget1;
this.readBuffer = this.renderTarget2;
},
setSize: function ( width, height ) {
this.renderTarget1.setSize( width, height );
this.renderTarget2.setSize( width, height );
for ( var i = 0; i < this.passes.length; i ++ ) {
this.passes[i].setSize( width, height );
}
}
} );
THREE.Pass = function () {
// if set to true, the pass is processed by the composer
this.enabled = true;
// if set to true, the pass indicates to swap read and write buffer after rendering
this.needsSwap = true;
// if set to true, the pass clears its buffer before rendering
this.clear = false;
// if set to true, the result of the pass is rendered to screen
this.renderToScreen = false;
};
Object.assign( THREE.Pass.prototype, {
setSize: function( width, height ) {},
render: function ( renderer, writeBuffer, readBuffer, delta, maskActive ) {
console.error( 'THREE.Pass: .render() must be implemented in derived pass.' );
}
} );
================================================
FILE: examples/libs/postprocessing/FilmPass.js
================================================
/**
* @author alteredq / http://alteredqualia.com/
*/
THREE.FilmPass = function ( noiseIntensity, scanlinesIntensity, scanlinesCount, grayscale ) {
THREE.Pass.call( this );
if ( THREE.FilmShader === undefined )
console.error( "THREE.FilmPass relies on THREE.FilmShader" );
var shader = THREE.FilmShader;
this.uniforms = THREE.UniformsUtils.clone( shader.uniforms );
this.material = new THREE.ShaderMaterial( {
uniforms: this.uniforms,
vertexShader: shader.vertexShader,
fragmentShader: shader.fragmentShader
} );
if ( grayscale !== undefined ) this.uniforms.grayscale.value = grayscale;
if ( noiseIntensity !== undefined ) this.uniforms.nIntensity.value = noiseIntensity;
if ( scanlinesIntensity !== undefined ) this.uniforms.sIntensity.value = scanlinesIntensity;
if ( scanlinesCount !== undefined ) this.uniforms.sCount.value = scanlinesCount;
this.camera = new THREE.OrthographicCamera( - 1, 1, 1, - 1, 0, 1 );
this.scene = new THREE.Scene();
this.quad = new THREE.Mesh( new THREE.PlaneBufferGeometry( 2, 2 ), null );
this.quad.frustumCulled = false; // Avoid getting clipped
this.scene.add( this.quad );
};
THREE.FilmPass.prototype = Object.assign( Object.create( THREE.Pass.prototype ), {
constructor: THREE.FilmPass,
render: function ( renderer, writeBuffer, readBuffer, delta, maskActive ) {
this.uniforms[ "tDiffuse" ].value = readBuffer.texture;
this.uniforms[ "time" ].value += delta;
this.quad.material = this.material;
if ( this.renderToScreen ) {
renderer.render( this.scene, this.camera );
} else {
renderer.render( this.scene, this.camera, writeBuffer, this.clear );
}
}
} );
================================================
FILE: examples/libs/postprocessing/MaskPass.js
================================================
/**
* @author alteredq / http://alteredqualia.com/
*/
THREE.MaskPass = function ( scene, camera ) {
THREE.Pass.call( this );
this.scene = scene;
this.camera = camera;
this.clear = true;
this.needsSwap = false;
this.inverse = false;
};
THREE.MaskPass.prototype = Object.assign( Object.create( THREE.Pass.prototype ), {
constructor: THREE.MaskPass,
render: function ( renderer, writeBuffer, readBuffer, delta, maskActive ) {
var context = renderer.context;
var state = renderer.state;
// don't update color or depth
state.buffers.color.setMask( false );
state.buffers.depth.setMask( false );
// lock buffers
state.buffers.color.setLocked( true );
state.buffers.depth.setLocked( true );
// set up stencil
var writeValue, clearValue;
if ( this.inverse ) {
writeValue = 0;
clearValue = 1;
} else {
writeValue = 1;
clearValue = 0;
}
state.buffers.stencil.setTest( true );
state.buffers.stencil.setOp( context.REPLACE, context.REPLACE, context.REPLACE );
state.buffers.stencil.setFunc( context.ALWAYS, writeValue, 0xffffffff );
state.buffers.stencil.setClear( clearValue );
// draw into the stencil buffer
renderer.render( this.scene, this.camera, readBuffer, this.clear );
renderer.render( this.scene, this.camera, writeBuffer, this.clear );
// unlock color and depth buffer for subsequent rendering
state.buffers.color.setLocked( false );
state.buffers.depth.setLocked( false );
// only render where stencil is set to 1
state.buffers.stencil.setFunc( context.EQUAL, 1, 0xffffffff ); // draw if == 1
state.buffers.stencil.setOp( context.KEEP, context.KEEP, context.KEEP );
}
} );
THREE.ClearMaskPass = function () {
THREE.Pass.call( this );
this.needsSwap = false;
};
THREE.ClearMaskPass.prototype = Object.create( THREE.Pass.prototype );
Object.assign( THREE.ClearMaskPass.prototype, {
render: function ( renderer, writeBuffer, readBuffer, delta, maskActive ) {
renderer.state.buffers.stencil.setTest( false );
}
} );
================================================
FILE: examples/libs/postprocessing/RenderPass.js
================================================
/**
* @author alteredq / http://alteredqualia.com/
*/
THREE.RenderPass = function ( scene, camera, overrideMaterial, clearColor, clearAlpha ) {
THREE.Pass.call( this );
this.scene = scene;
this.camera = camera;
this.overrideMaterial = overrideMaterial;
this.clearColor = clearColor;
this.clearAlpha = ( clearAlpha !== undefined ) ? clearAlpha : 0;
this.clear = true;
this.clearDepth = false;
this.needsSwap = false;
};
THREE.RenderPass.prototype = Object.assign( Object.create( THREE.Pass.prototype ), {
constructor: THREE.RenderPass,
render: function ( renderer, writeBuffer, readBuffer, delta, maskActive ) {
var oldAutoClear = renderer.autoClear;
renderer.autoClear = false;
this.scene.overrideMaterial = this.overrideMaterial;
var oldClearColor, oldClearAlpha;
if ( this.clearColor ) {
oldClearColor = renderer.getClearColor().getHex();
oldClearAlpha = renderer.getClearAlpha();
renderer.setClearColor( this.clearColor, this.clearAlpha );
}
if ( this.clearDepth ) {
renderer.clearDepth();
}
renderer.render( this.scene, this.camera, this.renderToScreen ? null : readBuffer, this.clear );
if ( this.clearColor ) {
renderer.setClearColor( oldClearColor, oldClearAlpha );
}
this.scene.overrideMaterial = null;
renderer.autoClear = oldAutoClear;
}
} );
================================================
FILE: examples/libs/postprocessing/ShaderPass.js
================================================
/**
* @author alteredq / http://alteredqualia.com/
*/
THREE.ShaderPass = function ( shader, textureID ) {
THREE.Pass.call( this );
this.textureID = ( textureID !== undefined ) ? textureID : "tDiffuse";
if ( shader instanceof THREE.ShaderMaterial ) {
this.uniforms = shader.uniforms;
this.material = shader;
} else if ( shader ) {
this.uniforms = THREE.UniformsUtils.clone( shader.uniforms );
this.material = new THREE.ShaderMaterial( {
defines: shader.defines || {},
uniforms: this.uniforms,
vertexShader: shader.vertexShader,
fragmentShader: shader.fragmentShader
} );
}
this.camera = new THREE.OrthographicCamera( - 1, 1, 1, - 1, 0, 1 );
this.scene = new THREE.Scene();
this.quad = new THREE.Mesh( new THREE.PlaneBufferGeometry( 2, 2 ), null );
this.quad.frustumCulled = false; // Avoid getting clipped
this.scene.add( this.quad );
};
THREE.ShaderPass.prototype = Object.assign( Object.create( THREE.Pass.prototype ), {
constructor: THREE.ShaderPass,
render: function( renderer, writeBuffer, readBuffer, delta, maskActive ) {
if ( this.uniforms[ this.textureID ] ) {
this.uniforms[ this.textureID ].value = readBuffer.texture;
}
this.quad.material = this.material;
if ( this.renderToScreen ) {
renderer.render( this.scene, this.camera );
} else {
renderer.render( this.scene, this.camera, writeBuffer, this.clear );
}
}
} );
================================================
FILE: examples/libs/shaders/ConvolutionShader.js
================================================
/**
* @author alteredq / http://alteredqualia.com/
*
* Convolution shader
* ported from o3d sample to WebGL / GLSL
* http://o3d.googlecode.com/svn/trunk/samples/convolution.html
*/
THREE.ConvolutionShader = {
defines: {
"KERNEL_SIZE_FLOAT": "25.0",
"KERNEL_SIZE_INT": "25"
},
uniforms: {
"tDiffuse": { value: null },
"uImageIncrement": { value: new THREE.Vector2( 0.001953125, 0.0 ) },
"cKernel": { value: [] }
},
vertexShader: [
"uniform vec2 uImageIncrement;",
"varying vec2 vUv;",
"void main() {",
"vUv = uv - ( ( KERNEL_SIZE_FLOAT - 1.0 ) / 2.0 ) * uImageIncrement;",
"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
"}"
].join( "\n" ),
fragmentShader: [
"uniform float cKernel[ KERNEL_SIZE_INT ];",
"uniform sampler2D tDiffuse;",
"uniform vec2 uImageIncrement;",
"varying vec2 vUv;",
"void main() {",
"vec2 imageCoord = vUv;",
"vec4 sum = vec4( 0.0, 0.0, 0.0, 0.0 );",
"for( int i = 0; i < KERNEL_SIZE_INT; i ++ ) {",
"sum += texture2D( tDiffuse, imageCoord ) * cKernel[ i ];",
"imageCoord += uImageIncrement;",
"}",
"gl_FragColor = sum;",
"}"
].join( "\n" ),
buildKernel: function ( sigma ) {
// We lop off the sqrt(2 * pi) * sigma term, since we're going to normalize anyway.
function gauss( x, sigma ) {
return Math.exp( - ( x * x ) / ( 2.0 * sigma * sigma ) );
}
var i, values, sum, halfWidth, kMaxKernelSize = 25, kernelSize = 2 * Math.ceil( sigma * 3.0 ) + 1;
if ( kernelSize > kMaxKernelSize ) kernelSize = kMaxKernelSize;
halfWidth = ( kernelSize - 1 ) * 0.5;
values = new Array( kernelSize );
sum = 0.0;
for ( i = 0; i < kernelSize; ++ i ) {
values[ i ] = gauss( i - halfWidth, sigma );
sum += values[ i ];
}
// normalize the kernel
for ( i = 0; i < kernelSize; ++ i ) values[ i ] /= sum;
return values;
}
};
================================================
FILE: examples/libs/shaders/CopyShader.js
================================================
/**
* @author alteredq / http://alteredqualia.com/
*
* Full-screen textured quad shader
*/
THREE.CopyShader = {
uniforms: {
"tDiffuse": { value: null },
"opacity": { value: 1.0 }
},
vertexShader: [
"varying vec2 vUv;",
"void main() {",
"vUv = uv;",
"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
"}"
].join( "\n" ),
fragmentShader: [
"uniform float opacity;",
"uniform sampler2D tDiffuse;",
"varying vec2 vUv;",
"void main() {",
"vec4 texel = texture2D( tDiffuse, vUv );",
"gl_FragColor = opacity * texel;",
"}"
].join( "\n" )
};
================================================
FILE: examples/libs/shaders/FilmShader.js
================================================
/**
* @author alteredq / http://alteredqualia.com/
*
* Film grain & scanlines shader
*
* - ported from HLSL to WebGL / GLSL
* http://www.truevision3d.com/forums/showcase/staticnoise_colorblackwhite_scanline_shaders-t18698.0.html
*
* Screen Space Static Postprocessor
*
* Produces an analogue noise overlay similar to a film grain / TV static
*
* Original implementation and noise algorithm
* Pat 'Hawthorne' Shearon
*
* Optimized scanlines + noise version with intensity scaling
* Georg 'Leviathan' Steinrohder
*
* This version is provided under a Creative Commons Attribution 3.0 License
* http://creativecommons.org/licenses/by/3.0/
*/
THREE.FilmShader = {
uniforms: {
"tDiffuse": { value: null },
"time": { value: 0.0 },
"nIntensity": { value: 0.5 },
"sIntensity": { value: 0.05 },
"sCount": { value: 4096 },
"grayscale": { value: 1 }
},
vertexShader: [
"varying vec2 vUv;",
"void main() {",
"vUv = uv;",
"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
"}"
].join( "\n" ),
fragmentShader: [
"#include <common>",
// control parameter
"uniform float time;",
"uniform bool grayscale;",
// noise effect intensity value (0 = no effect, 1 = full effect)
"uniform float nIntensity;",
// scanlines effect intensity value (0 = no effect, 1 = full effect)
"uniform float sIntensity;",
// scanlines effect count value (0 = no effect, 4096 = full effect)
"uniform float sCount;",
"uniform sampler2D tDiffuse;",
"varying vec2 vUv;",
"void main() {",
// sample the source
"vec4 cTextureScreen = texture2D( tDiffuse, vUv );",
// make some noise
"float dx = rand( vUv + time );",
// add noise
"vec3 cResult = cTextureScreen.rgb + cTextureScreen.rgb * clamp( 0.1 + dx, 0.0, 1.0 );",
// get us a sine and cosine
"vec2 sc = vec2( sin( vUv.y * sCount ), cos( vUv.y * sCount ) );",
// add scanlines
"cResult += cTextureScreen.rgb * vec3( sc.x, sc.y, sc.x ) * sIntensity;",
// interpolate between source and result by intensity
"cResult = cTextureScreen.rgb + clamp( nIntensity, 0.0,1.0 ) * ( cResult - cTextureScreen.rgb );",
// convert to grayscale if desired
"if( grayscale ) {",
"cResult = vec3( cResult.r * 0.3 + cResult.g * 0.59 + cResult.b * 0.11 );",
"}",
"gl_FragColor = vec4( cResult, cTextureScreen.a );",
"}"
].join( "\n" )
};
================================================
FILE: examples/libs/shaders/FocusShader.js
================================================
/**
* @author alteredq / http://alteredqualia.com/
*
* Focus shader
* based on PaintEffect postprocess from ro.me
* http://code.google.com/p/3-dreams-of-black/source/browse/deploy/js/effects/PaintEffect.js
*/
THREE.FocusShader = {
uniforms : {
"tDiffuse": { value: null },
"screenWidth": { value: 1024 },
"screenHeight": { value: 1024 },
"sampleDistance": { value: 0.94 },
"waveFactor": { value: 0.00125 }
},
vertexShader: [
"varying vec2 vUv;",
"void main() {",
"vUv = uv;",
"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
"}"
].join( "\n" ),
fragmentShader: [
"uniform float screenWidth;",
"uniform float screenHeight;",
"uniform float sampleDistance;",
"uniform float waveFactor;",
"uniform sampler2D tDiffuse;",
"varying vec2 vUv;",
"void main() {",
"vec4 color, org, tmp, add;",
"float sample_dist, f;",
"vec2 vin;",
"vec2 uv = vUv;",
"add = color = org = texture2D( tDiffuse, uv );",
"vin = ( uv - vec2( 0.5 ) ) * vec2( 1.4 );",
"sample_dist = dot( vin, vin ) * 2.0;",
"f = ( waveFactor * 100.0 + sample_dist ) * sampleDistance * 4.0;",
"vec2 sampleSize = vec2( 1.0 / screenWidth, 1.0 / screenHeight ) * vec2( f );",
"add += tmp = texture2D( tDiffuse, uv + vec2( 0.111964, 0.993712 ) * sampleSize );",
"if( tmp.b < color.b ) color = tmp;",
"add += tmp = texture2D( tDiffuse, uv + vec2( 0.846724, 0.532032 ) * sampleSize );",
"if( tmp.b < color.b ) color = tmp;",
"add += tmp = texture2D( tDiffuse, uv + vec2( 0.943883, -0.330279 ) * sampleSize );",
"if( tmp.b < color.b ) color = tmp;",
"add += tmp = texture2D( tDiffuse, uv + vec2( 0.330279, -0.943883 ) * sampleSize );",
"if( tmp.b < color.b ) color = tmp;",
"add += tmp = texture2D( tDiffuse, uv + vec2( -0.532032, -0.846724 ) * sampleSize );",
"if( tmp.b < color.b ) color = tmp;",
"add += tmp = texture2D( tDiffuse, uv + vec2( -0.993712, -0.111964 ) * sampleSize );",
"if( tmp.b < color.b ) color = tmp;",
"add += tmp = texture2D( tDiffuse, uv + vec2( -0.707107, 0.707107 ) * sampleSize );",
"if( tmp.b < color.b ) color = tmp;",
"color = color * vec4( 2.0 ) - ( add / vec4( 8.0 ) );",
"color = color + ( add / vec4( 8.0 ) - color ) * ( vec4( 1.0 ) - vec4( sample_dist * 0.5 ) );",
"gl_FragColor = vec4( color.rgb * color.rgb * vec3( 0.95 ) + color.rgb, 1.0 );",
"}"
].join( "\n" )
};
================================================
FILE: examples/libs/stats.js
================================================
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global.Stats = factory());
}(this, (function () { 'use strict';
/**
* @author mrdoob / http://mrdoob.com/
*/
var Stats = function () {
var mode = 0;
var container = document.createElement( 'div' );
container.style.cssText = 'position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000';
container.addEventListener( 'click', function ( event ) {
event.preventDefault();
showPanel( ++ mode % container.children.length );
}, false );
//
function addPanel( panel ) {
container.appendChild( panel.dom );
return panel;
}
function showPanel( id ) {
for ( var i = 0; i < container.children.length; i ++ ) {
container.children[ i ].style.display = i === id ? 'block' : 'none';
}
mode = id;
}
//
var beginTime = ( performance || Date ).now(), prevTime = beginTime, frames = 0;
var fpsPanel = addPanel( new Stats.Panel( 'FPS', '#0ff', '#002' ) );
var msPanel = addPanel( new Stats.Panel( 'MS', '#0f0', '#020' ) );
if ( self.performance && self.performance.memory ) {
var memPanel = addPanel( new Stats.Panel( 'MB', '#f08', '#201' ) );
}
showPanel( 0 );
return {
REVISION: 16,
dom: container,
addPanel: addPanel,
showPanel: showPanel,
begin: function () {
beginTime = ( performance || Date ).now();
},
end: function () {
frames ++;
var time = ( performance || Date ).now();
msPanel.update( time - beginTime, 200 );
if ( time > prevTime + 1000 ) {
fpsPanel.update( ( frames * 1000 ) / ( time - prevTime ), 100 );
prevTime = time;
frames = 0;
if ( memPanel ) {
var memory = performance.memory;
memPanel.update( memory.usedJSHeapSize / 1048576, memory.jsHeapSizeLimit / 1048576 );
}
}
return time;
},
update: function () {
beginTime = this.end();
},
// Backwards Compatibility
domElement: container,
setMode: showPanel
};
};
Stats.Panel = function ( name, fg, bg ) {
var min = Infinity, max = 0, round = Math.round;
var PR = round( window.devicePixelRatio || 1 );
var WIDTH = 80 * PR, HEIGHT = 48 * PR,
TEXT_X = 3 * PR, TEXT_Y = 2 * PR,
GRAPH_X = 3 * PR, GRAPH_Y = 15 * PR,
GRAPH_WIDTH = 74 * PR, GRAPH_HEIGHT = 30 * PR;
var canvas = document.createElement( 'canvas' );
canvas.width = WIDTH;
canvas.height = HEIGHT;
canvas.style.cssText = 'width:80px;height:48px';
var context = canvas.getContext( '2d' );
context.font = 'bold ' + ( 9 * PR ) + 'px Helvetica,Arial,sans-serif';
context.textBaseline = 'top';
context.fillStyle = bg;
context.fillRect( 0, 0, WIDTH, HEIGHT );
context.fillStyle = fg;
context.fillText( name, TEXT_X, TEXT_Y );
context.fillRect( GRAPH_X, GRAPH_Y, GRAPH_WIDTH, GRAPH_HEIGHT );
context.fillStyle = bg;
context.globalAlpha = 0.9;
context.fillRect( GRAPH_X, GRAPH_Y, GRAPH_WIDTH, GRAPH_HEIGHT );
return {
dom: canvas,
update: function ( value, maxValue ) {
min = Math.min( min, value );
max = Math.max( max, value );
context.fillStyle = bg;
context.globalAlpha = 1;
context.fillRect( 0, 0, WIDTH, GRAPH_Y );
context.fillStyle = fg;
context.fillText( round( value ) + ' ' + name + ' (' + round( min ) + '-' + round( max ) + ')', TEXT_X, TEXT_Y );
context.drawImage( canvas, GRAPH_X + PR, GRAPH_Y, GRAPH_WIDTH - PR, GRAPH_HEIGHT, GRAPH_X, GRAPH_Y, GRAPH_WIDTH - PR, GRAPH_HEIGHT );
context.fillRect( GRAPH_X + GRAPH_WIDTH - PR, GRAPH_Y, PR, GRAPH_HEIGHT );
context.fillStyle = bg;
context.globalAlpha = 0.9;
context.fillRect( GRAPH_X + GRAPH_WIDTH - PR, GRAPH_Y, PR, round( ( 1 - ( value / maxValue ) ) * GRAPH_HEIGHT ) );
}
};
};
return Stats;
})));
================================================
FILE: examples/libs/three-gltf-loader.js
================================================
/**
* @author Rich Tibbett / https://github.com/richtr
* @author mrdoob / http://mrdoob.com/
* @author Tony Parisi / http://www.tonyparisi.com/
* @author Takahiro / https://github.com/takahirox
* @author Don McCurdy / https://www.donmccurdy.com
*/
THREE.GLTFLoader = ( function () {
function GLTFLoader( manager ) {
this.manager = ( manager !== undefined ) ? manager : THREE.DefaultLoadingManager;
}
GLTFLoader.prototype = {
constructor: GLTFLoader,
crossOrigin: 'Anonymous',
load: function ( url, onLoad, onProgress, onError ) {
var scope = this;
var path = this.path && ( typeof this.path === 'string' ) ? this.path : THREE.Loader.prototype.extractUrlBase( url );
var loader = new THREE.FileLoader( scope.manager );
loader.setResponseType( 'arraybuffer' );
loader.load( url, function ( data ) {
try {
scope.parse( data, path, onLoad, onError );
} catch ( e ) {
// For SyntaxError or TypeError, return a generic failure message.
onError( e.constructor === Error ? e : new Error( 'THREE.GLTFLoader: Unable to parse model.' ) );
}
}, onProgress, onError );
},
setCrossOrigin: function ( value ) {
this.crossOrigin = value;
},
setPath: function ( value ) {
this.path = value;
},
parse: function ( data, path, onLoad, onError ) {
var content;
var extensions = {};
var magic = convertUint8ArrayToString( new Uint8Array( data, 0, 4 ) );
if ( magic === BINARY_EXTENSION_HEADER_MAGIC ) {
extensions[ EXTENSIONS.KHR_BINARY_GLTF ] = new GLTFBinaryExtension( data );
content = extensions[ EXTENSIONS.KHR_BINARY_GLTF ].content;
} else {
content = convertUint8ArrayToString( new Uint8Array( data ) );
}
var json = JSON.parse( content );
if ( json.asset === undefined || json.asset.version[ 0 ] < 2 ) {
onError( new Error( 'THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported.' ) );
return;
}
if ( json.extensionsUsed ) {
if( json.extensionsUsed.indexOf( EXTENSIONS.KHR_LIGHTS ) >= 0 ) {
extensions[ EXTENSIONS.KHR_LIGHTS ] = new GLTFLightsExtension( json );
}
if( json.extensionsUsed.indexOf( EXTENSIONS.KHR_MATERIALS_COMMON ) >= 0 ) {
extensions[ EXTENSIONS.KHR_MATERIALS_COMMON ] = new GLTFMaterialsCommonExtension( json );
}
if( json.extensionsUsed.indexOf( EXTENSIONS.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS ) >= 0 ) {
extensions[ EXTENSIONS.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS ] = new GLTFMaterialsPbrSpecularGlossinessExtension();
}
}
console.time( 'GLTFLoader' );
var parser = new GLTFParser( json, extensions, {
path: path || this.path,
crossOrigin: this.crossOrigin
} );
parser.parse( function ( scene, scenes, cameras, animations ) {
console.timeEnd( 'GLTFLoader' );
var glTF = {
scene: scene,
scenes: scenes,
cameras: cameras,
animations: animations
};
onLoad( glTF );
}, onError );
}
};
/* GLTFREGISTRY */
function GLTFRegistry() {
var objects = {};
return {
get: function ( key ) {
return objects[ key ];
},
add: function ( key, object ) {
objects[ key ] = object;
},
remove: function ( key ) {
delete objects[ key ];
},
removeAll: function () {
objects = {};
},
update: function ( scene, camera ) {
for ( var name in objects ) {
var object = objects[ name ];
if ( object.update ) {
object.update( scene, camera );
}
}
}
};
}
/*********************************/
/********** EXTENSIONS ***********/
/*********************************/
var EXTENSIONS = {
KHR_BINARY_GLTF: 'KHR_binary_glTF',
KHR_LIGHTS: 'KHR_lights',
KHR_MATERIALS_COMMON: 'KHR_materials_common',
KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS: 'KHR_materials_pbrSpecularGlossiness'
};
/**
* Lights Extension
*
* Specification: PENDING
*/
function GLTFLightsExtension( json ) {
this.name = EXTENSIONS.KHR_LIGHTS;
this.lights = {};
var extension = ( json.extensions && json.extensions[ EXTENSIONS.KHR_LIGHTS ] ) || {};
var lights = extension.lights || {};
for ( var lightId in lights ) {
var light = lights[ lightId ];
var lightNode;
var color = new THREE.Color().fromArray( light.color );
switch ( light.type ) {
case 'directional':
lightNode = new THREE.DirectionalLight( color );
lightNode.position.set( 0, 0, 1 );
break;
case 'point':
lightNode = new THREE.PointLight( color );
break;
case 'spot':
lightNode = new THREE.SpotLight( color );
lightNode.position.set( 0, 0, 1 );
break;
case 'ambient':
lightNode = new THREE.AmbientLight( color );
break;
}
if ( lightNode ) {
if ( light.constantAttenuation !== undefined ) {
lightNode.intensity = light.constantAttenuation;
}
if ( light.linearAttenuation !== undefined ) {
lightNode.distance = 1 / light.linearAttenuation;
}
if ( light.quadraticAttenuation !== undefined ) {
lightNode.decay = light.quadraticAttenuation;
}
if ( light.fallOffAngle !== undefined ) {
lightNode.angle = light.fallOffAngle;
}
if ( light.fallOffExponent !== undefined ) {
console.warn( 'THREE.GLTFLoader:: light.fallOffExponent not currently supported.' );
}
lightNode.name = light.name || ( 'light_' + lightId );
this.lights[ lightId ] = lightNode;
}
}
}
/**
* Common Materials Extension
*
* Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/Khronos/KHR_materials_common
*/
function GLTFMaterialsCommonExtension( json ) {
this.name = EXTENSIONS.KHR_MATERIALS_COMMON;
}
GLTFMaterialsCommonExtension.prototype.getMaterialType = function ( material ) {
var khrMaterial = material.extensions[ this.name ];
switch ( khrMaterial.type ) {
case 'commonBlinn' :
case 'commonPhong' :
return THREE.MeshPhongMaterial;
case 'commonLambert' :
return THREE.MeshLambertMaterial;
case 'commonConstant' :
default :
return THREE.MeshBasicMaterial;
}
};
GLTFMaterialsCommonExtension.prototype.extendParams = function ( materialParams, material, parser ) {
var khrMaterial = material.extensions[ this.name ];
var pending = [];
var keys = [];
// TODO: Currently ignored: 'ambientFactor', 'ambientTexture'
switch ( khrMaterial.type ) {
case 'commonBlinn' :
case 'commonPhong' :
keys.push( 'diffuseFactor', 'diffuseTexture', 'specularFactor', 'specularTexture', 'shininessFactor' );
break;
case 'commonLambert' :
keys.push( 'diffuseFactor', 'diffuseTexture' );
break;
case 'commonConstant' :
default :
break;
}
var materialValues = {};
keys.forEach( function( v ) {
if ( khrMaterial[ v ] !== undefined ) materialValues[ v ] = khrMaterial[ v ];
} );
if ( materialValues.diffuseFactor !== undefined ) {
materialParams.color = new THREE.Color().fromArray( materialValues.diffuseFactor );
materialParams.opacity = materialValues.diffuseFactor[ 3 ];
}
if ( materialValues.diffuseTexture !== undefined ) {
pending.push( parser.assignTexture( materialParams, 'map', materialValues.diffuseTexture.index ) );
}
if ( materialValues.specularFactor !== undefined ) {
materialParams.specular = new THREE.Color().fromArray( materialValues.specularFactor );
}
if ( materialValues.specularTexture !== undefined ) {
pending.push( parser.assignTexture( materialParams, 'specularMap', materialValues.specularTexture.index ) );
}
if ( materialValues.shininessFactor !== undefined ) {
materialParams.shininess = materialValues.shininessFactor;
}
return Promise.all( pending );
};
/* BINARY EXTENSION */
var BINARY_EXTENSION_BUFFER_NAME = 'binary_glTF';
var BINARY_EXTENSION_HEADER_MAGIC = 'glTF';
var BINARY_EXTENSION_HEADER_LENGTH = 12;
var BINARY_EXTENSION_CHUNK_TYPES = { JSON: 0x4E4F534A, BIN: 0x004E4942 };
function GLTFBinaryExtension( data ) {
this.name = EXTENSIONS.KHR_BINARY_GLTF;
this.content = null;
this.body = null;
var headerView = new DataView( data, 0, BINARY_EXTENSION_HEADER_LENGTH );
this.header = {
magic: convertUint8ArrayToString( new Uint8Array( data.slice( 0, 4 ) ) ),
version: headerView.getUint32( 4, true ),
length: headerView.getUint32( 8, true )
};
if ( this.header.magic !== BINARY_EXTENSION_HEADER_MAGIC ) {
throw new Error( 'THREE.GLTFLoader: Unsupported glTF-Binary header.' );
} else if ( this.header.version < 2.0 ) {
throw new Error( 'THREE.GLTFLoader: Legacy binary file detected. Use GLTFLoader instead.' );
}
var chunkView = new DataView( data, BINARY_EXTENSION_HEADER_LENGTH );
var chunkIndex = 0;
while ( chunkIndex < chunkView.byteLength ) {
var chunkLength = chunkView.getUint32( chunkIndex, true );
chunkIndex += 4;
var chunkType = chunkView.getUint32( chunkIndex, true );
chunkIndex += 4;
if ( chunkType === BINARY_EXTENSION_CHUNK_TYPES.JSON ) {
var contentArray = new Uint8Array( data, BINARY_EXTENSION_HEADER_LENGTH + chunkIndex, chunkLength );
this.content = convertUint8ArrayToString( contentArray );
} else if ( chunkType === BINARY_EXTENSION_CHUNK_TYPES.BIN ) {
var byteOffset = BINARY_EXTENSION_HEADER_LENGTH + chunkIndex;
this.body = data.slice( byteOffset, byteOffset + chunkLength );
}
// Clients must ignore chunks with unknown types.
chunkIndex += chunkLength;
}
if ( this.content === null ) {
throw new Error( 'THREE.GLTFLoader: JSON content not found.' );
}
}
/**
* Specular-Glossiness Extension
*
* Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/Khronos/KHR_materials_pbrSpecularGlossiness
*/
function GLTFMaterialsPbrSpecularGlossinessExtension() {
return {
name: EXTENSIONS.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,
getMaterialType: function () {
return THREE.ShaderMaterial;
},
extendParams: function ( params, material, parser ) {
var pbrSpecularGlossiness = material.extensions[ this.name ];
var shader = THREE.ShaderLib[ 'standard' ];
var uniforms = THREE.UniformsUtils.clone( shader.uniforms );
var specularMapParsFragmentChunk = [
'#ifdef USE_SPECULARMAP',
' uniform sampler2D specularMap;',
'#endif'
].join( '\n' );
var glossinessMapParsFragmentChunk = [
'#ifdef USE_GLOSSINESSMAP',
' uniform sampler2D glossinessMap;',
'#endif'
].join( '\n' );
var specularMapFragmentChunk = [
'vec3 specularFactor = specular;',
'#ifdef USE_SPECULARMAP',
' vec4 texelSpecular = texture2D( specularMap, vUv );',
' // reads channel RGB, compatible with a glTF Specular-Glossiness (RGBA) texture',
' specularFactor *= texelSpecular.rgb;',
'#endif'
].join( '\n' );
var glossinessMapFragmentChunk = [
'float glossinessFactor = glossiness;',
'#ifdef USE_GLOSSINESSMAP',
' vec4 texelGlossiness = texture2D( glossinessMap, vUv );',
' // reads channel A, compatible with a glTF Specular-Glossiness (RGBA) texture',
' glossinessFactor *= texelGlossiness.a;',
'#endif'
].join( '\n' );
var lightPhysicalFragmentChunk = [
'PhysicalMaterial material;',
'material.diffuseColor = diffuseColor.rgb;',
'material.specularRoughness = clamp( 1.0 - glossinessFactor, 0.04, 1.0 );',
'material.specularColor = specularFactor.rgb;',
].join( '\n' );
var fragmentShader = shader.fragmentShader
.replace( '#include <specularmap_fragment>', '' )
.replace( 'uniform float roughness;', 'uniform vec3 specular;' )
.replace( 'uniform float metalness;', 'uniform float glossiness;' )
.replace( '#include <roughnessmap_pars_fragment>', specularMapParsFragmentChunk )
.replace( '#include <metalnessmap_pars_fragment>', glossinessMapParsFragmentChunk )
.replace( '#include <roughnessmap_fragment>', specularMapFragmentChunk )
.replace( '#include <metalnessmap_fragment>', glossinessMapFragmentChunk )
.replace( '#include <lights_physical_fragment>', lightPhysicalFragmentChunk );
delete uniforms.roughness;
delete uniforms.metalness;
delete uniforms.roughnessMap;
delete uniforms.metalnessMap;
uniforms.specular = { value: new THREE.Color().setHex( 0x111111 ) };
uniforms.glossiness = { value: 0.5 };
uniforms.specularMap = { value: null };
uniforms.glossinessMap = { value: null };
params.vertexShader = shader.vertexShader;
params.fragmentShader = fragmentShader;
params.uniforms = uniforms;
params.defines = { 'STANDARD': '' };
params.color = new THREE.Color( 1.0, 1.0, 1.0 );
params.opacity = 1.0;
var pending = [];
if ( Array.isArray( pbrSpecularGlossiness.diffuseFactor ) ) {
var array = pbrSpecularGlossiness.diffuseFactor;
params.color.fromArray( array );
params.opacity = array[ 3 ];
}
if ( pbrSpecularGlossiness.diffuseTexture !== undefined ) {
pending.push( parser.assignTexture( params, 'map', pbrSpecularGlossiness.diffuseTexture.index ) );
}
params.emissive = new THREE.Color( 0.0, 0.0, 0.0 );
params.glossiness = pbrSpecularGlossiness.glossinessFactor !== undefined ? pbrSpecularGlossiness.glossinessFactor : 1.0;
params.specular = new THREE.Color( 1.0, 1.0, 1.0 );
if ( Array.isArray( pbrSpecularGlossiness.specularFactor ) ) {
params.specular.fromArray( pbrSpecularGlossiness.specularFactor );
}
if ( pbrSpecularGlossiness.specularGlossinessTexture !== undefined ) {
var specGlossIndex = pbrSpecularGlossiness.specularGlossinessTexture.index;
pending.push( parser.assignTexture( params, 'glossinessMap', specGlossIndex ) );
pending.push( parser.assignTexture( params, 'specularMap', specGlossIndex ) );
}
return Promise.all( pending );
},
createMaterial: function ( params ) {
// setup material properties based on MeshStandardMaterial for Specular-Glossiness
var material = new THREE.ShaderMaterial( {
defines: params.defines,
vertexShader: params.vertexShader,
fragmentShader: params.fragmentShader,
uniforms: params.uniforms,
fog: true,
lights: true,
opacity: params.opacity,
transparent: params.transparent
} );
material.isGLTFSpecularGlossinessMaterial = true;
material.color = params.color;
material.map = params.map === undefined ? null : params.map;
material.lightMap = null;
material.lightMapIntensity = 1.0;
material.aoMap = params.aoMap === undefined ? null : params.aoMap;
material.aoMapIntensity = 1.0;
material.emissive = params.emissive;
material.emissiveIntensity = 1.0;
material.emissiveMap = params.emissiveMap === undefined ? null : params.emissiveMap;
material.bumpMap = params.bumpMap === undefined ? null : params.bumpMap;
material.bumpScale = 1;
material.normalMap = params.normalMap === undefined ? null : params.normalMap;
material.normalScale = new THREE.Vector2( 1, 1 );
material.displacementMap = null;
material.displacementScale = 1;
material.displacementBias = 0;
material.specularMap = params.specularMap === undefined ? null : params.specularMap;
material.specular = params.specular;
material.glossinessMap = params.glossinessMap === undefined ? null : params.glossinessMap;
material.glossiness = params.glossiness;
material.alphaMap = null;
material.envMap = params.envMap === undefined ? null : params.envMap;
material.envMapIntensity = 1.0;
material.refractionRatio = 0.98;
material.extensions.derivatives = true;
return material;
},
// Here's based on refreshUniformsCommon() and refreshUniformsStandard() in WebGLRenderer.
refreshUniforms: function ( renderer, scene, camera, geometry, material, group ) {
var uniforms = material.uniforms;
var defines = material.defines;
uniforms.opacity.value = material.opacity;
uniforms.diffuse.value.copy( material.color );
uniforms.emissive.value.copy( material.emissive ).multiplyScalar( material.emissiveIntensity );
uniforms.map.value = material.map;
uniforms.specularMap.value = material.specularMap;
uniforms.alphaMap.value = material.alphaMap;
uniforms.lightMap.value = material.lightMap;
uniforms.lightMapIntensity.value = material.lightMapIntensity;
uniforms.aoMap.value = material.aoMap;
uniforms.aoMapIntensity.value = material.aoMapIntensity;
// uv repeat and offset setting priorities
// 1. color map
// 2. specular map
// 3. normal map
// 4. bump map
// 5. alpha map
// 6. emissive map
var uvScaleMap;
if ( material.map ) {
uvScaleMap = material.map;
} else if ( material.specularMap ) {
uvScaleMap = material.specularMap;
} else if ( material.displacementMap ) {
uvScaleMap = material.displacementMap;
} else if ( material.normalMap ) {
uvScaleMap = material.normalMap;
} else if ( material.bumpMap ) {
uvScaleMap = material.bumpMap;
} else if ( material.glossinessMap ) {
uvScaleMap = material.glossinessMap;
} else if ( material.alphaMap ) {
uvScaleMap = material.alphaMap;
} else if ( material.emissiveMap ) {
uvScaleMap = material.emissiveMap;
}
if ( uvScaleMap !== undefined ) {
// backwards compatibility
if ( uvScaleMap.isWebGLRenderTarget ) {
uvScaleMap = uvScaleMap.texture;
}
var offset = uvScaleMap.offset;
var repeat = uvScaleMap.repeat;
uniforms.offsetRepeat.value.set( offset.x, offset.y, repeat.x, repeat.y );
}
uniforms.envMap.value = material.envMap;
uniforms.envMapIntensity.value = material.envMapIntensity;
uniforms.flipEnvMap.value = ( material.envMap && material.envMap.isCubeTexture ) ? -1 : 1;
uniforms.refractionRatio.value = material.refractionRatio;
uniforms.specular.value.copy( material.specular );
uniforms.glossiness.value = material.glossiness;
uniforms.glossinessMap.value = material.glossinessMap;
uniforms.emissiveMap.value = material.emissiveMap;
uniforms.bumpMap.value = material.bumpMap;
uniforms.normalMap.value = material.normalMap;
uniforms.displacementMap.value = material.displacementMap;
uniforms.displacementScale.value = material.displacementScale;
uniforms.displacementBias.value = material.displacementBias;
if ( uniforms.glossinessMap.value !== null && defines.USE_GLOSSINESSMAP === undefined ) {
defines.USE_GLOSSINESSMAP = '';
// set USE_ROUGHNESSMAP to enable vUv
defines.USE_ROUGHNESSMAP = '';
}
if ( uniforms.glossinessMap.value === null && defines.USE_GLOSSINESSMAP !== undefined ) {
delete defines.USE_GLOSSINESSMAP;
delete defines.USE_ROUGHNESSMAP;
}
}
};
}
/*********************************/
/********** INTERNALS ************/
/*********************************/
/* CONSTANTS */
var WEBGL_CONSTANTS = {
FLOAT: 5126,
//FLOAT_MAT2: 35674,
FLOAT_MAT3: 35675,
FLOAT_MAT4: 35676,
FLOAT_VEC2: 35664,
FLOAT_VEC3: 35665,
FLOAT_VEC4: 35666,
LINEAR: 9729,
REPEAT: 10497,
SAMPLER_2D: 35678,
POINTS: 0,
LINES: 1,
LINE_LOOP: 2,
LINE_STRIP: 3,
TRIANGLES: 4,
TRIANGLE_STRIP: 5,
TRIANGLE_FAN: 6,
UNSIGNED_BYTE: 5121,
UNSIGNED_SHORT: 5123
};
var WEBGL_TYPE = {
5126: Number,
//35674: THREE.Matrix2,
35675: THREE.Matrix3,
35676: THREE.Matrix4,
35664: THREE.Vector2,
35665: THREE.Vector3,
35666: THREE.Vector4,
35678: THREE.Texture
};
var WEBGL_COMPONENT_TYPES = {
5120: Int8Array,
5121: Uint8Array,
5122: Int16Array,
5123: Uint16Array,
5125: Uint32Array,
5126: Float32Array
};
var WEBGL_FILTERS = {
9728: THREE.NearestFilter,
9729: THREE.LinearFilter,
9984: THREE.NearestMipMapNearestFilter,
9985: THREE.LinearMipMapNearestFilter,
9986: THREE.NearestMipMapLinearFilter,
9987: THREE.LinearMipMapLinearFilter
};
var WEBGL_WRAPPINGS = {
33071: THREE.ClampToEdgeWrapping,
33648: THREE.MirroredRepeatWrapping,
10497: THREE.RepeatWrapping
};
var WEBGL_TEXTURE_FORMATS = {
6406: THREE.AlphaFormat,
6407: THREE.RGBFormat,
6408: THREE.RGBAFormat,
6409: THREE.LuminanceFormat,
6410: THREE.LuminanceAlphaFormat
};
var WEBGL_TEXTURE_DATATYPES = {
5121: THREE.UnsignedByteType,
32819: THREE.UnsignedShort4444Type,
32820: THREE.UnsignedShort5551Type,
33635: THREE.UnsignedShort565Type
};
var WEBGL_SIDES = {
1028: THREE.BackSide, // Culling front
1029: THREE.FrontSide // Culling back
//1032: THREE.NoSide // Culling front and back, what to do?
};
var WEBGL_DEPTH_FUNCS = {
512: THREE.NeverDepth,
513: THREE.LessDepth,
514: THREE.EqualDepth,
515: THREE.LessEqualDepth,
516: THREE.GreaterEqualDepth,
517: THREE.NotEqualDepth,
518: THREE.GreaterEqualDepth,
519: THREE.AlwaysDepth
};
var WEBGL_BLEND_EQUATIONS = {
32774: THREE.AddEquation,
32778: THREE.SubtractEquation,
32779: THREE.ReverseSubtractEquation
};
var WEBGL_BLEND_FUNCS = {
0: THREE.ZeroFactor,
1: THREE.OneFactor,
768: THREE.SrcColorFactor,
769: THREE.OneMinusSrcColorFactor,
770: THREE.SrcAlphaFactor,
771: THREE.OneMinusSrcAlphaFactor,
772: THREE.DstAlphaFactor,
773: THREE.OneMinusDstAlphaFactor,
774: THREE.DstColorFactor,
775: THREE.OneMinusDstColorFactor,
776: THREE.SrcAlphaSaturateFactor
// The followings are not supported by Three.js yet
//32769: CONSTANT_COLOR,
//32770: ONE_MINUS_CONSTANT_COLOR,
//32771: CONSTANT_ALPHA,
//32772: ONE_MINUS_CONSTANT_COLOR
};
var WEBGL_TYPE_SIZES = {
'SCALAR': 1,
'VEC2': 2,
'VEC3': 3,
'VEC4': 4,
'MAT2': 4,
'MAT3': 9,
'MAT4': 16
};
var PATH_PROPERTIES = {
scale: 'scale',
translation: 'position',
rotation: 'quaternion',
weights: 'morphTargetInfluences'
};
var INTERPOLATION = {
CATMULLROMSPLINE: THREE.InterpolateSmooth,
CUBICSPLINE: THREE.InterpolateSmooth,
LINEAR: THREE.InterpolateLinear,
STEP: THREE.InterpolateDiscrete
};
var STATES_ENABLES = {
2884: 'CULL_FACE',
2929: 'DEPTH_TEST',
3042: 'BLEND',
3089: 'SCISSOR_TEST',
32823: 'POLYGON_OFFSET_FILL',
32926: 'SAMPLE_ALPHA_TO_COVERAGE'
};
var ALPHA_MODES = {
OPAQUE: 'OPAQUE',
MASK: 'MASK',
BLEND: 'BLEND'
};
/* UTILITY FUNCTIONS */
function _each( object, callback, thisObj ) {
if ( !object ) {
return Promise.resolve();
}
var results;
var fns = [];
if ( Object.prototype.toString.call( object ) === '[object Array]' ) {
results = [];
var length = object.length;
for ( var idx = 0; idx < length; idx ++ ) {
var value = callback.call( thisObj || this, object[ idx ], idx );
if ( value ) {
fns.push( value );
if ( value instanceof Promise ) {
value.then( function( key, value ) {
results[ key ] = value;
}.bind( this, idx ));
} else {
results[ idx ] = value;
}
}
}
} else {
results = {};
for ( var key in object ) {
if ( object.hasOwnProperty( key ) ) {
var value = callback.call( thisObj || this, object[ key ], key );
if ( value ) {
fns.push( value );
if ( value instanceof Promise ) {
value.then( function( key, value ) {
results[ key ] = value;
}.bind( this, key ));
} else {
results[ key ] = value;
}
}
}
}
}
return Promise.all( fns ).then( function() {
return results;
});
}
function resolveURL( url, path ) {
// Invalid URL
if ( typeof url !== 'string' || url === '' )
return '';
// Absolute URL http://,https://,//
if ( /^(https?:)?\/\//i.test( url ) ) {
return url;
}
// Data URI
if ( /^data:.*,.*$/i.test( url ) ) {
return url;
}
// Blob URL
if ( /^blob:.*$/i.test( url ) ) {
return url;
}
// Relative URL
return ( path || '' ) + url;
}
function convertUint8ArrayToString( array ) {
if ( window.TextDecoder !== undefined ) {
return new TextDecoder().decode( array );
}
// Avoid the String.fromCharCode.apply(null, array) shortcut, which
// throws a "maximum call stack size exceeded" error for large arrays.
var s = '';
for ( var i = 0, il = array.length; i < il; i ++ ) {
s += String.fromCharCode( array[ i ] );
}
return s;
}
/**
* Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#default-material
*/
function createDefaultMaterial() {
return new THREE.MeshStandardMaterial( {
color: 0xFFFFFF,
emissive: 0x000000,
metalness: 1,
roughness: 1,
transparent: false,
depthTest: true,
side: THREE.FrontSide
} );
}
/**
* Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#morph-targets
* @param {THREE.Mesh} mesh
* @param {GLTF.Mesh} meshDef
* @param {GLTF.Primitive} primitiveDef
* @param {Object} dependencies
*/
function addMorphTargets ( mesh, meshDef, primitiveDef, dependencies ) {
var geometry = mesh.geometry;
var material = mesh.material;
var targets = primitiveDef.targets;
var morphAttributes = geometry.morphAttributes;
morphAttributes.position = [];
morphAttributes.normal = [];
material.morphTargets = true;
for ( var i = 0, il = targets.length; i < il; i ++ ) {
var target = targets[ i ];
var attributeName = 'morphTarget' + i;
var positionAttribute, normalAttribute;
if ( target.POSITION !== undefined ) {
// Three.js morph formula is
// position
// + weight0 * ( morphTarget0 - position )
// + weight1 * ( morphTarget1 - position )
// ...
// while the glTF one is
// position
// + weight0 * morphTarget0
// + weight1 * morphTarget1
// ...
// then adding position to morphTarget.
// So morphTarget value will depend on mesh's position, then cloning attribute
// for the case if attribute is shared among two or more meshes.
positionAttribute = dependencies.accessors[ target.POSITION ].clone();
var position = geometry.attributes.position;
for ( var j = 0, jl = positionAttribute.count; j < jl; j ++ ) {
positionAttribute.setXYZ(
j,
positionAttribute.getX( j ) + position.getX( j ),
positionAttribute.getY( j ) + position.getY( j ),
positionAttribute.getZ( j ) + position.getZ( j )
);
}
} else {
// Copying the original position not to affect the final position.
// See the formula above.
positionAttribute = geometry.attributes.position.clone();
}
if ( target.NORMAL !== undefined ) {
material.morphNormals = true;
// see target.POSITION's comment
normalAttribute = dependencies.accessors[ target.NORMAL ].clone();
var normal = geometry.attributes.normal;
for ( var j = 0, jl = normalAttribute.count; j < jl; j ++ ) {
normalAttribute.setXYZ(
j,
normalAttribute.getX( j ) + normal.getX( j ),
normalAttribute.getY( j ) + normal.getY( j ),
normalAttribute.getZ( j ) + normal.getZ( j )
);
}
} else {
normalAttribute = geometry.attributes.normal.clone();
}
if ( target.TANGENT !== undefined ) {
// TODO: implement
}
positionAttribute.name = attributeName;
normalAttribute.name = attributeName;
morphAttributes.position.push( positionAttribute );
morphAttributes.normal.push( normalAttribute );
}
mesh.updateMorphTargets();
if ( meshDef.weights !== undefined ) {
for ( var i = 0, il = meshDef.weights.length; i < il; i ++ ) {
mesh.morphTargetInfluences[ i ] = meshDef.weights[ i ];
}
}
}
/* GLTF PARSER */
function GLTFParser( json, extensions, options ) {
this.json = json || {};
this.extensions = extensions || {};
this.options = options || {};
// loader object cache
this.cache = new GLTFRegistry();
}
GLTFParser.prototype._withDependencies = function ( dependencies ) {
var _dependencies = {};
for ( var i = 0; i < dependencies.length; i ++ ) {
var dependency = dependencies[ i ];
var fnName = 'load' + dependency.charAt( 0 ).toUpperCase() + dependency.slice( 1 );
var cached = this.cache.get( dependency );
if ( cached !== undefined ) {
_dependencies[ dependency ] = cached;
} else if ( this[ fnName ] ) {
var fn = this[ fnName ]();
this.cache.add( dependency, fn );
_dependencies[ dependency ] = fn;
}
}
return _each( _dependencies, function ( dependency ) {
return dependency;
} );
};
GLTFParser.prototype.parse = function ( onLoad, onError ) {
var json = this.json;
// Clear the loader cache
this.cache.removeAll();
// Fire the callback on complete
this._withDependencies( [
'scenes',
'cameras',
'animations'
] ).then( function ( dependencies ) {
var scenes = [];
for ( var name in dependencies.scenes ) {
scenes.push( dependencies.scenes[ name ] );
}
var scene = json.scene !== undefined ? dependencies.scenes[ json.scene ] : scenes[ 0 ];
var cameras = [];
for ( var name in dependencies.cameras ) {
var camera = dependencies.cameras[ name ];
cameras.push( camera );
}
var animations = [];
for ( var name in dependencies.animations ) {
animations.push( dependencies.animations[ name ] );
}
onLoad( scene, scenes, cameras, animations );
} ).catch( onError );
};
/**
* Requests the specified dependency asynchronously, with caching.
* @param {string} type
* @param {number} index
* @return {Promise<Object>}
*/
GLTFParser.prototype.getDependency = function ( type, index ) {
var cacheKey = type + ':' + index;
var dependency = this.cache.get( cacheKey );
if ( !dependency ) {
var fnName = 'load' + type.charAt( 0 ).toUpperCase() + type.slice( 1 );
dependency = this[ fnName ]( index );
this.cache.add( cacheKey, dependency );
}
return dependency;
};
/**
* Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#buffers-and-buffer-views
* @param {number} bufferIndex
* @return {Promise<ArrayBuffer>}
*/
GLTFParser.prototype.loadBuffer = function ( bufferIndex ) {
var bufferDef = this.json.buffers[ bufferIndex ];
if ( bufferDef.type && bufferDef.type !== 'arraybuffer' ) {
throw new Error( 'THREE.GLTFLoader: %s buffer type is not supported.', bufferDef.type );
}
// If present, GLB container is required to be the first buffer.
if ( bufferDef.uri === undefined && bufferIndex === 0 ) {
return Promise.resolve( this.extensions[ EXTENSIONS.KHR_BINARY_GLTF ].body );
}
var options = this.options;
return new Promise( function ( resolve ) {
var loader = new THREE.FileLoader();
loader.setResponseType( 'arraybuffer' );
loader.load( resolveURL( bufferDef.uri, options.path ), resolve);
} );
};
/**
* Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#buffers-and-buffer-views
* @param {number} bufferViewIndex
* @return {Promise<ArrayBuffer>}
*/
GLTFParser.prototype.loadBufferView = function ( bufferViewIndex ) {
var bufferViewDef = this.json.bufferViews[ bufferViewIndex ];
return this.getDependency( 'buffer', bufferViewDef.buffer ).then( function ( buffer ) {
var byteLength = bufferViewDef.byteLength || 0;
var byteOffset = bufferViewDef.byteOffset || 0;
return buffer.slice( byteOffset, byteOffset + byteLength );
} );
};
GLTFParser.prototype.loadAccessors = function () {
var parser = this;
var json = this.json;
return _each( json.accessors, function ( accessor ) {
return parser.getDependency( 'bufferView', accessor.bufferView ).then( function ( bufferView ) {
var itemSize = WEBGL_TYPE_SIZES[ accessor.type ];
var TypedArray = WEBGL_COMPONENT_TYPES[ accessor.componentType ];
// For VEC3: itemSize is 3, elementBytes is 4, itemBytes is 12.
var elementBytes = TypedArray.BYTES_PER_ELEMENT;
var itemBytes = elementBytes * itemSize;
var byteStride = json.bufferViews[ accessor.bufferView ].byteStride;
var array;
// The buffer is not interleaved if the stride is the item size in bytes.
if ( byteStride && byteStride !== itemBytes ) {
// Use the full buffer if it's interleaved.
array = new TypedArray( bufferView );
// Integer parameters to IB/IBA are in array elements, not bytes.
var ib = new THREE.InterleavedBuffer( array, byteStride / elementBytes );
return new THREE.InterleavedBufferAttribute( ib, itemSize, accessor.byteOffset / elementBytes );
} else {
array = new TypedArray( bufferView, accessor.byteOffset, accessor.count * itemSize );
return new THREE.BufferAttribute( array, itemSize );
}
} );
} );
};
/**
* Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#textures
* @param {number} textureIndex
* @return {Promise<THREE.Texture>}
*/
GLTFParser.prototype.loadTexture = function ( textureIndex ) {
var parser = this;
var json = this.json;
var options = this.options;
var URL = window.URL || window.webkitURL;
var textureDef = json.textures[ textureIndex ];
var source = json.images[ textureDef.source ];
var sourceURI = source.uri;
var isObjectURL = false;
if ( source.bufferView !== undefined ) {
// Load binary image data from bufferView, if provided.
sourceURI = parser.getDependency( 'bufferView', source.bufferView )
.then( function ( bufferView ) {
isObjectURL = true;
var blob = new Blob( [ bufferView ], { type: source.mimeType } );
sourceURI = URL.createObjectURL( blob );
return sourceURI;
} );
}
return Promise.resolve( sourceURI ).then( function ( sourceURI ) {
// Load Texture resource.
var textureLoader = THREE.Loader.Handlers.get( sourceURI ) || new THREE.TextureLoader();
textureLoader.setCrossOrigin( options.crossOrigin );
return new Promise( function ( resolve, reject ) {
textureLoader.load( resolveURL( sourceURI, options.path ), resolve, undefined, reject );
} );
} ).then( function ( texture ) {
// Clean up resources and configure Texture.
if ( isObjectURL !== undefined ) {
URL.revokeObjectURL( sourceURI );
}
texture.flipY = false;
if ( textureDef.name !== undefined ) texture.name = textureDef.name;
texture.format = textureDef.format !== undefined ? WEBGL_TEXTURE_FORMATS[ textureDef.format ] : THREE.RGBAFormat;
if ( textureDef.internalFormat !== undefined && texture.format !== WEBGL_TEXTURE_FORMATS[ textureDef.internalFormat ] ) {
console.warn( 'THREE.GLTFLoader: Three.js does not support texture internalFormat which is different from texture format. ' +
'internalFormat will be forced to be the same value as format.' );
}
texture.type = textureDef.type !== undefined ? WEBGL_TEXTURE_DATATYPES[ textureDef.type ] : THREE.UnsignedByteType;
var samplers = json.samplers || {};
var sampler = samplers[ textureDef.sampler ] || {};
texture.magFilter = WEBGL_FILTERS[ sampler.magFilter ] || THREE.LinearFilter;
texture.minFilter = WEBGL_FILTERS[ sampler.minFilter ] || THREE.LinearMipMapLinearFilter;
texture.wrapS = WEBGL_WRAPPINGS[ sampler.wrapS ] || THREE.RepeatWrapping;
texture.wrapT = WEBGL_WRAPPINGS[ sampler.wrapT ] || THREE.RepeatWrapping;
return texture;
} );
};
/**
* Asynchronously assigns a texture to the given material parameters.
* @param {Object} materialParams
* @param {string} textureName
* @param {number} textureIndex
* @return {Promise}
*/
GLTFParser.prototype.assignTexture = function ( materialParams, textureName, textureIndex ) {
return this.getDependency( 'texture', textureIndex ).then( function ( texture ) {
materialParams[ textureName ] = texture;
} );
};
/**
* Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#materials
* @return {Promise<Array<THREE.Material>>}
*/
GLTFParser.prototype.loadMaterials = function () {
var parser = this;
var json = this.json;
var extensions = this.extensions;
return _each( json.materials, function ( material ) {
var materialType;
var materialParams = {};
var materialExtensions = material.extensions || {};
var pending = [];
if ( materialExtensions[ EXTENSIONS.KHR_MATERIALS_COMMON ] ) {
var khcExtension = extensions[ EXTENSIONS.KHR_MATERIALS_COMMON ];
materialType = khcExtension.getMaterialType( material );
pending.push( khcExtension.extendParams( materialParams, material, parser ) );
} else if ( materialExtensions[ EXTENSIONS.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS ] ) {
var sgExtension = extensions[ EXTENSIONS.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS ];
materialType = sgExtension.getMaterialType( material );
pending.push( sgExtension.extendParams( materialParams, material, parser ) );
} else if ( material.pbrMetallicRoughness !== undefined ) {
// Specification:
// https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#metallic-roughness-material
materialType = THREE.MeshStandardMaterial;
var metallicRoughness = material.pbrMetallicRoughness;
materialParams.color = new THREE.Color( 1.0, 1.0, 1.0 );
materialParams.opacity = 1.0;
if ( Array.isArray( metallicRoughness.baseColorFactor ) ) {
var array = metallicRoughness.baseColorFactor;
materialParams.color.fromArray( array );
materialParams.opacity = array[ 3 ];
}
if ( metallicRoughness.baseColorTexture !== undefined ) {
pending.push( parser.assignTexture( materialParams, 'map', metallicRoughness.baseColorTexture.index ) );
}
materialParams.metalness = metallicRoughness.metallicFactor !== undefined ? metallicRoughness.metallicFactor : 1.0;
materialParams.roughness = metallicRoughness.roughnessFactor !== undefined ? metallicRoughness.roughnessFactor : 1.0;
if ( metallicRoughness.metallicRoughnessTexture !== undefined ) {
var textureIndex = metallicRoughness.metallicRoughnessTexture.index;
pending.push( parser.assignTexture( materialParams, 'metalnessMap', textureIndex ) );
pending.push( parser.assignTexture( materialParams, 'roughnessMap', textureIndex ) );
}
} else {
materialType = THREE.MeshPhongMaterial;
}
if ( material.doubleSided === true ) {
materialParams.side = THREE.DoubleSide;
}
var alphaMode = material.alphaMode || ALPHA_MODES.OPAQUE;
if ( alphaMode !== ALPHA_MODES.OPAQUE ) {
materialParams.transparent = true;
} else {
materialParams.transparent = false;
}
if ( material.normalTexture !== undefined ) {
pending.push( parser.assignTexture( materialParams, 'normalMap', material.normalTexture.index ) );
}
if ( material.occlusionTexture !== undefined ) {
pending.push( parser.assignTexture( materialParams, 'aoMap', material.occlusionTexture.index ) );
}
if ( material.emissiveFactor !== undefined ) {
if ( materialType === THREE.MeshBasicMaterial ) {
materialParams.color = new THREE.Color().fromArray( material.emissiveFactor );
} else {
materialParams.emissive = new THREE.Color().fromArray( material.emissiveFactor );
}
}
if ( material.emissiveTexture !== undefined ) {
if ( materialType === THREE.MeshBasicMaterial ) {
pending.push( parser.assignTexture( materialParams, 'map', material.emissiveTexture.index ) );
} else {
pending.push( parser.assignTexture( materialParams, 'emissiveMap', material.emissiveTexture.index ) );
}
}
return Promise.all( pending ).then( function () {
var _material;
if ( materialType === THREE.ShaderMaterial ) {
_material = extensions[ EXTENSIONS.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS ].createMaterial( materialParams );
} else {
_material = new materialType( materialParams );
}
if ( material.name !== undefined ) _material.name = material.name;
// Normal map textures use OpenGL conventions:
// https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#materialnormaltexture
_material.normalScale.x = -1;
_material.userData = material.extras;
return _material;
} );
} );
};
GLTFParser.prototype.loadGeometries = function ( primitives ) {
return this._withDependencies( [
'accessors',
] ).then( function ( dependencies ) {
return _each( primitives, function ( primitive ) {
var geometry = new THREE.BufferGeometry();
var attributes = primitive.attributes;
for ( var attributeId in attributes ) {
var attributeEntry = attributes[ attributeId ];
if ( attributeEntry === undefined ) return;
var bufferAttribute = dependencies.accessors[ attributeEntry ];
switch ( attributeId ) {
case 'POSITION':
geometry.addAttribute( 'position', bufferAttribute );
break;
case 'NORMAL':
geometry.addAttribute( 'normal', bufferAttribute );
break;
case 'TEXCOORD_0':
case 'TEXCOORD0':
case 'TEXCOORD':
geometry.addAttribute( 'uv', bufferAttribute );
break;
case 'TEXCOORD_1':
geometry.addAttribute( 'uv2', bufferAttribute );
break;
case 'COLOR_0':
case 'COLOR0':
case 'COLOR':
geometry.addAttribute( 'color', bufferAttribute );
break;
case 'WEIGHTS_0':
case 'WEIGHT': // WEIGHT semantic deprecated.
geometry.addAttribute( 'skinWeight', bufferAttribute );
break;
case 'JOINTS_0':
case 'JOINT': // JOINT semantic deprecated.
geometry.addAttribute( 'skinIndex', bufferAttribute );
break;
}
}
if ( primitive.indices !== undefined ) {
geometry.setIndex( dependencies.accessors[ primitive.indices ] );
}
return geometry;
} );
} );
};
/**
* Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#meshes
*/
GLTFParser.prototype.loadMeshes = function () {
var scope = this;
var json = this.json;
return this._withDependencies( [
'accessors',
'materials'
] ).then( function ( dependencies ) {
return _each( json.meshes, function ( meshDef ) {
var group = new THREE.Group();
if ( meshDef.name !== undefined ) group.name = meshDef.name;
if ( meshDef.extras ) group.userData = meshDef.extras;
var primitives = meshDef.primitives || [];
return scope.loadGeometries( primitives ).then( function ( geometries ) {
for ( var name in primitives ) {
var primitive = primitives[ name ];
var geometry = geometries[ name ];
var material = primitive.material === undefined
? createDefaultMaterial()
: dependencies.materials[ primitive.material ];
if ( material.aoMap
&& geometry.attributes.uv2 === undefined
&& geometry.attributes.uv !== undefined ) {
console.log( 'THREE.GLTFLoader: Duplicating UVs to support aoMap.' );
geometry.addAttribute( 'uv2', new THREE.BufferAttribute( geometry.attributes.uv.array, 2 ) );
}
if ( geometry.attributes.color !== undefined ) {
material.vertexColors = THREE.VertexColors;
material.needsUpdate = true;
}
if ( geometry.attributes.normal === undefined ) {
if ( material.flatShading !== undefined ) {
material.flatShading = true;
} else {
// TODO: Remove this backwards-compatibility fix after r87 release.
material.shading = THREE.FlatShading;
}
}
var mesh;
if ( primitive.mode === WEBGL_CONSTANTS.TRIANGLES || primitive.mode === undefined ) {
mesh = new THREE.Mesh( geometry, material );
} else if ( primitive.mode === WEBGL_CONSTANTS.TRIANGLE_STRIP ) {
mesh = new THREE.Mesh( geometry, material );
mesh.drawMode = THREE.TriangleStripDrawMode;
} else if ( primitive.mode === WEBGL_CONSTANTS.TRIANGLE_FAN ) {
mesh = new THREE.Mesh( geometry, material );
mesh.drawMode = THREE.TriangleFanDrawMode;
} else if ( primitive.mode === WEBGL_CONSTANTS.LINES ) {
mesh = new THREE.LineSegments( geometry, material );
} else if ( primitive.mode === WEBGL_CONSTANTS.LINE_STRIP ) {
mesh = new THREE.Line( geometry, material );
} else if ( primitive.mode === WEBGL_CONSTANTS.LINE_LOOP ) {
mesh = new THREE.LineLoop( geometry, material );
} else if ( primitive.mode === WEBGL_CONSTANTS.POINTS ) {
mesh = new THREE.Points( geometry, material );
} else {
throw new Error( 'THREE.GLTFLoader: Primitive mode unsupported: ', primitive.mode );
}
mesh.name = group.name + '_' + name;
if ( primitive.targets !== undefined ) {
addMorphTargets( mesh, meshDef, primitive, dependencies );
}
if ( primitive.extras ) mesh.userData = primitive.extras;
group.add( mesh );
}
return group;
} );
} );
} );
};
/**
* Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#cameras
*/
GLTFParser.prototype.loadCameras = function () {
var json = this.json;
return _each( json.cameras, function ( camera ) {
var _camera;
var params = camera[ camera.type ];
if ( !params ) {
console.warn( 'THREE.GLTFLoader: Missing camera parameters.' );
return;
}
if ( camera.type === 'perspective' ) {
var aspectRatio = params.aspectRatio || 1;
var xfov = params.yfov * aspectRatio;
_camera = new THREE.PerspectiveCamera( THREE.Math.radToDeg( xfov ), aspectRatio, params.znear || 1, params.zfar || 2e6 );
} else if ( camera.type === 'orthographic' ) {
_camera = new THREE.OrthographicCamera( params.xmag / -2, params.xmag / 2, params.ymag / 2, params.ymag / -2, params.znear, params.zfar );
}
if ( camera.name !== undefined ) _camera.name = camera.name;
if ( camera.extras ) _camera.userData = camera.extras;
return _camera;
} );
};
GLTFParser.prototype.loadSkins = function () {
var json = this.json;
return this._withDependencies( [
'accessors'
] ).then( function ( dependencies ) {
return _each( json.skins, function ( skin ) {
var _skin = {
joints: skin.joints,
inverseBindMatrices: dependencies.accessors[ skin.inverseBindMatrices ]
};
return _skin;
} );
} );
};
GLTFParser.prototype.loadAnimations = function () {
var json = this.json;
return this._withDependencies( [
'accessors',
'nodes'
] ).then( function ( dependencies ) {
return _each( json.animations, function ( animation, animationId ) {
var tracks = [];
for ( var channelId in animation.channels ) {
var channel = animation.channels[ channelId ];
var sampler = animation.samplers[ channel.sampler ];
if ( sampler ) {
var target = channel.target;
var name = target.node !== undefined ? target.node : target.id; // NOTE: target.id is deprecated.
var input = animation.parameters !== undefined ? animation.parameters[ sampler.input ] : sampler.input;
var output = animation.parameters !== undefined ? animation.parameters[ sampler.output ] : sampler.output;
var inputAccessor = dependencies.accessors[ input ];
var outputAccessor = dependencies.accessors[ output ];
var node = dependencies.nodes[ name ];
if ( node ) {
node.updateMatrix();
node.matrixAutoUpdate = true;
var TypedKeyframeTrack;
switch ( PATH_PROPERTIES[ target.path ] ) {
case PATH_PROPERTIES.weights:
TypedKeyframeTrack = THREE.NumberKeyframeTrack;
break;
case PATH_PROPERTIES.rotation:
TypedKeyframeTrack = THREE.QuaternionKeyframeTrack;
break;
case PATH_PROPERTIES.position:
case PATH_PROPERTIES.scale:
default:
TypedKeyframeTrack = THREE.VectorKeyframeTrack;
break;
}
var targetName = node.name ? node.name : node.uuid;
if ( sampler.interpolation === 'CATMULLROMSPLINE' ) {
console.warn( 'THREE.GLTFLoader: CATMULLROMSPLINE interpolation is not supported. Using CUBICSPLINE instead.' );
}
var interpolation = sampler.interpolation !== undefined ? INTERPOLATION[ sampler.interpolation ] : THREE.InterpolateLinear;
var targetNames = [];
if ( PATH_PROPERTIES[ target.path ] === PATH_PROPERTIES.weights ) {
// node should be THREE.Group here but
// PATH_PROPERTIES.weights(morphTargetInfluences) should be
// the property of a mesh object under node.
// So finding targets here.
node.traverse( function ( object ) {
if ( object.isMesh === true && object.material.morphTargets === true ) {
targetNames.push( object.name ? object.name : object.uuid );
}
} );
} else {
targetNames.push( targetName );
}
// KeyframeTrack.optimize() will modify given 'times' and 'values'
// buffers before creating a truncated copy to keep. Because buffers may
// be reused by other tracks, make copies here.
for ( var i = 0, il = targetNames.length; i < il; i ++ ) {
tracks.push( new TypedKeyframeTrack(
targetNames[ i ] + '.' + PATH_PROPERTIES[ target.path ],
THREE.AnimationUtils.arraySlice( inputAccessor.array, 0 ),
THREE.AnimationUtils.arraySlice( outputAccessor.array, 0 ),
interpolation
) );
}
}
}
}
var name = animation.name !== undefined ? animation.name : 'animation_' + animationId;
return new THREE.AnimationClip( name, undefined, tracks );
} );
} );
};
GLTFParser.prototype.loadNodes = function () {
var json = this.json;
var extensions = this.extensions;
var scope = this;
var nodes = json.nodes || [];
var skins = json.skins || [];
// Nothing in the node definition indicates whether it is a Bone or an
// Object3D. Use the skins' joint references to mark bones.
skins.forEach( function ( skin ) {
skin.joints.forEach( function ( id ) {
nodes[ id ].isBone = true;
} );
} );
return _each( json.nodes, function ( node ) {
var matrix = new THREE.Matrix4();
var _node = node.isBone === true ? new THREE.Bone() : new THREE.Object3D();
if ( node.name !== undefined ) {
_node.name = THREE.PropertyBinding.sanitizeNodeName( node.name );
}
if ( node.extras ) _node.userData = node.extras;
if ( node.matrix !== undefined ) {
matrix.fromArray( node.matrix );
_node.applyMatrix( matrix );
} else {
if ( node.translation !== undefined ) {
_node.position.fromArray( node.translation );
}
if ( node.rotation !== undefined ) {
_node.quaternion.fromArray( node.rotation );
}
if ( node.scale !== undefined ) {
_node.scale.fromArray( node.scale );
}
}
return _node;
} ).then( function ( __nodes ) {
return scope._withDependencies( [
'meshes',
'skins',
'cameras'
] ).then( function ( dependencies ) {
return _each( __nodes, function ( _node, nodeId ) {
var node = json.nodes[ nodeId ];
var meshes;
if ( node.mesh !== undefined) {
meshes = [ node.mesh ];
} else if ( node.meshes !== undefined ) {
console.warn( 'THREE.GLTFLoader: Legacy glTF file detected. Nodes may have no more than one mesh.' );
meshes = node.meshes;
}
if ( meshes !== undefined ) {
for ( var meshId in meshes ) {
var mesh = meshes[ meshId ];
var group = dependencies.meshes[ mesh ];
if ( group === undefined ) {
console.warn( 'THREE.GLTFLoader: Could not find node "' + mesh + '".' );
continue;
}
// do not clone children as they will be replaced anyway
var clonedgroup = group.clone( false );
for ( var childrenId in group.children ) {
var child = group.children[ childrenId ];
var originalChild = child;
// clone Mesh to add to _node
var originalMaterial = child.material;
var originalGeometry = child.geometry;
var originalInfluences = child.morphTargetInfluences;
var originalUserData = child.userData;
var originalName = child.name;
var material = originalMaterial;
switch ( child.type ) {
case 'LineSegments':
child = new THREE.LineSegments( originalGeometry, material );
break;
case 'LineLoop':
child = new THREE.LineLoop( originalGeometry, material );
break;
case 'Line':
child = new THREE.Line( originalGeometry, material );
break;
case 'Points':
child = new THREE.Points( originalGeometry, material );
break;
default:
child = new THREE.Mesh( originalGeometry, material );
child.drawMode = originalChild.drawMode;
}
child.castShadow = true;
child.morphTargetInfluences = originalInfluences;
child.userData = originalUserData;
child.name = originalName;
var skinEntry;
if ( node.skin !== undefined ) {
skinEntry = dependencies.skins[ node.skin ];
}
// Replace Mesh with SkinnedMesh in library
if ( skinEntry ) {
var geometry = originalGeometry;
material = originalMaterial;
material.skinning = true;
child = new THREE.SkinnedMesh( geometry, material );
child.castShadow = true;
child.userData = originalUserData;
child.name = originalName;
var bones = [];
var boneInverses = [];
for ( var i = 0, l = skinEntry.joints.length; i < l; i ++ ) {
var jointId = skinEntry.joints[ i ];
var jointNode = __nodes[ jointId ];
if ( jointNode ) {
bones.push( jointNode );
var m = skinEntry.inverseBindMatrices.array;
var mat = new THREE.Matrix4().fromArray( m, i * 16 );
bone
gitextract_kgg3nd5t/ ├── .gitignore ├── CODE_OF_CONDUCT.md ├── CODING.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── dist-footer.js ├── dist-header.js ├── examples/ │ ├── ar_anchors/ │ │ └── index.html │ ├── ar_simplest/ │ │ └── index.html │ ├── boombox/ │ │ └── index.html │ ├── common.css │ ├── common.js │ ├── face_tracking/ │ │ ├── DuckyMesh.glb │ │ ├── glasses/ │ │ │ └── glasses.gltf │ │ └── index.html │ ├── hit_test/ │ │ └── index.html │ ├── image_detection/ │ │ ├── DuckyMesh.glb │ │ └── index.html │ ├── libs/ │ │ ├── loaders/ │ │ │ └── BinaryLoader.js │ │ ├── postprocessing/ │ │ │ ├── BloomPass.js │ │ │ ├── EffectComposer.js │ │ │ ├── FilmPass.js │ │ │ ├── MaskPass.js │ │ │ ├── RenderPass.js │ │ │ └── ShaderPass.js │ │ ├── shaders/ │ │ │ ├── ConvolutionShader.js │ │ │ ├── CopyShader.js │ │ │ ├── FilmShader.js │ │ │ └── FocusShader.js │ │ ├── stats.js │ │ ├── three-gltf-loader.js │ │ ├── three-mtl-loader.js │ │ ├── three-obj-loader.js │ │ └── three.js │ ├── light/ │ │ └── index.html │ ├── models/ │ │ ├── Axis.mtl │ │ ├── Axis.obj │ │ ├── BoomBox/ │ │ │ ├── README.md │ │ │ ├── glTF/ │ │ │ │ └── BoomBox.gltf │ │ │ ├── glTF-Binary/ │ │ │ │ └── BoomBox.glb │ │ │ └── glTF-pbrSpecularGlossiness/ │ │ │ └── BoomBox.gltf │ │ ├── TeapotBufferGeometry.js │ │ ├── female02/ │ │ │ ├── Female02_bin.js │ │ │ ├── Female02_slim.js │ │ │ ├── female02.mtl │ │ │ ├── female02.obj │ │ │ ├── female02_vertex_colors.obj │ │ │ └── readme.txt │ │ └── male02/ │ │ ├── 01_-_Default1noCulling.dds │ │ ├── Male02_bin.js │ │ ├── Male02_dds.js │ │ ├── Male02_slim.js │ │ ├── male-02-1noCulling.dds │ │ ├── male02.mtl │ │ ├── male02.obj │ │ ├── male02_dds.mtl │ │ ├── orig_02_-_Defaul1noCulling.dds │ │ └── readme.txt │ ├── opencv-aruco/ │ │ ├── createMarker.html │ │ ├── index.html │ │ ├── opencv.js │ │ ├── opencv_js.wasm │ │ └── worker.js │ ├── opencv-face/ │ │ ├── haarcascade_eye.xml │ │ ├── haarcascade_frontalface_default.xml │ │ ├── haarcascade_profileface.xml │ │ ├── index.html │ │ ├── old-rotate-resize.js │ │ ├── opencv.js │ │ ├── opencv_js.wasm │ │ └── worker.js │ ├── peoples/ │ │ └── index.html │ ├── persistence/ │ │ └── index.html │ ├── reticle/ │ │ └── index.html │ ├── sensing/ │ │ └── index.html │ ├── simplecv/ │ │ ├── index.html │ │ ├── webxr-worker.js │ │ └── worker.js │ ├── textures/ │ │ └── Park2/ │ │ └── readme.txt │ └── vr_simplest/ │ └── index.html ├── index.html ├── package.json ├── polyfill/ │ ├── Reality.js │ ├── XRAnchor.js │ ├── XRAnchorOffset.js │ ├── XRCoordinateSystem.js │ ├── XRDisplay.js │ ├── XRFaceAnchor.js │ ├── XRFieldOfView.js │ ├── XRImageAnchor.js │ ├── XRLayer.js │ ├── XRLightEstimate.js │ ├── XRPlaneAnchor.js │ ├── XRPointCloud.js │ ├── XRPolyfill.js │ ├── XRPresentationFrame.js │ ├── XRSession.js │ ├── XRSessionCreateParameters.js │ ├── XRStageBounds.js │ ├── XRStageBoundsPoint.js │ ├── XRVideoFrame.js │ ├── XRView.js │ ├── XRViewPose.js │ ├── XRViewport.js │ ├── XRWebGLLayer.js │ ├── XRWorkerPolyfill.js │ ├── display/ │ │ ├── FlatDisplay.js │ │ └── HeadMountedDisplay.js │ ├── fill/ │ │ ├── DeviceOrientationTracker.js │ │ ├── Euler.js │ │ ├── EventHandlerBase.js │ │ ├── MatrixMath.js │ │ ├── Quaternion.js │ │ ├── Vector3.js │ │ ├── base64-binary.js │ │ ├── gl-matrix/ │ │ │ ├── common.js │ │ │ ├── mat2.js │ │ │ ├── mat2d.js │ │ │ ├── mat3.js │ │ │ ├── mat4.js │ │ │ ├── quat.js │ │ │ ├── vec2.js │ │ │ ├── vec3.js │ │ │ └── vec4.js │ │ ├── gl-matrix-min.js │ │ └── gl-matrix.js │ ├── platform/ │ │ ├── ARCoreCameraRenderer.js │ │ └── ARKitWrapper.js │ └── reality/ │ ├── CameraReality.js │ └── VirtualReality.js ├── tests/ │ ├── CoordinatesTest.js │ ├── Test.js │ └── index.html ├── viewer.html └── webpack.config.js
Showing preview only (212K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (2368 symbols across 64 files)
FILE: examples/common.js
class XRExampleBase (line 16) | class XRExampleBase {
method constructor (line 17) | constructor(domElement, createVirtualReality=true, shouldStartPresenti...
method _startSession (line 86) | _startSession(){
method newSession (line 129) | newSession() {}
method showMessage (line 134) | showMessage(messageText){
method startPresenting (line 153) | startPresenting(){
method handleSessionFocus (line 170) | handleSessionFocus(ev){}
method handleSessionBlur (line 171) | handleSessionBlur(ev){}
method handleSessionEnded (line 172) | handleSessionEnded(ev){}
method handleLayerFocus (line 173) | handleLayerFocus(ev){}
method handleLayerBlur (line 174) | handleLayerBlur(ev){}
method setVideoWorker (line 179) | setVideoWorker(worker){
method requestVideoFrame (line 185) | requestVideoFrame() {
method initializeScene (line 192) | initializeScene(){}
method updateScene (line 197) | updateScene(frame){}
method _handleFrame (line 199) | _handleFrame(frame){
method doRender (line 268) | doRender(){
method addAnchoredNode (line 275) | addAnchoredNode(anchorOffset, node){
method removeAnchoredNode (line 286) | removeAnchoredNode(node) {
method anchoredNodeRemoved (line 299) | anchoredNodeRemoved(node) {}
method updateNodeFromAnchorOffset (line 304) | updateNodeFromAnchorOffset(frame, node, anchorOffset){
class ThingsOnSurfacesApp (line 321) | class ThingsOnSurfacesApp extends XRExampleBase {
method constructor (line 322) | constructor(domElement){
method createSceneGraphNode (line 329) | createSceneGraphNode(){
method updateScene (line 341) | updateScene(frame){
method _onTouchStart (line 362) | _onTouchStart(ev){
function fillInGLTFScene (line 375) | function fillInGLTFScene(path, scene, position=[0, 0, -2], scale=[1, 1, ...
function loadGLTF (line 392) | function loadGLTF(url){
function loadObj (line 410) | function loadObj(baseURL, geometry){
function requestFullScreen (line 430) | function requestFullScreen(){
function exitFullScreen (line 442) | function exitFullScreen(){
function hideMe (line 506) | function hideMe(elem) { elem.style.display = 'none' }
FILE: examples/libs/loaders/BinaryLoader.js
function handlePadding (line 163) | function handlePadding( n ) {
function parseMetaData (line 169) | function parseMetaData( data, offset ) {
function parseString (line 246) | function parseString( data, offset, length ) {
function parseUChar8 (line 262) | function parseUChar8( data, offset ) {
function parseUInt32 (line 270) | function parseUInt32( data, offset ) {
function init_vertices (line 278) | function init_vertices( start ) {
function init_normals (line 300) | function init_normals( start ) {
function init_uvs (line 326) | function init_uvs( start ) {
function init_uvs3 (line 351) | function init_uvs3( nElements, offset ) {
function init_uvs4 (line 382) | function init_uvs4( nElements, offset ) {
function init_faces3_flat (line 423) | function init_faces3_flat( nElements, offsetVertices, offsetMaterials ) {
function init_faces4_flat (line 444) | function init_faces4_flat( nElements, offsetVertices, offsetMaterials ) {
function init_faces3_smooth (line 467) | function init_faces3_smooth( nElements, offsetVertices, offsetNormals, o...
function init_faces4_smooth (line 510) | function init_faces4_smooth( nElements, offsetVertices, offsetNormals, o...
function init_triangles_flat (line 565) | function init_triangles_flat( start ) {
function init_triangles_flat_uv (line 578) | function init_triangles_flat_uv( start ) {
function init_triangles_smooth (line 594) | function init_triangles_smooth( start ) {
function init_triangles_smooth_uv (line 609) | function init_triangles_smooth_uv( start ) {
function init_quads_flat (line 626) | function init_quads_flat( start ) {
function init_quads_flat_uv (line 639) | function init_quads_flat_uv( start ) {
function init_quads_smooth (line 655) | function init_quads_smooth( start ) {
function init_quads_smooth_uv (line 670) | function init_quads_smooth_uv( start ) {
FILE: examples/libs/shaders/ConvolutionShader.js
function gauss (line 73) | function gauss( x, sigma ) {
FILE: examples/libs/stats.js
function addPanel (line 26) | function addPanel( panel ) {
function showPanel (line 33) | function showPanel( id ) {
FILE: examples/libs/three-gltf-loader.js
function GLTFLoader (line 11) | function GLTFLoader( manager ) {
function GLTFRegistry (line 141) | function GLTFRegistry() {
function GLTFLightsExtension (line 207) | function GLTFLightsExtension( json ) {
function GLTFMaterialsCommonExtension (line 291) | function GLTFMaterialsCommonExtension( json ) {
function GLTFBinaryExtension (line 394) | function GLTFBinaryExtension( data ) {
function GLTFMaterialsPbrSpecularGlossinessExtension (line 460) | function GLTFMaterialsPbrSpecularGlossinessExtension() {
function _each (line 926) | function _each( object, callback, thisObj ) {
function resolveURL (line 1011) | function resolveURL( url, path ) {
function convertUint8ArrayToString (line 1043) | function convertUint8ArrayToString( array ) {
function createDefaultMaterial (line 1069) | function createDefaultMaterial() {
function addMorphTargets (line 1090) | function addMorphTargets ( mesh, meshDef, primitiveDef, dependencies ) {
function GLTFParser (line 1204) | function GLTFParser( json, extensions, options ) {
function buildNodeHierachy (line 2330) | function buildNodeHierachy( nodeId, parentObject, allNodes ) {
FILE: examples/libs/three-mtl-loader.js
function resolveURL (line 355) | function resolveURL( baseUrl, url ) {
function setMapForType (line 367) | function setMapForType( mapType, value ) {
FILE: examples/libs/three-obj-loader.js
function ParserState (line 14) | function ParserState() {
function OBJLoader (line 317) | function OBJLoader( manager ) {
FILE: examples/libs/three.js
function EventDispatcher (line 110) | function EventDispatcher() {}
function Vector2 (line 489) | function Vector2( x, y ) {
function Texture (line 969) | function Texture( image, mapping, wrapS, wrapT, magFilter, minFilter, fo...
function getDataURL (line 1078) | function getDataURL( image ) {
function Vector4 (line 1255) | function Vector4( x, y, z, w ) {
function WebGLRenderTarget (line 1885) | function WebGLRenderTarget( width, height, options ) {
function WebGLRenderTargetCube (line 1964) | function WebGLRenderTargetCube( width, height, options ) {
function Quaternion (line 1985) | function Quaternion( x, y, z, w ) {
function Vector3 (line 2593) | function Vector3( x, y, z ) {
function Matrix4 (line 3327) | function Matrix4() {
function DataTexture (line 4240) | function DataTexture( data, width, height, format, type, mapping, wrapS,...
function CubeTexture (line 4264) | function CubeTexture( images, mapping, wrapS, wrapT, magFilter, minFilte...
function UniformContainer (line 4350) | function UniformContainer() {
function flatten (line 4371) | function flatten( array, nBlocks, blockSize ) {
function allocTexUnits (line 4408) | function allocTexUnits( renderer, n ) {
function setValue1f (line 4433) | function setValue1f( gl, v ) { gl.uniform1f( this.addr, v ); }
function setValue1i (line 4434) | function setValue1i( gl, v ) { gl.uniform1i( this.addr, v ); }
function setValue2fv (line 4438) | function setValue2fv( gl, v ) {
function setValue3fv (line 4445) | function setValue3fv( gl, v ) {
function setValue4fv (line 4456) | function setValue4fv( gl, v ) {
function setValue2fm (line 4465) | function setValue2fm( gl, v ) {
function setValue3fm (line 4471) | function setValue3fm( gl, v ) {
function setValue4fm (line 4486) | function setValue4fm( gl, v ) {
function setValueT1 (line 4503) | function setValueT1( gl, v, renderer ) {
function setValueT6 (line 4511) | function setValueT6( gl, v, renderer ) {
function setValue2iv (line 4521) | function setValue2iv( gl, v ) { gl.uniform2iv( this.addr, v ); }
function setValue3iv (line 4522) | function setValue3iv( gl, v ) { gl.uniform3iv( this.addr, v ); }
function setValue4iv (line 4523) | function setValue4iv( gl, v ) { gl.uniform4iv( this.addr, v ); }
function getSingularSetter (line 4527) | function getSingularSetter( type ) {
function setValue1fv (line 4554) | function setValue1fv( gl, v ) { gl.uniform1fv( this.addr, v ); }
function setValue1iv (line 4555) | function setValue1iv( gl, v ) { gl.uniform1iv( this.addr, v ); }
function setValueV2a (line 4559) | function setValueV2a( gl, v ) {
function setValueV3a (line 4565) | function setValueV3a( gl, v ) {
function setValueV4a (line 4571) | function setValueV4a( gl, v ) {
function setValueM2a (line 4579) | function setValueM2a( gl, v ) {
function setValueM3a (line 4585) | function setValueM3a( gl, v ) {
function setValueM4a (line 4591) | function setValueM4a( gl, v ) {
function setValueT1a (line 4599) | function setValueT1a( gl, v, renderer ) {
function setValueT6a (line 4614) | function setValueT6a( gl, v, renderer ) {
function getPureArraySetter (line 4631) | function getPureArraySetter( type ) {
function SingleUniform (line 4658) | function SingleUniform( id, activeInfo, addr ) {
function PureArrayUniform (line 4668) | function PureArrayUniform( id, activeInfo, addr ) {
function StructuredUniform (line 4679) | function StructuredUniform( id ) {
function addUniform (line 4718) | function addUniform( container, uniformObject ) {
function parseUniform (line 4725) | function parseUniform( activeInfo, addr, container ) {
function WebGLUniforms (line 4777) | function WebGLUniforms( gl, program, renderer ) {
function Color (line 4878) | function Color( r, g, b ) {
function hue2rgb (line 4951) | function hue2rgb( p, q, t ) {
function handleAlpha (line 4992) | function handleAlpha( string ) {
function Box2 (line 6158) | function Box2( min, max ) {
function LensFlarePlugin (line 6376) | function LensFlarePlugin( renderer, flares ) {
function SpritePlugin (line 6759) | function SpritePlugin( renderer, sprites ) {
function Material (line 7143) | function Material() {
function extractFromCache (line 7360) | function extractFromCache( cache ) {
function ShaderMaterial (line 7490) | function ShaderMaterial( parameters ) {
function MeshDepthMaterial (line 7614) | function MeshDepthMaterial( parameters ) {
function Box3 (line 7677) | function Box3( min, max ) {
function Sphere (line 8157) | function Sphere( center, radius ) {
function Matrix3 (line 8332) | function Matrix3() {
function Plane (line 8656) | function Plane( normal, constant ) {
function Frustum (line 8881) | function Frustum( p0, p1, p2, p3, p4, p5 ) {
function WebGLShadowMap (line 9075) | function WebGLShadowMap( _renderer, _lights, _objects, capabilities ) {
function WebGLAttributes (line 9516) | function WebGLAttributes( gl ) {
function Euler (line 9671) | function Euler( x, y, z, order ) {
function Layers (line 10014) | function Layers() {
function Object3D (line 10064) | function Object3D() {
function serialize (line 10669) | function serialize( library, element ) {
function extractFromCache (line 10744) | function extractFromCache( cache ) {
function Camera (line 10818) | function Camera() {
function OrthographicCamera (line 10883) | function OrthographicCamera( left, right, top, bottom, near, far ) {
function PerspectiveCamera (line 11007) | function PerspectiveCamera( fov, aspect, near, far ) {
function Face3 (line 11224) | function Face3( a, b, c, normal, color, materialIndex ) {
function GeometryIdCount (line 11287) | function GeometryIdCount() { return count++; }
function Geometry (line 11289) | function Geometry() {
function addFace (line 11528) | function addFace( a, b, c, materialIndex ) {
function materialIndexSort (line 12204) | function materialIndexSort( a, b ) {
function setBit (line 12360) | function setBit( value, position, enabled ) {
function getNormalIndex (line 12366) | function getNormalIndex( normal ) {
function getColorIndex (line 12383) | function getColorIndex( color ) {
function getUvIndex (line 12400) | function getUvIndex( uv ) {
function BufferAttribute (line 12705) | function BufferAttribute( array, itemSize, normalized ) {
function Int8BufferAttribute (line 13039) | function Int8BufferAttribute( array, itemSize ) {
function Uint8BufferAttribute (line 13049) | function Uint8BufferAttribute( array, itemSize ) {
function Uint8ClampedBufferAttribute (line 13059) | function Uint8ClampedBufferAttribute( array, itemSize ) {
function Int16BufferAttribute (line 13069) | function Int16BufferAttribute( array, itemSize ) {
function Uint16BufferAttribute (line 13079) | function Uint16BufferAttribute( array, itemSize ) {
function Int32BufferAttribute (line 13089) | function Int32BufferAttribute( array, itemSize ) {
function Uint32BufferAttribute (line 13099) | function Uint32BufferAttribute( array, itemSize ) {
function Float32BufferAttribute (line 13109) | function Float32BufferAttribute( array, itemSize ) {
function Float64BufferAttribute (line 13119) | function Float64BufferAttribute( array, itemSize ) {
function DirectGeometry (line 13132) | function DirectGeometry() {
function arrayMax (line 13387) | function arrayMax( array ) {
function BufferGeometry (line 13408) | function BufferGeometry() {
function BoxGeometry (line 14496) | function BoxGeometry( width, height, depth, widthSegments, heightSegment...
function BoxBufferGeometry (line 14521) | function BoxBufferGeometry( width, height, depth, widthSegments, heightS...
function PlaneGeometry (line 14688) | function PlaneGeometry( width, height, widthSegments, heightSegments ) {
function PlaneBufferGeometry (line 14711) | function PlaneBufferGeometry( width, height, widthSegments, heightSegmen...
function MeshBasicMaterial (line 14834) | function MeshBasicMaterial( parameters ) {
function Ray (line 14917) | function Ray( origin, direction ) {
function Line3 (line 15447) | function Line3( start, end ) {
function Triangle (line 15573) | function Triangle( a, b, c ) {
function Mesh (line 15827) | function Mesh( geometry, material ) {
function uvIntersection (line 15943) | function uvIntersection( point, p1, p2, p3, uv1, uv2, uv3 ) {
function checkIntersection (line 15957) | function checkIntersection( object, material, raycaster, ray, pA, pB, pC...
function checkBufferGeometryIntersection (line 15988) | function checkBufferGeometryIntersection( object, raycaster, ray, positi...
function WebGLBackground (line 16198) | function WebGLBackground( renderer, state, objects, premultipliedAlpha ) {
function painterSortStable (line 16324) | function painterSortStable( a, b ) {
function reversePainterSortStable (line 16350) | function reversePainterSortStable( a, b ) {
function WebGLRenderList (line 16368) | function WebGLRenderList() {
function WebGLRenderLists (line 16463) | function WebGLRenderLists() {
function WebGLIndexedBufferRenderer (line 16502) | function WebGLIndexedBufferRenderer( gl, extensions, infoRender ) {
function WebGLBufferRenderer (line 16567) | function WebGLBufferRenderer( gl, extensions, infoRender ) {
function WebGLGeometries (line 16634) | function WebGLGeometries( gl, attributes, infoMemory ) {
function WebGLLights (line 16823) | function WebGLLights() {
function WebGLObjects (line 16918) | function WebGLObjects( gl, geometries, infoRender ) {
function addLineNumbers (line 16968) | function addLineNumbers( string ) {
function WebGLShader (line 16982) | function WebGLShader( gl, type, string ) {
function getEncodingComponents (line 17014) | function getEncodingComponents( encoding ) {
function getTexelDecodingFunction (line 17039) | function getTexelDecodingFunction( functionName, encoding ) {
function getTexelEncodingFunction (line 17046) | function getTexelEncodingFunction( functionName, encoding ) {
function getToneMappingFunction (line 17053) | function getToneMappingFunction( functionName, toneMapping ) {
function generateExtensions (line 17084) | function generateExtensions( extensions, parameters, rendererExtensions ) {
function generateDefines (line 17099) | function generateDefines( defines ) {
function fetchAttributeLocations (line 17117) | function fetchAttributeLocations( gl, program, identifiers ) {
function filterEmptyLine (line 17138) | function filterEmptyLine( string ) {
function replaceLightNums (line 17144) | function replaceLightNums( string, parameters ) {
function parseIncludes (line 17155) | function parseIncludes( string ) {
function unrollLoops (line 17177) | function unrollLoops( string ) {
function WebGLProgram (line 17199) | function WebGLProgram( renderer, code, material, shader, parameters ) {
function WebGLPrograms (line 17680) | function WebGLPrograms( renderer, capabilities ) {
function WebGLTextures (line 17978) | function WebGLTextures( _gl, extensions, state, properties, capabilities...
function WebGLProperties (line 18769) | function WebGLProperties() {
function WebGLState (line 18813) | function WebGLState( gl, extensions, paramThreeToGL ) {
function WebGLCapabilities (line 19744) | function WebGLCapabilities( gl, extensions, parameters ) {
function ArrayCamera (line 19854) | function ArrayCamera( array ) {
function WebVRManager (line 19874) | function WebVRManager( renderer ) {
function WebGLExtensions (line 20076) | function WebGLExtensions( gl ) {
function WebGLClipping (line 20139) | function WebGLClipping() {
function WebGLRenderer (line 20304) | function WebGLRenderer( parameters ) {
function FogExp2 (line 23121) | function FogExp2 ( color, density ) {
function Fog (line 23153) | function Fog ( color, near, far ) {
function Scene (line 23187) | function Scene () {
function LensFlare (line 23238) | function LensFlare( texture, size, distance, blending, color ) {
function SpriteMaterial (line 23343) | function SpriteMaterial( parameters ) {
function Sprite (line 23383) | function Sprite( material ) {
function LOD (line 23446) | function LOD() {
function Skeleton (line 23618) | function Skeleton( bones, boneInverses ) {
function Bone (line 23773) | function Bone() {
function SkinnedMesh (line 23795) | function SkinnedMesh( geometry, material ) {
function LineBasicMaterial (line 24004) | function LineBasicMaterial( parameters ) {
function Line (line 24045) | function Line( geometry, material, mode ) {
function LineSegments (line 24230) | function LineSegments( geometry, material ) {
function LineLoop (line 24250) | function LineLoop( geometry, material ) {
function PointsMaterial (line 24280) | function PointsMaterial( parameters ) {
function Points (line 24323) | function Points( geometry, material ) {
function testPoint (line 24372) | function testPoint( point, index ) {
function Group (line 24460) | function Group() {
function VideoTexture (line 24478) | function VideoTexture( video, mapping, wrapS, wrapT, magFilter, minFilte...
function CompressedTexture (line 24509) | function CompressedTexture( mipmaps, width, height, format, type, mappin...
function CanvasTexture (line 24537) | function CanvasTexture( canvas, mapping, wrapS, wrapT, magFilter, minFil...
function DepthTexture (line 24553) | function DepthTexture( width, height, type, mapping, wrapS, wrapT, magFi...
function WireframeGeometry (line 24587) | function WireframeGeometry( geometry ) {
function ParametricGeometry (line 24765) | function ParametricGeometry( func, slices, stacks ) {
function ParametricBufferGeometry (line 24787) | function ParametricBufferGeometry( func, slices, stacks ) {
function PolyhedronGeometry (line 24914) | function PolyhedronGeometry( vertices, indices, radius, detail ) {
function PolyhedronBufferGeometry (line 24937) | function PolyhedronBufferGeometry( vertices, indices, radius, detail ) {
function TetrahedronGeometry (line 25245) | function TetrahedronGeometry( radius, detail ) {
function TetrahedronBufferGeometry (line 25266) | function TetrahedronBufferGeometry( radius, detail ) {
function OctahedronGeometry (line 25297) | function OctahedronGeometry( radius, detail ) {
function OctahedronBufferGeometry (line 25318) | function OctahedronBufferGeometry( radius, detail ) {
function IcosahedronGeometry (line 25349) | function IcosahedronGeometry( radius, detail ) {
function IcosahedronBufferGeometry (line 25370) | function IcosahedronBufferGeometry( radius, detail ) {
function DodecahedronGeometry (line 25408) | function DodecahedronGeometry( radius, detail ) {
function DodecahedronBufferGeometry (line 25429) | function DodecahedronBufferGeometry( radius, detail ) {
function TubeGeometry (line 25496) | function TubeGeometry( path, tubularSegments, radius, radialSegments, cl...
function TubeBufferGeometry (line 25532) | function TubeBufferGeometry( path, tubularSegments, radius, radialSegmen...
function TorusKnotGeometry (line 25707) | function TorusKnotGeometry( radius, tube, tubularSegments, radialSegment...
function TorusKnotBufferGeometry (line 25734) | function TorusKnotBufferGeometry( radius, tube, tubularSegments, radialS...
function TorusGeometry (line 25893) | function TorusGeometry( radius, tube, radialSegments, tubularSegments, a...
function TorusBufferGeometry (line 25917) | function TorusBufferGeometry( radius, tube, radialSegments, tubularSegme...
function snip (line 26059) | function snip( contour, u, v, w, n, verts ) {
function removeDupEndPts (line 26213) | function removeDupEndPts(points) {
function point_in_segment_2D_colin (line 26228) | function point_in_segment_2D_colin( inSegPt1, inSegPt2, inOtherPt ) {
function intersect_segments_2D (line 26259) | function intersect_segments_2D( inSeg1Pt1, inSeg1Pt2, inSeg2Pt1, inSeg2P...
function isPointInsideAngle (line 26432) | function isPointInsideAngle( inVertex, inLegFromPt, inLegToPt, inOtherPt...
function removeHoles (line 26475) | function removeHoles( contour, holes ) {
function ExtrudeGeometry (line 26739) | function ExtrudeGeometry( shapes, options ) {
function ExtrudeBufferGeometry (line 26760) | function ExtrudeBufferGeometry( shapes, options ) {
function scalePt2 (line 26936) | function scalePt2( pt, vec, size ) {
function getBevelVec (line 26952) | function getBevelVec( inPt, inPrev, inNext ) {
function buildLidFaces (line 27271) | function buildLidFaces() {
function buildSideFaces (line 27329) | function buildSideFaces() {
function sidewalls (line 27352) | function sidewalls( contour, layeroffset ) {
function v (line 27386) | function v( x, y, z ) {
function f3 (line 27395) | function f3( a, b, c ) {
function f4 (line 27410) | function f4( a, b, c, d, wallContour, stepIndex, stepsLength, contourInd...
function addVertex (line 27434) | function addVertex( index ) {
function addUV (line 27444) | function addUV( vector2 ) {
function TextGeometry (line 27539) | function TextGeometry( text, parameters ) {
function TextBufferGeometry (line 27560) | function TextBufferGeometry( text, parameters ) {
function SphereGeometry (line 27602) | function SphereGeometry( radius, widthSegments, heightSegments, phiStart...
function SphereBufferGeometry (line 27628) | function SphereBufferGeometry( radius, widthSegments, heightSegments, ph...
function RingGeometry (line 27746) | function RingGeometry( innerRadius, outerRadius, thetaSegments, phiSegme...
function RingBufferGeometry (line 27771) | function RingBufferGeometry( innerRadius, outerRadius, thetaSegments, ph...
function LatheGeometry (line 27892) | function LatheGeometry( points, segments, phiStart, phiLength ) {
function LatheBufferGeometry (line 27915) | function LatheBufferGeometry( points, segments, phiStart, phiLength ) {
function ShapeGeometry (line 28068) | function ShapeGeometry( shapes, curveSegments ) {
function ShapeBufferGeometry (line 28097) | function ShapeBufferGeometry( shapes, curveSegments ) {
function EdgesGeometry (line 28235) | function EdgesGeometry( geometry, thresholdAngle ) {
function CylinderGeometry (line 28343) | function CylinderGeometry( radiusTop, radiusBottom, height, radialSegmen...
function CylinderBufferGeometry (line 28370) | function CylinderBufferGeometry( radiusTop, radiusBottom, height, radial...
function ConeGeometry (line 28650) | function ConeGeometry( radius, height, radialSegments, heightSegments, o...
function ConeBufferGeometry (line 28673) | function ConeBufferGeometry( radius, height, radialSegments, heightSegme...
function CircleGeometry (line 28702) | function CircleGeometry( radius, segments, thetaStart, thetaLength ) {
function CircleBufferGeometry (line 28725) | function CircleBufferGeometry( radius, segments, thetaStart, thetaLength...
function ShadowMaterial (line 28862) | function ShadowMaterial( parameters ) {
function RawShaderMaterial (line 28903) | function RawShaderMaterial( parameters ) {
function MeshStandardMaterial (line 28967) | function MeshStandardMaterial( parameters ) {
function MeshPhysicalMaterial (line 29094) | function MeshPhysicalMaterial( parameters ) {
function MeshPhongMaterial (line 29181) | function MeshPhongMaterial( parameters ) {
function MeshToonMaterial (line 29300) | function MeshToonMaterial( parameters ) {
function MeshNormalMaterial (line 29355) | function MeshNormalMaterial( parameters ) {
function MeshLambertMaterial (line 29453) | function MeshLambertMaterial( parameters ) {
function LineDashedMaterial (line 29555) | function LineDashedMaterial( parameters ) {
function LoadingManager (line 29665) | function LoadingManager( onLoad, onProgress, onError ) {
function FileLoader (line 29736) | function FileLoader( manager ) {
function CompressedTextureLoader (line 29979) | function CompressedTextureLoader( manager ) {
function loadTexture (line 30003) | function loadTexture( i ) {
function DataTextureLoader (line 30113) | function DataTextureLoader( manager ) {
function ImageLoader (line 30199) | function ImageLoader( manager ) {
function CubeTextureLoader (line 30296) | function CubeTextureLoader( manager ) {
function loadTexture (line 30314) | function loadTexture( i ) {
function TextureLoader (line 30364) | function TextureLoader( manager ) {
function Light (line 30420) | function Light( color, intensity ) {
function HemisphereLight (line 30476) | function HemisphereLight( skyColor, groundColor, intensity ) {
function LightShadow (line 30513) | function LightShadow( camera ) {
function SpotLightShadow (line 30569) | function SpotLightShadow() {
function SpotLight (line 30606) | function SpotLight( color, intensity, distance, angle, penumbra, decay ) {
function PointLight (line 30669) | function PointLight( color, intensity, distance, decay ) {
function DirectionalLightShadow (line 30721) | function DirectionalLightShadow( ) {
function DirectionalLight (line 30738) | function DirectionalLight( color, intensity ) {
function AmbientLight (line 30777) | function AmbientLight( color, intensity ) {
function RectAreaLight (line 30799) | function RectAreaLight( color, intensity, width, height ) {
function compareTime (line 30899) | function compareTime( i, j ) {
function Interpolant (line 31036) | function Interpolant( parameterPositions, sampleValues, sampleSize, resu...
function CubicInterpolant (line 31280) | function CubicInterpolant( parameterPositions, sampleValues, sampleSize,...
function LinearInterpolant (line 31425) | function LinearInterpolant( parameterPositions, sampleValues, sampleSize...
function DiscreteInterpolant (line 31469) | function DiscreteInterpolant( parameterPositions, sampleValues, sampleSi...
function KeyframeTrackConstructor (line 31843) | function KeyframeTrackConstructor( name, times, values, interpolation ) {
function VectorKeyframeTrack (line 31875) | function VectorKeyframeTrack( name, times, values, interpolation ) {
function QuaternionLinearInterpolant (line 31900) | function QuaternionLinearInterpolant( parameterPositions, sampleValues, ...
function QuaternionKeyframeTrack (line 31942) | function QuaternionKeyframeTrack( name, times, values, interpolation ) {
function NumberKeyframeTrack (line 31979) | function NumberKeyframeTrack( name, times, values, interpolation ) {
function StringKeyframeTrack (line 32008) | function StringKeyframeTrack( name, times, values, interpolation ) {
function BooleanKeyframeTrack (line 32040) | function BooleanKeyframeTrack( name, times, values ) {
function ColorKeyframeTrack (line 32075) | function ColorKeyframeTrack( name, times, values, interpolation ) {
function KeyframeTrack (line 32108) | function KeyframeTrack( name, times, values, interpolation ) {
function AnimationClip (line 32250) | function AnimationClip( name, duration, tracks ) {
function MaterialLoader (line 32595) | function MaterialLoader( manager ) {
function getTexture (line 32627) | function getTexture( name ) {
function BufferGeometryLoader (line 32742) | function BufferGeometryLoader( manager ) {
function Loader (line 32840) | function Loader() {
function loadTexture (line 32932) | function loadTexture( path, repeat, offset, wrap, anisotropy ) {
function JSONLoader (line 33172) | function JSONLoader( manager ) {
function parseModel (line 33241) | function parseModel( json, geometry ) {
function parseSkin (line 33543) | function parseSkin( json, geometry ) {
function parseMorphing (line 33588) | function parseMorphing( json, geometry ) {
function parseAnimations (line 33635) | function parseAnimations( json, geometry ) {
function ObjectLoader (line 33733) | function ObjectLoader( manager ) {
function loadImage (line 34091) | function loadImage( url ) {
function parseConstant (line 34132) | function parseConstant( value, type ) {
function getGeometry (line 34204) | function getGeometry( name ) {
function getMaterial (line 34216) | function getMaterial( name ) {
function CatmullRom (line 34510) | function CatmullRom( t, p0, p1, p2, p3 ) {
function QuadraticBezierP0 (line 34522) | function QuadraticBezierP0( t, p ) {
function QuadraticBezierP1 (line 34529) | function QuadraticBezierP1( t, p ) {
function QuadraticBezierP2 (line 34535) | function QuadraticBezierP2( t, p ) {
function QuadraticBezier (line 34541) | function QuadraticBezier( t, p0, p1, p2 ) {
function CubicBezierP0 (line 34550) | function CubicBezierP0( t, p ) {
function CubicBezierP1 (line 34557) | function CubicBezierP1( t, p ) {
function CubicBezierP2 (line 34564) | function CubicBezierP2( t, p ) {
function CubicBezierP3 (line 34570) | function CubicBezierP3( t, p ) {
function CubicBezier (line 34576) | function CubicBezier( t, p0, p1, p2, p3 ) {
function Curve (line 34618) | function Curve() {
function LineCurve (line 34961) | function LineCurve( v1, v2 ) {
function CurvePath (line 35016) | function CurvePath() {
function EllipseCurve (line 35242) | function EllipseCurve( aX, aY, xRadius, yRadius, aStartAngle, aEndAngle,...
function SplineCurve (line 35326) | function SplineCurve( points /* array of Vector2 */ ) {
function CubicBezierCurve (line 35359) | function CubicBezierCurve( v0, v1, v2, v3 ) {
function QuadraticBezierCurve (line 35384) | function QuadraticBezierCurve( v0, v1, v2 ) {
function Path (line 35533) | function Path( points ) {
function Shape (line 35560) | function Shape() {
function ShapePath (line 35612) | function ShapePath() {
function toShapesNoHoles (line 35655) | function toShapesNoHoles( inSubpaths ) {
function isPointInsidePolygon (line 35674) | function isPointInsidePolygon( inPt, inPolygon ) {
function Font (line 35887) | function Font( data ) {
function createPaths (line 35899) | function createPaths( text ) {
function createPath (line 35932) | function createPath( c, scale, offsetX, offsetY ) {
function FontLoader (line 36065) | function FontLoader( manager ) {
function AudioLoader (line 36137) | function AudioLoader( manager ) {
function StereoCamera (line 36169) | function StereoCamera() {
function CubeCamera (line 36264) | function CubeCamera( near, far, cubeResolution ) {
function AudioListener (line 36349) | function AudioListener() {
function Audio (line 36473) | function Audio( listener ) {
function PositionalAudio (line 36769) | function PositionalAudio( listener ) {
function AudioAnalyser (line 36859) | function AudioAnalyser( audio, fftSize ) {
function PropertyMixer (line 36906) | function PropertyMixer( binding, typeName, valueSize ) {
function Composite (line 37111) | function Composite( targetGroup, path, optionalParsedPath ) {
function PropertyBinding (line 37176) | function PropertyBinding( rootNode, path, parsedPath ) {
function AnimationObjectGroup (line 37861) | function AnimationObjectGroup( var_args ) {
function AnimationAction (line 38209) | function AnimationAction( mixer, clip, localRoot ) {
function AnimationMixer (line 38869) | function AnimationMixer( root ) {
method total (line 39047) | get total() { return scope._actions.length; }
method inUse (line 39048) | get inUse() { return scope._nActiveActions; }
method total (line 39051) | get total() { return scope._bindings.length; }
method inUse (line 39052) | get inUse() { return scope._nActiveBindings; }
method total (line 39055) | get total() { return scope._controlInterpolants.length; }
method inUse (line 39056) | get inUse() { return scope._nActiveControlInterpolants; }
function Uniform (line 39589) | function Uniform( value ) {
function InstancedBufferGeometry (line 39612) | function InstancedBufferGeometry() {
function InterleavedBufferAttribute (line 39677) | function InterleavedBufferAttribute( interleavedBuffer, itemSize, offset...
function InterleavedBuffer (line 39815) | function InterleavedBuffer( array, stride ) {
function InstancedInterleavedBuffer (line 39923) | function InstancedInterleavedBuffer( array, stride, meshPerAttribute ) {
function InstancedBufferAttribute (line 39953) | function InstancedBufferAttribute( array, itemSize, meshPerAttribute ) {
function Raycaster (line 39985) | function Raycaster( origin, direction, near, far ) {
function ascSort (line 40012) | function ascSort( a, b ) {
function intersectObject (line 40018) | function intersectObject( object, raycaster, intersects, recursive ) {
function Clock (line 40111) | function Clock( autoStart ) {
function Spherical (line 40188) | function Spherical( radius, phi, theta ) {
function Cylindrical (line 40265) | function Cylindrical( radius, theta, y ) {
function MorphBlendMesh (line 40319) | function MorphBlendMesh( geometry, material ) {
function ImmediateRenderObject (line 40635) | function ImmediateRenderObject( material ) {
function VertexNormalsHelper (line 40654) | function VertexNormalsHelper( object, size, hex, linewidth ) {
function SpotLightHelper (line 40799) | function SpotLightHelper( light, color ) {
function getBoneList (line 40895) | function getBoneList( object ) {
function SkeletonHelper (line 40915) | function SkeletonHelper( object ) {
function PointLightHelper (line 41009) | function PointLightHelper( light, sphereSize, color ) {
function RectAreaLightHelper (line 41096) | function RectAreaLightHelper( light, color ) {
function HemisphereLightHelper (line 41170) | function HemisphereLightHelper( light, size, color ) {
function GridHelper (line 41253) | function GridHelper( size, divisions, color1, color2 ) {
function PolarGridHelper (line 41299) | function PolarGridHelper( radius, radials, circles, divisions, color1, c...
function FaceNormalsHelper (line 41385) | function FaceNormalsHelper( object, size, hex, linewidth ) {
function DirectionalLightHelper (line 41495) | function DirectionalLightHelper( light, size, color ) {
function CameraHelper (line 41588) | function CameraHelper( camera ) {
function setPoint (line 41702) | function setPoint( point, x, y, z ) {
function BoxHelper (line 41782) | function BoxHelper( object, color ) {
function Box3Helper (line 41878) | function Box3Helper( box, hex ) {
function PlaneHelper (line 41925) | function PlaneHelper( plane, size, hex ) {
function ArrowHelper (line 41993) | function ArrowHelper( dir, origin, length, color, headLength, headWidth ) {
function AxisHelper (line 42089) | function AxisHelper( size ) {
function CubicPoly (line 42140) | function CubicPoly() {
function CatmullRomCurve3 (line 42202) | function CatmullRomCurve3( points ) {
function CubicBezierCurve3 (line 42295) | function CubicBezierCurve3( v0, v1, v2, v3 ) {
function QuadraticBezierCurve3 (line 42321) | function QuadraticBezierCurve3( v0, v1, v2 ) {
function LineCurve3 (line 42346) | function LineCurve3( v1, v2 ) {
function ArcCurve (line 42376) | function ArcCurve( aX, aY, aRadius, aStartAngle, aEndAngle, aClockwise ) {
function Face4 (line 42428) | function Face4( a, b, c, d, normal, color, materialIndex ) {
function MeshFaceMaterial (line 42439) | function MeshFaceMaterial( materials ) {
function MultiMaterial (line 42446) | function MultiMaterial( materials ) {
function PointCloud (line 42462) | function PointCloud( geometry, material ) {
function Particle (line 42469) | function Particle( material ) {
function ParticleSystem (line 42476) | function ParticleSystem( geometry, material ) {
function PointCloudMaterial (line 42483) | function PointCloudMaterial( parameters ) {
function ParticleBasicMaterial (line 42490) | function ParticleBasicMaterial( parameters ) {
function ParticleSystemMaterial (line 42497) | function ParticleSystemMaterial( parameters ) {
function Vertex (line 42504) | function Vertex( x, y, z ) {
function DynamicBufferAttribute (line 42513) | function DynamicBufferAttribute( array, itemSize ) {
function Int8Attribute (line 42520) | function Int8Attribute( array, itemSize ) {
function Uint8Attribute (line 42527) | function Uint8Attribute( array, itemSize ) {
function Uint8ClampedAttribute (line 42534) | function Uint8ClampedAttribute( array, itemSize ) {
function Int16Attribute (line 42541) | function Int16Attribute( array, itemSize ) {
function Uint16Attribute (line 42548) | function Uint16Attribute( array, itemSize ) {
function Int32Attribute (line 42555) | function Int32Attribute( array, itemSize ) {
function Uint32Attribute (line 42562) | function Uint32Attribute( array, itemSize ) {
function Float32Attribute (line 42569) | function Float32Attribute( array, itemSize ) {
function Float64Attribute (line 42576) | function Float64Attribute( array, itemSize ) {
function ClosedSplineCurve3 (line 42599) | function ClosedSplineCurve3( points ) {
function SplineCurve3 (line 42613) | function SplineCurve3( points ) {
function Spline (line 42626) | function Spline( points ) {
function BoundingBoxHelper (line 42658) | function BoundingBoxHelper( object, color ) {
function EdgesHelper (line 42665) | function EdgesHelper( object, hex ) {
function WireframeHelper (line 42684) | function WireframeHelper( object, hex ) {
function XHRLoader (line 42693) | function XHRLoader( manager ) {
function BinaryTextureLoader (line 42700) | function BinaryTextureLoader( manager ) {
function Projector (line 43836) | function Projector() {
function CanvasRenderer (line 43864) | function CanvasRenderer() {
FILE: examples/opencv-aruco/opencv.js
function staticAlloc (line 20) | function staticAlloc(size){assert(!staticSealed);var ret=STATICTOP;STATI...
function dynamicAlloc (line 20) | function dynamicAlloc(size){assert(DYNAMICTOP_PTR);var ret=HEAP32[DYNAMI...
function alignMemory (line 20) | function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;var ret=...
function getNativeTypeSize (line 20) | function getNativeTypeSize(type){switch(type){case"i1":case"i8":return 1...
function warnOnce (line 20) | function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnc...
function dynCall (line 20) | function dynCall(sig,ptr,args){if(args&&args.length){return Module["dynC...
function assert (line 20) | function assert(condition,text){if(!condition){abort("Assertion failed: ...
function getCFunc (line 20) | function getCFunc(ident){var func=Module["_"+ident];assert(func,"Cannot ...
function ccall (line 20) | function ccall(ident,returnType,argTypes,args,opts){var func=getCFunc(id...
function setValue (line 20) | function setValue(ptr,value,type,noSafe){type=type||"i8";if(type.charAt(...
function getMemory (line 20) | function getMemory(size){if(!staticSealed)return staticAlloc(size);if(!r...
function Pointer_stringify (line 20) | function Pointer_stringify(ptr,length){if(length===0||!ptr)return"";var ...
function UTF8ArrayToString (line 20) | function UTF8ArrayToString(u8Array,idx){var endPtr=idx;while(u8Array[end...
function UTF8ToString (line 20) | function UTF8ToString(ptr){return UTF8ArrayToString(HEAPU8,ptr)}
function stringToUTF8Array (line 20) | function stringToUTF8Array(str,outU8Array,outIdx,maxBytesToWrite){if(!(m...
function stringToUTF8 (line 20) | function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Arr...
function lengthBytesUTF8 (line 20) | function lengthBytesUTF8(str){var len=0;for(var i=0;i<str.length;++i){va...
function allocateUTF8 (line 20) | function allocateUTF8(str){var size=lengthBytesUTF8(str)+1;var ret=_mall...
function demangle (line 20) | function demangle(func){var __cxa_demangle_func=Module["___cxa_demangle"...
function demangleAll (line 20) | function demangleAll(text){var regex=/__Z[\w\d_]+/g;return text.replace(...
function jsStackTrace (line 20) | function jsStackTrace(){var err=new Error;if(!err.stack){try{throw new E...
function stackTrace (line 20) | function stackTrace(){var js=jsStackTrace();if(Module["extraStackTrace"]...
function alignUp (line 20) | function alignUp(x,multiple){if(x%multiple>0){x+=multiple-x%multiple}ret...
function updateGlobalBuffer (line 20) | function updateGlobalBuffer(buf){Module["buffer"]=buffer=buf}
function updateGlobalBufferViews (line 20) | function updateGlobalBufferViews(){Module["HEAP8"]=HEAP8=new Int8Array(b...
function abortOnCannotGrowMemory (line 20) | function abortOnCannotGrowMemory(){abort("Cannot enlarge memory arrays. ...
function enlargeMemory (line 20) | function enlargeMemory(){var PAGE_MULTIPLE=Module["usingWasm"]?WASM_PAGE...
function getTotalMemory (line 20) | function getTotalMemory(){return TOTAL_MEMORY}
function callRuntimeCallbacks (line 20) | function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var c...
function preRun (line 20) | function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="func...
function ensureInitRuntime (line 20) | function ensureInitRuntime(){if(runtimeInitialized)return;runtimeInitial...
function preMain (line 20) | function preMain(){callRuntimeCallbacks(__ATMAIN__)}
function exitRuntime (line 20) | function exitRuntime(){callRuntimeCallbacks(__ATEXIT__);runtimeExited=true}
function postRun (line 20) | function postRun(){if(Module["postRun"]){if(typeof Module["postRun"]=="f...
function addOnPreRun (line 20) | function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}
function addOnPostRun (line 20) | function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}
function writeArrayToMemory (line 20) | function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}
function writeAsciiToMemory (line 20) | function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i<str.le...
function getUniqueRunDependency (line 20) | function getUniqueRunDependency(id){return id}
function addRunDependency (line 20) | function addRunDependency(id){runDependencies++;if(Module["monitorRunDep...
function removeRunDependency (line 20) | function removeRunDependency(id){runDependencies--;if(Module["monitorRun...
function isDataURI (line 20) | function isDataURI(filename){return String.prototype.startsWith?filename...
function integrateWasmJS (line 20) | function integrateWasmJS(){var wasmTextFile="opencv_js.wast";var wasmBin...
function _emscripten_set_main_loop_timing (line 20) | function _emscripten_set_main_loop_timing(mode,value){Browser.mainLoop.t...
function _emscripten_get_now (line 20) | function _emscripten_get_now(){abort()}
function _emscripten_set_main_loop (line 20) | function _emscripten_set_main_loop(func,fps,simulateInfiniteLoop,arg,noS...
function finish (line 20) | function finish(audio){if(done)return;done=true;Module["preloadedAudios"...
function fail (line 20) | function fail(){if(done)return;done=true;Module["preloadedAudios"][name]...
function encode64 (line 20) | function encode64(data){var BASE="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijkl...
function pointerLockChange (line 20) | function pointerLockChange(){Browser.pointerLock=document["pointerLockEl...
function fullscreenChange (line 20) | function fullscreenChange(){Browser.isFullscreen=false;var canvasContain...
function __ZSt18uncaught_exceptionv (line 20) | function __ZSt18uncaught_exceptionv(){return!!__ZSt18uncaught_exceptionv...
function ___cxa_allocate_exception (line 20) | function ___cxa_allocate_exception(size){return _malloc(size)}
function ___cxa_begin_catch (line 20) | function ___cxa_begin_catch(ptr){var info=EXCEPTIONS.infos[ptr];if(info&...
function ___cxa_pure_virtual (line 20) | function ___cxa_pure_virtual(){ABORT=true;throw"Pure virtual function ca...
function ___resumeException (line 20) | function ___resumeException(ptr){if(!EXCEPTIONS.last){EXCEPTIONS.last=pt...
function ___cxa_find_matching_catch (line 20) | function ___cxa_find_matching_catch(){var thrown=EXCEPTIONS.last;if(!thr...
function ___cxa_throw (line 20) | function ___cxa_throw(ptr,type,destructor){EXCEPTIONS.infos[ptr]={ptr:pt...
function ___gxx_personality_v0 (line 20) | function ___gxx_personality_v0(){}
function ___lock (line 20) | function ___lock(){}
function ___setErrNo (line 20) | function ___setErrNo(value){if(Module["___errno_location"])HEAP32[Module...
function ___map_file (line 20) | function ___map_file(pathname,size){___setErrNo(ERRNO_CODES.EPERM);retur...
function trim (line 20) | function trim(arr){var start=0;for(;start<arr.length;start++){if(arr[sta...
function isRealDir (line 20) | function isRealDir(p){return p!=="."&&p!==".."}
function toAbsolute (line 20) | function toAbsolute(root){return(function(p){return PATH.join2(root,p)})}
function done (line 20) | function done(err){if(err){if(!done.errored){done.errored=true;return ca...
function ensureParent (line 20) | function ensureParent(path){var parts=path.split("/");var parent=root;fo...
function base (line 20) | function base(path){var parts=path.split("/");return parts[parts.length-1]}
function doCallback (line 20) | function doCallback(err){assert(FS.syncFSRequests>0);FS.syncFSRequests--...
function done (line 20) | function done(err){if(err){if(!done.errored){done.errored=true;return do...
function LazyUint8Array (line 20) | function LazyUint8Array(){this.lengthKnown=false;this.chunks=[]}
function processData (line 20) | function processData(byteArray){function finish(byteArray){if(preFinish)...
function finish (line 20) | function finish(){if(fail==0)onload();else onerror()}
function finish (line 20) | function finish(){if(fail==0)onload();else onerror()}
function ___syscall140 (line 20) | function ___syscall140(which,varargs){SYSCALLS.varargs=varargs;try{var s...
function ___syscall145 (line 20) | function ___syscall145(which,varargs){SYSCALLS.varargs=varargs;try{var s...
function ___syscall146 (line 20) | function ___syscall146(which,varargs){SYSCALLS.varargs=varargs;try{var s...
function ___syscall221 (line 20) | function ___syscall221(which,varargs){SYSCALLS.varargs=varargs;try{var s...
function ___syscall3 (line 20) | function ___syscall3(which,varargs){SYSCALLS.varargs=varargs;try{var str...
function ___syscall4 (line 20) | function ___syscall4(which,varargs){SYSCALLS.varargs=varargs;try{var str...
function ___syscall5 (line 20) | function ___syscall5(which,varargs){SYSCALLS.varargs=varargs;try{var pat...
function ___syscall54 (line 20) | function ___syscall54(which,varargs){SYSCALLS.varargs=varargs;try{var st...
function ___syscall6 (line 20) | function ___syscall6(which,varargs){SYSCALLS.varargs=varargs;try{var str...
function ___syscall91 (line 20) | function ___syscall91(which,varargs){SYSCALLS.varargs=varargs;try{var ad...
function ___unlock (line 20) | function ___unlock(){}
function runDestructors (line 20) | function runDestructors(destructors){while(destructors.length){var ptr=d...
function simpleReadValueFromPointer (line 20) | function simpleReadValueFromPointer(pointer){return this["fromWireType"]...
function makeLegalFunctionName (line 20) | function makeLegalFunctionName(name){if(undefined===name){return"_unknow...
function createNamedFunction (line 20) | function createNamedFunction(name,body){name=makeLegalFunctionName(name)...
function extendError (line 20) | function extendError(baseErrorType,errorName){var errorClass=createNamed...
function throwInternalError (line 20) | function throwInternalError(message){throw new InternalError(message)}
function whenDependentTypesAreResolved (line 20) | function whenDependentTypesAreResolved(myTypes,dependentTypes,getTypeCon...
function __embind_finalize_value_array (line 20) | function __embind_finalize_value_array(rawTupleType){var reg=tupleRegist...
function __embind_finalize_value_object (line 20) | function __embind_finalize_value_object(structType){var reg=structRegist...
function getShiftFromSize (line 20) | function getShiftFromSize(size){switch(size){case 1:return 0;case 2:retu...
function embind_init_charCodes (line 20) | function embind_init_charCodes(){var codes=new Array(256);for(var i=0;i<...
function readLatin1String (line 20) | function readLatin1String(ptr){var ret="";var c=ptr;while(HEAPU8[c]){ret...
function throwBindingError (line 20) | function throwBindingError(message){throw new BindingError(message)}
function registerType (line 20) | function registerType(rawType,registeredInstance,options){options=option...
function __embind_register_bool (line 20) | function __embind_register_bool(rawType,name,size,trueValue,falseValue){...
function ClassHandle_isAliasOf (line 20) | function ClassHandle_isAliasOf(other){if(!(this instanceof ClassHandle))...
function shallowCopyInternalPointer (line 20) | function shallowCopyInternalPointer(o){return{count:o.count,deleteSchedu...
function throwInstanceAlreadyDeleted (line 20) | function throwInstanceAlreadyDeleted(obj){function getInstanceTypeName(h...
function ClassHandle_clone (line 20) | function ClassHandle_clone(){if(!this.$$.ptr){throwInstanceAlreadyDelete...
function runDestructor (line 20) | function runDestructor(handle){var $$=handle.$$;if($$.smartPtr){$$.smart...
function ClassHandle_delete (line 20) | function ClassHandle_delete(){if(!this.$$.ptr){throwInstanceAlreadyDelet...
function ClassHandle_isDeleted (line 20) | function ClassHandle_isDeleted(){return!this.$$.ptr}
function flushPendingDeletes (line 20) | function flushPendingDeletes(){while(deletionQueue.length){var obj=delet...
function ClassHandle_deleteLater (line 20) | function ClassHandle_deleteLater(){if(!this.$$.ptr){throwInstanceAlready...
function init_ClassHandle (line 20) | function init_ClassHandle(){ClassHandle.prototype["isAliasOf"]=ClassHand...
function ClassHandle (line 20) | function ClassHandle(){}
function ensureOverloadTable (line 20) | function ensureOverloadTable(proto,methodName,humanName){if(undefined===...
function exposePublicSymbol (line 20) | function exposePublicSymbol(name,value,numArguments){if(Module.hasOwnPro...
function RegisteredClass (line 20) | function RegisteredClass(name,constructor,instancePrototype,rawDestructo...
function upcastPointer (line 20) | function upcastPointer(ptr,ptrClass,desiredClass){while(ptrClass!==desir...
function constNoSmartPtrRawPointerToWireType (line 20) | function constNoSmartPtrRawPointerToWireType(destructors,handle){if(hand...
function genericPointerToWireType (line 20) | function genericPointerToWireType(destructors,handle){var ptr;if(handle=...
function nonConstNoSmartPtrRawPointerToWireType (line 20) | function nonConstNoSmartPtrRawPointerToWireType(destructors,handle){if(h...
function RegisteredPointer_getPointee (line 20) | function RegisteredPointer_getPointee(ptr){if(this.rawGetPointee){ptr=th...
function RegisteredPointer_destructor (line 20) | function RegisteredPointer_destructor(ptr){if(this.rawDestructor){this.r...
function RegisteredPointer_deleteObject (line 20) | function RegisteredPointer_deleteObject(handle){if(handle!==null){handle...
function downcastPointer (line 20) | function downcastPointer(ptr,ptrClass,desiredClass){if(ptrClass===desire...
function getInheritedInstanceCount (line 20) | function getInheritedInstanceCount(){return Object.keys(registeredInstan...
function getLiveInheritedInstances (line 20) | function getLiveInheritedInstances(){var rv=[];for(var k in registeredIn...
function setDelayFunction (line 20) | function setDelayFunction(fn){delayFunction=fn;if(deletionQueue.length&&...
function init_embind (line 20) | function init_embind(){Module["getInheritedInstanceCount"]=getInheritedI...
function getBasestPointer (line 20) | function getBasestPointer(class_,ptr){if(ptr===undefined){throwBindingEr...
function getInheritedInstance (line 20) | function getInheritedInstance(class_,ptr){ptr=getBasestPointer(class_,pt...
function makeClassHandle (line 20) | function makeClassHandle(prototype,record){if(!record.ptrType||!record.p...
function RegisteredPointer_fromWireType (line 20) | function RegisteredPointer_fromWireType(ptr){var rawPointer=this.getPoin...
function init_RegisteredPointer (line 20) | function init_RegisteredPointer(){RegisteredPointer.prototype.getPointee...
function RegisteredPointer (line 20) | function RegisteredPointer(name,registeredClass,isReference,isConst,isSm...
function replacePublicSymbol (line 20) | function replacePublicSymbol(name,value,numArguments){if(!Module.hasOwnP...
function embind__requireFunction (line 20) | function embind__requireFunction(signature,rawFunction){signature=readLa...
function getTypeName (line 20) | function getTypeName(type){var ptr=___getTypeName(type);var rv=readLatin...
function throwUnboundTypeError (line 20) | function throwUnboundTypeError(message,types){var unboundTypes=[];var se...
function __embind_register_class (line 20) | function __embind_register_class(rawType,rawPointerType,rawConstPointerT...
function new_ (line 20) | function new_(constructor,argumentList){if(!(constructor instanceof Func...
function craftInvokerFunction (line 20) | function craftInvokerFunction(humanName,argTypes,classType,cppInvokerFun...
function heap32VectorToArray (line 20) | function heap32VectorToArray(count,firstElement){var array=[];for(var i=...
function __embind_register_class_class_function (line 20) | function __embind_register_class_class_function(rawClassType,methodName,...
function __embind_register_class_constructor (line 20) | function __embind_register_class_constructor(rawClassType,argCount,rawAr...
function __embind_register_class_function (line 20) | function __embind_register_class_function(rawClassType,methodName,argCou...
function validateThis (line 20) | function validateThis(this_,classType,humanName){if(!(this_ instanceof O...
function __embind_register_class_property (line 20) | function __embind_register_class_property(classType,fieldName,getterRetu...
function __embind_register_constant (line 20) | function __embind_register_constant(name,type,value){name=readLatin1Stri...
function __emval_decref (line 20) | function __emval_decref(handle){if(handle>4&&0===--emval_handle_array[ha...
function count_emval_handles (line 20) | function count_emval_handles(){var count=0;for(var i=5;i<emval_handle_ar...
function get_first_emval (line 20) | function get_first_emval(){for(var i=5;i<emval_handle_array.length;++i){...
function init_emval (line 20) | function init_emval(){Module["count_emval_handles"]=count_emval_handles;...
function __emval_register (line 20) | function __emval_register(value){switch(value){case undefined:{return 1}...
function __embind_register_emval (line 20) | function __embind_register_emval(rawType,name){name=readLatin1String(nam...
function _embind_repr (line 20) | function _embind_repr(v){if(v===null){return"null"}var t=typeof v;if(t==...
function floatReadValueFromPointer (line 20) | function floatReadValueFromPointer(name,shift){switch(shift){case 2:retu...
function __embind_register_float (line 20) | function __embind_register_float(rawType,name,size){var shift=getShiftFr...
function __embind_register_function (line 20) | function __embind_register_function(name,argCount,rawArgTypesAddr,signat...
function integerReadValueFromPointer (line 20) | function integerReadValueFromPointer(name,shift,signed){switch(shift){ca...
function __embind_register_integer (line 20) | function __embind_register_integer(primitiveType,name,size,minRange,maxR...
function __embind_register_memory_view (line 20) | function __embind_register_memory_view(rawType,dataTypeIndex,name){var t...
function __embind_register_smart_ptr (line 20) | function __embind_register_smart_ptr(rawType,rawPointeeType,name,sharing...
function __embind_register_std_string (line 20) | function __embind_register_std_string(rawType,name){name=readLatin1Strin...
function __embind_register_std_wstring (line 20) | function __embind_register_std_wstring(rawType,charSize,name){name=readL...
function __embind_register_value_array (line 20) | function __embind_register_value_array(rawType,name,constructorSignature...
function __embind_register_value_array_element (line 20) | function __embind_register_value_array_element(rawTupleType,getterReturn...
function __embind_register_value_object (line 20) | function __embind_register_value_object(rawType,name,constructorSignatur...
function __embind_register_value_object_field (line 20) | function __embind_register_value_object_field(structType,fieldName,gette...
function __embind_register_void (line 20) | function __embind_register_void(rawType,name){name=readLatin1String(name...
function requireHandle (line 20) | function requireHandle(handle){if(!handle){throwBindingError("Cannot use...
function requireRegisteredType (line 20) | function requireRegisteredType(rawType,humanName){var impl=registeredTyp...
function __emval_as (line 20) | function __emval_as(handle,returnType,destructorsRef){handle=requireHand...
function __emval_allocateDestructors (line 20) | function __emval_allocateDestructors(destructorsRef){var destructors=[];...
function getStringOrSymbol (line 20) | function getStringOrSymbol(address){var symbol=emval_symbols[address];if...
function __emval_call_void_method (line 20) | function __emval_call_void_method(caller,handle,methodName,args){caller=...
function __emval_addMethodCaller (line 20) | function __emval_addMethodCaller(caller){var id=emval_methodCallers.leng...
function __emval_lookupTypes (line 20) | function __emval_lookupTypes(argCount,argTypes,argWireTypes){var a=new A...
function __emval_get_method_caller (line 20) | function __emval_get_method_caller(argCount,argTypes){var types=__emval_...
function __emval_get_property (line 20) | function __emval_get_property(handle,key){handle=requireHandle(handle);k...
function __emval_incref (line 20) | function __emval_incref(handle){if(handle>4){emval_handle_array[handle]....
function __emval_new_array (line 20) | function __emval_new_array(){return __emval_register([])}
function __emval_new_cstring (line 20) | function __emval_new_cstring(v){return __emval_register(getStringOrSymbo...
function __emval_run_destructors (line 20) | function __emval_run_destructors(handle){var destructors=emval_handle_ar...
function __emval_take_value (line 20) | function __emval_take_value(type,argv){type=requireRegisteredType(type,"...
function _abort (line 20) | function _abort(){Module["abort"]()}
function ___buildEnvironment (line 20) | function ___buildEnvironment(env){var MAX_ENV_VALUES=64;var TOTAL_ENV_SI...
function _getenv (line 20) | function _getenv(name){if(name===0)return 0;name=Pointer_stringify(name)...
function _llvm_trap (line 20) | function _llvm_trap(){abort("trap!")}
function _emscripten_memcpy_big (line 20) | function _emscripten_memcpy_big(dest,src,num){HEAPU8.set(HEAPU8.subarray...
function _pthread_cond_wait (line 20) | function _pthread_cond_wait(){return 0}
function _pthread_getspecific (line 20) | function _pthread_getspecific(key){return PTHREAD_SPECIFIC[key]||0}
function _pthread_key_create (line 20) | function _pthread_key_create(key,destructor){if(key==0){return ERRNO_COD...
function _pthread_key_delete (line 20) | function _pthread_key_delete(key){if(key in PTHREAD_SPECIFIC){delete PTH...
function _pthread_mutex_destroy (line 20) | function _pthread_mutex_destroy(){}
function _pthread_mutex_init (line 20) | function _pthread_mutex_init(){}
function _pthread_mutexattr_destroy (line 20) | function _pthread_mutexattr_destroy(){}
function _pthread_mutexattr_init (line 20) | function _pthread_mutexattr_init(){}
function _pthread_mutexattr_settype (line 20) | function _pthread_mutexattr_settype(){}
function _pthread_once (line 20) | function _pthread_once(ptr,func){if(!_pthread_once.seen)_pthread_once.se...
function _pthread_setspecific (line 20) | function _pthread_setspecific(key,value){if(!(key in PTHREAD_SPECIFIC)){...
function __isLeapYear (line 20) | function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400==...
function __arraySum (line 20) | function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=arr...
function __addDays (line 20) | function __addDays(date,days){var newDate=new Date(date.getTime());while...
function _strftime (line 20) | function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var...
function _strftime_l (line 20) | function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,for...
function intArrayFromString (line 20) | function intArrayFromString(stringy,dontAddNull,length){var len=length>0...
function invoke_di (line 20) | function invoke_di(index,a1){try{return Module["dynCall_di"](index,a1)}c...
function invoke_dii (line 20) | function invoke_dii(index,a1,a2){try{return Module["dynCall_dii"](index,...
function invoke_diiddi (line 20) | function invoke_diiddi(index,a1,a2,a3,a4,a5){try{return Module["dynCall_...
function invoke_diii (line 20) | function invoke_diii(index,a1,a2,a3){try{return Module["dynCall_diii"](i...
function invoke_diiid (line 20) | function invoke_diiid(index,a1,a2,a3,a4){try{return Module["dynCall_diii...
function invoke_diiiddi (line 20) | function invoke_diiiddi(index,a1,a2,a3,a4,a5,a6){try{return Module["dynC...
function invoke_diiii (line 20) | function invoke_diiii(index,a1,a2,a3,a4){try{return Module["dynCall_diii...
function invoke_diiiid (line 20) | function invoke_diiiid(index,a1,a2,a3,a4,a5){try{return Module["dynCall_...
function invoke_diiiii (line 20) | function invoke_diiiii(index,a1,a2,a3,a4,a5){try{return Module["dynCall_...
function invoke_diiiiii (line 20) | function invoke_diiiiii(index,a1,a2,a3,a4,a5,a6){try{return Module["dynC...
function invoke_diiiiiii (line 20) | function invoke_diiiiiii(index,a1,a2,a3,a4,a5,a6,a7){try{return Module["...
function invoke_diiiiiiii (line 20) | function invoke_diiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8){try{return Modu...
function invoke_fii (line 20) | function invoke_fii(index,a1,a2){try{return Module["dynCall_fii"](index,...
function invoke_fiii (line 20) | function invoke_fiii(index,a1,a2,a3){try{return Module["dynCall_fiii"](i...
function invoke_fiiii (line 20) | function invoke_fiiii(index,a1,a2,a3,a4){try{return Module["dynCall_fiii...
function invoke_fiiiii (line 20) | function invoke_fiiiii(index,a1,a2,a3,a4,a5){try{return Module["dynCall_...
function invoke_i (line 20) | function invoke_i(index){try{return Module["dynCall_i"](index)}catch(e){...
function invoke_ii (line 20) | function invoke_ii(index,a1){try{return Module["dynCall_ii"](index,a1)}c...
function invoke_iid (line 20) | function invoke_iid(index,a1,a2){try{return Module["dynCall_iid"](index,...
function invoke_iidi (line 20) | function invoke_iidi(index,a1,a2,a3){try{return Module["dynCall_iidi"](i...
function invoke_iii (line 20) | function invoke_iii(index,a1,a2){try{return Module["dynCall_iii"](index,...
function invoke_iiid (line 20) | function invoke_iiid(index,a1,a2,a3){try{return Module["dynCall_iiid"](i...
function invoke_iiidd (line 20) | function invoke_iiidd(index,a1,a2,a3,a4){try{return Module["dynCall_iiid...
function invoke_iiidi (line 20) | function invoke_iiidi(index,a1,a2,a3,a4){try{return Module["dynCall_iiid...
function invoke_iiii (line 20) | function invoke_iiii(index,a1,a2,a3){try{return Module["dynCall_iiii"](i...
function invoke_iiiid (line 20) | function invoke_iiiid(index,a1,a2,a3,a4){try{return Module["dynCall_iiii...
function invoke_iiiif (line 20) | function invoke_iiiif(index,a1,a2,a3,a4){try{return Module["dynCall_iiii...
function invoke_iiiii (line 20) | function invoke_iiiii(index,a1,a2,a3,a4){try{return Module["dynCall_iiii...
function invoke_iiiiid (line 20) | function invoke_iiiiid(index,a1,a2,a3,a4,a5){try{return Module["dynCall_...
function invoke_iiiiii (line 20) | function invoke_iiiiii(index,a1,a2,a3,a4,a5){try{return Module["dynCall_...
function invoke_iiiiiid (line 20) | function invoke_iiiiiid(index,a1,a2,a3,a4,a5,a6){try{return Module["dynC...
function invoke_iiiiiifiididiii (line 20) | function invoke_iiiiiifiididiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11...
function invoke_iiiiiii (line 20) | function invoke_iiiiiii(index,a1,a2,a3,a4,a5,a6){try{return Module["dynC...
function invoke_iiiiiiii (line 20) | function invoke_iiiiiiii(index,a1,a2,a3,a4,a5,a6,a7){try{return Module["...
function invoke_iiiiiiiididiii (line 20) | function invoke_iiiiiiiididiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,...
function invoke_iiiiiiiii (line 20) | function invoke_iiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8){try{return Modu...
function invoke_iiiiiiiiiiiii (line 20) | function invoke_iiiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a...
function invoke_iiiiij (line 20) | function invoke_iiiiij(index,a1,a2,a3,a4,a5,a6){try{return Module["dynCa...
function invoke_v (line 20) | function invoke_v(index){try{Module["dynCall_v"](index)}catch(e){if(type...
function invoke_vdii (line 20) | function invoke_vdii(index,a1,a2,a3){try{Module["dynCall_vdii"](index,a1...
function invoke_vdiii (line 20) | function invoke_vdiii(index,a1,a2,a3,a4){try{Module["dynCall_vdiii"](ind...
function invoke_vi (line 20) | function invoke_vi(index,a1){try{Module["dynCall_vi"](index,a1)}catch(e)...
function invoke_vid (line 20) | function invoke_vid(index,a1,a2){try{Module["dynCall_vid"](index,a1,a2)}...
function invoke_vidi (line 20) | function invoke_vidi(index,a1,a2,a3){try{Module["dynCall_vidi"](index,a1...
function invoke_vididdi (line 20) | function invoke_vididdi(index,a1,a2,a3,a4,a5,a6){try{Module["dynCall_vid...
function invoke_vididdii (line 20) | function invoke_vididdii(index,a1,a2,a3,a4,a5,a6,a7){try{Module["dynCall...
function invoke_vidii (line 20) | function invoke_vidii(index,a1,a2,a3,a4){try{Module["dynCall_vidii"](ind...
function invoke_vidiii (line 20) | function invoke_vidiii(index,a1,a2,a3,a4,a5){try{Module["dynCall_vidiii"...
function invoke_vifiiii (line 20) | function invoke_vifiiii(index,a1,a2,a3,a4,a5,a6){try{Module["dynCall_vif...
function invoke_vifiiiii (line 20) | function invoke_vifiiiii(index,a1,a2,a3,a4,a5,a6,a7){try{Module["dynCall...
function invoke_vii (line 20) | function invoke_vii(index,a1,a2){try{Module["dynCall_vii"](index,a1,a2)}...
function invoke_viid (line 20) | function invoke_viid(index,a1,a2,a3){try{Module["dynCall_viid"](index,a1...
function invoke_viidd (line 20) | function invoke_viidd(index,a1,a2,a3,a4){try{Module["dynCall_viidd"](ind...
function invoke_viiddi (line 20) | function invoke_viiddi(index,a1,a2,a3,a4,a5){try{Module["dynCall_viiddi"...
function invoke_viiddid (line 20) | function invoke_viiddid(index,a1,a2,a3,a4,a5,a6){try{Module["dynCall_vii...
function invoke_viiddidd (line 20) | function invoke_viiddidd(index,a1,a2,a3,a4,a5,a6,a7){try{Module["dynCall...
function invoke_viiddiddd (line 20) | function invoke_viiddiddd(index,a1,a2,a3,a4,a5,a6,a7,a8){try{Module["dyn...
function invoke_viiddidddd (line 20) | function invoke_viiddidddd(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){try{Module[...
function invoke_viiddii (line 20) | function invoke_viiddii(index,a1,a2,a3,a4,a5,a6){try{Module["dynCall_vii...
function invoke_viiddiii (line 20) | function invoke_viiddiii(index,a1,a2,a3,a4,a5,a6,a7){try{Module["dynCall...
function invoke_viidi (line 20) | function invoke_viidi(index,a1,a2,a3,a4){try{Module["dynCall_viidi"](ind...
function invoke_viididdi (line 20) | function invoke_viididdi(index,a1,a2,a3,a4,a5,a6,a7){try{Module["dynCall...
function invoke_viididdii (line 20) | function invoke_viididdii(index,a1,a2,a3,a4,a5,a6,a7,a8){try{Module["dyn...
function invoke_viididi (line 20) | function invoke_viididi(index,a1,a2,a3,a4,a5,a6){try{Module["dynCall_vii...
function invoke_viididii (line 20) | function invoke_viididii(index,a1,a2,a3,a4,a5,a6,a7){try{Module["dynCall...
function invoke_viidiiid (line 20) | function invoke_viidiiid(index,a1,a2,a3,a4,a5,a6,a7){try{Module["dynCall...
function invoke_viif (line 20) | function invoke_viif(index,a1,a2,a3){try{Module["dynCall_viif"](index,a1...
function invoke_viifiiii (line 20) | function invoke_viifiiii(index,a1,a2,a3,a4,a5,a6,a7){try{Module["dynCall...
function invoke_viifiiiii (line 20) | function invoke_viifiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8){try{Module["dyn...
function invoke_viii (line 20) | function invoke_viii(index,a1,a2,a3){try{Module["dynCall_viii"](index,a1...
function invoke_viiid (line 20) | function invoke_viiid(index,a1,a2,a3,a4){try{Module["dynCall_viiid"](ind...
function invoke_viiidd (line 20) | function invoke_viiidd(index,a1,a2,a3,a4,a5){try{Module["dynCall_viiidd"...
function invoke_viiiddd (line 20) | function invoke_viiiddd(index,a1,a2,a3,a4,a5,a6){try{Module["dynCall_vii...
function invoke_viiidddd (line 20) | function invoke_viiidddd(index,a1,a2,a3,a4,a5,a6,a7){try{Module["dynCall...
function invoke_viiiddddi (line 20) | function invoke_viiiddddi(index,a1,a2,a3,a4,a5,a6,a7,a8){try{Module["dyn...
function invoke_viiiddddii (line 20) | function invoke_viiiddddii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){try{Module[...
function invoke_viiidddi (line 20) | function invoke_viiidddi(index,a1,a2,a3,a4,a5,a6,a7){try{Module["dynCall...
function invoke_viiidddii (line 20) | function invoke_viiidddii(index,a1,a2,a3,a4,a5,a6,a7,a8){try{Module["dyn...
function invoke_viiidddiii (line 20) | function invoke_viiidddiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){try{Module[...
function invoke_viiidddiiii (line 20) | function invoke_viiidddiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){try{Mo...
function invoke_viiiddi (line 20) | function invoke_viiiddi(index,a1,a2,a3,a4,a5,a6){try{Module["dynCall_vii...
function invoke_viiiddid (line 20) | function invoke_viiiddid(index,a1,a2,a3,a4,a5,a6,a7){try{Module["dynCall...
function invoke_viiiddidd (line 20) | function invoke_viiiddidd(index,a1,a2,a3,a4,a5,a6,a7,a8){try{Module["dyn...
function invoke_viiiddiddd (line 20) | function invoke_viiiddiddd(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){try{Module[...
function invoke_viiiddidddd (line 20) | function invoke_viiiddidddd(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){try{Mo...
function invoke_viiiddii (line 20) | function invoke_viiiddii(index,a1,a2,a3,a4,a5,a6,a7){try{Module["dynCall...
function invoke_viiiddiii (line 20) | function invoke_viiiddiii(index,a1,a2,a3,a4,a5,a6,a7,a8){try{Module["dyn...
function invoke_viiiddiiid (line 20) | function invoke_viiiddiiid(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){try{Module[...
function invoke_viiiddiiii (line 20) | function invoke_viiiddiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){try{Module[...
function invoke_viiiddiiiid (line 20) | function invoke_viiiddiiiid(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){try{Mo...
function invoke_viiidi (line 20) | function invoke_viiidi(index,a1,a2,a3,a4,a5){try{Module["dynCall_viiidi"...
function invoke_viiididi (line 20) | function invoke_viiididi(index,a1,a2,a3,a4,a5,a6,a7){try{Module["dynCall...
function invoke_viiididii (line 20) | function invoke_viiididii(index,a1,a2,a3,a4,a5,a6,a7,a8){try{Module["dyn...
function invoke_viiidii (line 20) | function invoke_viiidii(index,a1,a2,a3,a4,a5,a6){try{Module["dynCall_vii...
function invoke_viiidiiddi (line 20) | function invoke_viiidiiddi(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){try{Module[...
function invoke_viiidiii (line 20) | function invoke_viiidiii(index,a1,a2,a3,a4,a5,a6,a7){try{Module["dynCall...
function invoke_viiidiiid (line 20) | function invoke_viiidiiid(index,a1,a2,a3,a4,a5,a6,a7,a8){try{Module["dyn...
function invoke_viiidiiii (line 20) | function invoke_viiidiiii(index,a1,a2,a3,a4,a5,a6,a7,a8){try{Module["dyn...
function invoke_viiidiiiidi (line 20) | function invoke_viiidiiiidi(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){try{Mo...
function invoke_viiif (line 20) | function invoke_viiif(index,a1,a2,a3,a4){try{Module["dynCall_viiif"](ind...
function invoke_viiii (line 20) | function invoke_viiii(index,a1,a2,a3,a4){try{Module["dynCall_viiii"](ind...
function invoke_viiiid (line 20) | function invoke_viiiid(index,a1,a2,a3,a4,a5){try{Module["dynCall_viiiid"...
function invoke_viiiidd (line 20) | function invoke_viiiidd(index,a1,a2,a3,a4,a5,a6){try{Module["dynCall_vii...
function invoke_viiiiddd (line 20) | function invoke_viiiiddd(index,a1,a2,a3,a4,a5,a6,a7){try{Module["dynCall...
function invoke_viiiidddd (line 20) | function invoke_viiiidddd(index,a1,a2,a3,a4,a5,a6,a7,a8){try{Module["dyn...
function invoke_viiiiddddi (line 20) | function invoke_viiiiddddi(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){try{Module[...
function invoke_viiiiddddii (line 20) | function invoke_viiiiddddii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){try{Mo...
function invoke_viiiidddi (line 20) | function invoke_viiiidddi(index,a1,a2,a3,a4,a5,a6,a7,a8){try{Module["dyn...
function invoke_viiiidddii (line 20) | function invoke_viiiidddii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){try{Module[...
function invoke_viiiidddiii (line 20) | function invoke_viiiidddiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){try{Mo...
function invoke_viiiidddiiii (line 20) | function invoke_viiiidddiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11){t...
function invoke_viiiiddi (line 20) | function invoke_viiiiddi(index,a1,a2,a3,a4,a5,a6,a7){try{Module["dynCall...
function invoke_viiiiddii (line 20) | function invoke_viiiiddii(index,a1,a2,a3,a4,a5,a6,a7,a8){try{Module["dyn...
function invoke_viiiiddiii (line 20) | function invoke_viiiiddiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){try{Module[...
function invoke_viiiiddiiid (line 20) | function invoke_viiiiddiiid(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){try{Mo...
function invoke_viiiiddiiii (line 20) | function invoke_viiiiddiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){try{Mo...
function invoke_viiiiddiiiid (line 20) | function invoke_viiiiddiiiid(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11){t...
function invoke_viiiidi (line 20) | function invoke_viiiidi(index,a1,a2,a3,a4,a5,a6){try{Module["dynCall_vii...
function invoke_viiiidii (line 20) | function invoke_viiiidii(index,a1,a2,a3,a4,a5,a6,a7){try{Module["dynCall...
function invoke_viiiidiid (line 20) | function invoke_viiiidiid(index,a1,a2,a3,a4,a5,a6,a7,a8){try{Module["dyn...
function invoke_viiiidiidd (line 20) | function invoke_viiiidiidd(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){try{Module[...
function invoke_viiiidiiddi (line 20) | function invoke_viiiidiiddi(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){try{Mo...
function invoke_viiiidiii (line 20) | function invoke_viiiidiii(index,a1,a2,a3,a4,a5,a6,a7,a8){try{Module["dyn...
function invoke_viiiidiiii (line 20) | function invoke_viiiidiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){try{Module[...
function invoke_viiiidiiiidi (line 20) | function invoke_viiiidiiiidi(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11){t...
function invoke_viiiii (line 20) | function invoke_viiiii(index,a1,a2,a3,a4,a5){try{Module["dynCall_viiiii"...
function invoke_viiiiid (line 20) | function invoke_viiiiid(index,a1,a2,a3,a4,a5,a6){try{Module["dynCall_vii...
function invoke_viiiiidd (line 20) | function invoke_viiiiidd(index,a1,a2,a3,a4,a5,a6,a7){try{Module["dynCall...
function invoke_viiiiiddi (line 20) | function invoke_viiiiiddi(index,a1,a2,a3,a4,a5,a6,a7,a8){try{Module["dyn...
function invoke_viiiiidi (line 20) | function invoke_viiiiidi(index,a1,a2,a3,a4,a5,a6,a7){try{Module["dynCall...
function invoke_viiiiidii (line 20) | function invoke_viiiiidii(index,a1,a2,a3,a4,a5,a6,a7,a8){try{Module["dyn...
function invoke_viiiiidiid (line 20) | function invoke_viiiiidiid(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){try{Module[...
function invoke_viiiiidiidd (line 20) | function invoke_viiiiidiidd(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){try{Mo...
function invoke_viiiiidiiddi (line 20) | function invoke_viiiiidiiddi(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11){t...
function invoke_viiiiidiii (line 20) | function invoke_viiiiidiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){try{Module[...
function invoke_viiiiidiiii (line 20) | function invoke_viiiiidiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){try{Mo...
function invoke_viiiiidiiiii (line 20) | function invoke_viiiiidiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11){t...
function invoke_viiiiif (line 20) | function invoke_viiiiif(index,a1,a2,a3,a4,a5,a6){try{Module["dynCall_vii...
function invoke_viiiiii (line 20) | function invoke_viiiiii(index,a1,a2,a3,a4,a5,a6){try{Module["dynCall_vii...
function invoke_viiiiiid (line 20) | function invoke_viiiiiid(index,a1,a2,a3,a4,a5,a6,a7){try{Module["dynCall...
function invoke_viiiiiidd (line 20) | function invoke_viiiiiidd(index,a1,a2,a3,a4,a5,a6,a7,a8){try{Module["dyn...
function invoke_viiiiiiddi (line 20) | function invoke_viiiiiiddi(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){try{Module[...
function invoke_viiiiiidi (line 20) | function invoke_viiiiiidi(index,a1,a2,a3,a4,a5,a6,a7,a8){try{Module["dyn...
function invoke_viiiiiidii (line 20) | function invoke_viiiiiidii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){try{Module[...
function invoke_viiiiiidiii (line 20) | function invoke_viiiiiidiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){try{Mo...
function invoke_viiiiiidiiii (line 20) | function invoke_viiiiiidiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11){t...
function invoke_viiiiiidiiiii (line 20) | function invoke_viiiiiidiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a...
function invoke_viiiiiif (line 20) | function invoke_viiiiiif(index,a1,a2,a3,a4,a5,a6,a7){try{Module["dynCall...
function invoke_viiiiiii (line 20) | function invoke_viiiiiii(index,a1,a2,a3,a4,a5,a6,a7){try{Module["dynCall...
function invoke_viiiiiiid (line 20) | function invoke_viiiiiiid(index,a1,a2,a3,a4,a5,a6,a7,a8){try{Module["dyn...
function invoke_viiiiiiidd (line 20) | function invoke_viiiiiiidd(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){try{Module[...
function invoke_viiiiiiiddi (line 20) | function invoke_viiiiiiiddi(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){try{Mo...
function invoke_viiiiiiidi (line 20) | function invoke_viiiiiiidi(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){try{Module[...
function invoke_viiiiiiii (line 20) | function invoke_viiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8){try{Module["dyn...
function invoke_viiiiiiiii (line 20) | function invoke_viiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){try{Module[...
function invoke_viiiiiiiiidd (line 20) | function invoke_viiiiiiiiidd(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11){t...
function invoke_viiiiiiiiii (line 20) | function invoke_viiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){try{Mo...
function invoke_viiiiiiiiiid (line 20) | function invoke_viiiiiiiiiid(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11){t...
function invoke_viiiiiiiiiiddi (line 20) | function invoke_viiiiiiiiiiddi(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,...
function invoke_viiiiiiiiiii (line 20) | function invoke_viiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11){t...
function invoke_viiiiiiiiiiid (line 20) | function invoke_viiiiiiiiiiid(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a...
function invoke_viijii (line 20) | function invoke_viijii(index,a1,a2,a3,a4,a5,a6){try{Module["dynCall_viij...
function invoke_vij (line 20) | function invoke_vij(index,a1,a2,a3){try{Module["dynCall_vij"](index,a1,a...
function ExitStatus (line 20) | function ExitStatus(status){this.name="ExitStatus";this.message="Program...
function run (line 20) | function run(args){args=args||Module["arguments"];if(runDependencies>0){...
function exit (line 20) | function exit(status,implicit){if(implicit&&Module["noExitRuntime"]&&sta...
function abort (line 20) | function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(wh...
function Range (line 20) | function Range(start,end){this.start=typeof start==="undefined"?0:start;...
function Point (line 20) | function Point(x,y){this.x=typeof x==="undefined"?0:x;this.y=typeof y===...
function Size (line 20) | function Size(width,height){this.width=typeof width==="undefined"?0:widt...
function Rect (line 20) | function Rect(){switch(arguments.length){case 0:{this.x=0;this.y=0;this....
function RotatedRect (line 20) | function RotatedRect(){switch(arguments.length){case 0:{this.center={x:0...
function Scalar (line 20) | function Scalar(v0,v1,v2,v3){this.push(typeof v0==="undefined"?0:v0);thi...
function MinMaxLoc (line 20) | function MinMaxLoc(){switch(arguments.length){case 0:{this.minVal=0;this...
function Circle (line 20) | function Circle(){switch(arguments.length){case 0:{this.center=new Point...
function TermCriteria (line 20) | function TermCriteria(){switch(arguments.length){case 0:{this.type=0;thi...
FILE: examples/opencv-aruco/worker.js
function createCVMat2 (line 96) | function createCVMat2(rotation, buffer, pixelFormat) {
FILE: examples/opencv-face/old-rotate-resize.js
function createCVMat (line 10) | function createCVMat(rotation, buffer, pixelFormat) {
FILE: examples/opencv-face/opencv.js
function staticAlloc (line 20) | function staticAlloc(size){assert(!staticSealed);var ret=STATICTOP;STATI...
function dynamicAlloc (line 20) | function dynamicAlloc(size){assert(DYNAMICTOP_PTR);var ret=HEAP32[DYNAMI...
function alignMemory (line 20) | function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;var ret=...
function getNativeTypeSize (line 20) | function getNativeTypeSize(type){switch(type){case"i1":case"i8":return 1...
function warnOnce (line 20) | function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnc...
function dynCall (line 20) | function dynCall(sig,ptr,args){if(args&&args.length){return Module["dynC...
function assert (line 20) | function assert(condition,text){if(!condition){abort("Assertion failed: ...
function getCFunc (line 20) | function getCFunc(ident){var func=Module["_"+ident];assert(func,"Cannot ...
function ccall (line 20) | function ccall(ident,returnType,argTypes,args,opts){var func=getCFunc(id...
function setValue (line 20) | function setValue(ptr,value,type,noSafe){type=type||"i8";if(type.charAt(...
function getMemory (line 20) | function getMemory(size){if(!staticSealed)return staticAlloc(size);if(!r...
function Pointer_stringify (line 20) | function Pointer_stringify(ptr,length){if(length===0||!ptr)return"";var ...
function UTF8ArrayToString (line 20) | function UTF8ArrayToString(u8Array,idx){var endPtr=idx;while(u8Array[end...
function UTF8ToString (line 20) | function UTF8ToString(ptr){return UTF8ArrayToString(HEAPU8,ptr)}
function stringToUTF8Array (line 20) | function stringToUTF8Array(str,outU8Array,outIdx,maxBytesToWrite){if(!(m...
function stringToUTF8 (line 20) | function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Arr...
function lengthBytesUTF8 (line 20) | function lengthBytesUTF8(str){var len=0;for(var i=0;i<str.length;++i){va...
function allocateUTF8 (line 20) | function allocateUTF8(str){var size=lengthBytesUTF8(str)+1;var ret=_mall...
function demangle (line 20) | function demangle(func){var __cxa_demangle_func=Module["___cxa_demangle"...
function demangleAll (line 20) | function demangleAll(text){var regex=/__Z[\w\d_]+/g;return text.replace(...
function jsStackTrace (line 20) | function jsStackTrace(){var err=new Error;if(!err.stack){try{throw new E...
function stackTrace (line 20) | function stackTrace(){var js=jsStackTrace();if(Module["extraStackTrace"]...
function alignUp (line 20) | function alignUp(x,multiple){if(x%multiple>0){x+=multiple-x%multiple}ret...
function updateGlobalBuffer (line 20) | function updateGlobalBuffer(buf){Module["buffer"]=buffer=buf}
function updateGlobalBufferViews (line 20) | function updateGlobalBufferViews(){Module["HEAP8"]=HEAP8=new Int8Array(b...
function abortOnCannotGrowMemory (line 20) | function abortOnCannotGrowMemory(){abort("Cannot enlarge memory arrays. ...
function enlargeMemory (line 20) | function enlargeMemory(){var PAGE_MULTIPLE=Module["usingWasm"]?WASM_PAGE...
function getTotalMemory (line 20) | function getTotalMemory(){return TOTAL_MEMORY}
function callRuntimeCallbacks (line 20) | function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var c...
function preRun (line 20) | function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="func...
function ensureInitRuntime (line 20) | function ensureInitRuntime(){if(runtimeInitialized)return;runtimeInitial...
function preMain (line 20) | function preMain(){callRuntimeCallbacks(__ATMAIN__)}
function exitRuntime (line 20) | function exitRuntime(){callRuntimeCallbacks(__ATEXIT__);runtimeExited=true}
function postRun (line 20) | function postRun(){if(Module["postRun"]){if(typeof Module["postRun"]=="f...
function addOnPreRun (line 20) | function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}
function addOnPostRun (line 20) | function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}
function writeArrayToMemory (line 20) | function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}
function writeAsciiToMemory (line 20) | function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i<str.le...
function getUniqueRunDependency (line 20) | function getUniqueRunDependency(id){return id}
function addRunDependency (line 20) | function addRunDependency(id){runDependencies++;if(Module["monitorRunDep...
function removeRunDependency (line 20) | function removeRunDependency(id){runDependencies--;if(Module["monitorRun...
function isDataURI (line 20) | function isDataURI(filename){return String.prototype.startsWith?filename...
function integrateWasmJS (line 20) | function integrateWasmJS(){var wasmTextFile="opencv_js.wast";var wasmBin...
function _emscripten_set_main_loop_timing (line 20) | function _emscripten_set_main_loop_timing(mode,value){Browser.mainLoop.t...
function _emscripten_get_now (line 20) | function _emscripten_get_now(){abort()}
function _emscripten_set_main_loop (line 20) | function _emscripten_set_main_loop(func,fps,simulateInfiniteLoop,arg,noS...
function finish (line 20) | function finish(audio){if(done)return;done=true;Module["preloadedAudios"...
function fail (line 20) | function fail(){if(done)return;done=true;Module["preloadedAudios"][name]...
function encode64 (line 20) | function encode64(data){var BASE="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijkl...
function pointerLockChange (line 20) | function pointerLockChange(){Browser.pointerLock=document["pointerLockEl...
function fullscreenChange (line 20) | function fullscreenChange(){Browser.isFullscreen=false;var canvasContain...
function __ZSt18uncaught_exceptionv (line 20) | function __ZSt18uncaught_exceptionv(){return!!__ZSt18uncaught_exceptionv...
function ___cxa_allocate_exception (line 20) | function ___cxa_allocate_exception(size){return _malloc(size)}
function ___cxa_begin_catch (line 20) | function ___cxa_begin_catch(ptr){var info=EXCEPTIONS.infos[ptr];if(info&...
function ___cxa_pure_virtual (line 20) | function ___cxa_pure_virtual(){ABORT=true;throw"Pure virtual function ca...
function ___resumeException (line 20) | function ___resumeException(ptr){if(!EXCEPTIONS.last){EXCEPTIONS.last=pt...
function ___cxa_find_matching_catch (line 20) | function ___cxa_find_matching_catch(){var thrown=EXCEPTIONS.last;if(!thr...
function ___cxa_throw (line 20) | function ___cxa_throw(ptr,type,destructor){EXCEPTIONS.infos[ptr]={ptr:pt...
function ___gxx_personality_v0 (line 20) | function ___gxx_personality_v0(){}
function ___lock (line 20) | function ___lock(){}
function ___setErrNo (line 20) | function ___setErrNo(value){if(Module["___errno_location"])HEAP32[Module...
function ___map_file (line 20) | function ___map_file(pathname,size){___setErrNo(ERRNO_CODES.EPERM);retur...
function trim (line 20) | function trim(arr){var start=0;for(;start<arr.length;start++){if(arr[sta...
function isRealDir (line 20) | function isRealDir(p){return p!=="."&&p!==".."}
function toAbsolute (line 20) | function toAbsolute(root){return(function(p){return PATH.join2(root,p)})}
function done (line 20) | function done(err){if(err){if(!done.errored){done.errored=true;return ca...
function ensureParent (line 20) | function ensureParent(path){var parts=path.split("/");var parent=root;fo...
function base (line 20) | function base(path){var parts=path.split("/");return parts[parts.length-1]}
function doCallback (line 20) | function doCallback(err){assert(FS.syncFSRequests>0);FS.syncFSRequests--...
function done (line 20) | function done(err){if(err){if(!done.errored){done.errored=true;return do...
function LazyUint8Array (line 20) | function LazyUint8Array(){this.lengthKnown=false;this.chunks=[]}
function processData (line 20) | function processData(byteArray){function finish(byteArray){if(preFinish)...
function finish (line 20) | function finish(){if(fail==0)onload();else onerror()}
function finish (line 20) | function finish(){if(fail==0)onload();else onerror()}
function ___syscall140 (line 20) | function ___syscall140(which,varargs){SYSCALLS.varargs=varargs;try{var s...
function ___syscall145 (line 20) | function ___syscall145(which,varargs){SYSCALLS.varargs=varargs;try{var s...
function ___syscall146 (line 20) | function ___syscall146(which,varargs){SYSCALLS.varargs=varargs;try{var s...
function ___syscall221 (line 20) | function ___syscall221(which,varargs){SYSCALLS.varargs=varargs;try{var s...
function ___syscall3 (line 20) | function ___syscall3(which,varargs){SYSCALLS.varargs=varargs;try{var str...
function ___syscall4 (line 20) | function ___syscall4(which,varargs){SYSCALLS.varargs=varargs;try{var str...
function ___syscall5 (line 20) | function ___syscall5(which,varargs){SYSCALLS.varargs=varargs;try{var pat...
function ___syscall54 (line 20) | function ___syscall54(which,varargs){SYSCALLS.varargs=varargs;try{var st...
function ___syscall6 (line 20) | function ___syscall6(which,varargs){SYSCALLS.varargs=varargs;try{var str...
function ___syscall91 (line 20) | function ___syscall91(which,varargs){SYSCALLS.varargs=varargs;try{var ad...
function ___unlock (line 20) | function ___unlock(){}
function runDestructors (line 20) | function runDestructors(destructors){while(destructors.length){var ptr=d...
function simpleReadValueFromPointer (line 20) | function simpleReadValueFromPointer(pointer){return this["fromWireType"]...
function makeLegalFunctionName (line 20) | function makeLegalFunctionName(name){if(undefined===name){return"_unknow...
function createNamedFunction (line 20) | function createNamedFunction(name,body){name=makeLegalFunctionName(name)...
function extendError (line 20) | function extendError(baseErrorType,errorName){var errorClass=createNamed...
function throwInternalError (line 20) | function throwInternalError(message){throw new InternalError(message)}
function whenDependentTypesAreResolved (line 20) | function whenDependentTypesAreResolved(myTypes,dependentTypes,getTypeCon...
function __embind_finalize_value_array (line 20) | function __embind_finalize_value_array(rawTupleType){var reg=tupleRegist...
function __embind_finalize_value_object (line 20) | function __embind_finalize_value_object(structType){var reg=structRegist...
function getShiftFromSize (line 20) | function getShiftFromSize(size){switch(size){case 1:return 0;case 2:retu...
function embind_init_charCodes (line 20) | function embind_init_charCodes(){var codes=new Array(256);for(var i=0;i<...
function readLatin1String (line 20) | function readLatin1String(ptr){var ret="";var c=ptr;while(HEAPU8[c]){ret...
function throwBindingError (line 20) | function throwBindingError(message){throw new BindingError(message)}
function registerType (line 20) | function registerType(rawType,registeredInstance,options){options=option...
function __embind_register_bool (line 20) | function __embind_register_bool(rawType,name,size,trueValue,falseValue){...
function ClassHandle_isAliasOf (line 20) | function ClassHandle_isAliasOf(other){if(!(this instanceof ClassHandle))...
function shallowCopyInternalPointer (line 20) | function shallowCopyInternalPointer(o){return{count:o.count,deleteSchedu...
function throwInstanceAlreadyDeleted (line 20) | function throwInstanceAlreadyDeleted(obj){function getInstanceTypeName(h...
function ClassHandle_clone (line 20) | function ClassHandle_clone(){if(!this.$$.ptr){throwInstanceAlreadyDelete...
function runDestructor (line 20) | function runDestructor(handle){var $$=handle.$$;if($$.smartPtr){$$.smart...
function ClassHandle_delete (line 20) | function ClassHandle_delete(){if(!this.$$.ptr){throwInstanceAlreadyDelet...
function ClassHandle_isDeleted (line 20) | function ClassHandle_isDeleted(){return!this.$$.ptr}
function flushPendingDeletes (line 20) | function flushPendingDeletes(){while(deletionQueue.length){var obj=delet...
function ClassHandle_deleteLater (line 20) | function ClassHandle_deleteLater(){if(!this.$$.ptr){throwInstanceAlready...
function init_ClassHandle (line 20) | function init_ClassHandle(){ClassHandle.prototype["isAliasOf"]=ClassHand...
function ClassHandle (line 20) | function ClassHandle(){}
function ensureOverloadTable (line 20) | function ensureOverloadTable(proto,methodName,humanName){if(undefined===...
function exposePublicSymbol (line 20) | function exposePublicSymbol(name,value,numArguments){if(Module.hasOwnPro...
function RegisteredClass (line 20) | function RegisteredClass(name,constructor,instancePrototype,rawDestructo...
function upcastPointer (line 20) | function upcastPointer(ptr,ptrClass,desiredClass){while(ptrClass!==desir...
function constNoSmartPtrRawPointerToWireType (line 20) | function constNoSmartPtrRawPointerToWireType(destructors,handle){if(hand...
function genericPointerToWireType (line 20) | function genericPointerToWireType(destructors,handle){var ptr;if(handle=...
function nonConstNoSmartPtrRawPointerToWireType (line 20) | function nonConstNoSmartPtrRawPointerToWireType(destructors,handle){if(h...
function RegisteredPointer_getPointee (line 20) | function RegisteredPointer_getPointee(ptr){if(this.rawGetPointee){ptr=th...
function RegisteredPointer_destructor (line 20) | function RegisteredPointer_destructor(ptr){if(this.rawDestructor){this.r...
function RegisteredPointer_deleteObject (line 20) | function RegisteredPointer_deleteObject(handle){if(handle!==null){handle...
function downcastPointer (line 20) | function downcastPointer(ptr,ptrClass,desiredClass){if(ptrClass===desire...
function getInheritedInstanceCount (line 20) | function getInheritedInstanceCount(){return Object.keys(registeredInstan...
function getLiveInheritedInstances (line 20) | function getLiveInheritedInstances(){var rv=[];for(var k in registeredIn...
function setDelayFunction (line 20) | function setDelayFunction(fn){delayFunction=fn;if(deletionQueue.length&&...
function init_embind (line 20) | function init_embind(){Module["getInheritedInstanceCount"]=getInheritedI...
function getBasestPointer (line 20) | function getBasestPointer(class_,ptr){if(ptr===undefined){throwBindingEr...
function getInheritedInstance (line 20) | function getInheritedInstance(class_,ptr){ptr=getBasestPointer(class_,pt...
function makeClassHandle (line 20) | function makeClassHandle(prototype,record){if(!record.ptrType||!record.p...
function RegisteredPointer_fromWireType (line 20) | function RegisteredPointer_fromWireType(ptr){var rawPointer=this.getPoin...
function init_RegisteredPointer (line 20) | function init_RegisteredPointer(){RegisteredPointer.prototype.getPointee...
function RegisteredPointer (line 20) | function RegisteredPointer(name,registeredClass,isReference,isConst,isSm...
function replacePublicSymbol (line 20) | function replacePublicSymbol(name,value,numArguments){if(!Module.hasOwnP...
function embind__requireFunction (line 20) | function embind__requireFunction(signature,rawFunction){signature=readLa...
function getTypeName (line 20) | function getTypeName(type){var ptr=___getTypeName(type);var rv=readLatin...
function throwUnboundTypeError (line 20) | function throwUnboundTypeError(message,types){var unboundTypes=[];var se...
function __embind_register_class (line 20) | function __embind_register_class(rawType,rawPointerType,rawConstPointerT...
function new_ (line 20) | function new_(constructor,argumentList){if(!(constructor instanceof Func...
function craftInvokerFunction (line 20) | function craftInvokerFunction(humanName,argTypes,classType,cppInvokerFun...
function heap32VectorToArray (line 20) | function heap32VectorToArray(count,firstElement){var array=[];for(var i=...
function __embind_register_class_class_function (line 20) | function __embind_register_class_class_function(rawClassType,methodName,...
function __embind_register_class_constructor (line 20) | function __embind_register_class_constructor(rawClassType,argCount,rawAr...
function __embind_register_class_function (line 20) | function __embind_register_class_function(rawClassType,methodName,argCou...
function validateThis (line 20) | function validateThis(this_,classType,humanName){if(!(this_ instanceof O...
function __embind_register_class_property (line 20) | function __embind_register_class_property(classType,fieldName,getterRetu...
function __embind_register_constant (line 20) | function __embind_register_constant(name,type,value){name=readLatin1Stri...
function __emval_decref (line 20) | function __emval_decref(handle){if(handle>4&&0===--emval_handle_array[ha...
function count_emval_handles (line 20) | function count_emval_handles(){var count=0;for(var i=5;i<emval_handle_ar...
function get_first_emval (line 20) | function get_first_emval(){for(var i=5;i<emval_handle_array.length;++i){...
function init_emval (line 20) | function init_emval(){Module["count_emval_handles"]=count_emval_handles;...
function __emval_register (line 20) | function __emval_register(value){switch(value){case undefined:{return 1}...
function __embind_register_emval (line 20) | function __embind_register_emval(rawType,name){name=readLatin1String(nam...
function _embind_repr (line 20) | function _embind_repr(v){if(v===null){return"null"}var t=typeof v;if(t==...
function floatReadValueFromPointer (line 20) | function floatReadValueFromPointer(name,shift){switch(shift){case 2:retu...
function __embind_register_float (line 20) | function __embind_register_float(rawType,name,size){var shift=getShiftFr...
function __embind_register_function (line 20) | function __embind_register_function(name,argCount,rawArgTypesAddr,signat...
function integerReadValueFromPointer (line 20) | function integerReadValueFromPointer(name,shift,signed){switch(shift){ca...
function __embind_register_integer (line 20) | function __embind_register_integer(primitiveType,name,size,minRange,maxR...
function __embind_register_memory_view (line 20) | function __embind_register_memory_view(rawType,dataTypeIndex,name){var t...
function __embind_register_smart_ptr (line 20) | function __embind_register_smart_ptr(rawType,rawPointeeType,name,sharing...
function __embind_register_std_string (line 20) | function __embind_register_std_string(rawType,name){name=readLatin1Strin...
function __embind_register_std_wstring (line 20) | function __embind_register_std_wstring(rawType,charSize,name){name=readL...
function __embind_register_value_array (line 20) | function __embind_register_value_array(rawType,name,constructorSignature...
function __embind_register_value_array_element (line 20) | function __embind_register_value_array_element(rawTupleType,getterReturn...
function __embind_register_value_object (line 20) | function __embind_register_value_object(rawType,name,constructorSignatur...
function __embind_register_value_object_field (line 20) | function __embind_register_value_object_field(structType,fieldName,gette...
function __embind_register_void (line 20) | function __embind_register_void(rawType,name){name=readLatin1String(name...
function requireHandle (line 20) | function requireHandle(handle){if(!handle){throwBindingError("Cannot use...
function requireRegisteredType (line 20) | function requireRegisteredType(rawType,humanName){var impl=registeredTyp...
function __emval_as (line 20) | function __emval_as(handle,returnType,destructorsRef){handle=requireHand...
function __emval_allocateDestructors (line 20) | function __emval_allocateDestructors(destructorsRef){var destructors=[];...
function getStringOrSymbol (line 20) | function getStringOrSymbol(address){var symbol=emval_symbols[address];if...
function __emval_call_void_method (line 20) | function __emval_call_void_method(caller,handle,methodName,args){caller=...
function __emval_addMethodCaller (line 20) | function __emval_addMethodCaller(caller){var id=emval_methodCallers.leng...
function __emval_lookupTypes (line 20) | function __emval_lookupTypes(argCount,argTypes,argWireTypes){var a=new A...
function __emval_get_method_caller (line 20) | function __emval_get_method_caller(argCount,argTypes){var types=__emval_...
function __emval_get_property (line 20) | function __emval_get_property(handle,key){handle=requireHandle(handle);k...
function __emval_incref (line 20) | function __emval_incref(handle){if(handle>4){emval_handle_array[handle]....
function __emval_new_array (line 20) | function __emval_new_array(){return __emval_register([])}
function __emval_new_cstring (line 20) | function __emval_new_cstring(v){return __emval_register(getStringOrSymbo...
function __emval_run_destructors (line 20) | function __emval_run_destructors(handle){var destructors=emval_handle_ar...
function __emval_take_value (line 20) | function __emval_take_value(type,argv){type=requireRegisteredType(type,"...
function _abort (line 20) | function _abort(){Module["abort"]()}
function ___buildEnvironment (line 20) | function ___buildEnvironment(env){var MAX_ENV_VALUES=64;var TOTAL_ENV_SI...
function _getenv (line 20) | function _getenv(name){if(name===0)return 0;name=Pointer_stringify(name)...
function _gettimeofday (line 20) | function _gettimeofday(ptr){var now=Date.now();HEAP32[ptr>>2]=now/1e3|0;...
function _llvm_trap (line 20) | function _llvm_trap(){abort("trap!")}
function _emscripten_memcpy_big (line 20) | function _emscripten_memcpy_big(dest,src,num){HEAPU8.set(HEAPU8.subarray...
function _pthread_cond_wait (line 20) | function _pthread_cond_wait(){return 0}
function _pthread_getspecific (line 20) | function _pthread_getspecific(key){return PTHREAD_SPECIFIC[key]||0}
function _pthread_key_create (line 20) | function _pthread_key_create(key,destructor){if(key==0){return ERRNO_COD...
function _pthread_key_delete (line 20) | function _pthread_key_delete(key){if(key in PTHREAD_SPECIFIC){delete PTH...
function _pthread_mutex_destroy (line 20) | function _pthread_mutex_destroy(){}
function _pthread_mutex_init (line 20) | function _pthread_mutex_init(){}
function _pthread_mutexattr_destroy (line 20) | function _pthread_mutexattr_destroy(){}
function _pthread_mutexattr_init (line 20) | function _pthread_mutexattr_init(){}
function _pthread_mutexattr_settype (line 20) | function _pthread_mutexattr_settype(){}
function _pthread_once (line 20) | function _pthread_once(ptr,func){if(!_pthread_once.seen)_pthread_once.se...
function _pthread_setspecific (line 20) | function _pthread_setspecific(key,value){if(!(key in PTHREAD_SPECIFIC)){...
function _sched_yield (line 20) | function _sched_yield(){return 0}
function __isLeapYear (line 20) | function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400==...
function __arraySum (line 20) | function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=arr...
function __addDays (line 20) | function __addDays(date,days){var newDate=new Date(date.getTime());while...
function _strftime (line 20) | function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var...
function _strftime_l (line 20) | function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,for...
function intArrayFromString (line 20) | function intArrayFromString(stringy,dontAddNull,length){var len=length>0...
function invoke_di (line 20) | function invoke_di(index,a1){try{return Module["dynCall_di"](index,a1)}c...
function invoke_dii (line 20) | function invoke_dii(index,a1,a2){try{return Module["dynCall_dii"](index,...
function invoke_diiddi (line 20) | function invoke_diiddi(index,a1,a2,a3,a4,a5){try{return Module["dynCall_...
function invoke_diii (line 20) | function invoke_diii(index,a1,a2,a3){try{return Module["dynCall_diii"](i...
function invoke_diiid (line 20) | function invoke_diiid(index,a1,a2,a3,a4){try{return Module["dynCall_diii...
function invoke_diiiddi (line 20) | function invoke_diiiddi(index,a1,a2,a3,a4,a5,a6){try{return Module["dynC...
function invoke_diiii (line 20) | function invoke_diiii(index,a1,a2,a3,a4){try{return Module["dynCall_diii...
function invoke_diiiid (line 20) | function invoke_diiiid(index,a1,a2,a3,a4,a5){try{return Module["dynCall_...
function invoke_diiiii (line 20) | function invoke_diiiii(index,a1,a2,a3,a4,a5){try{return Module["dynCall_...
function invoke_diiiiii (line 20) | function invoke_diiiiii(index,a1,a2,a3,a4,a5,a6){try{return Module["dynC...
function invoke_diiiiiii (line 20) | function invoke_diiiiiii(index,a1,a2,a3,a4,a5,a6,a7){try{return Module["...
function invoke_diiiiiiii (line 20) | function invoke_diiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8){try{return Modu...
function invoke_fii (line 20) | function invoke_fii(index,a1,a2){try{return Module["dynCall_fii"](index,...
function invoke_fiii (line 20) | function invoke_fiii(index,a1,a2,a3){try{return Module["dynCall_fiii"](i...
function invoke_fiiii (line 20) | function invoke_fiiii(index,a1,a2,a3,a4){try{return Module["dynCall_fiii...
function invoke_fiiiii (line 20) | function invoke_fiiiii(index,a1,a2,a3,a4,a5){try{return Module["dynCall_...
function invoke_i (line 20) | function invoke_i(index){try{return Module["dynCall_i"](index)}catch(e){...
function invoke_ii (line 20) | function invoke_ii(index,a1){try{return Module["dynCall_ii"](index,a1)}c...
function invoke_iid (line 20) | function invoke_iid(index,a1,a2){try{return Module["dynCall_iid"](index,...
function invoke_iidi (line 20) | function invoke_iidi(index,a1,a2,a3){try{return Module["dynCall_iidi"](i...
function invoke_iii (line 20) | function invoke_iii(index,a1,a2){try{return Module["dynCall_iii"](index,...
function invoke_iiid (line 20) | function invoke_iiid(index,a1,a2,a3){try{return Module["dynCall_iiid"](i...
function invoke_iiidd (line 20) | function invoke_iiidd(index,a1,a2,a3,a4){try{return Module["dynCall_iiid...
function invoke_iiidi (line 20) | function invoke_iiidi(index,a1,a2,a3,a4){try{return Module["dynCall_iiid...
function invoke_iiidii (line 20) | function invoke_iiidii(index,a1,a2,a3,a4,a5){try{return Module["dynCall_...
function invoke_iiidiii (line 20) | function invoke_iiidiii(index,a1,a2,a3,a4,a5,a6){try{return Module["dynC...
function invoke_iiidiiii (line 20) | function invoke_iiidiiii(index,a1,a2,a3,a4,a5,a6,a7){try{return Module["...
function invoke_iiii (line 20) | function invoke_iiii(index,a1,a2,a3){try{return Module["dynCall_iiii"](i...
function invoke_iiiid (line 20) | function invoke_iiiid(index,a1,a2,a3,a4){try{return Module["dynCall_iiii...
function invoke_iiiif (line 20) | function invoke_iiiif(index,a1,a2,a3,a4){try{return Module["dynCall_iiii...
function invoke_iiiii (line 20) | function invoke_iiiii(index,a1,a2,a3,a4){try{return Module["dynCall_iiii...
function invoke_iiiiid (line 20) | function invoke_iiiiid(index,a1,a2,a3,a4,a5){try{return Module["dynCall_...
function invoke_iiiiii (line 20) | function invoke_iiiiii(index,a1,a2,a3,a4,a5){try{return Module["dynCall_...
function invoke_iiiiiid (line 20) | function invoke_iiiiiid(index,a1,a2,a3,a4,a5,a6){try{return Module["dynC...
function invoke_iiiiiii (line 20) | function invoke_iiiiiii(index,a1,a2,a3,a4,a5,a6){try{return Module["dynC...
function invoke_iiiiiiii (line 20) | function invoke_iiiiiiii(index,a1,a2,a3,a4,a5,a6,a7){try{return Module["...
function invoke_iiiiiiiididiii (line 20) | function invoke_iiiiiiiididiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,...
function invoke_iiiiiiiii (line 20) | function invoke_iiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8){try{return Modu...
function invoke_iiiiiiiiiiiii (line 20) | function invoke_iiiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a...
function invoke_iiiiij (line 20) | function invoke_iiiiij(index,a1,a2,a3,a4,a5,a6){try{return Module["dynCa...
function invoke_ji (line 20) | function invoke_ji(index,a1){try{return Module["dynCall_ji"](index,a1)}c...
function invoke_jii (line 20) | function invoke_jii(index,a1,a2){try{return Module["dynCall_jii"](index,...
function invoke_jiii (line 20) | function invoke_jiii(index,a1,a2,a3){try{return Module["dynCall_jiii"](i...
function invoke_jiiii (line 20) | function invoke_jiiii(index,a1,a2,a3,a4){try{return Module["dynCall_jiii...
function invoke_v (line 20) | function invoke_v(index){try{Module["dynCall_v"](index)}catch(e){if(type...
function invoke_vdii (line 20) | function invoke_vdii(index,a1,a2,a3){try{Module["dynCall_vdii"](index,a1...
function invoke_vdiii (line 20) | function invoke_vdiii(index,a1,a2,a3,a4){try{Module["dynCall_vdiii"](ind...
function invoke_vi (line 20) | function invoke_vi(index,a1){try{Module["dynCall_vi"](index,a1)}catch(e)...
function invoke_vid (line 20) | function invoke_vid(index,a1,a2){try{Module["dynCall_vid"](index,a1,a2)}...
function invoke_vidi (line 20) | function invoke_vidi(index,a1,a2,a3){try{Module["dynCall_vidi"](index,a1...
function invoke_vididdi (line 20) | function invoke_vididdi(index,a1,a2,a3,a4,a5,a6){try{Module["dynCall_vid...
function invoke_vididdii (line 20) | function invoke_vididdii(index,a1,a2,a3,a4,a5,a6,a7){try{Module["dynCall...
function invoke_vidii (line 20) | function invoke_vidii(index,a1,a2,a3,a4){try{Module["dynCall_vidii"](ind...
function invoke_vidiii (line 20) | function invoke_vidiii(index,a1,a2,a3,a4,a5){try{Module["dynCall_vidiii"...
function invoke_vifi (line 20) | function invoke_vifi(index,a1,a2,a3){try{Module["dynCall_vifi"](index,a1...
function invoke_vii (line 20) | function invoke_vii(index,a1,a2){try{Module["dynCall_vii"](index,a1,a2)}...
function invoke_viid (line 20) | function invoke_viid(index,a1,a2,a3){try{Module["dynCall_viid"](index,a1...
function invoke_viidd (line 20) | function invoke_viidd(index,a1,a2,a3,a4){try{Module["dynCall_viidd"](ind...
function invoke_viiddi (line 20) | function invoke_viiddi(index,a1,a2,a3,a4,a5){try{Module["dynCall_viiddi"...
function invoke_viiddid (line 20) | function invoke_viiddid(index,a1,a2,a3,a4,a5,a6){try{Module["dynCall_vii...
function invoke_viiddidd (line 20) | function invoke_viiddidd(index,a1,a2,a3,a4,a5,a6,a7){try{Module["dynCall...
function invoke_viiddiddd (line 20) | function invoke_viiddiddd(index,a1,a2,a3,a4,a5,a6,a7,a8){try{Module["dyn...
function invoke_viiddidddd (line 20) | function invoke_viiddidddd(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){try{Module[...
function invoke_viiddii (line 20) | function invoke_viiddii(index,a1,a2,a3,a4,a5,a6){try{Module["dynCall_vii...
function invoke_viiddiii (line 20) | function invoke_viiddiii(index,a1,a2,a3,a4,a5,a6,a7){try{Module["dynCall...
function invoke_viidi (line 20) | function invoke_viidi(index,a1,a2,a3,a4){try{Module["dynCall_viidi"](ind...
function invoke_viididdi (line 20) | function invoke_viididdi(index,a1,a2,a3,a4,a5,a6,a7){try{Module["dynCall...
function invoke_viididdii (line 20) | function invoke_viididdii(index,a1,a2,a3,a4,a5,a6,a7,a8){try{Module["dyn...
function invoke_viididi (line 20) | function invoke_viididi(index,a1,a2,a3,a4,a5,a6){try{Module["dynCall_vii...
function invoke_viididii (line 20) | function invoke_viididii(index,a1,a2,a3,a4,a5,a6,a7){try{Module["dynCall...
function invoke_viidii (line 20) | function invoke_viidii(index,a1,a2,a3,a4,a5){try{Module["dynCall_viidii"...
function invoke_viidiii (line 20) | function invoke_viidiii(index,a1,a2,a3,a4,a5,a6){try{Module["dynCall_vii...
function invoke_viidiiid (line 20) | function invoke_viidiiid(index,a1,a2,a3,a4,a5,a6,a7){try{Module["dynCall...
function invoke_viidiiii (line 20) | function invoke_viidiiii(index,a1,a2,a3,a4,a5,a6,a7){try{Module["dynCall...
function invoke_viif (line 20) | function invoke_viif(index,a1,a2,a3){try{Module["dynCall_viif"](index,a1...
function invoke_viii (line 20) | function invoke_viii(index,a1,a2,a3){try{Module["dynCall_viii"](index,a1...
function invoke_viiid (line 20) | function invoke_viiid(index,a1,a2,a3,a4){try{Module["dynCall_viiid"](ind...
function invoke_viiidd (line 20) | function invoke_viiidd(index,a1,a2,a3,a4,a5){try{Module["dynCall_viiidd"...
function invoke_viiiddd (line 20) | function invoke_viiiddd(index,a1,a2,a3,a4,a5,a6){try{Module["dynCall_vii...
function invoke_viiidddd (line 20) | function invoke_viiidddd(index,a1,a2,a3,a4,a5,a6,a7){try{Module["dynCall...
function invoke_viiiddddi (line 20) | function invoke_viiiddddi(index,a1,a2,a3,a4,a5,a6,a7,a8){try{Module["dyn...
function invoke_viiiddddii (line 20) | function invoke_viiiddddii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){try{Module[...
function invoke_viiidddi (line 20) | function invoke_viiidddi(index,a1,a2,a3,a4,a5,a6,a7){try{Module["dynCall...
function invoke_viiidddii (line 20) | function invoke_viiidddii(index,a1,a2,a3,a4,a5,a6,a7,a8){try{Module["dyn...
function invoke_viiidddiii (line 20) | function invoke_viiidddiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){try{Module[...
function invoke_viiidddiiii (line 20) | function invoke_viiidddiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){try{Mo...
function invoke_viiiddi (line 20) | function invoke_viiiddi(index,a1,a2,a3,a4,a5,a6){try{Module["dynCall_vii...
function invoke_viiiddid (line 20) | function invoke_viiiddid(index,a1,a2,a3,a4,a5,a6,a7){try{Module["dynCall...
function invoke_viiiddidd (line 20) | function invoke_viiiddidd(index,a1,a2,a3,a4,a5,a6,a7,a8){try{Module["dyn...
function invoke_viiiddiddd (line 20) | function invoke_viiiddiddd(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){try{Module[...
function invoke_viiiddidddd (line 20) | function invoke_viiiddidddd(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){try{Mo...
function invoke_viiiddii (line 20) | function invoke_viiiddii(index,a1,a2,a3,a4,a5,a6,a7){try{Module["dynCall...
function invoke_viiiddiii (line 20) | function invoke_viiiddiii(index,a1,a2,a3,a4,a5,a6,a7,a8){try{Module["dyn...
function invoke_viiiddiiid (line 20) | function invoke_viiiddiiid(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){try{Module[...
function invoke_viiiddiiii (line 20) | function invoke_viiiddiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){try{Module[...
function invoke_viiiddiiiid (line 20) | function invoke_viiiddiiiid(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){try{Mo...
function invoke_viiidi (line 20) | function invoke_viiidi(index,a1,a2,a3,a4,a5){try{Module["dynCall_viiidi"...
function invoke_viiididi (line 20) | function invoke_viiididi(index,a1,a2,a3,a4,a5,a6,a7){try{Module["dynCall...
function invoke_viiididii (line 20) | function invoke_viiididii(index,a1,a2,a3,a4,a5,a6,a7,a8){try{Module["dyn...
function invoke_viiidii (line 20) | function invoke_viiidii(index,a1,a2,a3,a4,a5,a6){try{Module["dynCall_vii...
function invoke_viiidiiddi (line 20) | function invoke_viiidiiddi(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){try{Module[...
function invoke_viiidiii (line 20) | function invoke_viiidiii(index,a1,a2,a3,a4,a5,a6,a7){try{Module["dynCall...
function invoke_viiidiiid (line 20) | function invoke_viiidiiid(index,a1,a2,a3,a4,a5,a6,a7,a8){try{Module["dyn...
function invoke_viiidiiii (line 20) | function invoke_viiidiiii(index,a1,a2,a3,a4,a5,a6,a7,a8){try{Module["dyn...
function invoke_viiidiiiidi (line 20) | function invoke_viiidiiiidi(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){try{Mo...
function invoke_viiif (line 20) | function invoke_viiif(index,a1,a2,a3,a4){try{Module["dynCall_viiif"](ind...
function invoke_viiii (line 20) | function invoke_viiii(index,a1,a2,a3,a4){try{Module["dynCall_viiii"](ind...
function invoke_viiiid (line 20) | function invoke_viiiid(index,a1,a2,a3,a4,a5){try{Module["dynCall_viiiid"...
function invoke_viiiidd (line 20) | function invoke_viiiidd(index,a1,a2,a3,a4,a5,a6){try{Module["dynCall_vii...
function invoke_viiiiddd (line 20) | function invoke_viiiiddd(index,a1,a2,a3,a4,a5,a6,a7){try{Module["dynCall...
function invoke_viiiidddd (line 20) | function invoke_viiiidddd(index,a1,a2,a3,a4,a5,a6,a7,a8){try{Module["dyn...
function invoke_viiiiddddi (line 20) | function invoke_viiiiddddi(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){try{Module[...
function invoke_viiiiddddii (line 20) | function invoke_viiiiddddii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){try{Mo...
function invoke_viiiidddi (line 20) | function invoke_viiiidddi(index,a1,a2,a3,a4,a5,a6,a7,a8){try{Module["dyn...
function invoke_viiiidddii (line 20) | function invoke_viiiidddii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){try{Module[...
function invoke_viiiidddiii (line 20) | function invoke_viiiidddiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){try{Mo...
function invoke_viiiidddiiii (line 20) | function invoke_viiiidddiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11){t...
function invoke_viiiiddi (line 20) | function invoke_viiiiddi(index,a1,a2,a3,a4,a5,a6,a7){try{Module["dynCall...
function invoke_viiiiddii (line 20) | function invoke_viiiiddii(index,a1,a2,a3,a4,a5,a6,a7,a8){try{Module["dyn...
function invoke_viiiiddiii (line 20) | function invoke_viiiiddiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){try{Module[...
function invoke_viiiiddiiid (line 20) | function invoke_viiiiddiiid(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){try{Mo...
function invoke_viiiiddiiii (line 20) | function invoke_viiiiddiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){try{Mo...
function invoke_viiiiddiiiid (line 20) | function invoke_viiiiddiiiid(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11){t...
function invoke_viiiidi (line 20) | function invoke_viiiidi(index,a1,a2,a3,a4,a5,a6){try{Module["dynCall_vii...
function invoke_viiiidii (line 20) | function invoke_viiiidii(index,a1,a2,a3,a4,a5,a6,a7){try{Module["dynCall...
function invoke_viiiidiid (line 20) | function invoke_viiiidiid(index,a1,a2,a3,a4,a5,a6,a7,a8){try{Module["dyn...
function invoke_viiiidiidd (line 20) | function invoke_viiiidiidd(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){try{Module[...
function invoke_viiiidiiddi (line 20) | function invoke_viiiidiiddi(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){try{Mo...
function invoke_viiiidiii (line 20) | function invoke_viiiidiii(index,a1,a2,a3,a4,a5,a6,a7,a8){try{Module["dyn...
function invoke_viiiidiiii (line 20) | function invoke_viiiidiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){try{Module[...
function invoke_viiiidiiiidi (line 20) | function invoke_viiiidiiiidi(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11){t...
function invoke_viiiif (line 20) | function invoke_viiiif(index,a1,a2,a3,a4,a5){try{Module["dynCall_viiiif"...
function invoke_viiiii (line 20) | function invoke_viiiii(index,a1,a2,a3,a4,a5){try{Module["dynCall_viiiii"...
function invoke_viiiiid (line 20) | function invoke_viiiiid(index,a1,a2,a3,a4,a5,a6){try{Module["dynCall_vii...
function invoke_viiiiidd (line 20) | function invoke_viiiiidd(index,a1,a2,a3,a4,a5,a6,a7){try{Module["dynCall...
function invoke_viiiiiddi (line 20) | function invoke_viiiiiddi(index,a1,a2,a3,a4,a5,a6,a7,a8){try{Module["dyn...
function invoke_viiiiidi (line 20) | function invoke_viiiiidi(index,a1,a2,a3,a4,a5,a6,a7){try{Module["dynCall...
function invoke_viiiiidii (line 20) | function invoke_viiiiidii(index,a1,a2,a3,a4,a5,a6,a7,a8){try{Module["dyn...
function invoke_viiiiidiid (line 20) | function invoke_viiiiidiid(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){try{Module[...
function invoke_viiiiidiidd (line 20) | function invoke_viiiiidiidd(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){try{Mo...
function invoke_viiiiidiiddi (line 20) | function invoke_viiiiidiiddi(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11){t...
function invoke_viiiiidiii (line 20) | function invoke_viiiiidiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){try{Module[...
function invoke_viiiiidiiii (line 20) | function invoke_viiiiidiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){try{Mo...
function invoke_viiiiidiiiii (line 20) | function invoke_viiiiidiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11){t...
function invoke_viiiiii (line 20) | function invoke_viiiiii(index,a1,a2,a3,a4,a5,a6){try{Module["dynCall_vii...
function invoke_viiiiiid (line 20) | function invoke_viiiiiid(index,a1,a2,a3,a4,a5,a6,a7){try{Module["dynCall...
function invoke_viiiiiidd (line 20) | function invoke_viiiiiidd(index,a1,a2,a3,a4,a5,a6,a7,a8){try{Module["dyn...
function invoke_viiiiiiddi (line 20) | function invoke_viiiiiiddi(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){try{Module[...
function invoke_viiiiiidi (line 20) | function invoke_viiiiiidi(index,a1,a2,a3,a4,a5,a6,a7,a8){try{Module["dyn...
function invoke_viiiiiidii (line 20) | function invoke_viiiiiidii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){try{Module[...
function invoke_viiiiiidiii (line 20) | function invoke_viiiiiidiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){try{Mo...
function invoke_viiiiiidiiii (line 20) | function invoke_viiiiiidiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11){t...
function invoke_viiiiiidiiiii (line 20) | function invoke_viiiiiidiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a...
function invoke_viiiiiii (line 20) | function invoke_viiiiiii(index,a1,a2,a3,a4,a5,a6,a7){try{Module["dynCall...
function invoke_viiiiiiid (line 20) | function invoke_viiiiiiid(index,a1,a2,a3,a4,a5,a6,a7,a8){try{Module["dyn...
function invoke_viiiiiiidd (line 20) | function invoke_viiiiiiidd(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){try{Module[...
function invoke_viiiiiiiddi (line 20) | function invoke_viiiiiiiddi(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){try{Mo...
function invoke_viiiiiiidi (line 20) | function invoke_viiiiiiidi(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){try{Module[...
function invoke_viiiiiiii (line 20) | function invoke_viiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8){try{Module["dyn...
function invoke_viiiiiiiii (line 20) | function invoke_viiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){try{Module[...
function invoke_viiiiiiiiidd (line 20) | function invoke_viiiiiiiiidd(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11){t...
function invoke_viiiiiiiiii (line 20) | function invoke_viiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){try{Mo...
function invoke_viiiiiiiiiid (line 20) | function invoke_viiiiiiiiiid(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11){t...
function invoke_viiiiiiiiiiddi (line 20) | function invoke_viiiiiiiiiiddi(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,...
function invoke_viiiiiiiiiii (line 20) | function invoke_viiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11){t...
function invoke_viiiiiiiiiiid (line 20) | function invoke_viiiiiiiiiiid(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a...
function invoke_viiiij (line 20) | function invoke_viiiij(index,a1,a2,a3,a4,a5,a6){try{Module["dynCall_viii...
function invoke_viiij (line 20) | function invoke_viiij(index,a1,a2,a3,a4,a5){try{Module["dynCall_viiij"](...
function invoke_viijii (line 20) | function invoke_viijii(index,a1,a2,a3,a4,a5,a6){try{Module["dynCall_viij...
function invoke_viji (line 20) | function invoke_viji(index,a1,a2,a3,a4){try{Module["dynCall_viji"](index...
function ExitStatus (line 20) | function ExitStatus(status){this.name="ExitStatus";this.message="Program...
function run (line 20) | function run(args){args=args||Module["arguments"];if(runDependencies>0){...
function exit (line 20) | function exit(status,implicit){if(implicit&&Module["noExitRuntime"]&&sta...
function abort (line 20) | function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(wh...
function Range (line 20) | function Range(start,end){this.start=typeof start==="undefined"?0:start;...
function Point (line 20) | function Point(x,y){this.x=typeof x==="undefined"?0:x;this.y=typeof y===...
function Size (line 20) | function Size(width,height){this.width=typeof width==="undefined"?0:widt...
function Rect (line 20) | function Rect(){switch(arguments.length){case 0:{this.x=0;this.y=0;this....
function RotatedRect (line 20) | function RotatedRect(){switch(arguments.length){case 0:{this.center={x:0...
function Scalar (line 20) | function Scalar(v0,v1,v2,v3){this.push(typeof v0==="undefined"?0:v0);thi...
function MinMaxLoc (line 20) | function MinMaxLoc(){switch(arguments.length){case 0:{this.minVal=0;this...
function Circle (line 20) | function Circle(){switch(arguments.length){case 0:{this.center=new Point...
function TermCriteria (line 20) | function TermCriteria(){switch(arguments.length){case 0:{this.type=0;thi...
FILE: examples/opencv-face/worker.js
function loadFaceDetectTrainingSet (line 84) | function loadFaceDetectTrainingSet() {
function loadEyesDetectTrainingSet (line 92) | function loadEyesDetectTrainingSet() {
function faceDetect (line 100) | function faceDetect(img_gray, roiRect) {
function eyesDetect (line 132) | function eyesDetect(img_gray) {
function createCVMat2 (line 196) | function createCVMat2(rotation, buffer, pixelFormat) {
FILE: examples/simplecv/webxr-worker.js
function defineProperties (line 93) | function defineProperties(target, props) { for (var i = 0; i < props.len...
function _classCallCheck (line 95) | function _classCallCheck(instance, Constructor) { if (!(instance instanc...
function XRVideoFrame (line 104) | function XRVideoFrame(buffers, pixelFormat, timestamp, camera) {
FILE: polyfill/Reality.js
class Reality (line 6) | class Reality extends EventHandlerBase {
method constructor (line 7) | constructor(xr, name, isShared, isPassthrough){
method name (line 16) | get name(){ return this._name }
method isShared (line 18) | get isShared(){ return this._isShared }
method isPassthrough (line 20) | get isPassthrough(){ return this._isPassthrough }
method getCoordinateSystem (line 22) | getCoordinateSystem(...types){
method _start (line 30) | _start(parameters){
method _stop (line 37) | _stop(){
method _requestVideoFrame (line 44) | _requestVideoFrame() {
method _stopVideoFrames (line 50) | _stopVideoFrames() {
method _startVideoFrames (line 53) | _startVideoFrames() {
method _handleNewFrame (line 59) | _handleNewFrame(){}
method _addAnchor (line 64) | _addAnchor(anchor, display){
method _findAnchor (line 74) | _findAnchor(normalizedScreenX, normalizedScreenY, display){
method _createImageAnchor (line 78) | _createImageAnchor(uid, buffer, width, height, physicalWidthInMeters) {
method activateDetectionImage (line 82) | activateDetectionImage(uid, display) {
method _findFloorAnchor (line 90) | _findFloorAnchor(display, uid=null){
method _getAnchor (line 94) | _getAnchor(uid){
method _removeAnchor (line 98) | _removeAnchor(uid){
method _hitTestNoAnchor (line 103) | _hitTestNoAnchor(normalizedScreenX, normalizedScreenY, display){
method _getLightAmbientIntensity (line 107) | _getLightAmbientIntensity(){
method _getWorldMap (line 111) | _getWorldMap() {
method _setWorldMap (line 115) | _setWorldMap(worldMap) {
method _getWorldMappingStatus (line 119) | _getWorldMappingStatus() {
FILE: polyfill/XRAnchor.js
class XRAnchor (line 6) | class XRAnchor {
method constructor (line 7) | constructor(xrCoordinateSystem, uid=null){
method uid (line 12) | get uid(){ return this._uid }
method coordinateSystem (line 14) | get coordinateSystem(){ return this._coordinateSystem }
method _generateUID (line 16) | static _generateUID(){
FILE: polyfill/XRAnchorOffset.js
class XRAnchorOffset (line 9) | class XRAnchorOffset {
method constructor (line 10) | constructor(anchorUID, poseMatrix=null){
method setIdentityOffset (line 16) | setIdentityOffset() {
method anchorUID (line 24) | get anchorUID(){ return this._anchorUID }
method poseMatrix (line 29) | get poseMatrix(){ return this._poseMatrix }
method poseMatrix (line 31) | set poseMatrix(array16){
method position (line 40) | get position(){
method orientation (line 47) | get orientation(){
method getOffsetTransform (line 56) | getOffsetTransform(coordinateSystem){
FILE: polyfill/XRCoordinateSystem.js
class XRCoordinateSystem (line 15) | class XRCoordinateSystem {
method constructor (line 16) | constructor(display, type){
method getTransformTo (line 24) | getTransformTo(otherCoordinateSystem){
method _relativeMatrix (line 35) | get _relativeMatrix(){ return this.__relativeMatrix }
method _relativeMatrix (line 37) | set _relativeMatrix(value){
method _poseModelMatrix (line 43) | get _poseModelMatrix(){
FILE: polyfill/XRDisplay.js
class XRDisplay (line 15) | class XRDisplay extends EventHandlerBase {
method constructor (line 16) | constructor(xr, displayName, isExternal, reality){
method displayName (line 40) | get displayName(){ return this._displayName }
method isExternal (line 42) | get isExternal(){ return this._isExternal }
method supportsSession (line 44) | supportsSession(parameters){
method requestSession (line 50) | requestSession(parameters){
method _requestVideoFrame (line 65) | _requestVideoFrame() {}
method _requestAnimationFrame (line 67) | _requestAnimationFrame(callback){
method _cancelAnimationFrame (line 71) | _cancelAnimationFrame(handle){
method _createSession (line 75) | _createSession(parameters){
method _supportedCreationParameters (line 79) | _supportedCreationParameters(parameters){
method _handleNewFrame (line 87) | _handleNewFrame(frame){}
method _handleAfterFrame (line 93) | _handleAfterFrame(frame){}
method _handleNewBaseLayer (line 99) | _handleNewBaseLayer(baseLayer){}
FILE: polyfill/XRFaceAnchor.js
class XRFaceAnchor (line 6) | class XRFaceAnchor extends XRAnchor {
method constructor (line 7) | constructor(coordinateSystem, uid=null, geometry, blendShapeArray) {
method updateBlendShapes (line 14) | updateBlendShapes(blendShapeArray) {
FILE: polyfill/XRFieldOfView.js
class XRFieldOfView (line 4) | class XRFieldOfView {
method constructor (line 5) | constructor(upDegrees, downDegrees, leftDegrees, rightDegrees){
method upDegrees (line 12) | get upDegrees(){ return this._upDegrees }
method downDegrees (line 13) | get downDegrees(){ return this._downDegrees }
method leftDegrees (line 14) | get leftDegrees(){ return this._leftDegrees }
method rightDegrees (line 15) | get rightDegrees(){ return this._rightDegrees }
FILE: polyfill/XRImageAnchor.js
class XRImageAnchor (line 6) | class XRImageAnchor extends XRAnchor {
method constructor (line 7) | constructor(coordinateSystem, uid=null) {
FILE: polyfill/XRLayer.js
class XRLayer (line 6) | class XRLayer extends EventHandlerBase {
FILE: polyfill/XRLightEstimate.js
class XRLightEstimate (line 4) | class XRLightEstimate {
method constructor (line 5) | constructor(){
method ambientIntensity (line 9) | set ambientIntensity(value){
method ambientIntensity (line 14) | get ambientIntensity(){
method getAmbientColorTemperature (line 19) | getAmbientColorTemperature(){
FILE: polyfill/XRPlaneAnchor.js
class XRPlaneAnchor (line 6) | class XRPlaneAnchor extends XRAnchor {
method constructor (line 7) | constructor(coordinateSystem, uid=null, center, extent, alignment, geo...
method width (line 15) | get width(){
method length (line 20) | get length(){
FILE: polyfill/XRPointCloud.js
class XRPointCloud (line 5) | class XRPointCloud {
method points (line 6) | get points(){
FILE: polyfill/XRPolyfill.js
class XRPolyfill (line 35) | class XRPolyfill extends EventHandlerBase {
method constructor (line 36) | constructor(){
method getDisplays (line 131) | getDisplays(){
FILE: polyfill/XRPresentationFrame.js
class XRPresentationFrame (line 8) | class XRPresentationFrame {
method constructor (line 9) | constructor(session, timestamp){
method session (line 14) | get session(){ return this._session }
method views (line 16) | get views(){
method hasPointCloud (line 21) | get hasPointCloud(){
method pointCloud (line 26) | get pointCloud(){
method hasLightEstimate (line 31) | get hasLightEstimate(){
method lightEstimate (line 36) | get lightEstimate(){
method timestamp (line 41) | get timestamp () {
method anchors (line 47) | get anchors(){
method addAnchor (line 59) | addAnchor(coordinateSystem, position=[0,0,0], orientation=[0,0,0,1],ui...
method findAnchor (line 69) | findAnchor(normalizedScreenX, normalizedScreenY, options=null){
method hitTestNoAnchor (line 74) | hitTestNoAnchor(normalizedScreenX, normalizedScreenY){
method findFloorAnchor (line 83) | findFloorAnchor(uid=null){
method removeAnchor (line 88) | removeAnchor(uid){
method getAnchor (line 96) | getAnchor(uid){
method getCoordinateSystem (line 101) | getCoordinateSystem(...types){
method getDisplayPose (line 106) | getDisplayPose(coordinateSystem){
FILE: polyfill/XRSession.js
class XRSession (line 14) | class XRSession extends EventHandlerBase {
method constructor (line 15) | constructor(xr, display, createParameters){
method display (line 37) | get display(){ return this._display }
method createParameters (line 39) | get createParameters(){ return this._parameters }
method realities (line 41) | get realities(){ return this._xr._sharedRealities }
method reality (line 43) | get reality(){ return this._display._reality }
method baseLayer (line 45) | get baseLayer(){
method baseLayer (line 49) | set baseLayer(value){
method depthNear (line 54) | get depthNear(){ this._display._depthNear }
method depthNear (line 55) | set depthNear(value){ this._display._depthNear = value }
method depthFar (line 57) | get depthFar(){ this._display._depthFar }
method depthFar (line 58) | set depthFar(value){ this._display._depthFar = value }
method hasStageBounds (line 60) | get hasStageBounds(){ this._stageBounds !== null }
method stageBounds (line 62) | get stageBounds(){ return this._stageBounds }
method requestFrame (line 64) | requestFrame(callback){
method _handleRequestFrame (line 72) | _handleRequestFrame(callback) {
method cancelFrame (line 89) | cancelFrame(handle){
method end (line 93) | end(){
method _updateCameraAnchor (line 106) | _updateCameraAnchor(frame) {
method _transformToCameraAnchor (line 126) | _transformToCameraAnchor(camera) {
method setVideoFrameHandler (line 146) | setVideoFrameHandler(callback) {
method getVideoFramePose (line 171) | getVideoFramePose(videoFrame, poseOut)
method hitTest (line 199) | hitTest(normalizedScreenX, normalizedScreenY, options=null){
method requestVideoFrame (line 204) | requestVideoFrame() {
method stopVideoFrames (line 208) | stopVideoFrames() {
method startVideoFrames (line 212) | startVideoFrames() {
method _createPresentationFrame (line 216) | _createPresentationFrame(timestamp){
method _getCoordinateSystem (line 220) | _getCoordinateSystem(...types){
method createImageAnchor (line 238) | createImageAnchor(uid, buffer, width, height, physicalWidthInMeters) {
method activateDetectionImage (line 242) | activateDetectionImage(uid) {
method _handleNewWorldAnchor (line 246) | _handleNewWorldAnchor(event) {
method _handleUpdateWorldAnchor (line 269) | _handleUpdateWorldAnchor(event) {
method _handleRemoveWorldAnchor (line 288) | _handleRemoveWorldAnchor(event) {
method _handleTrackingChanged (line 307) | _handleTrackingChanged(event) {
method getWorldMap (line 323) | getWorldMap() {
method setWorldMap (line 327) | setWorldMap(worldMap) {
method getWorldMappingStatus (line 331) | getWorldMappingStatus() {
FILE: polyfill/XRSessionCreateParameters.js
class XRSessionCreateParameters (line 4) | class XRSessionCreateParameters {
method exclusive (line 5) | get exclusive(){
method type (line 10) | get type(){
FILE: polyfill/XRStageBounds.js
class XRStageBounds (line 6) | class XRStageBounds {
method center (line 7) | get center(){
method geometry (line 12) | get geometry(){
FILE: polyfill/XRStageBoundsPoint.js
class XRStageBoundsPoint (line 4) | class XRStageBoundsPoint {
method x (line 5) | get x(){
method y (line 10) | get y(){
FILE: polyfill/XRVideoFrame.js
class XRVideoFrame (line 70) | class XRVideoFrame {
method constructor (line 71) | constructor(buffers, pixelFormat, timestamp, camera){
method createFromMessage (line 113) | static createFromMessage (event) {
method numBuffers (line 117) | numBuffers() {this._buffers.length}
method buffer (line 119) | buffer(index) {
method pixelFormat (line 139) | get pixelFormat(){ return this._pixelFormat }
method timestamp (line 140) | get timestamp(){ return this._timestamp }
method camera (line 141) | get camera(){ return this._camera }
method release (line 143) | release () {
method postMessageToWorker (line 160) | postMessageToWorker (worker, options) {
method postReplyMessage (line 183) | postReplyMessage (options) {
FILE: polyfill/XRView.js
class XRView (line 8) | class XRView {
method constructor (line 9) | constructor(fov, depthNear, depthFar, eye=null){
method fov (line 20) | set fov ( value ) {
method eye (line 25) | get eye(){ return this._eye }
method projectionMatrix (line 27) | get projectionMatrix(){ return this._projectionMatrix }
method setProjectionMatrix (line 29) | setProjectionMatrix(array16){
method viewMatrix (line 35) | get viewMatrix(){ return this._viewMatrix }
method setViewMatrix (line 37) | setViewMatrix(array16){
method getViewport (line 43) | getViewport(layer){
FILE: polyfill/XRViewPose.js
class XRViewPose (line 8) | class XRViewPose {
method constructor (line 9) | constructor(position=[0, 0, 0], orientation=[0, 0, 0, 1]){
method poseModelMatrix (line 14) | get poseModelMatrix(){ return this._poseModelMatrix }
method _setPoseModelMatrix (line 16) | _setPoseModelMatrix(array16){
method _position (line 22) | get _position(){
method _position (line 26) | set _position(array3){
method _orientation (line 32) | get _orientation(){
method _orientation (line 38) | set _orientation(array4){
method _translate (line 42) | _translate(array3){
method getViewMatrix (line 48) | getViewMatrix(view, out=null){
FILE: polyfill/XRViewport.js
class XRViewport (line 4) | class XRViewport {
method constructor (line 5) | constructor(x, y, width, height){
method x (line 12) | get x(){ return this._x }
method x (line 13) | set x(value) { this._x = value }
method y (line 15) | get y(){ return this._y }
method y (line 16) | set y(value) { this._y = value }
method width (line 18) | get width(){ return this._width }
method width (line 19) | set width(value) { this._width = value }
method height (line 21) | get height(){ return this._height }
method height (line 22) | set height(value) { this._height = value }
FILE: polyfill/XRWebGLLayer.js
class XRWebGLLayer (line 6) | class XRWebGLLayer extends XRLayer {
method constructor (line 7) | constructor(session, context){
method context (line 16) | get context(){ return this._context }
method antialias (line 18) | get antialias(){
method depth (line 23) | get depth(){
method stencil (line 28) | get stencil(){
method alpha (line 33) | get alpha(){
method multiview (line 38) | get multiview(){
method framebuffer (line 43) | get framebuffer(){
method framebufferWidth (line 47) | set framebufferWidth(w){
method framebufferWidth (line 52) | get framebufferWidth(){
method framebufferHeight (line 59) | set framebufferHeight(h){
method framebufferHeight (line 64) | get framebufferHeight(){
method requestViewportScaling (line 71) | requestViewportScaling(viewportScaleFactor){
FILE: polyfill/XRWorkerPolyfill.js
class XRWorkerPolyfill (line 14) | class XRWorkerPolyfill extends EventHandlerBase {
method constructor (line 15) | constructor(){
FILE: polyfill/display/FlatDisplay.js
class FlatDisplay (line 24) | class FlatDisplay extends XRDisplay {
method constructor (line 25) | constructor(xr, reality){
method _start (line 49) | _start(parameters=null){
method _stop (line 96) | _stop(){
method _fixFov (line 103) | _fixFov (width, height, focalLength) {
method _handleWindowResize (line 122) | _handleWindowResize(ev){
method _handleNewWorldAnchor (line 126) | _handleNewWorldAnchor(event) {
method _handleUpdateWorldAnchor (line 170) | _handleUpdateWorldAnchor(event) {
method _handleRemoveWorldAnchor (line 190) | _handleRemoveWorldAnchor(event) {
method _handleNewBaseLayer (line 214) | _handleNewBaseLayer(baseLayer){
method _handleNewFrame (line 236) | _handleNewFrame(frame){
method _updateFromVRDevice (line 242) | _updateFromVRDevice(){
method _updateFromDeviceOrientationTracker (line 254) | _updateFromDeviceOrientationTracker(){
method _handleARKitUpdate (line 265) | _handleARKitUpdate(...params){
method _handleARKitInit (line 284) | _handleARKitInit(ev){
method _handleARKitWindowResize (line 297) | _handleARKitWindowResize(ev){
method _handleOnError (line 302) | _handleOnError(ev){
method _handleArTrackingChanged (line 309) | _handleArTrackingChanged(ev){
method _handleComputerVisionData (line 336) | _handleComputerVisionData(ev) {
method _requestVideoFrame (line 353) | _requestVideoFrame() {
method _stopVideoFrames (line 363) | _stopVideoFrames() {
method _startVideoFrames (line 373) | _startVideoFrames() {
method _createSession (line 383) | _createSession(parameters=null){
method _supportedCreationParameters (line 395) | _supportedCreationParameters(parameters){
FILE: polyfill/display/HeadMountedDisplay.js
class HeadMountedDisplay (line 16) | class HeadMountedDisplay extends XRDisplay {
method constructor (line 17) | constructor(xr, reality, vrDisplay){
method _requestAnimationFrame (line 36) | _requestAnimationFrame(callback){
method _handleNewBaseLayer (line 48) | _handleNewBaseLayer(baseLayer){
method _stop (line 67) | _stop(){
method _handleNewFrame (line 77) | _handleNewFrame(frame){
method _handleAfterFrame (line 83) | _handleAfterFrame(frame){
method _supportedCreationParameters (line 89) | _supportedCreationParameters(parameters){
method _updateFromVRFrameData (line 93) | _updateFromVRFrameData(){
FILE: polyfill/fill/DeviceOrientationTracker.js
class DeviceOrientationTracker (line 10) | class DeviceOrientationTracker extends EventHandlerBase {
method constructor (line 11) | constructor(){
method getOrientation (line 36) | getOrientation(outQuaternion){
FILE: polyfill/fill/Euler.js
class Euler (line 2) | class Euler {
method constructor (line 3) | constructor(x, y, z, order=Euler.DefaultOrder){
method set (line 10) | set(x, y, z, order=Euler.DefaultOrder){
method toArray (line 17) | toArray(){
FILE: polyfill/fill/EventHandlerBase.js
class EventHandlerBase (line 4) | class EventHandlerBase {
method constructor (line 5) | constructor(){
method addEventListener (line 9) | addEventListener(type, listener){
method removeEventListener (line 18) | removeEventListener(type, listener){
method dispatchEvent (line 31) | dispatchEvent(event){
FILE: polyfill/fill/MatrixMath.js
class MatrixMath (line 9) | class MatrixMath {
method mat4_generateIdentity (line 12) | static mat4_generateIdentity(){
method mat4_get_position (line 21) | static mat4_get_position(out, m){
method mat4_get_rotation (line 28) | static mat4_get_rotation(out, m){
method mat4_eyeView (line 38) | static mat4_eyeView(out, poseModelMatrix, offset=new Float32Array([0, ...
method mat4_perspectiveFromFieldOfView (line 43) | static mat4_perspectiveFromFieldOfView(out, fov, near, far) {
method mat4_fromRotationTranslation (line 71) | static mat4_fromRotationTranslation(out, q=[0,0,0,1], v=[0,0,0]) {
method mat4_translate (line 111) | static mat4_translate(out, a, v) {
method mat4_invert (line 145) | static mat4_invert(out, a) {
method mat4_multiply (line 192) | static mat4_multiply(out, ae, be){
FILE: polyfill/fill/Quaternion.js
class Quaternion (line 6) | class Quaternion{
method constructor (line 7) | constructor(x=0, y=0, z=0, w=1){
method set (line 14) | set(x, y, z, w){
method toArray (line 22) | toArray(){
method copy (line 26) | copy(quaternion){
method setFromRotationMatrix (line 34) | setFromRotationMatrix(array16){
method setFromEuler (line 73) | setFromEuler(x, y, z, order='XYZ'){
method setFromAxisAngle (line 120) | setFromAxisAngle(axis, angle){
method multiply (line 132) | multiply(q){
method multiplyQuaternions (line 136) | multiplyQuaternions(a, b){
method inverse (line 147) | inverse(){
method normalize (line 155) | normalize(){
method slerp (line 172) | slerp(qb, t){
FILE: polyfill/fill/Vector3.js
class Vector3 (line 6) | class Vector3 {
method constructor (line 7) | constructor(x=0, y=0, z=0){
method set (line 13) | set(x, y, z){
method copy (line 20) | copy(v){
method toArray (line 27) | toArray(){
method length (line 31) | length(){
method add (line 35) | add(x, y, z){
method normalize (line 41) | normalize(){
method multiplyScalar (line 53) | multiplyScalar(scalar){
method applyQuaternion (line 59) | applyQuaternion(q){
method applyMatrix4 (line 83) | applyMatrix4(matrix){
method dot (line 94) | dot(v){
method crossVectors (line 98) | crossVectors(a, b){
FILE: polyfill/fill/base64-binary.js
class base64 (line 36) | class base64 {
method decodeLength (line 37) | static decodeLength(input) {
method decodeArrayBuffer (line 42) | static decodeArrayBuffer(input, buffer) {
method removePaddingChars (line 53) | static removePaddingChars(input){
method decode (line 61) | static decode(input, arrayBuffer) {
method encode (line 101) | static encode(buffer) {
FILE: polyfill/fill/gl-matrix-min.js
function n (line 28) | function n(a){if(r[a])return r[a].exports;var e=r[a]={i:a,l:!1,exports:{...
function a (line 28) | function a(t){n.ARRAY_TYPE=i=t}
function e (line 28) | function e(t){return t*s}
function u (line 28) | function u(t,n){return Math.abs(t-n)<=o*Math.max(1,Math.abs(t),Math.abs(...
function a (line 28) | function a(){var t=new g.ARRAY_TYPE(9);return t[0]=1,t[1]=0,t[2]=0,t[3]=...
function e (line 28) | function e(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[4],t[4]=n[5]...
function u (line 28) | function u(t){var n=new g.ARRAY_TYPE(9);return n[0]=t[0],n[1]=t[1],n[2]=...
function o (line 28) | function o(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4]...
function i (line 28) | function i(t,n,r,a,e,u,o,i,s){var c=new g.ARRAY_TYPE(9);return c[0]=t,c[...
function s (line 28) | function s(t,n,r,a,e,u,o,i,s,c){return t[0]=n,t[1]=r,t[2]=a,t[3]=e,t[4]=...
function c (line 28) | function c(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[...
function f (line 28) | function f(t,n){if(t===n){var r=n[1],a=n[2],e=n[5];t[1]=n[3],t[2]=n[6],t...
function M (line 28) | function M(t,n){var r=n[0],a=n[1],e=n[2],u=n[3],o=n[4],i=n[5],s=n[6],c=n...
function h (line 28) | function h(t,n){var r=n[0],a=n[1],e=n[2],u=n[3],o=n[4],i=n[5],s=n[6],c=n...
function l (line 28) | function l(t){var n=t[0],r=t[1],a=t[2],e=t[3],u=t[4],o=t[5],i=t[6],s=t[7...
function v (line 28) | function v(t,n,r){var a=n[0],e=n[1],u=n[2],o=n[3],i=n[4],s=n[5],c=n[6],f...
function d (line 28) | function d(t,n,r){var a=n[0],e=n[1],u=n[2],o=n[3],i=n[4],s=n[5],c=n[6],f...
function b (line 28) | function b(t,n,r){var a=n[0],e=n[1],u=n[2],o=n[3],i=n[4],s=n[5],c=n[6],f...
function m (line 28) | function m(t,n,r){var a=r[0],e=r[1];return t[0]=a*n[0],t[1]=a*n[1],t[2]=...
function p (line 28) | function p(t,n){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=n[...
function P (line 28) | function P(t,n){var r=Math.sin(n),a=Math.cos(n);return t[0]=a,t[1]=r,t[2...
function E (line 28) | function E(t,n){return t[0]=n[0],t[1]=0,t[2]=0,t[3]=0,t[4]=n[1],t[5]=0,t...
function O (line 28) | function O(t,n){return t[0]=n[0],t[1]=n[1],t[2]=0,t[3]=n[2],t[4]=n[3],t[...
function x (line 28) | function x(t,n){var r=n[0],a=n[1],e=n[2],u=n[3],o=r+r,i=a+a,s=e+e,c=r*o,...
function A (line 28) | function A(t,n){var r=n[0],a=n[1],e=n[2],u=n[3],o=n[4],i=n[5],s=n[6],c=n...
function q (line 28) | function q(t,n,r){return t[0]=2/n,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/r,t[5]=0,...
function y (line 28) | function y(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]...
function w (line 28) | function w(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.po...
function R (line 28) | function R(t,n,r){return t[0]=n[0]+r[0],t[1]=n[1]+r[1],t[2]=n[2]+r[2],t[...
function L (line 28) | function L(t,n,r){return t[0]=n[0]-r[0],t[1]=n[1]-r[1],t[2]=n[2]-r[2],t[...
function S (line 28) | function S(t,n,r){return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=n[3]*r...
function _ (line 28) | function _(t,n,r,a){return t[0]=n[0]+r[0]*a,t[1]=n[1]+r[1]*a,t[2]=n[2]+r...
function I (line 28) | function I(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3...
function N (line 28) | function N(t,n){var r=t[0],a=t[1],e=t[2],u=t[3],o=t[4],i=t[5],s=t[6],c=t...
function a (line 28) | function a(){var t=new Z.ARRAY_TYPE(3);return t[0]=0,t[1]=0,t[2]=0,t}
function e (line 28) | function e(t){var n=new Z.ARRAY_TYPE(3);return n[0]=t[0],n[1]=t[1],n[2]=...
function u (line 28) | function u(t){var n=t[0],r=t[1],a=t[2];return Math.sqrt(n*n+r*r+a*a)}
function o (line 28) | function o(t,n,r){var a=new Z.ARRAY_TYPE(3);return a[0]=t,a[1]=n,a[2]=r,a}
function i (line 28) | function i(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t}
function s (line 28) | function s(t,n,r,a){return t[0]=n,t[1]=r,t[2]=a,t}
function c (line 28) | function c(t,n,r){return t[0]=n[0]+r[0],t[1]=n[1]+r[1],t[2]=n[2]+r[2],t}
function f (line 28) | function f(t,n,r){return t[0]=n[0]-r[0],t[1]=n[1]-r[1],t[2]=n[2]-r[2],t}
function M (line 28) | function M(t,n,r){return t[0]=n[0]*r[0],t[1]=n[1]*r[1],t[2]=n[2]*r[2],t}
function h (line 28) | function h(t,n,r){return t[0]=n[0]/r[0],t[1]=n[1]/r[1],t[2]=n[2]/r[2],t}
function l (line 28) | function l(t,n){return t[0]=Math.ceil(n[0]),t[1]=Math.ceil(n[1]),t[2]=Ma...
function v (line 28) | function v(t,n){return t[0]=Math.floor(n[0]),t[1]=Math.floor(n[1]),t[2]=...
function d (line 28) | function d(t,n,r){return t[0]=Math.min(n[0],r[0]),t[1]=Math.min(n[1],r[1...
function b (line 28) | function b(t,n,r){return t[0]=Math.max(n[0],r[0]),t[1]=Math.max(n[1],r[1...
function m (line 28) | function m(t,n){return t[0]=Math.round(n[0]),t[1]=Math.round(n[1]),t[2]=...
function p (line 28) | function p(t,n,r){return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t}
function P (line 28) | function P(t,n,r,a){return t[0]=n[0]+r[0]*a,t[1]=n[1]+r[1]*a,t[2]=n[2]+r...
function E (line 28) | function E(t,n){var r=n[0]-t[0],a=n[1]-t[1],e=n[2]-t[2];return Math.sqrt...
function O (line 28) | function O(t,n){var r=n[0]-t[0],a=n[1]-t[1],e=n[2]-t[2];return r*r+a*a+e*e}
function x (line 28) | function x(t){var n=t[0],r=t[1],a=t[2];return n*n+r*r+a*a}
function A (line 28) | function A(t,n){return t[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t}
function q (line 28) | function q(t,n){return t[0]=1/n[0],t[1]=1/n[1],t[2]=1/n[2],t}
function y (line 28) | function y(t,n){var r=n[0],a=n[1],e=n[2],u=r*r+a*a+e*e;return u>0&&(u=1/...
function w (line 28) | function w(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}
function R (line 28) | function R(t,n,r){var a=n[0],e=n[1],u=n[2],o=r[0],i=r[1],s=r[2];return t...
function L (line 28) | function L(t,n,r,a){var e=n[0],u=n[1],o=n[2];return t[0]=e+a*(r[0]-e),t[...
function S (line 28) | function S(t,n,r,a,e,u){var o=u*u,i=o*(2*u-3)+1,s=o*(u-2)+u,c=o*(u-1),f=...
function _ (line 28) | function _(t,n,r,a,e,u){var o=1-u,i=o*o,s=u*u,c=i*o,f=3*u*i,M=3*s*o,h=s*...
function I (line 28) | function I(t,n){n=n||1;var r=2*Z.RANDOM()*Math.PI,a=2*Z.RANDOM()-1,e=Mat...
function N (line 28) | function N(t,n,r){var a=n[0],e=n[1],u=n[2],o=r[3]*a+r[7]*e+r[11]*u+r[15]...
function Y (line 28) | function Y(t,n,r){var a=n[0],e=n[1],u=n[2];return t[0]=a*r[0]+e*r[3]+u*r...
function g (line 28) | function g(t,n,r){var a=n[0],e=n[1],u=n[2],o=r[0],i=r[1],s=r[2],c=r[3],f...
function T (line 28) | function T(t,n,r,a){var e=[],u=[];return e[0]=n[0]-r[0],e[1]=n[1]-r[1],e...
function j (line 28) | function j(t,n,r,a){var e=[],u=[];return e[0]=n[0]-r[0],e[1]=n[1]-r[1],e...
function D (line 28) | function D(t,n,r,a){var e=[],u=[];return e[0]=n[0]-r[0],e[1]=n[1]-r[1],e...
function V (line 28) | function V(t,n){var r=o(t[0],t[1],t[2]),a=o(n[0],n[1],n[2]);y(r,r),y(a,a...
function z (line 28) | function z(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"}
function F (line 28) | function F(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]}
function Q (line 28) | function Q(t,n){var r=t[0],a=t[1],e=t[2],u=n[0],o=n[1],i=n[2];return Mat...
function a (line 28) | function a(){var t=new T.ARRAY_TYPE(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=...
function e (line 28) | function e(t){var n=new T.ARRAY_TYPE(4);return n[0]=t[0],n[1]=t[1],n[2]=...
function u (line 28) | function u(t,n,r,a){var e=new T.ARRAY_TYPE(4);return e[0]=t,e[1]=n,e[2]=...
function o (line 28) | function o(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t}
function i (line 28) | function i(t,n,r,a,e){return t[0]=n,t[1]=r,t[2]=a,t[3]=e,t}
function s (line 28) | function s(t,n,r){return t[0]=n[0]+r[0],t[1]=n[1]+r[1],t[2]=n[2]+r[2],t[...
function c (line 28) | function c(t,n,r){return t[0]=n[0]-r[0],t[1]=n[1]-r[1],t[2]=n[2]-r[2],t[...
function f (line 28) | function f(t,n,r){return t[0]=n[0]*r[0],t[1]=n[1]*r[1],t[2]=n[2]*r[2],t[...
function M (line 28) | function M(t,n,r){return t[0]=n[0]/r[0],t[1]=n[1]/r[1],t[2]=n[2]/r[2],t[...
function h (line 28) | function h(t,n){return t[0]=Math.ceil(n[0]),t[1]=Math.ceil(n[1]),t[2]=Ma...
function l (line 28) | function l(t,n){return t[0]=Math.floor(n[0]),t[1]=Math.floor(n[1]),t[2]=...
function v (line 28) | function v(t,n,r){return t[0]=Math.min(n[0],r[0]),t[1]=Math.min(n[1],r[1...
function d (line 28) | function d(t,n,r){return t[0]=Math.max(n[0],r[0]),t[1]=Math.max(n[1],r[1...
function b (line 28) | function b(t,n){return t[0]=Math.round(n[0]),t[1]=Math.round(n[1]),t[2]=...
function m (line 28) | function m(t,n,r){return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=n[3]*r,t}
function p (line 28) | function p(t,n,r,a){return t[0]=n[0]+r[0]*a,t[1]=n[1]+r[1]*a,t[2]=n[2]+r...
function P (line 28) | function P(t,n){var r=n[0]-t[0],a=n[1]-t[1],e=n[2]-t[2],u=n[3]-t[3];retu...
function E (line 28) | function E(t,n){var r=n[0]-t[0],a=n[1]-t[1],e=n[2]-t[2],u=n[3]-t[3];retu...
function O (line 28) | function O(t){var n=t[0],r=t[1],a=t[2],e=t[3];return Math.sqrt(n*n+r*r+a...
function x (line 28) | function x(t){var n=t[0],r=t[1],a=t[2],e=t[3];return n*n+r*r+a*a+e*e}
function A (line 28) | function A(t,n){return t[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t[3]=-n[3],t}
function q (line 28) | function q(t,n){return t[0]=1/n[0],t[1]=1/n[1],t[2]=1/n[2],t[3]=1/n[3],t}
function y (line 28) | function y(t,n){var r=n[0],a=n[1],e=n[2],u=n[3],o=r*r+a*a+e*e+u*u;return...
function w (line 28) | function w(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]+t[3]*n[3]}
function R (line 28) | function R(t,n,r,a){var e=n[0],u=n[1],o=n[2],i=n[3];return t[0]=e+a*(r[0...
function L (line 28) | function L(t,n){return n=n||1,t[0]=T.RANDOM(),t[1]=T.RANDOM(),t[2]=T.RAN...
function S (line 28) | function S(t,n,r){var a=n[0],e=n[1],u=n[2],o=n[3];return t[0]=r[0]*a+r[4...
function _ (line 28) | function _(t,n,r){var a=n[0],e=n[1],u=n[2],o=r[0],i=r[1],s=r[2],c=r[3],f...
function I (line 28) | function I(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}
function N (line 28) | function N(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]}
function Y (line 28) | function Y(t,n){var r=t[0],a=t[1],e=t[2],u=t[3],o=n[0],i=n[1],s=n[2],c=n...
function a (line 28) | function a(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var r ...
function a (line 28) | function a(){var t=new L.ARRAY_TYPE(4);return t[0]=1,t[1]=0,t[2]=0,t[3]=...
function e (line 28) | function e(t){var n=new L.ARRAY_TYPE(4);return n[0]=t[0],n[1]=t[1],n[2]=...
function u (line 28) | function u(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t}
function o (line 28) | function o(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t}
function i (line 28) | function i(t,n,r,a){var e=new L.ARRAY_TYPE(4);return e[0]=t,e[1]=n,e[2]=...
function s (line 28) | function s(t,n,r,a,e){return t[0]=n,t[1]=r,t[2]=a,t[3]=e,t}
function c (line 28) | function c(t,n){if(t===n){var r=n[1];t[1]=n[2],t[2]=r}else t[0]=n[0],t[1...
function f (line 28) | function f(t,n){var r=n[0],a=n[1],e=n[2],u=n[3],o=r*u-e*a;return o?(o=1/...
function M (line 28) | function M(t,n){var r=n[0];return t[0]=n[3],t[1]=-n[1],t[2]=-n[2],t[3]=r,t}
function h (line 28) | function h(t){return t[0]*t[3]-t[2]*t[1]}
function l (line 28) | function l(t,n,r){var a=n[0],e=n[1],u=n[2],o=n[3],i=r[0],s=r[1],c=r[2],f...
function v (line 28) | function v(t,n,r){var a=n[0],e=n[1],u=n[2],o=n[3],i=Math.sin(r),s=Math.c...
function d (line 28) | function d(t,n,r){var a=n[0],e=n[1],u=n[2],o=n[3],i=r[0],s=r[1];return t...
function b (line 28) | function b(t,n){var r=Math.sin(n),a=Math.cos(n);return t[0]=a,t[1]=r,t[2...
function m (line 28) | function m(t,n){return t[0]=n[0],t[1]=0,t[2]=0,t[3]=n[1],t}
function p (line 28) | function p(t){return"mat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}
function P (line 28) | function P(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.po...
function E (line 28) | function E(t,n,r,a){return t[2]=a[2]/a[0],r[0]=a[0],r[1]=a[1],r[3]=a[3]-...
function O (line 28) | function O(t,n,r){return t[0]=n[0]+r[0],t[1]=n[1]+r[1],t[2]=n[2]+r[2],t[...
function x (line 28) | function x(t,n,r){return t[0]=n[0]-r[0],t[1]=n[1]-r[1],t[2]=n[2]-r[2],t[...
function A (line 28) | function A(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]}
function q (line 28) | function q(t,n){var r=t[0],a=t[1],e=t[2],u=t[3],o=n[0],i=n[1],s=n[2],c=n...
function y (line 28) | function y(t,n,r){return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=n[3]*r,t}
function w (line 28) | function w(t,n,r,a){return t[0]=n[0]+r[0]*a,t[1]=n[1]+r[1]*a,t[2]=n[2]+r...
function a (line 28) | function a(){var t=new R.ARRAY_TYPE(6);return t[0]=1,t[1]=0,t[2]=0,t[3]=...
function e (line 28) | function e(t){var n=new R.ARRAY_TYPE(6);return n[0]=t[0],n[1]=t[1],n[2]=...
function u (line 28) | function u(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4]...
function o (line 28) | function o(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}
function i (line 28) | function i(t,n,r,a,e,u){var o=new R.ARRAY_TYPE(6);return o[0]=t,o[1]=n,o...
function s (line 28) | function s(t,n,r,a,e,u,o){return t[0]=n,t[1]=r,t[2]=a,t[3]=e,t[4]=u,t[5]...
function c (line 28) | function c(t,n){var r=n[0],a=n[1],e=n[2],u=n[3],o=n[4],i=n[5],s=r*u-a*e;...
function f (line 28) | function f(t){return t[0]*t[3]-t[1]*t[2]}
function M (line 28) | function M(t,n,r){var a=n[0],e=n[1],u=n[2],o=n[3],i=n[4],s=n[5],c=r[0],f...
function h (line 28) | function h(t,n,r){var a=n[0],e=n[1],u=n[2],o=n[3],i=n[4],s=n[5],c=Math.s...
function l (line 28) | function l(t,n,r){var a=n[0],e=n[1],u=n[2],o=n[3],i=n[4],s=n[5],c=r[0],f...
function v (line 28) | function v(t,n,r){var a=n[0],e=n[1],u=n[2],o=n[3],i=n[4],s=n[5],c=r[0],f...
function d (line 28) | function d(t,n){var r=Math.sin(n),a=Math.cos(n);return t[0]=a,t[1]=r,t[2...
function b (line 28) | function b(t,n){return t[0]=n[0],t[1]=0,t[2]=0,t[3]=n[1],t[4]=0,t[5]=0,t}
function m (line 28) | function m(t,n){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=n[0],t[5]=n[1],t}
function p (line 28) | function p(t){return"mat2d("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4...
function P (line 28) | function P(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.po...
function E (line 28) | function E(t,n,r){return t[0]=n[0]+r[0],t[1]=n[1]+r[1],t[2]=n[2]+r[2],t[...
function O (line 28) | function O(t,n,r){return t[0]=n[0]-r[0],t[1]=n[1]-r[1],t[2]=n[2]-r[2],t[...
function x (line 28) | function x(t,n,r){return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=n[3]*r...
function A (line 28) | function A(t,n,r,a){return t[0]=n[0]+r[0]*a,t[1]=n[1]+r[1]*a,t[2]=n[2]+r...
function q (line 28) | function q(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3...
function y (line 28) | function y(t,n){var r=t[0],a=t[1],e=t[2],u=t[3],o=t[4],i=t[5],s=n[0],c=n...
function a (line 28) | function a(){var t=new C.ARRAY_TYPE(16);return t[0]=1,t[1]=0,t[2]=0,t[3]...
function e (line 28) | function e(t){var n=new C.ARRAY_TYPE(16);return n[0]=t[0],n[1]=t[1],n[2]...
function u (line 28) | function u(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4]...
function o (line 28) | function o(t,n,r,a,e,u,o,i,s,c,f,M,h,l,v,d){var b=new C.ARRAY_TYPE(16);r...
function i (line 28) | function i(t,n,r,a,e,u,o,i,s,c,f,M,h,l,v,d,b){return t[0]=n,t[1]=r,t[2]=...
function s (line 28) | function s(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[...
function c (line 28) | function c(t,n){if(t===n){var r=n[1],a=n[2],e=n[3],u=n[6],o=n[7],i=n[11]...
function f (line 28) | function f(t,n){var r=n[0],a=n[1],e=n[2],u=n[3],o=n[4],i=n[5],s=n[6],c=n...
function M (line 28) | function M(t,n){var r=n[0],a=n[1],e=n[2],u=n[3],o=n[4],i=n[5],s=n[6],c=n...
function h (line 28) | function h(t){var n=t[0],r=t[1],a=t[2],e=t[3],u=t[4],o=t[5],i=t[6],s=t[7...
function l (line 28) | function l(t,n,r){var a=n[0],e=n[1],u=n[2],o=n[3],i=n[4],s=n[5],c=n[6],f...
function v (line 28) | function v(t,n,r){var a=r[0],e=r[1],u=r[2],o=void 0,i=void 0,s=void 0,c=...
function d (line 28) | function d(t,n,r){var a=r[0],e=r[1],u=r[2];return t[0]=n[0]*a,t[1]=n[1]*...
function b (line 28) | function b(t,n,r,a){var e=a[0],u=a[1],o=a[2],i=Math.sqrt(e*e+u*u+o*o),s=...
function m (line 28) | function m(t,n,r){var a=Math.sin(r),e=Math.cos(r),u=n[4],o=n[5],i=n[6],s...
function p (line 28) | function p(t,n,r){var a=Math.sin(r),e=Math.cos(r),u=n[0],o=n[1],i=n[2],s...
function P (line 28) | function P(t,n,r){var a=Math.sin(r),e=Math.cos(r),u=n[0],o=n[1],i=n[2],s...
function E (line 28) | function E(t,n){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,...
function O (line 28) | function O(t,n){return t[0]=n[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=n[1],t...
function x (line 28) | function x(t,n,r){var a=r[0],e=r[1],u=r[2],o=Math.sqrt(a*a+e*e+u*u),i=vo...
function A (line 28) | function A(t,n){var r=Math.sin(n),a=Math.cos(n);return t[0]=1,t[1]=0,t[2...
function q (line 28) | function q(t,n){var r=Math.sin(n),a=Math.cos(n);return t[0]=a,t[1]=0,t[2...
function y (line 28) | function y(t,n){var r=Math.sin(n),a=Math.cos(n);return t[0]=a,t[1]=r,t[2...
function w (line 28) | function w(t,n,r){var a=n[0],e=n[1],u=n[2],o=n[3],i=a+a,s=e+e,c=u+u,f=a*...
function R (line 28) | function R(t,n){return t[0]=n[12],t[1]=n[13],t[2]=n[14],t}
function L (line 28) | function L(t,n){var r=n[0],a=n[1],e=n[2],u=n[4],o=n[5],i=n[6],s=n[8],c=n...
function S (line 28) | function S(t,n){var r=n[0]+n[5]+n[10],a=0;return r>0?(a=2*Math.sqrt(r+1)...
function _ (line 28) | function _(t,n,r,a){var e=n[0],u=n[1],o=n[2],i=n[3],s=e+e,c=u+u,f=o+o,M=...
function I (line 28) | function I(t,n,r,a,e){var u=n[0],o=n[1],i=n[2],s=n[3],c=u+u,f=o+o,M=i+i,...
function N (line 28) | function N(t,n){var r=n[0],a=n[1],e=n[2],u=n[3],o=r+r,i=a+a,s=e+e,c=r*o,...
function Y (line 28) | function Y(t,n,r,a,e,u,o){var i=1/(r-n),s=1/(e-a),c=1/(u-o);return t[0]=...
function g (line 28) | function g(t,n,r,a,e){var u=1/Math.tan(n/2),o=1/(a-e);return t[0]=u/r,t[...
function T (line 28) | function T(t,n,r,a){var e=Math.tan(n.upDegrees*Math.PI/180),u=Math.tan(n...
function j (line 28) | function j(t,n,r,a,e,u,o){var i=1/(n-r),s=1/(a-e),c=1/(u-o);return t[0]=...
function D (line 28) | function D(t,n,r,a){var e=void 0,u=void 0,o=void 0,i=void 0,c=void 0,f=v...
function V (line 28) | function V(t,n,r,a){var e=n[0],u=n[1],o=n[2],i=a[0],s=a[1],c=a[2],f=e-r[...
function z (line 28) | function z(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]...
function F (line 28) | function F(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.po...
function Q (line 28) | function Q(t,n,r){return t[0]=n[0]+r[0],t[1]=n[1]+r[1],t[2]=n[2]+r[2],t[...
function X (line 28) | function X(t,n,r){return t[0]=n[0]-r[0],t[1]=n[1]-r[1],t[2]=n[2]-r[2],t[...
function Z (line 28) | function Z(t,n,r){return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=n[3]*r...
function k (line 28) | function k(t,n,r,a){return t[0]=n[0]+r[0]*a,t[1]=n[1]+r[1]*a,t[2]=n[2]+r...
function U (line 28) | function U(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3...
function W (line 28) | function W(t,n){var r=t[0],a=t[1],e=t[2],u=t[3],o=t[4],i=t[5],s=t[6],c=t...
function a (line 28) | function a(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var r ...
function e (line 28) | function e(){var t=new E.ARRAY_TYPE(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=...
function u (line 28) | function u(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}
function o (line 28) | function o(t,n,r){r*=.5;var a=Math.sin(r);return t[0]=a*n[0],t[1]=a*n[1]...
function i (line 28) | function i(t,n){var r=2*Math.acos(n[3]),a=Math.sin(r/2);return 0!=a?(t[0...
function s (line 28) | function s(t,n,r){var a=n[0],e=n[1],u=n[2],o=n[3],i=r[0],s=r[1],c=r[2],f...
function c (line 28) | function c(t,n,r){r*=.5;var a=n[0],e=n[1],u=n[2],o=n[3],i=Math.sin(r),s=...
function f (line 28) | function f(t,n,r){r*=.5;var a=n[0],e=n[1],u=n[2],o=n[3],i=Math.sin(r),s=...
function M (line 28) | function M(t,n,r){r*=.5;var a=n[0],e=n[1],u=n[2],o=n[3],i=Math.sin(r),s=...
function h (line 28) | function h(t,n){var r=n[0],a=n[1],e=n[2];return t[0]=r,t[1]=a,t[2]=e,t[3...
function l (line 28) | function l(t,n,r,a){var e=n[0],u=n[1],o=n[2],i=n[3],s=r[0],c=r[1],f=r[2]...
function v (line 28) | function v(t,n){var r=n[0],a=n[1],e=n[2],u=n[3],o=r*r+a*a+e*e+u*u,i=o?1/...
function d (line 28) | function d(t,n){return t[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t[3]=n[3],t}
function b (line 28) | function b(t,n){var r=n[0]+n[4]+n[8],a=void 0;if(r>0)a=Math.sqrt(r+1),t[...
function m (line 28) | function m(t,n,r,a){var e=.5*Math.PI/180;n*=e,r*=e,a*=e;var u=Math.sin(n...
function p (line 28) | function p(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}
function a (line 28) | function a(){var t=new V.ARRAY_TYPE(2);return t[0]=0,t[1]=0,t}
function e (line 28) | function e(t){var n=new V.ARRAY_TYPE(2);return n[0]=t[0],n[1]=t[1],n}
function u (line 28) | function u(t,n){var r=new V.ARRAY_TYPE(2);return r[0]=t,r[1]=n,r}
function o (line 28) | function o(t,n){return t[0]=n[0],t[1]=n[1],t}
function i (line 28) | function i(t,n,r){return t[0]=n,t[1]=r,t}
function s (line 28) | function s(t,n,r){return t[0]=n[0]+r[0],t[1]=n[1]+r[1],t}
function c (line 28) | function c(t,n,r){return t[0]=n[0]-r[0],t[1]=n[1]-r[1],t}
function f (line 28) | function f(t,n,r){return t[0]=n[0]*r[0],t[1]=n[1]*r[1],t}
function M (line 28) | function M(t,n,r){return t[0]=n[0]/r[0],t[1]=n[1]/r[1],t}
function h (line 28) | function h(t,n){return t[0]=Math.ceil(n[0]),t[1]=Math.ceil(n[1]),t}
function l (line 28) | function l(t,n){return t[0]=Math.floor(n[0]),t[1]=Math.floor(n[1]),t}
function v (line 28) | function v(t,n,r){return t[0]=Math.min(n[0],r[0]),t[1]=Math.min(n[1],r[1...
function d (line 28) | function d(t,n,r){return t[0]=Math.max(n[0],r[0]),t[1]=Math.max(n[1],r[1...
function b (line 28) | function b(t,n){return t[0]=Math.round(n[0]),t[1]=Math.round(n[1]),t}
function m (line 28) | function m(t,n,r){return t[0]=n[0]*r,t[1]=n[1]*r,t}
function p (line 28) | function p(t,n,r,a){return t[0]=n[0]+r[0]*a,t[1]=n[1]+r[1]*a,t}
function P (line 28) | function P(t,n){var r=n[0]-t[0],a=n[1]-t[1];return Math.sqrt(r*r+a*a)}
function E (line 28) | function E(t,n){var r=n[0]-t[0],a=n[1]-t[1];return r*r+a*a}
function O (line 28) | function O(t){var n=t[0],r=t[1];return Math.sqrt(n*n+r*r)}
function x (line 28) | function x(t){var n=t[0],r=t[1];return n*n+r*r}
function A (line 28) | function A(t,n){return t[0]=-n[0],t[1]=-n[1],t}
function q (line 28) | function q(t,n){return t[0]=1/n[0],t[1]=1/n[1],t}
function y (line 28) | function y(t,n){var r=n[0],a=n[1],e=r*r+a*a;return e>0&&(e=1/Math.sqrt(e...
function w (line 28) | function w(t,n){return t[0]*n[0]+t[1]*n[1]}
function R (line 28) | function R(t,n,r){var a=n[0]*r[1]-n[1]*r[0];return t[0]=t[1]=0,t[2]=a,t}
function L (line 28) | function L(t,n,r,a){var e=n[0],u=n[1];return t[0]=e+a*(r[0]-e),t[1]=u+a*...
function S (line 28) | function S(t,n){n=n||1;var r=2*V.RANDOM()*Math.PI;return t[0]=Math.cos(r...
function _ (line 28) | function _(t,n,r){var a=n[0],e=n[1];return t[0]=r[0]*a+r[2]*e,t[1]=r[1]*...
function I (line 28) | function I(t,n,r){var a=n[0],e=n[1];return t[0]=r[0]*a+r[2]*e+r[4],t[1]=...
function N (line 28) | function N(t,n,r){var a=n[0],e=n[1];return t[0]=r[0]*a+r[3]*e+r[6],t[1]=...
function Y (line 28) | function Y(t,n,r){var a=n[0],e=n[1];return t[0]=r[0]*a+r[4]*e+r[12],t[1]...
function g (line 28) | function g(t){return"vec2("+t[0]+", "+t[1]+")"}
function T (line 28) | function T(t,n){return t[0]===n[0]&&t[1]===n[1]}
function j (line 28) | function j(t,n){var r=t[0],a=t[1],e=n[0],u=n[1];return Math.abs(r-e)<=V....
FILE: polyfill/fill/gl-matrix.js
function __webpack_require__ (line 43) | function __webpack_require__(moduleId) {
function setMatrixArrayType (line 151) | function setMatrixArrayType(type) {
function toRadian (line 162) | function toRadian(a) {
function equals (line 175) | function equals(a, b) {
function _interopRequireWildcard (line 225) | function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { ret...
function create (line 237) | function create() {
function fromMat4 (line 278) | function fromMat4(out, a) {
function clone (line 297) | function clone(a) {
function copy (line 318) | function copy(out, a) {
function fromValues (line 345) | function fromValues(m00, m01, m02, m10, m11, m12, m20, m21, m22) {
function set (line 374) | function set(out, m00, m01, m02, m10, m11, m12, m20, m21, m22) {
function identity (line 393) | function identity(out) {
function transpose (line 413) | function transpose(out, a) {
function invert (line 447) | function invert(out, a) {
function adjoint (line 489) | function adjoint(out, a) {
function determinant (line 518) | function determinant(a) {
function multiply (line 540) | function multiply(out, a, b) {
function translate (line 583) | function translate(out, a, v) {
function rotate (line 618) | function rotate(out, a, rad) {
function scale (line 653) | function scale(out, a, v) {
function fromTranslation (line 682) | function fromTranslation(out, v) {
function fromRotation (line 706) | function fromRotation(out, rad) {
function fromScaling (line 735) | function fromScaling(out, v) {
function fromMat2d (line 757) | function fromMat2d(out, a) {
function fromQuat (line 780) | function fromQuat(out, q) {
function normalFromMat4 (line 822) | function normalFromMat4(out, a) {
function projection (line 884) | function projection(out, width, height) {
function str (line 903) | function str(a) {
function frob (line 913) | function frob(a) {
function add (line 925) | function add(out, a, b) {
function subtract (line 946) | function subtract(out, a, b) {
function multiplyScalar (line 967) | function multiplyScalar(out, a, b) {
function multiplyScalarAndAdd (line 989) | function multiplyScalarAndAdd(out, a, b, scale) {
function exactEquals (line 1009) | function exactEquals(a, b) {
function equals (line 1020) | function equals(a, b) {
function _interopRequireWildcard (line 1109) | function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { ret...
function create (line 1121) | function create() {
function clone (line 1155) | function clone(a) {
function length (line 1169) | function length(a) {
function fromValues (line 1184) | function fromValues(x, y, z) {
function copy (line 1199) | function copy(out, a) {
function set (line 1215) | function set(out, x, y, z) {
function add (line 1230) | function add(out, a, b) {
function subtract (line 1245) | function subtract(out, a, b) {
function multiply (line 1260) | function multiply(out, a, b) {
function divide (line 1275) | function divide(out, a, b) {
function ceil (line 1289) | function ceil(out, a) {
function floor (line 1303) | function floor(out, a) {
function min (line 1318) | function min(out, a, b) {
function max (line 1333) | function max(out, a, b) {
function round (line 1347) | function round(out, a) {
function scale (line 1362) | function scale(out, a, b) {
function scaleAndAdd (line 1378) | function scaleAndAdd(out, a, b, scale) {
function distance (line 1392) | function distance(a, b) {
function squaredDistance (line 1406) | function squaredDistance(a, b) {
function squaredLength (line 1419) | function squaredLength(a) {
function negate (line 1433) | function negate(out, a) {
function inverse (line 1447) | function inverse(out, a) {
function normalize (line 1461) | function normalize(out, a) {
function dot (line 1483) | function dot(a, b) {
function cross (line 1495) | function cross(out, a, b) {
function lerp (line 1518) | function lerp(out, a, b, t) {
function hermite (line 1539) | function hermite(out, a, b, c, d, t) {
function bezier (line 1564) | function bezier(out, a, b, c, d, t) {
function random (line 1587) | function random(out, scale) {
function transformMat4 (line 1609) | function transformMat4(out, a, m) {
function transformMat3 (line 1629) | function transformMat3(out, a, m) {
function transformQuat (line 1647) | function transformQuat(out, a, q) {
function rotateX (line 1679) | function rotateX(out, a, b, c) {
function rotateY (line 1708) | function rotateY(out, a, b, c) {
function rotateZ (line 1737) | function rotateZ(out, a, b, c) {
function angle (line 1764) | function angle(a, b) {
function str (line 1788) | function str(a) {
function exactEquals (line 1799) | function exactEquals(a, b) {
function equals (line 1810) | function equals(a, b) {
function _interopRequireWildcard (line 1951) | function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { ret...
function create (line 1963) | function create() {
function clone (line 1998) | function clone(a) {
function fromValues (line 2016) | function fromValues(x, y, z, w) {
function copy (line 2032) | function copy(out, a) {
function set (line 2050) | function set(out, x, y, z, w) {
function add (line 2066) | function add(out, a, b) {
function subtract (line 2082) | function subtract(out, a, b) {
function multiply (line 2098) | function multiply(out, a, b) {
function divide (line 2114) | function divide(out, a, b) {
function ceil (line 2129) | function ceil(out, a) {
function floor (line 2144) | function floor(out, a) {
function min (line 2160) | function min(out, a, b) {
function max (line 2176) | function max(out, a, b) {
function round (line 2191) | function round(out, a) {
function scale (line 2207) | function scale(out, a, b) {
function scaleAndAdd (line 2224) | function scaleAndAdd(out, a, b, scale) {
function distance (line 2239) | function distance(a, b) {
function squaredDistance (line 2254) | function squaredDistance(a, b) {
function length (line 2268) | function length(a) {
function squaredLength (line 2282) | function squaredLength(a) {
function negate (line 2297) | function negate(out, a) {
function inverse (line 2312) | function inverse(out, a) {
function normalize (line 2327) | function normalize(out, a) {
function dot (line 2350) | function dot(a, b) {
function lerp (line 2363) | function lerp(out, a, b, t) {
function random (line 2382) | function random(out, vectorScale) {
function transformMat4 (line 2403) | function transformMat4(out, a, m) {
function transformQuat (line 2423) | function transformQuat(out, a, q) {
function str (line 2452) | function str(a) {
function exactEquals (line 2463) | function exactEquals(a, b) {
function equals (line 2474) | function equals(a, b) {
function _interopRequireWildcard (line 2618) | function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { ret...
function _interopRequireWildcard (line 2696) | function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { ret...
function create (line 2708) | function create() {
function clone (line 2743) | function clone(a) {
function copy (line 2759) | function copy(out, a) {
function identity (line 2773) | function identity(out) {
function fromValues (line 2790) | function fromValues(m00, m01, m10, m11) {
function set (line 2809) | function set(out, m00, m01, m10, m11) {
function transpose (line 2824) | function transpose(out, a) {
function invert (line 2848) | function invert(out, a) {
function adjoint (line 2877) | function adjoint(out, a) {
function determinant (line 2894) | function determinant(a) {
function multiply (line 2906) | function multiply(out, a, b) {
function rotate (line 2930) | function rotate(out, a, rad) {
function scale (line 2952) | function scale(out, a, v) {
function fromRotation (line 2977) | function fromRotation(out, rad) {
function fromScaling (line 2998) | function fromScaling(out, v) {
function str (line 3012) | function str(a) {
function frob (line 3022) | function frob(a) {
function LDU (line 3034) | function LDU(L, D, U, a) {
function add (line 3050) | function add(out, a, b) {
function subtract (line 3066) | function subtract(out, a, b) {
function exactEquals (line 3081) | function exactEquals(a, b) {
function equals (line 3092) | function equals(a, b) {
function multiplyScalar (line 3112) | function multiplyScalar(out, a, b) {
function multiplyScalarAndAdd (line 3129) | function multiplyScalarAndAdd(out, a, b, scale) {
function _interopRequireWildcard (line 3188) | function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { ret...
function create (line 3214) | function create() {
function clone (line 3251) | function clone(a) {
function copy (line 3269) | function copy(out, a) {
function identity (line 3285) | function identity(out) {
function fromValues (line 3306) | function fromValues(a, b, c, d, tx, ty) {
function set (line 3329) | function set(out, a, b, c, d, tx, ty) {
function invert (line 3346) | function invert(out, a) {
function determinant (line 3375) | function determinant(a) {
function multiply (line 3387) | function multiply(out, a, b) {
function rotate (line 3417) | function rotate(out, a, rad) {
function scale (line 3443) | function scale(out, a, v) {
function translate (line 3469) | function translate(out, a, v) {
function fromRotation (line 3498) | function fromRotation(out, rad) {
function fromScaling (line 3521) | function fromScaling(out, v) {
function fromTranslation (line 3542) | function fromTranslation(out, v) {
function str (line 3558) | function str(a) {
function frob (line 3568) | function frob(a) {
function add (line 3580) | function add(out, a, b) {
function subtract (line 3598) | function subtract(out, a, b) {
function multiplyScalar (line 3616) | function multiplyScalar(out, a, b) {
function multiplyScalarAndAdd (line 3635) | function multiplyScalarAndAdd(out, a, b, scale) {
function exactEquals (line 3652) | function exactEquals(a, b) {
function equals (line 3663) | function equals(a, b) {
function _interopRequireWildcard (line 3751) | function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { ret...
function create (line 3763) | function create() {
function clone (line 3810) | function clone(a) {
function copy (line 3838) | function copy(out, a) {
function fromValues (line 3879) | function fromValues(m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m2...
function set (line 3922) | function set(out, m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22,...
function identity (line 3948) | function identity(out) {
function transpose (line 3975) | function transpose(out, a) {
function invert (line 4026) | function invert(out, a) {
function adjoint (line 4092) | function adjoint(out, a) {
function determinant (line 4135) | function determinant(a) {
function multiply (line 4178) | function multiply(out, a, b) {
function translate (line 4234) | function translate(out, a, v) {
function scale (line 4282) | function scale(out, a, v) {
function rotate (line 4315) | function rotate(out, a, rad, axis) {
function rotateX (line 4399) | function rotateX(out, a, rad) {
function rotateY (line 4443) | function rotateY(out, a, rad) {
function rotateZ (line 4487) | function rotateZ(out, a, rad) {
function fromTranslation (line 4534) | function fromTranslation(out, v) {
function fromScaling (line 4565) | function fromScaling(out, v) {
function fromRotation (line 4597) | function fromRotation(out, rad, axis) {
function fromXRotation (line 4650) | function fromXRotation(out, rad) {
function fromYRotation (line 4685) | function fromYRotation(out, rad) {
function fromZRotation (line 4720) | function fromZRotation(out, rad) {
function fromRotationTranslation (line 4759) | function fromRotationTranslation(out, q, v) {
function getTranslation (line 4808) | function getTranslation(out, mat) {
function getScaling (line 4826) | function getScaling(out, mat) {
function getRotation (line 4853) | function getRotation(out, mat) {
function fromRotationTranslationScale (line 4904) | function fromRotationTranslationScale(out, q, v, s) {
function fromRotationTranslationScaleOrigin (line 4967) | function fromRotationTranslationScaleOrigin(out, q, v, s, o) {
function fromQuat (line 5033) | function fromQuat(out, q) {
function frustum (line 5087) | function frustum(out, left, right, bottom, top, near, far) {
function perspective (line 5120) | function perspective(out, fovy, aspect, near, far) {
function perspectiveFromFieldOfView (line 5153) | function perspectiveFromFieldOfView(out, fov, near, far) {
function ortho (line 5192) | function ortho(out, left, right, bottom, top, near, far) {
function lookAt (line 5225) | function lookAt(out, eye, center, up) {
function targetTo (line 5319) | function targetTo(out, eye, target, up) {
function str (line 5376) | function str(a) {
function frob (line 5386) | function frob(a) {
function add (line 5398) | function add(out, a, b) {
function subtract (line 5426) | function subtract(out, a, b) {
function multiplyScalar (line 5454) | function multiplyScalar(out, a, b) {
function multiplyScalarAndAdd (line 5483) | function multiplyScalarAndAdd(out, a, b, scale) {
function exactEquals (line 5510) | function exactEquals(a, b) {
function equals (line 5521) | function equals(a, b) {
function _interopRequireWildcard (line 5614) | function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { ret...
function create (line 5646) | function create() {
function identity (line 5661) | function identity(out) {
function setAxisAngle (line 5678) | function setAxisAngle(out, axis, rad) {
function getAxisAngle (line 5701) | function getAxisAngle(out_axis, q) {
function multiply (line 5725) | function multiply(out, a, b) {
function rotateX (line 5750) | function rotateX(out, a, rad) {
function rotateY (line 5775) | function rotateY(out, a, rad) {
function rotateZ (line 5800) | function rotateZ(out, a, rad) {
function calculateW (line 5826) | function calculateW(out, a) {
function slerp (line 5847) | function slerp(out, a, b, t) {
function invert (line 5904) | function invert(out, a) {
function conjugate (line 5929) | function conjugate(out, a) {
function fromMat3 (line 5948) | function fromMat3(out, m) {
function fromEuler (line 5991) | function fromEuler(out, x, y, z) {
function str (line 6018) | function str(a) {
function _interopRequireWildcard (line 6318) | function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { ret...
function create (line 6330) | function create() {
function clone (line 6363) | function clone(a) {
function fromValues (line 6377) | function fromValues(x, y) {
function copy (line 6391) | function copy(out, a) {
function set (line 6405) | function set(out, x, y) {
function add (line 6419) | function add(out, a, b) {
function subtract (line 6433) | function subtract(out, a, b) {
function multiply (line 6447) | function multiply(out, a, b) {
function divide (line 6461) | function divide(out, a, b) {
function ceil (line 6474) | function ceil(out, a) {
function floor (line 6487) | function floor(out, a) {
function min (line 6501) | function min(out, a, b) {
function max (line 6515) | function max(out, a, b) {
function round (line 6528) | function round(out, a) {
function scale (line 6542) | function scale(out, a, b) {
function scaleAndAdd (line 6557) | function scaleAndAdd(out, a, b, scale) {
function distance (line 6570) | function distance(a, b) {
function squaredDistance (line 6583) | function squaredDistance(a, b) {
function length (line 6595) | function length(a) {
function squaredLength (line 6607) | function squaredLength(a) {
function negate (line 6620) | function negate(out, a) {
function inverse (line 6633) | function inverse(out, a) {
function normalize (line 6646) | function normalize(out, a) {
function dot (line 6666) | function dot(a, b) {
function cross (line 6679) | function cross(out, a, b) {
function lerp (line 6695) | function lerp(out, a, b, t) {
function random (line 6710) | function random(out, scale) {
function transformMat2 (line 6726) | function transformMat2(out, a, m) {
function transformMat2d (line 6742) | function transformMat2d(out, a, m) {
function transformMat3 (line 6759) | function transformMat3(out, a, m) {
function transformMat4 (line 6777) | function transformMat4(out, a, m) {
function str (line 6791) | function str(a) {
function exactEquals (line 6802) | function exactEquals(a, b) {
function equals (line 6813) | function equals(a, b) {
FILE: polyfill/fill/gl-matrix/common.js
constant EPSILON (line 27) | const EPSILON = 0.000001;
constant ARRAY_TYPE (line 28) | let ARRAY_TYPE = (typeof Float32Array !== 'undefined') ? Float32Array : ...
constant RANDOM (line 29) | const RANDOM = Math.random;
function setMatrixArrayType (line 36) | function setMatrixArrayType(type) {
function toRadian (line 47) | function toRadian(a) {
function equals (line 60) | function equals(a, b) {
FILE: polyfill/fill/gl-matrix/mat2.js
function create (line 33) | function create() {
function clone (line 48) | function clone(a) {
function copy (line 64) | function copy(out, a) {
function identity (line 78) | function identity(out) {
function fromValues (line 95) | function fromValues(m00, m01, m10, m11) {
function set (line 114) | function set(out, m00, m01, m10, m11) {
function transpose (line 129) | function transpose(out, a) {
function invert (line 153) | function invert(out, a) {
function adjoint (line 179) | function adjoint(out, a) {
function determinant (line 196) | function determinant(a) {
function multiply (line 208) | function multiply(out, a, b) {
function rotate (line 226) | function rotate(out, a, rad) {
function scale (line 245) | function scale(out, a, v) {
function fromRotation (line 266) | function fromRotation(out, rad) {
function fromScaling (line 287) | function fromScaling(out, v) {
function str (line 301) | function str(a) {
function frob (line 311) | function frob(a) {
function LDU (line 323) | function LDU(L, D, U, a) {
function add (line 339) | function add(out, a, b) {
function subtract (line 355) | function subtract(out, a, b) {
function exactEquals (line 370) | function exactEquals(a, b) {
function equals (line 381) | function equals(a, b) {
function multiplyScalar (line 398) | function multiplyScalar(out, a, b) {
function multiplyScalarAndAdd (line 415) | function multiplyScalarAndAdd(out, a, b, scale) {
FILE: polyfill/fill/gl-matrix/mat2d.js
function create (line 47) | function create() {
function clone (line 64) | function clone(a) {
function copy (line 82) | function copy(out, a) {
function identity (line 98) | function identity(out) {
function fromValues (line 119) | function fromValues(a, b, c, d, tx, ty) {
function set (line 142) | function set(out, a, b, c, d, tx, ty) {
function invert (line 159) | function invert(out, a) {
function determinant (line 184) | function determinant(a) {
function multiply (line 196) | function multiply(out, a, b) {
function rotate (line 216) | function rotate(out, a, rad) {
function scale (line 237) | function scale(out, a, v) {
function translate (line 257) | function translate(out, a, v) {
function fromRotation (line 280) | function fromRotation(out, rad) {
function fromScaling (line 302) | function fromScaling(out, v) {
function fromTranslation (line 323) | function fromTranslation(out, v) {
function str (line 339) | function str(a) {
function frob (line 350) | function frob(a) {
function add (line 362) | function add(out, a, b) {
function subtract (line 380) | function subtract(out, a, b) {
function multiplyScalar (line 398) | function multiplyScalar(out, a, b) {
function multiplyScalarAndAdd (line 417) | function multiplyScalarAndAdd(out, a, b, scale) {
function exactEquals (line 434) | function exactEquals(a, b) {
function equals (line 445) | function equals(a, b) {
FILE: polyfill/fill/gl-matrix/mat3.js
function create (line 33) | function create() {
function fromMat4 (line 54) | function fromMat4(out, a) {
function clone (line 73) | function clone(a) {
function copy (line 94) | function copy(out, a) {
function fromValues (line 121) | function fromValues(m00, m01, m02, m10, m11, m12, m20, m21, m22) {
function set (line 150) | function set(out, m00, m01, m02, m10, m11, m12, m20, m21, m22) {
function identity (line 169) | function identity(out) {
function transpose (line 189) | function transpose(out, a) {
function invert (line 221) | function invert(out, a) {
function adjoint (line 257) | function adjoint(out, a) {
function determinant (line 280) | function determinant(a) {
function multiply (line 296) | function multiply(out, a, b) {
function translate (line 327) | function translate(out, a, v) {
function rotate (line 355) | function rotate(out, a, rad) {
function scale (line 385) | function scale(out, a, v) {
function fromTranslation (line 413) | function fromTranslation(out, v) {
function fromRotation (line 437) | function fromRotation(out, rad) {
function fromScaling (line 465) | function fromScaling(out, v) {
function fromMat2d (line 487) | function fromMat2d(out, a) {
function fromQuat (line 510) | function fromQuat(out, q) {
function normalFromMat4 (line 549) | function normalFromMat4(out, a) {
function projection (line 599) | function projection(out, width, height) {
function str (line 618) | function str(a) {
function frob (line 630) | function frob(a) {
function add (line 642) | function add(out, a, b) {
function subtract (line 663) | function subtract(out, a, b) {
function multiplyScalar (line 686) | function multiplyScalar(out, a, b) {
function multiplyScalarAndAdd (line 708) | function multiplyScalarAndAdd(out, a, b, scale) {
function exactEquals (line 728) | function exactEquals(a, b) {
function equals (line 741) | function equals(a, b) {
FILE: polyfill/fill/gl-matrix/mat4.js
function create (line 33) | function create() {
function clone (line 60) | function clone(a) {
function copy (line 88) | function copy(out, a) {
function fromValues (line 129) | function fromValues(m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m2...
function set (line 172) | function set(out, m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22,...
function identity (line 199) | function identity(out) {
function transpose (line 226) | function transpose(out, a) {
function invert (line 274) | function invert(out, a) {
function adjoint (line 328) | function adjoint(out, a) {
function determinant (line 359) | function determinant(a) {
function multiply (line 390) | function multiply(out, a, b) {
function translate (line 431) | function translate(out, a, v) {
function scale (line 468) | function scale(out, a, v) {
function rotate (line 499) | function rotate(out, a, rad, axis) {
function rotateX (line 561) | function rotateX(out, a, rad) {
function rotateY (line 604) | function rotateY(out, a, rad) {
function rotateZ (line 647) | function rotateZ(out, a, rad) {
function fromTranslation (line 693) | function fromTranslation(out, v) {
function fromScaling (line 724) | function fromScaling(out, v) {
function fromRotation (line 756) | function fromRotation(out, rad, axis) {
function fromXRotation (line 803) | function fromXRotation(out, rad) {
function fromYRotation (line 838) | function fromYRotation(out, rad) {
function fromZRotation (line 873) | function fromZRotation(out, rad) {
function fromRotationTranslation (line 912) | function fromRotationTranslation(out, q, v) {
function getTranslation (line 958) | function getTranslation(out, mat) {
function getScaling (line 976) | function getScaling(out, mat) {
function getRotation (line 1003) | function getRotation(out, mat) {
function fromRotationTranslationScale (line 1054) | function fromRotationTranslationScale(out, q, v, s) {
function fromRotationTranslationScaleOrigin (line 1114) | function fromRotationTranslationScaleOrigin(out, q, v, s, o) {
function fromQuat (line 1177) | function fromQuat(out, q) {
function frustum (line 1228) | function frustum(out, left, right, bottom, top, near, far) {
function perspective (line 1261) | function perspective(out, fovy, aspect, near, far) {
function perspectiveFromFieldOfView (line 1294) | function perspectiveFromFieldOfView(out, fov, near, far) {
function ortho (line 1333) | function ortho(out, left, right, bottom, top, near, far) {
function lookAt (line 1366) | function lookAt(out, eye, center, up) {
function targetTo (line 1453) | function targetTo(out, eye, target, up) {
function str (line 1510) | function str(a) {
function frob (line 1523) | function frob(a) {
function add (line 1535) | function add(out, a, b) {
function subtract (line 1563) | function subtract(out, a, b) {
function multiplyScalar (line 1591) | function multiplyScalar(out, a, b) {
function multiplyScalarAndAdd (line 1620) | function multiplyScalarAndAdd(out, a, b, scale) {
function exactEquals (line 1647) | function exactEquals(a, b) {
function equals (line 1661) | function equals(a, b) {
FILE: polyfill/fill/gl-matrix/quat.js
function create (line 36) | function create() {
function identity (line 51) | function identity(out) {
function setAxisAngle (line 68) | function setAxisAngle(out, axis, rad) {
function getAxisAngle (line 91) | function getAxisAngle(out_axis, q) {
function multiply (line 115) | function multiply(out, a, b) {
function rotateX (line 134) | function rotateX(out, a, rad) {
function rotateY (line 155) | function rotateY(out, a, rad) {
function rotateZ (line 176) | function rotateZ(out, a, rad) {
function calculateW (line 198) | function calculateW(out, a) {
function slerp (line 217) | function slerp(out, a, b, t) {
function invert (line 264) | function invert(out, a) {
function conjugate (line 286) | function conjugate(out, a) {
function fromMat3 (line 305) | function fromMat3(out, m) {
function fromEuler (line 350) | function fromEuler(out, x, y, z) {
function str (line 377) | function str(a) {
FILE: polyfill/fill/gl-matrix/vec2.js
function create (line 33) | function create() {
function clone (line 46) | function clone(a) {
function fromValues (line 60) | function fromValues(x, y) {
function copy (line 74) | function copy(out, a) {
function set (line 88) | function set(out, x, y) {
function add (line 102) | function add(out, a, b) {
function subtract (line 116) | function subtract(out, a, b) {
function multiply (line 130) | function multiply(out, a, b) {
function divide (line 144) | function divide(out, a, b) {
function ceil (line 157) | function ceil(out, a) {
function floor (line 170) | function floor(out, a) {
function min (line 184) | function min(out, a, b) {
function max (line 198) | function max(out, a, b) {
function round (line 211) | function round (ou
Condensed preview — 136 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (8,100K chars).
[
{
"path": ".gitignore",
"chars": 20,
"preview": "node_modules/\ndist/\n"
},
{
"path": "CODE_OF_CONDUCT.md",
"chars": 691,
"preview": "# Community Participation Guidelines\n\nThis repository is governed by Mozilla's code of conduct and etiquette guidelines."
},
{
"path": "CODING.md",
"chars": 5572,
"preview": "# How to code against the WebXR APIs \n\nWorking examples of this type of code can be found in the [examples directory](ht"
},
{
"path": "CONTRIBUTING.md",
"chars": 2823,
"preview": "Contributing to webxr-polyfill\n======================\n\nThis is an open source project and we love to receive contributio"
},
{
"path": "LICENSE",
"chars": 16726,
"preview": "Mozilla Public License Version 2.0\n==================================\n\n1. Definitions\n--------------\n\n1.1. \"Contributor\""
},
{
"path": "README.md",
"chars": 5065,
"preview": "# (deprecated, experimental) WebXR polyfill with examples\n\nThe API for \"WebXR\" implemented in this repository is based o"
},
{
"path": "dist-footer.js",
"chars": 772,
"preview": "\nXRDisplay = window.XRDisplay\nXRSession = window.XRSession\nXRSessionCreateParameters = window.XRSessionCreateParameters\n"
},
{
"path": "dist-header.js",
"chars": 1543,
"preview": "/* if there is a navigator.xr, clear it out */\nif(typeof navigator.xr != 'undefined') {\n if(typeof XRDisplay != 'unde"
},
{
"path": "examples/ar_anchors/index.html",
"chars": 3512,
"preview": "<html>\n\t<head>\n\t\t<title>AR anchor example</title>\n\t\t<meta charset=\"utf-8\">\n\t\t<meta name=\"viewport\" content=\"width=device"
},
{
"path": "examples/ar_simplest/index.html",
"chars": 3448,
"preview": "<html>\n\t<head>\n\t\t<title>AR simplest example</title>\n\t\t<meta charset=\"utf-8\">\n\t\t<meta name=\"viewport\" content=\"width=devi"
},
{
"path": "examples/boombox/index.html",
"chars": 3372,
"preview": "<html>\n\t<head>\n\t\t<title>Boombox</title>\n\t\t<meta charset=\"utf-8\">\n\t\t<meta name=\"viewport\" content=\"width=device-width, us"
},
{
"path": "examples/common.css",
"chars": 276,
"preview": "#description {\n pointer-events: auto;\n font-family: sans-serif;\n padding: 1em;\n background-color:rgba(255,25"
},
{
"path": "examples/common.js",
"chars": 16442,
"preview": "/*\n\tXRExampleBase holds all of the common XR setup, rendering, and teardown code for a THREE.js based app\n\tIt also holds"
},
{
"path": "examples/face_tracking/glasses/glasses.gltf",
"chars": 11383,
"preview": "{\n \"accessors\": [\n {\n \"bufferView\": 2,\n \"componentType\": 5126,\n \"count\": 248,\n \"max\": [\n "
},
{
"path": "examples/face_tracking/index.html",
"chars": 10961,
"preview": "\n<html>\n<head>\n\t<title>ARKit face tracking example</title>\n\t<meta charset=\"utf-8\">\n\t<meta name=\"viewport\" content=\"width"
},
{
"path": "examples/hit_test/index.html",
"chars": 5030,
"preview": "\n <html>\n\t<head>\n\t\t<title>Hit test example</title>\n\t\t<meta charset=\"utf-8\">\n\t\t<meta name=\"viewport\" content=\"width=devi"
},
{
"path": "examples/image_detection/index.html",
"chars": 8675,
"preview": "\n<html>\n<head>\n\t<title>ARKit 1.5 image detection example</title>\n\t<meta charset=\"utf-8\">\n\t<meta name=\"viewport\" content="
},
{
"path": "examples/libs/loaders/BinaryLoader.js",
"chars": 20208,
"preview": "/**\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.BinaryLoader = function ( manager ) {\n\n\tif ( typeof manag"
},
{
"path": "examples/libs/postprocessing/BloomPass.js",
"chars": 3744,
"preview": "/**\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.BloomPass = function ( strength, kernelSize, sigma, resol"
},
{
"path": "examples/libs/postprocessing/EffectComposer.js",
"chars": 3684,
"preview": "/**\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.EffectComposer = function ( renderer, renderTarget ) {\n\n\t"
},
{
"path": "examples/libs/postprocessing/FilmPass.js",
"chars": 1662,
"preview": "/**\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.FilmPass = function ( noiseIntensity, scanlinesIntensity,"
},
{
"path": "examples/libs/postprocessing/MaskPass.js",
"chars": 2036,
"preview": "/**\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.MaskPass = function ( scene, camera ) {\n\n\tTHREE.Pass.call"
},
{
"path": "examples/libs/postprocessing/RenderPass.js",
"chars": 1334,
"preview": "/**\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.RenderPass = function ( scene, camera, overrideMaterial, "
},
{
"path": "examples/libs/postprocessing/ShaderPass.js",
"chars": 1414,
"preview": "/**\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.ShaderPass = function ( shader, textureID ) {\n\n\tTHREE.Pas"
},
{
"path": "examples/libs/shaders/ConvolutionShader.js",
"chars": 1918,
"preview": "/**\n * @author alteredq / http://alteredqualia.com/\n *\n * Convolution shader\n * ported from o3d sample to WebGL / GLSL\n "
},
{
"path": "examples/libs/shaders/CopyShader.js",
"chars": 622,
"preview": "/**\n * @author alteredq / http://alteredqualia.com/\n *\n * Full-screen textured quad shader\n */\n\nTHREE.CopyShader = {\n\n\tu"
},
{
"path": "examples/libs/shaders/FilmShader.js",
"chars": 2428,
"preview": "/**\n * @author alteredq / http://alteredqualia.com/\n *\n * Film grain & scanlines shader\n *\n * - ported from HLSL to WebG"
},
{
"path": "examples/libs/shaders/FocusShader.js",
"chars": 2451,
"preview": "/**\n * @author alteredq / http://alteredqualia.com/\n *\n * Focus shader\n * based on PaintEffect postprocess from ro.me\n *"
},
{
"path": "examples/libs/stats.js",
"chars": 3817,
"preview": "(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory()"
},
{
"path": "examples/libs/three-gltf-loader.js",
"chars": 56911,
"preview": "/**\n * @author Rich Tibbett / https://github.com/richtr\n * @author mrdoob / http://mrdoob.com/\n * @author Tony Parisi / "
},
{
"path": "examples/libs/three-mtl-loader.js",
"chars": 10995,
"preview": "/**\n * Loads a Wavefront .mtl file specifying materials\n *\n * @author angelxuanchang\n */\n\nTHREE.MTLLoader = function ( m"
},
{
"path": "examples/libs/three-obj-loader.js",
"chars": 16554,
"preview": "/**\n * @author mrdoob / http://mrdoob.com/\n */\n\nTHREE.OBJLoader = ( function () {\n\n\t// o object_name | g group_name\n\tvar"
},
{
"path": "examples/libs/three.js",
"chars": 1043353,
"preview": "(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\n\ttypeof"
},
{
"path": "examples/light/index.html",
"chars": 5328,
"preview": "\n <html>\n\t<head>\n\t\t<title>Light example</title>\n\t\t<meta charset=\"utf-8\">\n\t\t<meta name=\"viewport\" content=\"width=device-"
},
{
"path": "examples/models/Axis.mtl",
"chars": 752,
"preview": "# Blender MTL File: 'Axis.blend'\n# Material Count: 4\n\nnewmtl Cube\nNs 96.078431\nKa 1.000000 1.000000 1.000000\nKd 0.420028"
},
{
"path": "examples/models/Axis.obj",
"chars": 69627,
"preview": "# Blender v2.78 (sub 0) OBJ File: 'Axis.blend'\n# www.blender.org\nmtllib Axis.mtl\no Cube.091_Cube.096\nv -0.891198 0.93190"
},
{
"path": "examples/models/BoomBox/README.md",
"chars": 209,
"preview": "# Boom Box\n## Screenshot\n\n\n\n## License Information\n\nDonated by Microsoft for glT"
},
{
"path": "examples/models/BoomBox/glTF/BoomBox.gltf",
"chars": 3137,
"preview": "{\n \"accessors\": [\n {\n \"bufferView\": 0,\n \"componentType\": 5126,\n \"count\": 3575,\n \"type\": \"VEC2\",\n"
},
{
"path": "examples/models/BoomBox/glTF-pbrSpecularGlossiness/BoomBox.gltf",
"chars": 3679,
"preview": "{\n \"accessors\": [\n {\n \"bufferView\": 0,\n \"componentType\": 5126,\n \"count\": 3575,\n \"type\": \"VEC2\",\n"
},
{
"path": "examples/models/TeapotBufferGeometry.js",
"chars": 18306,
"preview": "/**\n * @author Eric Haines / http://erichaines.com/\n *\n * Tessellates the famous Utah teapot database by Martin Newell i"
},
{
"path": "examples/models/female02/Female02_bin.js",
"chars": 2404,
"preview": "{\r\n\r\n \"metadata\" :\r\n {\r\n \"formatVersion\" : 3.1,\r\n \"sourceFile\" : \"female02.obj\",\r\n \"genera"
},
{
"path": "examples/models/female02/Female02_slim.js",
"chars": 503988,
"preview": "{\r\n\r\n \"metadata\" :\r\n {\r\n \"formatVersion\" : 3.1,\r\n \"sourceFile\" : \"female02.obj\",\r\n \"genera"
},
{
"path": "examples/models/female02/female02.mtl",
"chars": 1352,
"preview": "# Material Count: 6\nnewmtl FrontColorNoCullingID__01_-_Default1noCulli\nNs 154.901961\nKa 0.000000 0.000000 0.000000\nKd 0."
},
{
"path": "examples/models/female02/female02.obj",
"chars": 590864,
"preview": "# Blender v2.54 (sub 0) OBJ File: ''\n# www.blender.org\nmtllib female02.mtl\no mesh1.002_mesh1-geometry\nv 15.257854 104.64"
},
{
"path": "examples/models/female02/female02_vertex_colors.obj",
"chars": 679261,
"preview": "# Blender v2.54 (sub 0) OBJ File: ''\n# www.blender.org\nmtllib female02.mtl\no mesh1.002_mesh1-geometry\nv 15.257854 104.64"
},
{
"path": "examples/models/female02/readme.txt",
"chars": 137,
"preview": "Model by Reallusion iClone from Google 3d Warehouse:\n\nhttp://sketchup.google.com/3dwarehouse/details?mid=2c6fd128fca3405"
},
{
"path": "examples/models/male02/Male02_bin.js",
"chars": 2064,
"preview": "{\r\n\r\n \"metadata\" :\r\n {\r\n \"formatVersion\" : 3.1,\r\n \"sourceFile\" : \"male02.obj\",\r\n \"generate"
},
{
"path": "examples/models/male02/Male02_dds.js",
"chars": 398038,
"preview": "{\n\n \"metadata\" :\n {\n \"formatVersion\" : 3.1,\n \"sourceFile\" : \"male02.obj\",\n \"generatedBy\" "
},
{
"path": "examples/models/male02/Male02_slim.js",
"chars": 398133,
"preview": "{\r\n\r\n \"metadata\" :\r\n {\r\n \"formatVersion\" : 3.1,\r\n \"sourceFile\" : \"male02.obj\",\r\n \"generate"
},
{
"path": "examples/models/male02/male02.mtl",
"chars": 1129,
"preview": "# Material Count: 5\nnewmtl _01_-_Default1noCulli__01_-_Default1noCulli\nNs 154.901961\nKa 0.000000 0.000000 0.000000\nKd 0."
},
{
"path": "examples/models/male02/male02.obj",
"chars": 464590,
"preview": "# Blender v2.54 (sub 0) OBJ File: ''\n# www.blender.org\nmtllib male02.mtl\no mesh1.002_mesh1-geometry\nv 4.649472 159.85496"
},
{
"path": "examples/models/male02/male02_dds.mtl",
"chars": 1114,
"preview": "# Material Count: 5\nnewmtl _01_-_Default1noCulli__01_-_Default1noCulli\nNs 30.0000\nKa 0.640000 0.640000 0.640000\nKd 0.640"
},
{
"path": "examples/models/male02/readme.txt",
"chars": 126,
"preview": "Model by Reallusion iClone from Google 3d Warehouse:\n\nhttps://3dwarehouse.sketchup.com/user.html?id=01227258735522235942"
},
{
"path": "examples/opencv-aruco/createMarker.html",
"chars": 1431,
"preview": "<!DOCTYPE html>\n<head>\n<style>\ncanvas {\n border: 1px solid black;\n}\n.err {\n color: red;\n}\n</style>\n</head>\n<body>\n"
},
{
"path": "examples/opencv-aruco/index.html",
"chars": 11955,
"preview": "<html>\n\t<head>\n\t\t<title>OpenCV Aruco example</title>\n\t\t<meta charset=\"utf-8\">\n\t\t<meta name=\"viewport\" content=\"width=dev"
},
{
"path": "examples/opencv-aruco/opencv.js",
"chars": 263075,
"preview": "(function (root, factory) {\n if (typeof define === 'function' && define.amd) {\n // AMD. Register as an anonymous mod"
},
{
"path": "examples/opencv-aruco/worker.js",
"chars": 11498,
"preview": "importScripts('../../dist/webxr-worker.js')\nimportScripts(\"../../polyfill/fill/gl-matrix.js\")\nconsole.log(\"loaded webxr-"
},
{
"path": "examples/opencv-face/haarcascade_eye.xml",
"chars": 341406,
"preview": "<?xml version=\"1.0\"?>\n<!--\n Stump-based 20x20 frontal eye detector.\n Created by Shameem Hameed (http://umich.edu/~"
},
{
"path": "examples/opencv-face/haarcascade_frontalface_default.xml",
"chars": 930127,
"preview": "<?xml version=\"1.0\"?>\n<!--\n Stump-based 24x24 discrete(?) adaboost frontal face detector.\n Created by Rainer Lienh"
},
{
"path": "examples/opencv-face/haarcascade_profileface.xml",
"chars": 828514,
"preview": "<?xml version=\"1.0\"?>\n<!--\n 20x20 profile face detector.\n Contributed by David Bradley from Princeton University.\n"
},
{
"path": "examples/opencv-face/index.html",
"chars": 13680,
"preview": "<html>\n\t<head>\n\t\t<title>OpenCV Face Detection example</title>\n\t\t<meta charset=\"utf-8\">\n\t\t<meta name=\"viewport\" content=\""
},
{
"path": "examples/opencv-face/old-rotate-resize.js",
"chars": 3979,
"preview": "// createCVMat\n//\n// this routine does two things (if needed) as part of copying the input buffer to a cv.Mat:\n// - rota"
},
{
"path": "examples/opencv-face/opencv.js",
"chars": 268677,
"preview": "(function (root, factory) {\n if (typeof define === 'function' && define.amd) {\n // AMD. Register as an anonymous mod"
},
{
"path": "examples/opencv-face/worker.js",
"chars": 9913,
"preview": "importScripts('../../dist/webxr-worker.js')\nconsole.log(\"loaded webxr-worker.js\")\n\nvar openCVready = false;\n\n// need to "
},
{
"path": "examples/peoples/index.html",
"chars": 8960,
"preview": "\n <html>\n\t<head>\n\t\t<title>Spinners example</title>\n\t\t<meta charset=\"utf-8\">\n\t\t<meta name=\"viewport\" content=\"width=devi"
},
{
"path": "examples/persistence/index.html",
"chars": 8178,
"preview": "\n <html>\n\t<head>\n\t\t<title>Hit test example</title>\n\t\t<meta charset=\"utf-8\">\n\t\t<meta name=\"viewport\" content=\"width=devi"
},
{
"path": "examples/reticle/index.html",
"chars": 5627,
"preview": "\n <html>\n\t<head>\n\t\t<title>Reticle example</title>\n\t\t<meta charset=\"utf-8\">\n\t\t<meta name=\"viewport\" content=\"width=devic"
},
{
"path": "examples/sensing/index.html",
"chars": 9489,
"preview": "\n<html>\n<head>\n\t<title>Show What Information is Being Sensed in the World</title>\n\t<meta charset=\"utf-8\">\n\t<meta name=\"v"
},
{
"path": "examples/simplecv/index.html",
"chars": 9311,
"preview": "<html>\n\t<head>\n\t\t<title>Simple Custom CV example</title>\n\t\t<meta charset=\"utf-8\">\n\t\t<meta name=\"viewport\" content=\"width"
},
{
"path": "examples/simplecv/webxr-worker.js",
"chars": 10003,
"preview": "/*\nCopyright (c) 2011, Daniel Guerrero\nAll rights reserved.\nRedistribution and use in source and binary forms, with or w"
},
{
"path": "examples/simplecv/worker.js",
"chars": 6432,
"preview": "//importScripts('webxr-worker.js')\nimportScripts('../../dist/webxr-worker.js')\n/**\n * In the video callback, ev.detail "
},
{
"path": "examples/textures/Park2/readme.txt",
"chars": 578,
"preview": "Author\r\n======\r\n\r\nThis is the work of Emil Persson, aka Humus.\r\nhttp://www.humus.name\r\nhumus@comhem.se\r\n\r\n\r\n\r\nLegal stuf"
},
{
"path": "examples/vr_simplest/index.html",
"chars": 3723,
"preview": "<html>\n\t<head>\n\t\t<title>VR simplest example</title>\n\t\t<meta charset=\"utf-8\">\n\t\t<meta name=\"viewport\" content=\"width=devi"
},
{
"path": "index.html",
"chars": 13511,
"preview": "<!doctype html>\n<html>\n<head>\n <script async src=\"https://www.googletagmanager.com/gtag/js?id=UA-77033033-2\"></script"
},
{
"path": "package.json",
"chars": 756,
"preview": "{\n \"name\": \"WebXR_examples\",\n \"version\": \"0.0.1\",\n \"description\": \"\",\n \"main\": \"index.js\",\n \"directories\": {\n \"l"
},
{
"path": "polyfill/Reality.js",
"chars": 3603,
"preview": "import EventHandlerBase from './fill/EventHandlerBase.js'\n\n/*\nA Reality represents a view of the world, be it the real w"
},
{
"path": "polyfill/XRAnchor.js",
"chars": 672,
"preview": "/*\nXRAnchors provide per-frame coordinates which the Reality attempts to pin \"in place\".\nIn a virtual Reality these coor"
},
{
"path": "polyfill/XRAnchorOffset.js",
"chars": 1573,
"preview": "import MatrixMath from './fill/MatrixMath.js'\nimport Quaternion from './fill/Quaternion.js'\n\nimport XRAnchor from './XRA"
},
{
"path": "polyfill/XRCoordinateSystem.js",
"chars": 2334,
"preview": "import MatrixMath from './fill/MatrixMath.js'\n\n/*\nXRCoordinateSystem represents the origin of a 3D coordinate system pos"
},
{
"path": "polyfill/XRDisplay.js",
"chars": 3179,
"preview": "import MatrixMath from './fill/MatrixMath.js'\nimport EventHandlerBase from './fill/EventHandlerBase.js'\n\nimport VirtualR"
},
{
"path": "polyfill/XRFaceAnchor.js",
"chars": 1671,
"preview": "import XRAnchor from './XRAnchor.js'\n\n/*\nXRFaceAnchor represents a face anchor\n*/\nexport default class XRFaceAnchor exte"
},
{
"path": "polyfill/XRFieldOfView.js",
"chars": 534,
"preview": "/*\nXRFieldOFView represents the four boundaries of a camera's field of view: up, down, left, and right.\n*/\nexport defaul"
},
{
"path": "polyfill/XRImageAnchor.js",
"chars": 222,
"preview": "import XRAnchor from './XRAnchor.js'\n\n/*\nXRFaceAnchor represents an anchor\n*/\nexport default class XRImageAnchor extends"
},
{
"path": "polyfill/XRLayer.js",
"chars": 280,
"preview": "import EventHandlerBase from './fill/EventHandlerBase.js'\n\n/*\nXRLayer defines a source of bitmap images and a descriptio"
},
{
"path": "polyfill/XRLightEstimate.js",
"chars": 664,
"preview": "/*\nXRLightEstimate represents the attributes of environmental light as supplied by the device's sensors.\n*/\nexport defau"
},
{
"path": "polyfill/XRPlaneAnchor.js",
"chars": 555,
"preview": "import XRAnchor from './XRAnchor.js'\n\n/*\nXRPlaneAnchor represents a flat surfaces like floors, table tops, or walls.\n*/\n"
},
{
"path": "polyfill/XRPointCloud.js",
"chars": 320,
"preview": "\n/*\nXRPointCloud holds an array of float values where each four values represents [x, y, z, confidence in range 0-1] tha"
},
{
"path": "polyfill/XRPolyfill.js",
"chars": 5395,
"preview": "import _XRDisplay from './XRDisplay.js'\nimport _XRSession from './XRSession.js'\nimport _XRSessionCreateParameters from '"
},
{
"path": "polyfill/XRPresentationFrame.js",
"chars": 5048,
"preview": "import XRAnchor from './XRAnchor.js'\nimport ARKitWrapper from './platform/ARKitWrapper.js'\nimport MatrixMath from './fil"
},
{
"path": "polyfill/XRSession.js",
"chars": 10150,
"preview": "import EventHandlerBase from './fill/EventHandlerBase.js'\nimport MatrixMath from './fill/MatrixMath.js'\nimport XRDisplay"
},
{
"path": "polyfill/XRSessionCreateParameters.js",
"chars": 401,
"preview": "/*\nThe XRSessionCreateParametersInit dictionary provides a session description, indicating the desired capabilities of a"
},
{
"path": "polyfill/XRStageBounds.js",
"chars": 538,
"preview": "/*\nThe XRStageBounds interface describes a space known as a \"Stage\".\nThe stage is a bounded, floor-relative play space t"
},
{
"path": "polyfill/XRStageBoundsPoint.js",
"chars": 312,
"preview": "/*\nXRStageBoundPoints represent the offset in meters from the stage origin along the X and Z axes.\n*/\nexport default cla"
},
{
"path": "polyfill/XRVideoFrame.js",
"chars": 9127,
"preview": "import * as glMatrix from \"./fill/gl-matrix/common.js\";\nimport * as mat4 from \"./fill/gl-matrix/mat4.js\";\nimport * as qu"
},
{
"path": "polyfill/XRView.js",
"chars": 1919,
"preview": "import XRViewport from './XRViewport.js'\nimport MatrixMath from './fill/MatrixMath.js'\n\n/*\nAn XRView describes a single "
},
{
"path": "polyfill/XRViewPose.js",
"chars": 1750,
"preview": "import MatrixMath from './fill/MatrixMath.js'\nimport Quaternion from './fill/Quaternion.js'\n\n/*\nXRDevicePose describes t"
},
{
"path": "polyfill/XRViewport.js",
"chars": 498,
"preview": "/*\nXRViewport represents the dimensions in pixels of an XRView.\n*/\nexport default class XRViewport {\n\tconstructor(x, y, "
},
{
"path": "polyfill/XRWebGLLayer.js",
"chars": 1640,
"preview": "import XRLayer from './XRLayer.js'\n\n/*\nXRWebGLLayer defines the WebGL or WebGL 2 context that is rendering the visuals f"
},
{
"path": "polyfill/XRWorkerPolyfill.js",
"chars": 863,
"preview": "import XRAnchor from './XRAnchor.js'\nimport XRAnchorOffset from './XRAnchorOffset.js'\nimport XRCoordinateSystem from './"
},
{
"path": "polyfill/display/FlatDisplay.js",
"chars": 14741,
"preview": "import XRDisplay from '../XRDisplay.js'\nimport XRView from '../XRView.js'\nimport XRSession from '../XRSession.js'\nimport"
},
{
"path": "polyfill/display/HeadMountedDisplay.js",
"chars": 4251,
"preview": "import XRDisplay from '../XRDisplay.js'\nimport XRView from '../XRView.js'\nimport XRSession from '../XRSession.js'\nimport"
},
{
"path": "polyfill/fill/DeviceOrientationTracker.js",
"chars": 2420,
"preview": "import EventHandlerBase from './EventHandlerBase.js'\n\nimport Vector3 from './Vector3.js'\nimport Quaternion from './Quate"
},
{
"path": "polyfill/fill/Euler.js",
"chars": 393,
"preview": "\nexport default class Euler {\n\tconstructor(x, y, z, order=Euler.DefaultOrder){\n\t\tthis.x = x\n\t\tthis.y = y\n\t\tthis.z = z\n\t\t"
},
{
"path": "polyfill/fill/EventHandlerBase.js",
"chars": 1119,
"preview": "/*\nEventHandlerBase is the base class that implements the EventHandler interface methods for dispatching and receiving e"
},
{
"path": "polyfill/fill/MatrixMath.js",
"chars": 6660,
"preview": "import Quaternion from './Quaternion.js'\n\n/*\nMatrixMath provides helper functions for populating the various matrices in"
},
{
"path": "polyfill/fill/Quaternion.js",
"chars": 5795,
"preview": "/*\nQuaternion wraps a vector of length 4 used as an orientation value.\n\nTaken from https://github.com/googlevr/webvr-pol"
},
{
"path": "polyfill/fill/Vector3.js",
"chars": 2093,
"preview": "/*\nVector3 wraps a vector of length 3, often used as a position in 3D space.\n\nTaken from https://github.com/googlevr/web"
},
{
"path": "polyfill/fill/base64-binary.js",
"chars": 5293,
"preview": "/*\nCopyright (c) 2011, Daniel Guerrero\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or "
},
{
"path": "polyfill/fill/gl-matrix/common.js",
"chars": 2252,
"preview": "/* Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV.\n\nPermission is hereby granted, free of charge, to any person o"
},
{
"path": "polyfill/fill/gl-matrix/mat2.js",
"chars": 10780,
"preview": "/* Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV.\n\nPermission is hereby granted, free of charge, to any person o"
},
{
"path": "polyfill/fill/gl-matrix/mat2d.js",
"chars": 11889,
"preview": "/* Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV.\n\nPermission is hereby granted, free of charge, to any person o"
},
{
"path": "polyfill/fill/gl-matrix/mat3.js",
"chars": 19503,
"preview": "/* Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV.\n\nPermission is hereby granted, free of charge, to any person o"
},
{
"path": "polyfill/fill/gl-matrix/mat4.js",
"chars": 47005,
"preview": "/* Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV.\n\nPermission is hereby granted, free of charge, to any person o"
},
{
"path": "polyfill/fill/gl-matrix/quat.js",
"chars": 16279,
"preview": "/* Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV.\n\nPermission is hereby granted, free of charge, to any person o"
},
{
"path": "polyfill/fill/gl-matrix/vec2.js",
"chars": 13468,
"preview": "/* Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV.\n\nPermission is hereby granted, free of charge, to any person o"
},
{
"path": "polyfill/fill/gl-matrix/vec3.js",
"chars": 18986,
"preview": "/* Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV.\n\nPermission is hereby granted, free of charge, to any person o"
},
{
"path": "polyfill/fill/gl-matrix/vec4.js",
"chars": 14618,
"preview": "/* Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV.\n\nPermission is hereby granted, free of charge, to any person o"
},
{
"path": "polyfill/fill/gl-matrix-min.js",
"chars": 48134,
"preview": "/**\n * @fileoverview gl-matrix - High performance matrix and vector operations\n * @author Brandon Jones\n * @author Colin"
},
{
"path": "polyfill/fill/gl-matrix.js",
"chars": 174815,
"preview": "/**\n * @fileoverview gl-matrix - High performance matrix and vector operations\n * @author Brandon Jones\n * @author Colin"
},
{
"path": "polyfill/platform/ARCoreCameraRenderer.js",
"chars": 9776,
"preview": "/*\n * Copyright 2017 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the 'License')\n"
},
{
"path": "polyfill/platform/ARKitWrapper.js",
"chars": 42428,
"preview": "import EventHandlerBase from '../fill/EventHandlerBase.js'\nimport * as glMatrix from \"../fill/gl-matrix/common.js\";\nimpo"
},
{
"path": "polyfill/reality/CameraReality.js",
"chars": 24402,
"preview": "import Reality from '../Reality.js'\nimport XRAnchor from '../XRAnchor.js'\nimport XRViewPose from '../XRViewPose.js'\n\nimp"
},
{
"path": "polyfill/reality/VirtualReality.js",
"chars": 2035,
"preview": "import Reality from '../Reality.js'\n\n/*\nVirtualReality is a Reality that is empty and waiting for fanstastic CG scenes.\n"
},
{
"path": "tests/CoordinatesTest.js",
"chars": 2457,
"preview": "import Test from './Test.js'\n\nimport MatrixMath from '../polyfill/fill/MatrixMath.js'\nimport XRDisplay from '../polyfill"
},
{
"path": "tests/Test.js",
"chars": 1134,
"preview": "export default class Test {\n\trun(){\n\t\tfor(let name of Object.getOwnPropertyNames(Object.getPrototypeOf(this))){\n\t\t\tif(na"
},
{
"path": "tests/index.html",
"chars": 445,
"preview": "<html>\n\t<head>\n\t\t<title>Tests</title>\n\t\t<meta charset=\"utf-8\">\n\t\t<style>\n\t\t</style>\n\n\t\t<script type=\"module\" src=\"../pol"
},
{
"path": "viewer.html",
"chars": 11434,
"preview": "<!doctype html> \n<html>\n\t<head>\n\t\t<script async src=\"https://www.googletagmanager.com/gtag/js?id=UA-77033033-2\"></script"
},
{
"path": "webpack.config.js",
"chars": 1217,
"preview": "const path = require('path');\nconst fs = require('fs');\n\nWrapperPlugin = require('wrapper-webpack-plugin');\n\nconst heade"
}
]
// ... and 8 more files (download for full content)
About this extraction
This page contains the full source code of the mozilla/webxr-polyfill GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 136 files (18.1 MB), approximately 1.9M tokens, and a symbol index with 2368 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.