feat: use custom player module
This commit is contained in:
3444
apps/module/spine-ts/threejs/example/assets/raptor-pro.json
Executable file
3444
apps/module/spine-ts/threejs/example/assets/raptor-pro.json
Executable file
File diff suppressed because one or more lines are too long
272
apps/module/spine-ts/threejs/example/assets/raptor.atlas
Executable file
272
apps/module/spine-ts/threejs/example/assets/raptor.atlas
Executable file
@@ -0,0 +1,272 @@
|
||||
|
||||
raptor.png
|
||||
size: 1024,512
|
||||
format: RGBA8888
|
||||
filter: Linear,Linear
|
||||
repeat: none
|
||||
back-arm
|
||||
rotate: true
|
||||
xy: 829, 88
|
||||
size: 46, 25
|
||||
orig: 46, 25
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
back-bracer
|
||||
rotate: true
|
||||
xy: 195, 238
|
||||
size: 39, 28
|
||||
orig: 39, 28
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
back-hand
|
||||
rotate: true
|
||||
xy: 724, 140
|
||||
size: 36, 34
|
||||
orig: 36, 34
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
back-knee
|
||||
rotate: true
|
||||
xy: 760, 131
|
||||
size: 49, 67
|
||||
orig: 49, 67
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
back-thigh
|
||||
rotate: true
|
||||
xy: 225, 238
|
||||
size: 39, 24
|
||||
orig: 39, 24
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
eyes-open
|
||||
rotate: false
|
||||
xy: 975, 204
|
||||
size: 47, 45
|
||||
orig: 47, 45
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
front-arm
|
||||
rotate: false
|
||||
xy: 969, 112
|
||||
size: 48, 26
|
||||
orig: 48, 26
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
front-bracer
|
||||
rotate: true
|
||||
xy: 724, 97
|
||||
size: 41, 29
|
||||
orig: 41, 29
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
front-hand
|
||||
rotate: false
|
||||
xy: 251, 239
|
||||
size: 41, 38
|
||||
orig: 41, 38
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
front-open-hand
|
||||
rotate: true
|
||||
xy: 856, 76
|
||||
size: 43, 44
|
||||
orig: 43, 44
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
front-thigh
|
||||
rotate: true
|
||||
xy: 729, 178
|
||||
size: 57, 29
|
||||
orig: 57, 29
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
gun
|
||||
rotate: false
|
||||
xy: 894, 251
|
||||
size: 107, 103
|
||||
orig: 107, 103
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
gun-nohand
|
||||
rotate: false
|
||||
xy: 764, 241
|
||||
size: 105, 102
|
||||
orig: 105, 102
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
head
|
||||
rotate: false
|
||||
xy: 756, 345
|
||||
size: 136, 149
|
||||
orig: 136, 149
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
lower-leg
|
||||
rotate: true
|
||||
xy: 475, 237
|
||||
size: 73, 98
|
||||
orig: 73, 98
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
mouth-grind
|
||||
rotate: false
|
||||
xy: 975, 172
|
||||
size: 47, 30
|
||||
orig: 47, 30
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
mouth-smile
|
||||
rotate: false
|
||||
xy: 975, 140
|
||||
size: 47, 30
|
||||
orig: 47, 30
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
neck
|
||||
rotate: false
|
||||
xy: 366, 282
|
||||
size: 18, 21
|
||||
orig: 18, 21
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
raptor-back-arm
|
||||
rotate: true
|
||||
xy: 636, 97
|
||||
size: 82, 86
|
||||
orig: 82, 86
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
raptor-body
|
||||
rotate: false
|
||||
xy: 2, 2
|
||||
size: 632, 233
|
||||
orig: 632, 233
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
raptor-front-arm
|
||||
rotate: true
|
||||
xy: 871, 168
|
||||
size: 81, 102
|
||||
orig: 81, 102
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
raptor-front-leg
|
||||
rotate: false
|
||||
xy: 2, 237
|
||||
size: 191, 257
|
||||
orig: 191, 257
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
raptor-hindleg-back
|
||||
rotate: false
|
||||
xy: 195, 279
|
||||
size: 169, 215
|
||||
orig: 169, 215
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
raptor-horn
|
||||
rotate: true
|
||||
xy: 431, 312
|
||||
size: 182, 80
|
||||
orig: 182, 80
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
raptor-horn-back
|
||||
rotate: true
|
||||
xy: 513, 318
|
||||
size: 176, 77
|
||||
orig: 176, 77
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
raptor-jaw
|
||||
rotate: false
|
||||
xy: 894, 356
|
||||
size: 126, 138
|
||||
orig: 126, 138
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
raptor-jaw-tooth
|
||||
rotate: true
|
||||
xy: 294, 240
|
||||
size: 37, 48
|
||||
orig: 37, 48
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
raptor-mouth-inside
|
||||
rotate: true
|
||||
xy: 344, 241
|
||||
size: 36, 41
|
||||
orig: 36, 41
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
raptor-saddle-strap-back
|
||||
rotate: false
|
||||
xy: 575, 242
|
||||
size: 54, 74
|
||||
orig: 54, 74
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
raptor-saddle-strap-front
|
||||
rotate: true
|
||||
xy: 764, 182
|
||||
size: 57, 95
|
||||
orig: 57, 95
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
raptor-saddle-w-shadow
|
||||
rotate: false
|
||||
xy: 592, 323
|
||||
size: 162, 171
|
||||
orig: 162, 171
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
raptor-tail-shadow
|
||||
rotate: true
|
||||
xy: 366, 305
|
||||
size: 189, 63
|
||||
orig: 189, 63
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
raptor-tongue
|
||||
rotate: false
|
||||
xy: 387, 239
|
||||
size: 86, 64
|
||||
orig: 86, 64
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
stirrup-back
|
||||
rotate: true
|
||||
xy: 829, 136
|
||||
size: 44, 35
|
||||
orig: 44, 35
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
stirrup-front
|
||||
rotate: true
|
||||
xy: 866, 121
|
||||
size: 45, 50
|
||||
orig: 45, 50
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
stirrup-strap
|
||||
rotate: false
|
||||
xy: 918, 120
|
||||
size: 49, 46
|
||||
orig: 49, 46
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
torso
|
||||
rotate: true
|
||||
xy: 636, 181
|
||||
size: 54, 91
|
||||
orig: 54, 91
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
visor
|
||||
rotate: false
|
||||
xy: 631, 237
|
||||
size: 131, 84
|
||||
orig: 131, 84
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
BIN
apps/module/spine-ts/threejs/example/assets/raptor.png
Executable file
BIN
apps/module/spine-ts/threejs/example/assets/raptor.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 468 KiB |
122
apps/module/spine-ts/threejs/example/index.html
Executable file
122
apps/module/spine-ts/threejs/example/index.html
Executable file
@@ -0,0 +1,122 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>spine-threejs</title>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/110/three.min.js"></script>
|
||||
<script src="../../build/spine-threejs.js"></script>
|
||||
</head>
|
||||
<style>
|
||||
* { margin: 0; padding: 0; }
|
||||
body, html { height: 100% }
|
||||
canvas { position: absolute; width: 100% ;height: 100%; }
|
||||
</style>
|
||||
<body>
|
||||
<script>
|
||||
|
||||
var scene, camera, renderer;
|
||||
var geometry, material, mesh, skeletonMesh;
|
||||
var assetManager;
|
||||
var canvas;
|
||||
var lastFrameTime = Date.now() / 1000;
|
||||
|
||||
var baseUrl = "assets/";
|
||||
var skeletonFile = "raptor-pro.json";
|
||||
var atlasFile = skeletonFile.replace("-pro", "").replace("-ess", "").replace(".json", ".atlas");
|
||||
var animation = "walk";
|
||||
|
||||
function init () {
|
||||
// create the THREE.JS camera, scene and renderer (WebGL)
|
||||
var width = window.innerWidth, height = window.innerHeight;
|
||||
camera = new THREE.PerspectiveCamera(75, width / height, 1, 3000);
|
||||
camera.position.y = 100;
|
||||
camera.position.z = 400;
|
||||
scene = new THREE.Scene();
|
||||
renderer = new THREE.WebGLRenderer();
|
||||
renderer.setSize(width, height);
|
||||
document.body.appendChild(renderer.domElement);
|
||||
canvas = renderer.domElement;
|
||||
|
||||
// load the assets required to display the Raptor model
|
||||
assetManager = new spine.threejs.AssetManager(baseUrl);
|
||||
assetManager.loadText(skeletonFile);
|
||||
assetManager.loadTextureAtlas(atlasFile);
|
||||
|
||||
requestAnimationFrame(load);
|
||||
}
|
||||
|
||||
function load (name, scale) {
|
||||
if (assetManager.isLoadingComplete()) {
|
||||
// Add a box to the scene to which we attach the skeleton mesh
|
||||
geometry = new THREE.BoxGeometry(200, 200, 200);
|
||||
material = new THREE.MeshBasicMaterial({ color: 0xff0000, wireframe: true });
|
||||
mesh = new THREE.Mesh(geometry, material);
|
||||
scene.add(mesh);
|
||||
|
||||
// Load the texture atlas using name.atlas and name.png from the AssetManager.
|
||||
// The function passed to TextureAtlas is used to resolve relative paths.
|
||||
atlas = assetManager.get(atlasFile);
|
||||
|
||||
// Create a AtlasAttachmentLoader that resolves region, mesh, boundingbox and path attachments
|
||||
atlasLoader = new spine.AtlasAttachmentLoader(atlas);
|
||||
|
||||
// Create a SkeletonJson instance for parsing the .json file.
|
||||
var skeletonJson = new spine.SkeletonJson(atlasLoader);
|
||||
|
||||
// Set the scale to apply during parsing, parse the file, and create a new skeleton.
|
||||
skeletonJson.scale = 0.4;
|
||||
var skeletonData = skeletonJson.readSkeletonData(assetManager.get(skeletonFile));
|
||||
|
||||
// Create a SkeletonMesh from the data and attach it to the scene
|
||||
skeletonMesh = new spine.threejs.SkeletonMesh(skeletonData, function(parameters) {
|
||||
parameters.depthTest = false;
|
||||
});
|
||||
skeletonMesh.state.setAnimation(0, animation, true);
|
||||
mesh.add(skeletonMesh);
|
||||
|
||||
requestAnimationFrame(render);
|
||||
} else requestAnimationFrame(load);
|
||||
}
|
||||
|
||||
var lastTime = Date.now();
|
||||
function render() {
|
||||
// calculate delta time for animation purposes
|
||||
var now = Date.now() / 1000;
|
||||
var delta = now - lastFrameTime;
|
||||
lastFrameTime = now;
|
||||
|
||||
// resize canvas to use full page, adjust camera/renderer
|
||||
resize();
|
||||
|
||||
// rotate the cube
|
||||
mesh.rotation.x = Math.sin(now) * Math.PI * 0.2;
|
||||
mesh.rotation.y = Math.cos(now) * Math.PI * 0.4;
|
||||
|
||||
// update the animation
|
||||
skeletonMesh.update(delta);
|
||||
|
||||
// render the scene
|
||||
renderer.render(scene, camera);
|
||||
|
||||
requestAnimationFrame(render);
|
||||
}
|
||||
|
||||
function resize () {
|
||||
var w = window.innerWidth;
|
||||
var h = window.innerHeight;
|
||||
if (canvas.width != w || canvas.height != h) {
|
||||
canvas.width = w;
|
||||
canvas.height = h;
|
||||
}
|
||||
|
||||
camera.aspect = w / h;
|
||||
camera.updateProjectionMatrix();
|
||||
|
||||
renderer.setSize(w, h);
|
||||
}
|
||||
|
||||
(function() {
|
||||
init();
|
||||
}());
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
38
apps/module/spine-ts/threejs/src/AssetManager.ts
Executable file
38
apps/module/spine-ts/threejs/src/AssetManager.ts
Executable file
@@ -0,0 +1,38 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated January 1, 2020. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2020, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
module spine.threejs {
|
||||
export class AssetManager extends spine.AssetManager {
|
||||
constructor (pathPrefix: string = "") {
|
||||
super((image: HTMLImageElement) => {
|
||||
return new ThreeJsTexture(image);
|
||||
}, pathPrefix);
|
||||
}
|
||||
}
|
||||
}
|
||||
125
apps/module/spine-ts/threejs/src/MeshBatcher.ts
Executable file
125
apps/module/spine-ts/threejs/src/MeshBatcher.ts
Executable file
@@ -0,0 +1,125 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated January 1, 2020. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2020, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
module spine.threejs {
|
||||
export class MeshBatcher extends THREE.Mesh {
|
||||
private static VERTEX_SIZE = 9;
|
||||
private vertexBuffer: THREE.InterleavedBuffer;
|
||||
private vertices: Float32Array;
|
||||
private verticesLength = 0;
|
||||
private indices: Uint16Array;
|
||||
private indicesLength = 0;
|
||||
|
||||
constructor (maxVertices: number = 10920, materialCustomizer: SkeletonMeshMaterialParametersCustomizer = (parameters) => { }) {
|
||||
super();
|
||||
if (maxVertices > 10920) throw new Error("Can't have more than 10920 triangles per batch: " + maxVertices);
|
||||
let vertices = this.vertices = new Float32Array(maxVertices * MeshBatcher.VERTEX_SIZE);
|
||||
let indices = this.indices = new Uint16Array(maxVertices * 3);
|
||||
let geo = new THREE.BufferGeometry();
|
||||
let vertexBuffer = this.vertexBuffer = new THREE.InterleavedBuffer(vertices, MeshBatcher.VERTEX_SIZE);
|
||||
vertexBuffer.usage = WebGLRenderingContext.DYNAMIC_DRAW;
|
||||
geo.setAttribute("position", new THREE.InterleavedBufferAttribute(vertexBuffer, 3, 0, false));
|
||||
geo.setAttribute("color", new THREE.InterleavedBufferAttribute(vertexBuffer, 4, 3, false));
|
||||
geo.setAttribute("uv", new THREE.InterleavedBufferAttribute(vertexBuffer, 2, 7, false));
|
||||
geo.setIndex(new THREE.BufferAttribute(indices, 1));
|
||||
geo.getIndex().usage = WebGLRenderingContext.DYNAMIC_DRAW;;
|
||||
geo.drawRange.start = 0;
|
||||
geo.drawRange.count = 0;
|
||||
this.geometry = geo;
|
||||
this.material = new SkeletonMeshMaterial(materialCustomizer);
|
||||
}
|
||||
|
||||
dispose () {
|
||||
this.geometry.dispose();
|
||||
if (this.material instanceof THREE.Material)
|
||||
this.material.dispose();
|
||||
else if (this.material) {
|
||||
for (let i = 0; i < this.material.length; i++) {
|
||||
let material = this.material[i];
|
||||
if (material instanceof THREE.Material)
|
||||
material.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
clear () {
|
||||
let geo = (<THREE.BufferGeometry>this.geometry);
|
||||
geo.drawRange.start = 0;
|
||||
geo.drawRange.count = 0;
|
||||
(<SkeletonMeshMaterial>this.material).uniforms.map.value = null;
|
||||
}
|
||||
|
||||
begin () {
|
||||
this.verticesLength = 0;
|
||||
this.indicesLength = 0;
|
||||
}
|
||||
|
||||
canBatch(verticesLength: number, indicesLength: number) {
|
||||
if (this.indicesLength + indicesLength >= this.indices.byteLength / 2) return false;
|
||||
if (this.verticesLength + verticesLength >= this.vertices.byteLength / 2) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
batch (vertices: ArrayLike<number>, verticesLength: number, indices: ArrayLike<number>, indicesLength: number, z: number = 0) {
|
||||
let indexStart = this.verticesLength / MeshBatcher.VERTEX_SIZE;
|
||||
let vertexBuffer = this.vertices;
|
||||
let i = this.verticesLength;
|
||||
let j = 0;
|
||||
for (;j < verticesLength;) {
|
||||
vertexBuffer[i++] = vertices[j++];
|
||||
vertexBuffer[i++] = vertices[j++];
|
||||
vertexBuffer[i++] = z;
|
||||
vertexBuffer[i++] = vertices[j++];
|
||||
vertexBuffer[i++] = vertices[j++];
|
||||
vertexBuffer[i++] = vertices[j++];
|
||||
vertexBuffer[i++] = vertices[j++];
|
||||
vertexBuffer[i++] = vertices[j++];
|
||||
vertexBuffer[i++] = vertices[j++];
|
||||
}
|
||||
this.verticesLength = i;
|
||||
|
||||
let indicesArray = this.indices;
|
||||
for (i = this.indicesLength, j = 0; j < indicesLength; i++, j++)
|
||||
indicesArray[i] = indices[j] + indexStart;
|
||||
this.indicesLength += indicesLength;
|
||||
}
|
||||
|
||||
end () {
|
||||
this.vertexBuffer.needsUpdate = this.verticesLength > 0;
|
||||
this.vertexBuffer.updateRange.offset = 0;
|
||||
this.vertexBuffer.updateRange.count = this.verticesLength;
|
||||
let geo = (<THREE.BufferGeometry>this.geometry);
|
||||
geo.getIndex().needsUpdate = this.indicesLength > 0;
|
||||
geo.getIndex().updateRange.offset = 0;
|
||||
geo.getIndex().updateRange.count = this.indicesLength;
|
||||
geo.drawRange.start = 0;
|
||||
geo.drawRange.count = this.indicesLength;
|
||||
}
|
||||
}
|
||||
}
|
||||
316
apps/module/spine-ts/threejs/src/SkeletonMesh.ts
Executable file
316
apps/module/spine-ts/threejs/src/SkeletonMesh.ts
Executable file
@@ -0,0 +1,316 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated January 1, 2020. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2020, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
module spine.threejs {
|
||||
export interface SkeletonMeshMaterialParametersCustomizer {
|
||||
(materialParameters: THREE.ShaderMaterialParameters): void;
|
||||
}
|
||||
|
||||
export class SkeletonMeshMaterial extends THREE.ShaderMaterial {
|
||||
constructor (customizer: SkeletonMeshMaterialParametersCustomizer) {
|
||||
let vertexShader = `
|
||||
attribute vec4 color;
|
||||
varying vec2 vUv;
|
||||
varying vec4 vColor;
|
||||
void main() {
|
||||
vUv = uv;
|
||||
vColor = color;
|
||||
gl_Position = projectionMatrix*modelViewMatrix*vec4(position,1.0);
|
||||
}
|
||||
`;
|
||||
let fragmentShader = `
|
||||
uniform sampler2D map;
|
||||
varying vec2 vUv;
|
||||
varying vec4 vColor;
|
||||
void main(void) {
|
||||
gl_FragColor = texture2D(map, vUv)*vColor;
|
||||
}
|
||||
`;
|
||||
|
||||
let parameters: THREE.ShaderMaterialParameters = {
|
||||
uniforms: {
|
||||
map: { type: "t", value: null }
|
||||
},
|
||||
vertexShader: vertexShader,
|
||||
fragmentShader: fragmentShader,
|
||||
side: THREE.DoubleSide,
|
||||
transparent: true,
|
||||
alphaTest: 0.5
|
||||
};
|
||||
customizer(parameters);
|
||||
super(parameters);
|
||||
};
|
||||
}
|
||||
|
||||
export class SkeletonMesh extends THREE.Object3D {
|
||||
tempPos: Vector2 = new Vector2();
|
||||
tempUv: Vector2 = new Vector2();
|
||||
tempLight = new Color();
|
||||
tempDark = new Color();
|
||||
skeleton: Skeleton;
|
||||
state: AnimationState;
|
||||
zOffset: number = 0.1;
|
||||
vertexEffect: VertexEffect;
|
||||
|
||||
private batches = new Array<MeshBatcher>();
|
||||
private nextBatchIndex = 0;
|
||||
private clipper: SkeletonClipping = new SkeletonClipping();
|
||||
|
||||
static QUAD_TRIANGLES = [0, 1, 2, 2, 3, 0];
|
||||
static VERTEX_SIZE = 2 + 2 + 4;
|
||||
|
||||
private vertices = Utils.newFloatArray(1024);
|
||||
private tempColor = new Color();
|
||||
private materialCustomizer: SkeletonMeshMaterialParametersCustomizer;
|
||||
|
||||
constructor (skeletonData: SkeletonData, materialCustomizer: SkeletonMeshMaterialParametersCustomizer = (parameters) => { }) {
|
||||
super();
|
||||
this.materialCustomizer = materialCustomizer;
|
||||
this.skeleton = new Skeleton(skeletonData);
|
||||
let animData = new AnimationStateData(skeletonData);
|
||||
this.state = new AnimationState(animData);
|
||||
}
|
||||
|
||||
update(deltaTime: number) {
|
||||
let state = this.state;
|
||||
let skeleton = this.skeleton;
|
||||
|
||||
state.update(deltaTime);
|
||||
state.apply(skeleton);
|
||||
skeleton.updateWorldTransform();
|
||||
|
||||
this.updateGeometry();
|
||||
}
|
||||
|
||||
dispose () {
|
||||
for (var i = 0; i < this.batches.length; i++) {
|
||||
this.batches[i].dispose();
|
||||
}
|
||||
}
|
||||
|
||||
private clearBatches () {
|
||||
for (var i = 0; i < this.batches.length; i++) {
|
||||
this.batches[i].clear();
|
||||
this.batches[i].visible = false;
|
||||
}
|
||||
this.nextBatchIndex = 0;
|
||||
}
|
||||
|
||||
private nextBatch () {
|
||||
if (this.batches.length == this.nextBatchIndex) {
|
||||
let batch = new MeshBatcher(10920, this.materialCustomizer);
|
||||
this.add(batch);
|
||||
this.batches.push(batch);
|
||||
}
|
||||
let batch = this.batches[this.nextBatchIndex++];
|
||||
batch.visible = true;
|
||||
return batch;
|
||||
}
|
||||
|
||||
private updateGeometry() {
|
||||
this.clearBatches();
|
||||
|
||||
let tempPos = this.tempPos;
|
||||
let tempUv = this.tempUv;
|
||||
let tempLight = this.tempLight;
|
||||
let tempDark = this.tempDark;
|
||||
|
||||
var numVertices = 0;
|
||||
var verticesLength = 0;
|
||||
var indicesLength = 0;
|
||||
|
||||
let blendMode: BlendMode = null;
|
||||
let clipper = this.clipper;
|
||||
|
||||
let vertices: ArrayLike<number> = this.vertices;
|
||||
let triangles: Array<number> = null;
|
||||
let uvs: ArrayLike<number> = null;
|
||||
let drawOrder = this.skeleton.drawOrder;
|
||||
let batch = this.nextBatch();
|
||||
batch.begin();
|
||||
let z = 0;
|
||||
let zOffset = this.zOffset;
|
||||
for (let i = 0, n = drawOrder.length; i < n; i++) {
|
||||
let vertexSize = clipper.isClipping() ? 2 : SkeletonMesh.VERTEX_SIZE;
|
||||
let slot = drawOrder[i];
|
||||
if (!slot.bone.active) continue;
|
||||
let attachment = slot.getAttachment();
|
||||
let attachmentColor: Color = null;
|
||||
let texture: ThreeJsTexture = null;
|
||||
let numFloats = 0;
|
||||
if (attachment instanceof RegionAttachment) {
|
||||
let region = <RegionAttachment>attachment;
|
||||
attachmentColor = region.color;
|
||||
vertices = this.vertices;
|
||||
numFloats = vertexSize * 4;
|
||||
region.computeWorldVertices(slot.bone, vertices, 0, vertexSize);
|
||||
triangles = SkeletonMesh.QUAD_TRIANGLES;
|
||||
uvs = region.uvs;
|
||||
texture = <ThreeJsTexture>(<TextureAtlasRegion>region.region.renderObject).texture;
|
||||
} else if (attachment instanceof MeshAttachment) {
|
||||
let mesh = <MeshAttachment>attachment;
|
||||
attachmentColor = mesh.color;
|
||||
vertices = this.vertices;
|
||||
numFloats = (mesh.worldVerticesLength >> 1) * vertexSize;
|
||||
if (numFloats > vertices.length) {
|
||||
vertices = this.vertices = spine.Utils.newFloatArray(numFloats);
|
||||
}
|
||||
mesh.computeWorldVertices(slot, 0, mesh.worldVerticesLength, vertices, 0, vertexSize);
|
||||
triangles = mesh.triangles;
|
||||
uvs = mesh.uvs;
|
||||
texture = <ThreeJsTexture>(<TextureAtlasRegion>mesh.region.renderObject).texture;
|
||||
} else if (attachment instanceof ClippingAttachment) {
|
||||
let clip = <ClippingAttachment>(attachment);
|
||||
clipper.clipStart(slot, clip);
|
||||
continue;
|
||||
} else continue;
|
||||
|
||||
if (texture != null) {
|
||||
let skeleton = slot.bone.skeleton;
|
||||
let skeletonColor = skeleton.color;
|
||||
let slotColor = slot.color;
|
||||
let alpha = skeletonColor.a * slotColor.a * attachmentColor.a;
|
||||
let color = this.tempColor;
|
||||
color.set(skeletonColor.r * slotColor.r * attachmentColor.r,
|
||||
skeletonColor.g * slotColor.g * attachmentColor.g,
|
||||
skeletonColor.b * slotColor.b * attachmentColor.b,
|
||||
alpha);
|
||||
|
||||
let finalVertices: ArrayLike<number>;
|
||||
let finalVerticesLength: number;
|
||||
let finalIndices: ArrayLike<number>;
|
||||
let finalIndicesLength: number;
|
||||
|
||||
if (clipper.isClipping()) {
|
||||
clipper.clipTriangles(vertices, numFloats, triangles, triangles.length, uvs, color, null, false);
|
||||
let clippedVertices = clipper.clippedVertices;
|
||||
let clippedTriangles = clipper.clippedTriangles;
|
||||
if (this.vertexEffect != null) {
|
||||
let vertexEffect = this.vertexEffect;
|
||||
let verts = clippedVertices;
|
||||
for (let v = 0, n = clippedVertices.length; v < n; v += vertexSize) {
|
||||
tempPos.x = verts[v];
|
||||
tempPos.y = verts[v + 1];
|
||||
tempLight.setFromColor(color);
|
||||
tempDark.set(0, 0, 0, 0);
|
||||
tempUv.x = verts[v + 6];
|
||||
tempUv.y = verts[v + 7];
|
||||
vertexEffect.transform(tempPos, tempUv, tempLight, tempDark);
|
||||
verts[v] = tempPos.x;
|
||||
verts[v + 1] = tempPos.y;
|
||||
verts[v + 2] = tempLight.r;
|
||||
verts[v + 3] = tempLight.g;
|
||||
verts[v + 4] = tempLight.b;
|
||||
verts[v + 5] = tempLight.a;
|
||||
verts[v + 6] = tempUv.x;
|
||||
verts[v + 7] = tempUv.y;
|
||||
}
|
||||
}
|
||||
finalVertices = clippedVertices;
|
||||
finalVerticesLength = clippedVertices.length;
|
||||
finalIndices = clippedTriangles;
|
||||
finalIndicesLength = clippedTriangles.length;
|
||||
} else {
|
||||
let verts = vertices;
|
||||
if (this.vertexEffect != null) {
|
||||
let vertexEffect = this.vertexEffect;
|
||||
for (let v = 0, u = 0, n = numFloats; v < n; v += vertexSize, u += 2) {
|
||||
tempPos.x = verts[v];
|
||||
tempPos.y = verts[v + 1];
|
||||
tempLight.setFromColor(color);
|
||||
tempDark.set(0, 0, 0, 0);
|
||||
tempUv.x = uvs[u];
|
||||
tempUv.y = uvs[u + 1];
|
||||
vertexEffect.transform(tempPos, tempUv, tempLight, tempDark);
|
||||
verts[v] = tempPos.x;
|
||||
verts[v + 1] = tempPos.y;
|
||||
verts[v + 2] = tempLight.r;
|
||||
verts[v + 3] = tempLight.g;
|
||||
verts[v + 4] = tempLight.b;
|
||||
verts[v + 5] = tempLight.a;
|
||||
verts[v + 6] = tempUv.x;
|
||||
verts[v + 7] = tempUv.y;
|
||||
}
|
||||
} else {
|
||||
for (let v = 2, u = 0, n = numFloats; v < n; v += vertexSize, u += 2) {
|
||||
verts[v] = color.r;
|
||||
verts[v + 1] = color.g;
|
||||
verts[v + 2] = color.b;
|
||||
verts[v + 3] = color.a;
|
||||
verts[v + 4] = uvs[u];
|
||||
verts[v + 5] = uvs[u + 1];
|
||||
}
|
||||
}
|
||||
finalVertices = vertices;
|
||||
finalVerticesLength = numFloats;
|
||||
finalIndices = triangles;
|
||||
finalIndicesLength = triangles.length;
|
||||
}
|
||||
|
||||
if (finalVerticesLength == 0 || finalIndicesLength == 0)
|
||||
continue;
|
||||
|
||||
// Start new batch if this one can't hold vertices/indices
|
||||
if (!batch.canBatch(finalVerticesLength, finalIndicesLength)) {
|
||||
batch.end();
|
||||
batch = this.nextBatch();
|
||||
batch.begin();
|
||||
}
|
||||
|
||||
// FIXME per slot blending would require multiple material support
|
||||
//let slotBlendMode = slot.data.blendMode;
|
||||
//if (slotBlendMode != blendMode) {
|
||||
// blendMode = slotBlendMode;
|
||||
// batcher.setBlendMode(getSourceGLBlendMode(this._gl, blendMode, premultipliedAlpha), getDestGLBlendMode(this._gl, blendMode));
|
||||
//}
|
||||
|
||||
let batchMaterial = <SkeletonMeshMaterial>batch.material;
|
||||
if (batchMaterial.uniforms.map.value == null) {
|
||||
batchMaterial.uniforms.map.value = texture.texture;
|
||||
}
|
||||
if (batchMaterial.uniforms.map.value != texture.texture) {
|
||||
batch.end();
|
||||
batch = this.nextBatch();
|
||||
batch.begin();
|
||||
batchMaterial = <SkeletonMeshMaterial>batch.material;
|
||||
batchMaterial.uniforms.map.value = texture.texture;
|
||||
}
|
||||
batchMaterial.needsUpdate = true;
|
||||
|
||||
batch.batch(finalVertices, finalVerticesLength, finalIndices, finalIndicesLength, z);
|
||||
z += zOffset;
|
||||
}
|
||||
|
||||
clipper.clipEndWithSlot(slot);
|
||||
}
|
||||
clipper.clipEnd();
|
||||
batch.end();
|
||||
}
|
||||
}
|
||||
}
|
||||
72
apps/module/spine-ts/threejs/src/ThreeJsTexture.ts
Executable file
72
apps/module/spine-ts/threejs/src/ThreeJsTexture.ts
Executable file
@@ -0,0 +1,72 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated January 1, 2020. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2020, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
module spine.threejs {
|
||||
export class ThreeJsTexture extends Texture {
|
||||
texture: THREE.Texture;
|
||||
|
||||
constructor (image: HTMLImageElement) {
|
||||
super(image);
|
||||
this.texture = new THREE.Texture(image);
|
||||
this.texture.flipY = false;
|
||||
this.texture.needsUpdate = true;
|
||||
}
|
||||
|
||||
setFilters (minFilter: TextureFilter, magFilter: TextureFilter) {
|
||||
this.texture.minFilter = ThreeJsTexture.toThreeJsTextureFilter(minFilter);
|
||||
this.texture.magFilter = ThreeJsTexture.toThreeJsTextureFilter(magFilter);
|
||||
}
|
||||
|
||||
setWraps (uWrap: TextureWrap, vWrap: TextureWrap) {
|
||||
this.texture.wrapS = ThreeJsTexture.toThreeJsTextureWrap(uWrap);
|
||||
this.texture.wrapT = ThreeJsTexture.toThreeJsTextureWrap(vWrap);
|
||||
}
|
||||
|
||||
dispose () {
|
||||
this.texture.dispose();
|
||||
}
|
||||
|
||||
static toThreeJsTextureFilter(filter: TextureFilter) {
|
||||
if (filter === TextureFilter.Linear) return THREE.LinearFilter;
|
||||
else if (filter === TextureFilter.MipMap) return THREE.LinearMipMapLinearFilter; // also includes TextureFilter.MipMapLinearLinear
|
||||
else if (filter === TextureFilter.MipMapLinearNearest) return THREE.LinearMipMapNearestFilter;
|
||||
else if (filter === TextureFilter.MipMapNearestLinear) return THREE.NearestMipMapLinearFilter;
|
||||
else if (filter === TextureFilter.MipMapNearestNearest) return THREE.NearestMipMapNearestFilter;
|
||||
else if (filter === TextureFilter.Nearest) return THREE.NearestFilter;
|
||||
else throw new Error("Unknown texture filter: " + filter);
|
||||
}
|
||||
|
||||
static toThreeJsTextureWrap(wrap: TextureWrap) {
|
||||
if (wrap === TextureWrap.ClampToEdge) return THREE.ClampToEdgeWrapping;
|
||||
else if (wrap === TextureWrap.MirroredRepeat) return THREE.MirroredRepeatWrapping;
|
||||
else if (wrap === TextureWrap.Repeat) return THREE.RepeatWrapping;
|
||||
else throw new Error("Unknown texture wrap: " + wrap);
|
||||
}
|
||||
}
|
||||
}
|
||||
13
apps/module/spine-ts/threejs/src/threejs/Three.Legacy.d.ts
vendored
Executable file
13
apps/module/spine-ts/threejs/src/threejs/Three.Legacy.d.ts
vendored
Executable file
@@ -0,0 +1,13 @@
|
||||
import { Geometry } from './core/Geometry';
|
||||
import { Material } from './materials/Material';
|
||||
import { Object3D } from './core/Object3D';
|
||||
import { Scene } from './scenes/Scene';
|
||||
|
||||
export namespace SceneUtils {
|
||||
export function createMultiMaterialObject(
|
||||
geometry: Geometry,
|
||||
materials: Material[]
|
||||
): Object3D;
|
||||
export function detach( child: Object3D, parent: Object3D, scene: Scene ): void;
|
||||
export function attach( child: Object3D, scene: Scene, parent: Object3D ): void;
|
||||
}
|
||||
180
apps/module/spine-ts/threejs/src/threejs/Three.d.ts
vendored
Executable file
180
apps/module/spine-ts/threejs/src/threejs/Three.d.ts
vendored
Executable file
@@ -0,0 +1,180 @@
|
||||
export * from './polyfills';
|
||||
export * from './renderers/WebGLMultisampleRenderTarget';
|
||||
export * from './renderers/WebGLRenderTargetCube';
|
||||
export * from './renderers/WebGLRenderTarget';
|
||||
export * from './renderers/WebGLRenderer';
|
||||
export * from './renderers/shaders/ShaderLib';
|
||||
export * from './renderers/shaders/UniformsLib';
|
||||
export * from './renderers/shaders/UniformsUtils';
|
||||
export * from './renderers/shaders/ShaderChunk';
|
||||
export * from './scenes/FogExp2';
|
||||
export * from './scenes/Fog';
|
||||
export * from './scenes/Scene';
|
||||
export * from './objects/Sprite';
|
||||
export * from './objects/LOD';
|
||||
export * from './objects/InstancedMesh';
|
||||
export * from './objects/SkinnedMesh';
|
||||
export * from './objects/Skeleton';
|
||||
export * from './objects/Bone';
|
||||
export * from './objects/Mesh';
|
||||
export * from './objects/LineSegments';
|
||||
export * from './objects/LineLoop';
|
||||
export * from './objects/Line';
|
||||
export * from './objects/Points';
|
||||
export * from './objects/Group';
|
||||
export * from './textures/VideoTexture';
|
||||
export * from './textures/DataTexture';
|
||||
export * from './textures/DataTexture3D';
|
||||
export * from './textures/CompressedTexture';
|
||||
export * from './textures/CubeTexture';
|
||||
export * from './textures/CanvasTexture';
|
||||
export * from './textures/DepthTexture';
|
||||
export * from './textures/Texture';
|
||||
export * from './geometries/Geometries';
|
||||
export * from './materials/Materials';
|
||||
export * from './loaders/AnimationLoader';
|
||||
export * from './loaders/CompressedTextureLoader';
|
||||
export * from './loaders/DataTextureLoader';
|
||||
export * from './loaders/CubeTextureLoader';
|
||||
export * from './loaders/TextureLoader';
|
||||
export * from './loaders/ObjectLoader';
|
||||
export * from './loaders/MaterialLoader';
|
||||
export * from './loaders/BufferGeometryLoader';
|
||||
export * from './loaders/LoadingManager';
|
||||
export * from './loaders/ImageLoader';
|
||||
export * from './loaders/ImageBitmapLoader';
|
||||
export * from './loaders/FontLoader';
|
||||
export * from './loaders/FileLoader';
|
||||
export * from './loaders/Loader';
|
||||
export * from './loaders/LoaderUtils';
|
||||
export * from './loaders/Cache';
|
||||
export * from './loaders/AudioLoader';
|
||||
export * from './lights/SpotLightShadow';
|
||||
export * from './lights/SpotLight';
|
||||
export * from './lights/PointLight';
|
||||
export * from './lights/RectAreaLight';
|
||||
export * from './lights/HemisphereLight';
|
||||
export * from './lights/DirectionalLightShadow';
|
||||
export * from './lights/DirectionalLight';
|
||||
export * from './lights/AmbientLight';
|
||||
export * from './lights/LightShadow';
|
||||
export * from './lights/Light';
|
||||
export * from './lights/AmbientLightProbe';
|
||||
export * from './lights/HemisphereLightProbe';
|
||||
export * from './lights/LightProbe';
|
||||
export * from './cameras/StereoCamera';
|
||||
export * from './cameras/PerspectiveCamera';
|
||||
export * from './cameras/OrthographicCamera';
|
||||
export * from './cameras/CubeCamera';
|
||||
export * from './cameras/ArrayCamera';
|
||||
export * from './cameras/Camera';
|
||||
export * from './audio/AudioListener';
|
||||
export * from './audio/PositionalAudio';
|
||||
export * from './audio/AudioContext';
|
||||
export * from './audio/AudioAnalyser';
|
||||
export * from './audio/Audio';
|
||||
export * from './animation/tracks/VectorKeyframeTrack';
|
||||
export * from './animation/tracks/StringKeyframeTrack';
|
||||
export * from './animation/tracks/QuaternionKeyframeTrack';
|
||||
export * from './animation/tracks/NumberKeyframeTrack';
|
||||
export * from './animation/tracks/ColorKeyframeTrack';
|
||||
export * from './animation/tracks/BooleanKeyframeTrack';
|
||||
export * from './animation/PropertyMixer';
|
||||
export * from './animation/PropertyBinding';
|
||||
export * from './animation/KeyframeTrack';
|
||||
export * from './animation/AnimationUtils';
|
||||
export * from './animation/AnimationObjectGroup';
|
||||
export * from './animation/AnimationMixer';
|
||||
export * from './animation/AnimationClip';
|
||||
export * from './core/Uniform';
|
||||
export * from './core/InstancedBufferGeometry';
|
||||
export * from './core/BufferGeometry';
|
||||
export * from './core/Geometry';
|
||||
export * from './core/InterleavedBufferAttribute';
|
||||
export * from './core/InstancedInterleavedBuffer';
|
||||
export * from './core/InterleavedBuffer';
|
||||
export * from './core/InstancedBufferAttribute';
|
||||
export * from './core/BufferAttribute';
|
||||
export * from './core/Face3';
|
||||
export * from './core/Object3D';
|
||||
export * from './core/Raycaster';
|
||||
export * from './core/Layers';
|
||||
export * from './core/EventDispatcher';
|
||||
export * from './core/DirectGeometry';
|
||||
export * from './core/Clock';
|
||||
export * from './math/interpolants/QuaternionLinearInterpolant';
|
||||
export * from './math/interpolants/LinearInterpolant';
|
||||
export * from './math/interpolants/DiscreteInterpolant';
|
||||
export * from './math/interpolants/CubicInterpolant';
|
||||
export * from './math/Interpolant';
|
||||
export * from './math/Triangle';
|
||||
export { _Math as Math } from './math/Math';
|
||||
export * from './math/Spherical';
|
||||
export * from './math/Cylindrical';
|
||||
export * from './math/Plane';
|
||||
export * from './math/Frustum';
|
||||
export * from './math/Sphere';
|
||||
export * from './math/Ray';
|
||||
export * from './math/Matrix4';
|
||||
export * from './math/Matrix3';
|
||||
export * from './math/Box3';
|
||||
export * from './math/Box2';
|
||||
export * from './math/Line3';
|
||||
export * from './math/Euler';
|
||||
export * from './math/Vector4';
|
||||
export * from './math/Vector3';
|
||||
export * from './math/Vector2';
|
||||
export * from './math/Quaternion';
|
||||
export * from './math/Color';
|
||||
export * from './math/SphericalHarmonics3';
|
||||
export * from './extras/objects/ImmediateRenderObject';
|
||||
export * from './helpers/VertexNormalsHelper';
|
||||
export * from './helpers/SpotLightHelper';
|
||||
export * from './helpers/SkeletonHelper';
|
||||
export * from './helpers/PointLightHelper';
|
||||
export * from './helpers/RectAreaLightHelper';
|
||||
export * from './helpers/HemisphereLightHelper';
|
||||
export * from './helpers/GridHelper';
|
||||
export * from './helpers/PolarGridHelper';
|
||||
export * from './helpers/PositionalAudioHelper';
|
||||
export * from './helpers/FaceNormalsHelper';
|
||||
export * from './helpers/DirectionalLightHelper';
|
||||
export * from './helpers/CameraHelper';
|
||||
export * from './helpers/BoxHelper';
|
||||
export * from './helpers/Box3Helper';
|
||||
export * from './helpers/PlaneHelper';
|
||||
export * from './helpers/ArrowHelper';
|
||||
export * from './helpers/AxesHelper';
|
||||
export * from './extras/curves/Curves';
|
||||
export * from './extras/core/Shape';
|
||||
export * from './extras/core/Path';
|
||||
export * from './extras/core/ShapePath';
|
||||
export * from './extras/core/Font';
|
||||
export * from './extras/core/CurvePath';
|
||||
export * from './extras/core/Curve';
|
||||
export * from './extras/ImageUtils';
|
||||
export * from './extras/ShapeUtils';
|
||||
export * from './renderers/webgl/WebGLBufferRenderer';
|
||||
export * from './renderers/webgl/WebGLCapabilities';
|
||||
export * from './renderers/webgl/WebGLClipping';
|
||||
export * from './renderers/webgl/WebGLExtensions';
|
||||
export * from './renderers/webgl/WebGLGeometries';
|
||||
export * from './renderers/webgl/WebGLIndexedBufferRenderer';
|
||||
export * from './renderers/webgl/WebGLInfo';
|
||||
export * from './renderers/webgl/WebGLLights';
|
||||
export * from './renderers/webgl/WebGLObjects';
|
||||
export * from './renderers/webgl/WebGLProgram';
|
||||
export * from './renderers/webgl/WebGLPrograms';
|
||||
export * from './renderers/webgl/WebGLProperties';
|
||||
export * from './renderers/webgl/WebGLRenderLists';
|
||||
export * from './renderers/webgl/WebGLShader';
|
||||
export * from './renderers/webgl/WebGLShadowMap';
|
||||
export * from './renderers/webgl/WebGLState';
|
||||
export * from './renderers/webgl/WebGLTextures';
|
||||
export * from './renderers/webgl/WebGLUniforms';
|
||||
//export * from './renderers/webgl/WebGLUtils';
|
||||
export * from './renderers/webvr/WebVRManager';
|
||||
export * from './constants';
|
||||
export * from './Three.Legacy';
|
||||
|
||||
export as namespace THREE;
|
||||
62
apps/module/spine-ts/threejs/src/threejs/animation/AnimationAction.d.ts
vendored
Executable file
62
apps/module/spine-ts/threejs/src/threejs/animation/AnimationAction.d.ts
vendored
Executable file
@@ -0,0 +1,62 @@
|
||||
import { AnimationMixer } from './AnimationMixer';
|
||||
import { AnimationClip } from './AnimationClip';
|
||||
import { AnimationActionLoopStyles } from '../constants';
|
||||
import { Object3D } from '../core/Object3D';
|
||||
// Animation ////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
export class AnimationAction {
|
||||
|
||||
constructor( mixer: AnimationMixer, clip: AnimationClip, localRoot?: Object3D );
|
||||
|
||||
loop: AnimationActionLoopStyles;
|
||||
time: number;
|
||||
timeScale: number;
|
||||
weight: number;
|
||||
repetitions: number;
|
||||
paused: boolean;
|
||||
enabled: boolean;
|
||||
clampWhenFinished: boolean;
|
||||
zeroSlopeAtStart: boolean;
|
||||
zeroSlopeAtEnd: boolean;
|
||||
|
||||
play(): AnimationAction;
|
||||
stop(): AnimationAction;
|
||||
reset(): AnimationAction;
|
||||
isRunning(): boolean;
|
||||
isScheduled(): boolean;
|
||||
startAt( time: number ): AnimationAction;
|
||||
setLoop(
|
||||
mode: AnimationActionLoopStyles,
|
||||
repetitions: number
|
||||
): AnimationAction;
|
||||
setEffectiveWeight( weight: number ): AnimationAction;
|
||||
getEffectiveWeight(): number;
|
||||
fadeIn( duration: number ): AnimationAction;
|
||||
fadeOut( duration: number ): AnimationAction;
|
||||
crossFadeFrom(
|
||||
fadeOutAction: AnimationAction,
|
||||
duration: number,
|
||||
warp: boolean
|
||||
): AnimationAction;
|
||||
crossFadeTo(
|
||||
fadeInAction: AnimationAction,
|
||||
duration: number,
|
||||
warp: boolean
|
||||
): AnimationAction;
|
||||
stopFading(): AnimationAction;
|
||||
setEffectiveTimeScale( timeScale: number ): AnimationAction;
|
||||
getEffectiveTimeScale(): number;
|
||||
setDuration( duration: number ): AnimationAction;
|
||||
syncWith( action: AnimationAction ): AnimationAction;
|
||||
halt( duration: number ): AnimationAction;
|
||||
warp(
|
||||
statTimeScale: number,
|
||||
endTimeScale: number,
|
||||
duration: number
|
||||
): AnimationAction;
|
||||
stopWarping(): AnimationAction;
|
||||
getMixer(): AnimationMixer;
|
||||
getClip(): AnimationClip;
|
||||
getRoot(): Object3D;
|
||||
|
||||
}
|
||||
41
apps/module/spine-ts/threejs/src/threejs/animation/AnimationClip.d.ts
vendored
Executable file
41
apps/module/spine-ts/threejs/src/threejs/animation/AnimationClip.d.ts
vendored
Executable file
@@ -0,0 +1,41 @@
|
||||
import { KeyframeTrack } from './KeyframeTrack';
|
||||
import { Bone } from '../objects/Bone';
|
||||
import { MorphTarget } from '../core/Geometry';
|
||||
|
||||
export class AnimationClip {
|
||||
|
||||
constructor( name?: string, duration?: number, tracks?: KeyframeTrack[] );
|
||||
|
||||
name: string;
|
||||
tracks: KeyframeTrack[];
|
||||
duration: number;
|
||||
uuid: string;
|
||||
results: any[];
|
||||
|
||||
resetDuration(): AnimationClip;
|
||||
trim(): AnimationClip;
|
||||
validate(): boolean;
|
||||
optimize(): AnimationClip;
|
||||
clone(): AnimationClip;
|
||||
|
||||
static CreateFromMorphTargetSequence(
|
||||
name: string,
|
||||
morphTargetSequence: MorphTarget[],
|
||||
fps: number,
|
||||
noLoop: boolean
|
||||
): AnimationClip;
|
||||
static findByName( clipArray: AnimationClip[], name: string ): AnimationClip;
|
||||
static CreateClipsFromMorphTargetSequences(
|
||||
morphTargets: MorphTarget[],
|
||||
fps: number,
|
||||
noLoop: boolean
|
||||
): AnimationClip[];
|
||||
static parse( json: any ): AnimationClip;
|
||||
static parseAnimation(
|
||||
animation: any,
|
||||
bones: Bone[],
|
||||
nodeName: string
|
||||
): AnimationClip;
|
||||
static toJSON(): any;
|
||||
|
||||
}
|
||||
23
apps/module/spine-ts/threejs/src/threejs/animation/AnimationMixer.d.ts
vendored
Executable file
23
apps/module/spine-ts/threejs/src/threejs/animation/AnimationMixer.d.ts
vendored
Executable file
@@ -0,0 +1,23 @@
|
||||
import { AnimationClip } from './AnimationClip';
|
||||
import { AnimationAction } from './AnimationAction';
|
||||
import { EventDispatcher } from '../core/EventDispatcher';
|
||||
import { Object3D } from '../core/Object3D';
|
||||
|
||||
export class AnimationMixer extends EventDispatcher {
|
||||
|
||||
constructor( root: Object3D );
|
||||
|
||||
time: number;
|
||||
timeScale: number;
|
||||
|
||||
clipAction( clip: AnimationClip, root?: Object3D ): AnimationAction;
|
||||
existingAction( clip: AnimationClip, root?: Object3D ): AnimationAction | null;
|
||||
stopAllAction(): AnimationMixer;
|
||||
update( deltaTime: number ): AnimationMixer;
|
||||
setTime( timeInSeconds: number ): AnimationMixer;
|
||||
getRoot(): Object3D;
|
||||
uncacheClip( clip: AnimationClip ): void;
|
||||
uncacheRoot( root: Object3D ): void;
|
||||
uncacheAction( clip: AnimationClip, root?: Object3D ): void;
|
||||
|
||||
}
|
||||
18
apps/module/spine-ts/threejs/src/threejs/animation/AnimationObjectGroup.d.ts
vendored
Executable file
18
apps/module/spine-ts/threejs/src/threejs/animation/AnimationObjectGroup.d.ts
vendored
Executable file
@@ -0,0 +1,18 @@
|
||||
export class AnimationObjectGroup {
|
||||
|
||||
constructor( ...args: any[] );
|
||||
|
||||
uuid: string;
|
||||
stats: {
|
||||
bindingsPerObject: number;
|
||||
objects: {
|
||||
total: number;
|
||||
inUse: number;
|
||||
};
|
||||
};
|
||||
|
||||
add( ...args: any[] ): void;
|
||||
remove( ...args: any[] ): void;
|
||||
uncache( ...args: any[] ): void;
|
||||
|
||||
}
|
||||
26
apps/module/spine-ts/threejs/src/threejs/animation/AnimationUtils.d.ts
vendored
Executable file
26
apps/module/spine-ts/threejs/src/threejs/animation/AnimationUtils.d.ts
vendored
Executable file
@@ -0,0 +1,26 @@
|
||||
import { AnimationClip } from './AnimationClip';
|
||||
|
||||
export namespace AnimationUtils {
|
||||
export function arraySlice( array: any, from: number, to: number ): any;
|
||||
export function convertArray( array: any, type: any, forceClone: boolean ): any;
|
||||
export function isTypedArray( object: any ): boolean;
|
||||
export function getKeyFrameOrder( times: number[] ): number[];
|
||||
export function sortedArray(
|
||||
values: any[],
|
||||
stride: number,
|
||||
order: number[]
|
||||
): any[];
|
||||
export function flattenJSON(
|
||||
jsonKeys: string[],
|
||||
times: any[],
|
||||
values: any[],
|
||||
valuePropertyName: string
|
||||
): void;
|
||||
export function subclip(
|
||||
sourceClip: AnimationClip,
|
||||
name: string,
|
||||
startFrame: number,
|
||||
endFrame: number,
|
||||
fps?: number
|
||||
): AnimationClip;
|
||||
}
|
||||
43
apps/module/spine-ts/threejs/src/threejs/animation/KeyframeTrack.d.ts
vendored
Executable file
43
apps/module/spine-ts/threejs/src/threejs/animation/KeyframeTrack.d.ts
vendored
Executable file
@@ -0,0 +1,43 @@
|
||||
import { DiscreteInterpolant } from '../math/interpolants/DiscreteInterpolant';
|
||||
import { LinearInterpolant } from '../math/interpolants/LinearInterpolant';
|
||||
import { CubicInterpolant } from '../math/interpolants/CubicInterpolant';
|
||||
import { InterpolationModes } from '../constants';
|
||||
|
||||
export class KeyframeTrack {
|
||||
|
||||
constructor(
|
||||
name: string,
|
||||
times: any[],
|
||||
values: any[],
|
||||
interpolation?: InterpolationModes
|
||||
);
|
||||
|
||||
name: string;
|
||||
times: Float32Array;
|
||||
values: Float32Array;
|
||||
|
||||
ValueTypeName: string;
|
||||
TimeBufferType: Float32Array;
|
||||
ValueBufferType: Float32Array;
|
||||
|
||||
DefaultInterpolation: InterpolationModes;
|
||||
|
||||
InterpolantFactoryMethodDiscrete( result: any ): DiscreteInterpolant;
|
||||
InterpolantFactoryMethodLinear( result: any ): LinearInterpolant;
|
||||
InterpolantFactoryMethodSmooth( result: any ): CubicInterpolant;
|
||||
|
||||
setInterpolation( interpolation: InterpolationModes ): KeyframeTrack;
|
||||
getInterpolation(): InterpolationModes;
|
||||
|
||||
getValuesize(): number;
|
||||
|
||||
shift( timeOffset: number ): KeyframeTrack;
|
||||
scale( timeScale: number ): KeyframeTrack;
|
||||
trim( startTime: number, endTime: number ): KeyframeTrack;
|
||||
validate(): boolean;
|
||||
optimize(): KeyframeTrack;
|
||||
clone(): KeyframeTrack;
|
||||
|
||||
static toJSON( track: KeyframeTrack ): any;
|
||||
|
||||
}
|
||||
51
apps/module/spine-ts/threejs/src/threejs/animation/PropertyBinding.d.ts
vendored
Executable file
51
apps/module/spine-ts/threejs/src/threejs/animation/PropertyBinding.d.ts
vendored
Executable file
@@ -0,0 +1,51 @@
|
||||
export interface ParseTrackNameResults {
|
||||
nodeName: string;
|
||||
objectName: string;
|
||||
objectIndex: string;
|
||||
propertyName: string;
|
||||
propertyIndex: string;
|
||||
}
|
||||
|
||||
export class PropertyBinding {
|
||||
|
||||
constructor( rootNode: any, path: string, parsedPath?: any );
|
||||
|
||||
path: string;
|
||||
parsedPath: any;
|
||||
node: any;
|
||||
rootNode: any;
|
||||
|
||||
getValue( targetArray: any, offset: number ): any;
|
||||
setValue( sourceArray: any, offset: number ): void;
|
||||
bind(): void;
|
||||
unbind(): void;
|
||||
|
||||
BindingType: { [bindingType: string]: number };
|
||||
Versioning: { [versioning: string]: number };
|
||||
|
||||
GetterByBindingType: Function[];
|
||||
SetterByBindingTypeAndVersioning: Array<Function[]>;
|
||||
|
||||
static create(
|
||||
root: any,
|
||||
path: any,
|
||||
parsedPath?: any
|
||||
): PropertyBinding | PropertyBinding.Composite;
|
||||
static sanitizeNodeName( name: string ): string;
|
||||
static parseTrackName( trackName: string ): ParseTrackNameResults;
|
||||
static findNode( root: any, nodeName: string ): any;
|
||||
|
||||
}
|
||||
|
||||
export namespace PropertyBinding {
|
||||
export class Composite {
|
||||
|
||||
constructor( targetGroup: any, path: any, parsedPath?: any );
|
||||
|
||||
getValue( array: any, offset: number ): any;
|
||||
setValue( array: any, offset: number ): void;
|
||||
bind(): void;
|
||||
unbind(): void;
|
||||
|
||||
}
|
||||
}
|
||||
17
apps/module/spine-ts/threejs/src/threejs/animation/PropertyMixer.d.ts
vendored
Executable file
17
apps/module/spine-ts/threejs/src/threejs/animation/PropertyMixer.d.ts
vendored
Executable file
@@ -0,0 +1,17 @@
|
||||
export class PropertyMixer {
|
||||
|
||||
constructor( binding: any, typeName: string, valueSize: number );
|
||||
|
||||
binding: any;
|
||||
valueSize: number;
|
||||
buffer: any;
|
||||
cumulativeWeight: number;
|
||||
useCount: number;
|
||||
referenceCount: number;
|
||||
|
||||
accumulate( accuIndex: number, weight: number ): void;
|
||||
apply( accuIndex: number ): void;
|
||||
saveOriginalState(): void;
|
||||
restoreOriginalState(): void;
|
||||
|
||||
}
|
||||
7
apps/module/spine-ts/threejs/src/threejs/animation/tracks/BooleanKeyframeTrack.d.ts
vendored
Executable file
7
apps/module/spine-ts/threejs/src/threejs/animation/tracks/BooleanKeyframeTrack.d.ts
vendored
Executable file
@@ -0,0 +1,7 @@
|
||||
import { KeyframeTrack } from '../KeyframeTrack';
|
||||
|
||||
export class BooleanKeyframeTrack extends KeyframeTrack {
|
||||
|
||||
constructor( name: string, times: any[], values: any[] );
|
||||
|
||||
}
|
||||
13
apps/module/spine-ts/threejs/src/threejs/animation/tracks/ColorKeyframeTrack.d.ts
vendored
Executable file
13
apps/module/spine-ts/threejs/src/threejs/animation/tracks/ColorKeyframeTrack.d.ts
vendored
Executable file
@@ -0,0 +1,13 @@
|
||||
import { KeyframeTrack } from '../KeyframeTrack';
|
||||
import { InterpolationModes } from '../../constants';
|
||||
|
||||
export class ColorKeyframeTrack extends KeyframeTrack {
|
||||
|
||||
constructor(
|
||||
name: string,
|
||||
times: any[],
|
||||
values: any[],
|
||||
interpolation?: InterpolationModes
|
||||
);
|
||||
|
||||
}
|
||||
13
apps/module/spine-ts/threejs/src/threejs/animation/tracks/NumberKeyframeTrack.d.ts
vendored
Executable file
13
apps/module/spine-ts/threejs/src/threejs/animation/tracks/NumberKeyframeTrack.d.ts
vendored
Executable file
@@ -0,0 +1,13 @@
|
||||
import { KeyframeTrack } from '../KeyframeTrack';
|
||||
import { InterpolationModes } from '../../constants';
|
||||
|
||||
export class NumberKeyframeTrack extends KeyframeTrack {
|
||||
|
||||
constructor(
|
||||
name: string,
|
||||
times: any[],
|
||||
values: any[],
|
||||
interpolation?: InterpolationModes
|
||||
);
|
||||
|
||||
}
|
||||
13
apps/module/spine-ts/threejs/src/threejs/animation/tracks/QuaternionKeyframeTrack.d.ts
vendored
Executable file
13
apps/module/spine-ts/threejs/src/threejs/animation/tracks/QuaternionKeyframeTrack.d.ts
vendored
Executable file
@@ -0,0 +1,13 @@
|
||||
import { KeyframeTrack } from '../KeyframeTrack';
|
||||
import { InterpolationModes } from '../../constants';
|
||||
|
||||
export class QuaternionKeyframeTrack extends KeyframeTrack {
|
||||
|
||||
constructor(
|
||||
name: string,
|
||||
times: any[],
|
||||
values: any[],
|
||||
interpolation?: InterpolationModes
|
||||
);
|
||||
|
||||
}
|
||||
13
apps/module/spine-ts/threejs/src/threejs/animation/tracks/StringKeyframeTrack.d.ts
vendored
Executable file
13
apps/module/spine-ts/threejs/src/threejs/animation/tracks/StringKeyframeTrack.d.ts
vendored
Executable file
@@ -0,0 +1,13 @@
|
||||
import { KeyframeTrack } from '../KeyframeTrack';
|
||||
import { InterpolationModes } from '../../constants';
|
||||
|
||||
export class StringKeyframeTrack extends KeyframeTrack {
|
||||
|
||||
constructor(
|
||||
name: string,
|
||||
times: any[],
|
||||
values: any[],
|
||||
interpolation?: InterpolationModes
|
||||
);
|
||||
|
||||
}
|
||||
13
apps/module/spine-ts/threejs/src/threejs/animation/tracks/VectorKeyframeTrack.d.ts
vendored
Executable file
13
apps/module/spine-ts/threejs/src/threejs/animation/tracks/VectorKeyframeTrack.d.ts
vendored
Executable file
@@ -0,0 +1,13 @@
|
||||
import { KeyframeTrack } from '../KeyframeTrack';
|
||||
import { InterpolationModes } from '../../constants';
|
||||
|
||||
export class VectorKeyframeTrack extends KeyframeTrack {
|
||||
|
||||
constructor(
|
||||
name: string,
|
||||
times: any[],
|
||||
values: any[],
|
||||
interpolation?: InterpolationModes
|
||||
);
|
||||
|
||||
}
|
||||
70
apps/module/spine-ts/threejs/src/threejs/audio/Audio.d.ts
vendored
Executable file
70
apps/module/spine-ts/threejs/src/threejs/audio/Audio.d.ts
vendored
Executable file
@@ -0,0 +1,70 @@
|
||||
import { Object3D } from '../core/Object3D';
|
||||
import { AudioListener } from './AudioListener';
|
||||
import { AudioContext } from './AudioContext';
|
||||
|
||||
// Extras / Audio /////////////////////////////////////////////////////////////////////
|
||||
|
||||
export class Audio extends Object3D {
|
||||
|
||||
constructor( listener: AudioListener );
|
||||
type: 'Audio';
|
||||
|
||||
context: AudioContext;
|
||||
gain: GainNode;
|
||||
autoplay: boolean;
|
||||
buffer: null | Audio;
|
||||
detune: number;
|
||||
loop: boolean;
|
||||
offset: number;
|
||||
duration: number | undefined;
|
||||
playbackRate: number;
|
||||
isPlaying: boolean;
|
||||
hasPlaybackControl: boolean;
|
||||
sourceType: string;
|
||||
source: AudioBufferSourceNode;
|
||||
filters: any[];
|
||||
|
||||
getOutput(): GainNode;
|
||||
setNodeSource( audioNode: AudioBufferSourceNode ): this;
|
||||
setMediaElementSource( mediaElement: HTMLMediaElement ): this;
|
||||
setMediaStreamSource( mediaStream: MediaStream ): this;
|
||||
setBuffer( audioBuffer: AudioBuffer ): this;
|
||||
play( delay?: number ): this;
|
||||
onEnded(): void;
|
||||
pause(): this;
|
||||
stop(): this;
|
||||
connect(): this;
|
||||
disconnect(): this;
|
||||
setDetune( value: number ): this;
|
||||
getDetune(): number;
|
||||
getFilters(): any[];
|
||||
setFilter( value: any[] ): this;
|
||||
getFilter(): any;
|
||||
setFilter( filter: any ): this;
|
||||
setPlaybackRate( value: number ): this;
|
||||
getPlaybackRate(): number;
|
||||
getLoop(): boolean;
|
||||
setLoop( value: boolean ): this;
|
||||
setLoopStart( value: number ): this;
|
||||
setLoopEnd( value: number ): this;
|
||||
getVolume(): number;
|
||||
setVolume( value: number ): this;
|
||||
/**
|
||||
* @deprecated Use {@link AudioLoader} instead.
|
||||
*/
|
||||
load( file: string ): Audio;
|
||||
|
||||
}
|
||||
|
||||
export class AudioBuffer {
|
||||
|
||||
constructor( context: any );
|
||||
|
||||
context: any;
|
||||
ready: boolean;
|
||||
readyCallbacks: Function[];
|
||||
|
||||
load( file: string ): AudioBuffer;
|
||||
onReady( callback: Function ): void;
|
||||
|
||||
}
|
||||
16
apps/module/spine-ts/threejs/src/threejs/audio/AudioAnalyser.d.ts
vendored
Executable file
16
apps/module/spine-ts/threejs/src/threejs/audio/AudioAnalyser.d.ts
vendored
Executable file
@@ -0,0 +1,16 @@
|
||||
export class AudioAnalyser {
|
||||
|
||||
constructor( audio: any, fftSize: number );
|
||||
|
||||
analyser: any;
|
||||
data: Uint8Array;
|
||||
|
||||
getFrequencyData(): Uint8Array;
|
||||
getAverageFrequency(): number;
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link AudioAnalyser#getFrequencyData .getFrequencyData()} instead.
|
||||
*/
|
||||
getData( file: any ): any;
|
||||
|
||||
}
|
||||
1
apps/module/spine-ts/threejs/src/threejs/audio/AudioContext.d.ts
vendored
Executable file
1
apps/module/spine-ts/threejs/src/threejs/audio/AudioContext.d.ts
vendored
Executable file
@@ -0,0 +1 @@
|
||||
export const AudioContext: AudioContext;
|
||||
21
apps/module/spine-ts/threejs/src/threejs/audio/AudioListener.d.ts
vendored
Executable file
21
apps/module/spine-ts/threejs/src/threejs/audio/AudioListener.d.ts
vendored
Executable file
@@ -0,0 +1,21 @@
|
||||
import { Object3D } from '../core/Object3D';
|
||||
import { AudioContext } from './AudioContext';
|
||||
|
||||
export class AudioListener extends Object3D {
|
||||
|
||||
constructor();
|
||||
|
||||
type: 'AudioListener';
|
||||
context: AudioContext;
|
||||
gain: GainNode;
|
||||
filter: null | any;
|
||||
|
||||
getInput(): GainNode;
|
||||
removeFilter(): void;
|
||||
setFilter( value: any ): void;
|
||||
getFilter(): any;
|
||||
setMasterVolume( value: number ): void;
|
||||
getMasterVolume(): number;
|
||||
updateMatrixWorld( force?: boolean ): void;
|
||||
|
||||
}
|
||||
24
apps/module/spine-ts/threejs/src/threejs/audio/PositionalAudio.d.ts
vendored
Executable file
24
apps/module/spine-ts/threejs/src/threejs/audio/PositionalAudio.d.ts
vendored
Executable file
@@ -0,0 +1,24 @@
|
||||
import { AudioListener } from './AudioListener';
|
||||
import { Audio } from './Audio';
|
||||
|
||||
export class PositionalAudio extends Audio {
|
||||
|
||||
constructor( listener: AudioListener );
|
||||
|
||||
panner: PannerNode;
|
||||
|
||||
setRefDistance( value: number ): this;
|
||||
getRefDistance(): number;
|
||||
setRolloffFactor( value: number ): this;
|
||||
getRolloffFactor(): number;
|
||||
setDistanceModel( value: string ): this;
|
||||
getDistanceModel(): string;
|
||||
setMaxDistance( value: number ): this;
|
||||
getMaxDistance(): number;
|
||||
setDirectionalCone(
|
||||
coneInnerAngle: number,
|
||||
coneOuterAngle: number,
|
||||
coneOuterGain: number
|
||||
): this;
|
||||
|
||||
}
|
||||
10
apps/module/spine-ts/threejs/src/threejs/cameras/ArrayCamera.d.ts
vendored
Executable file
10
apps/module/spine-ts/threejs/src/threejs/cameras/ArrayCamera.d.ts
vendored
Executable file
@@ -0,0 +1,10 @@
|
||||
import { PerspectiveCamera } from './PerspectiveCamera';
|
||||
|
||||
export class ArrayCamera extends PerspectiveCamera {
|
||||
|
||||
constructor( cameras?: PerspectiveCamera[] );
|
||||
|
||||
cameras: PerspectiveCamera[];
|
||||
isArrayCamera: true;
|
||||
|
||||
}
|
||||
38
apps/module/spine-ts/threejs/src/threejs/cameras/Camera.d.ts
vendored
Executable file
38
apps/module/spine-ts/threejs/src/threejs/cameras/Camera.d.ts
vendored
Executable file
@@ -0,0 +1,38 @@
|
||||
import { Matrix4 } from '../math/Matrix4';
|
||||
import { Vector3 } from '../math/Vector3';
|
||||
import { Object3D } from '../core/Object3D';
|
||||
|
||||
// Cameras ////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* Abstract base class for cameras. This class should always be inherited when you build a new camera.
|
||||
*/
|
||||
export class Camera extends Object3D {
|
||||
|
||||
/**
|
||||
* This constructor sets following properties to the correct type: matrixWorldInverse, projectionMatrix and projectionMatrixInverse.
|
||||
*/
|
||||
constructor();
|
||||
|
||||
/**
|
||||
* This is the inverse of matrixWorld. MatrixWorld contains the Matrix which has the world transform of the Camera.
|
||||
*/
|
||||
matrixWorldInverse: Matrix4;
|
||||
|
||||
/**
|
||||
* This is the matrix which contains the projection.
|
||||
*/
|
||||
projectionMatrix: Matrix4;
|
||||
|
||||
/**
|
||||
* This is the inverse of projectionMatrix.
|
||||
*/
|
||||
projectionMatrixInverse: Matrix4;
|
||||
|
||||
isCamera: true;
|
||||
|
||||
getWorldDirection( target: Vector3 ): Vector3;
|
||||
|
||||
updateMatrixWorld( force?: boolean ): void;
|
||||
|
||||
}
|
||||
19
apps/module/spine-ts/threejs/src/threejs/cameras/CubeCamera.d.ts
vendored
Executable file
19
apps/module/spine-ts/threejs/src/threejs/cameras/CubeCamera.d.ts
vendored
Executable file
@@ -0,0 +1,19 @@
|
||||
import { WebGLRenderTargetCube } from '../renderers/WebGLRenderTargetCube';
|
||||
import { WebGLRenderTargetOptions } from '../renderers/WebGLRenderTarget';
|
||||
import { Scene } from '../scenes/Scene';
|
||||
import { WebGLRenderer } from '../renderers/WebGLRenderer';
|
||||
import { Object3D } from '../core/Object3D';
|
||||
|
||||
export class CubeCamera extends Object3D {
|
||||
|
||||
constructor( near?: number, far?: number, cubeResolution?: number, options?: WebGLRenderTargetOptions );
|
||||
|
||||
type: 'CubeCamera';
|
||||
|
||||
renderTarget: WebGLRenderTargetCube;
|
||||
|
||||
update( renderer: WebGLRenderer, scene: Scene ): void;
|
||||
|
||||
clear( renderer: WebGLRenderer, color: boolean, depth: boolean, stencil: boolean ): void;
|
||||
|
||||
}
|
||||
91
apps/module/spine-ts/threejs/src/threejs/cameras/OrthographicCamera.d.ts
vendored
Executable file
91
apps/module/spine-ts/threejs/src/threejs/cameras/OrthographicCamera.d.ts
vendored
Executable file
@@ -0,0 +1,91 @@
|
||||
import { Camera } from './Camera';
|
||||
|
||||
/**
|
||||
* Camera with orthographic projection
|
||||
*
|
||||
* @example
|
||||
* var camera = new THREE.OrthographicCamera( width / - 2, width / 2, height / 2, height / - 2, 1, 1000 );
|
||||
* scene.add( camera );
|
||||
*
|
||||
* @see <a href="https://github.com/mrdoob/three.js/blob/master/src/cameras/OrthographicCamera.js">src/cameras/OrthographicCamera.js</a>
|
||||
*/
|
||||
export class OrthographicCamera extends Camera {
|
||||
|
||||
/**
|
||||
* @param left Camera frustum left plane.
|
||||
* @param right Camera frustum right plane.
|
||||
* @param top Camera frustum top plane.
|
||||
* @param bottom Camera frustum bottom plane.
|
||||
* @param near Camera frustum near plane.
|
||||
* @param far Camera frustum far plane.
|
||||
*/
|
||||
constructor(
|
||||
left: number,
|
||||
right: number,
|
||||
top: number,
|
||||
bottom: number,
|
||||
near?: number,
|
||||
far?: number
|
||||
);
|
||||
|
||||
type: 'OrthographicCamera';
|
||||
|
||||
isOrthographicCamera: true;
|
||||
|
||||
zoom: number;
|
||||
view: null | {
|
||||
enabled: boolean;
|
||||
fullWidth: number;
|
||||
fullHeight: number;
|
||||
offsetX: number;
|
||||
offsetY: number;
|
||||
width: number;
|
||||
height: number;
|
||||
};
|
||||
|
||||
/**
|
||||
* Camera frustum left plane.
|
||||
*/
|
||||
left: number;
|
||||
|
||||
/**
|
||||
* Camera frustum right plane.
|
||||
*/
|
||||
right: number;
|
||||
|
||||
/**
|
||||
* Camera frustum top plane.
|
||||
*/
|
||||
top: number;
|
||||
|
||||
/**
|
||||
* Camera frustum bottom plane.
|
||||
*/
|
||||
bottom: number;
|
||||
|
||||
/**
|
||||
* Camera frustum near plane.
|
||||
*/
|
||||
near: number;
|
||||
|
||||
/**
|
||||
* Camera frustum far plane.
|
||||
*/
|
||||
far: number;
|
||||
|
||||
/**
|
||||
* Updates the camera projection matrix. Must be called after change of parameters.
|
||||
*/
|
||||
updateProjectionMatrix(): void;
|
||||
setViewOffset(
|
||||
fullWidth: number,
|
||||
fullHeight: number,
|
||||
offsetX: number,
|
||||
offsetY: number,
|
||||
width: number,
|
||||
height: number
|
||||
): void;
|
||||
clearViewOffset(): void;
|
||||
toJSON( meta?: any ): any;
|
||||
|
||||
}
|
||||
121
apps/module/spine-ts/threejs/src/threejs/cameras/PerspectiveCamera.d.ts
vendored
Executable file
121
apps/module/spine-ts/threejs/src/threejs/cameras/PerspectiveCamera.d.ts
vendored
Executable file
@@ -0,0 +1,121 @@
|
||||
import { Camera } from './Camera';
|
||||
|
||||
/**
|
||||
* Camera with perspective projection.
|
||||
*
|
||||
* @source https://github.com/mrdoob/three.js/blob/master/src/cameras/PerspectiveCamera.js
|
||||
*/
|
||||
export class PerspectiveCamera extends Camera {
|
||||
|
||||
/**
|
||||
* @param fov Camera frustum vertical field of view. Default value is 50.
|
||||
* @param aspect Camera frustum aspect ratio. Default value is 1.
|
||||
* @param near Camera frustum near plane. Default value is 0.1.
|
||||
* @param far Camera frustum far plane. Default value is 2000.
|
||||
*/
|
||||
constructor( fov?: number, aspect?: number, near?: number, far?: number );
|
||||
|
||||
type: 'PerspectiveCamera';
|
||||
|
||||
isPerspectiveCamera: true;
|
||||
|
||||
zoom: number;
|
||||
|
||||
/**
|
||||
* Camera frustum vertical field of view, from bottom to top of view, in degrees.
|
||||
*/
|
||||
fov: number;
|
||||
|
||||
/**
|
||||
* Camera frustum aspect ratio, window width divided by window height.
|
||||
*/
|
||||
aspect: number;
|
||||
|
||||
/**
|
||||
* Camera frustum near plane.
|
||||
*/
|
||||
near: number;
|
||||
|
||||
/**
|
||||
* Camera frustum far plane.
|
||||
*/
|
||||
far: number;
|
||||
|
||||
focus: number;
|
||||
view: null | {
|
||||
enabled: boolean;
|
||||
fullWidth: number;
|
||||
fullHeight: number;
|
||||
offsetX: number;
|
||||
offsetY: number;
|
||||
width: number;
|
||||
height: number;
|
||||
};
|
||||
filmGauge: number;
|
||||
filmOffset: number;
|
||||
|
||||
setFocalLength( focalLength: number ): void;
|
||||
getFocalLength(): number;
|
||||
getEffectiveFOV(): number;
|
||||
getFilmWidth(): number;
|
||||
getFilmHeight(): number;
|
||||
|
||||
/**
|
||||
* Sets an offset in a larger frustum. This is useful for multi-window or multi-monitor/multi-machine setups.
|
||||
* For example, if you have 3x2 monitors and each monitor is 1920x1080 and the monitors are in grid like this:
|
||||
*
|
||||
* +---+---+---+
|
||||
* | A | B | C |
|
||||
* +---+---+---+
|
||||
* | D | E | F |
|
||||
* +---+---+---+
|
||||
*
|
||||
* then for each monitor you would call it like this:
|
||||
*
|
||||
* var w = 1920;
|
||||
* var h = 1080;
|
||||
* var fullWidth = w * 3;
|
||||
* var fullHeight = h * 2;
|
||||
*
|
||||
* // A
|
||||
* camera.setViewOffset( fullWidth, fullHeight, w * 0, h * 0, w, h );
|
||||
* // B
|
||||
* camera.setViewOffset( fullWidth, fullHeight, w * 1, h * 0, w, h );
|
||||
* // C
|
||||
* camera.setViewOffset( fullWidth, fullHeight, w * 2, h * 0, w, h );
|
||||
* // D
|
||||
* camera.setViewOffset( fullWidth, fullHeight, w * 0, h * 1, w, h );
|
||||
* // E
|
||||
* camera.setViewOffset( fullWidth, fullHeight, w * 1, h * 1, w, h );
|
||||
* // F
|
||||
* camera.setViewOffset( fullWidth, fullHeight, w * 2, h * 1, w, h ); Note there is no reason monitors have to be the same size or in a grid.
|
||||
*
|
||||
* @param fullWidth full width of multiview setup
|
||||
* @param fullHeight full height of multiview setup
|
||||
* @param x horizontal offset of subcamera
|
||||
* @param y vertical offset of subcamera
|
||||
* @param width width of subcamera
|
||||
* @param height height of subcamera
|
||||
*/
|
||||
setViewOffset(
|
||||
fullWidth: number,
|
||||
fullHeight: number,
|
||||
x: number,
|
||||
y: number,
|
||||
width: number,
|
||||
height: number
|
||||
): void;
|
||||
clearViewOffset(): void;
|
||||
|
||||
/**
|
||||
* Updates the camera projection matrix. Must be called after change of parameters.
|
||||
*/
|
||||
updateProjectionMatrix(): void;
|
||||
toJSON( meta?: any ): any;
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link PerspectiveCamera#setFocalLength .setFocalLength()} and {@link PerspectiveCamera#filmGauge .filmGauge} instead.
|
||||
*/
|
||||
setLens( focalLength: number, frameHeight?: number ): void;
|
||||
|
||||
}
|
||||
17
apps/module/spine-ts/threejs/src/threejs/cameras/StereoCamera.d.ts
vendored
Executable file
17
apps/module/spine-ts/threejs/src/threejs/cameras/StereoCamera.d.ts
vendored
Executable file
@@ -0,0 +1,17 @@
|
||||
import { PerspectiveCamera } from './PerspectiveCamera';
|
||||
import { Camera } from './Camera';
|
||||
|
||||
export class StereoCamera extends Camera {
|
||||
|
||||
constructor();
|
||||
|
||||
type: 'StereoCamera';
|
||||
|
||||
aspect: number;
|
||||
eyeSep: number;
|
||||
cameraL: PerspectiveCamera;
|
||||
cameraR: PerspectiveCamera;
|
||||
|
||||
update( camera: PerspectiveCamera ): void;
|
||||
|
||||
}
|
||||
290
apps/module/spine-ts/threejs/src/threejs/constants.d.ts
vendored
Executable file
290
apps/module/spine-ts/threejs/src/threejs/constants.d.ts
vendored
Executable file
@@ -0,0 +1,290 @@
|
||||
export const REVISION: string;
|
||||
|
||||
// https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent.button
|
||||
export enum MOUSE {
|
||||
LEFT,
|
||||
MIDDLE,
|
||||
RIGHT,
|
||||
ROTATE,
|
||||
DOLLY,
|
||||
PAN,
|
||||
}
|
||||
|
||||
export enum TOUCH {
|
||||
ROTATE,
|
||||
PAN,
|
||||
DOLLY_PAN,
|
||||
DOLLY_ROTATE,
|
||||
}
|
||||
|
||||
// GL STATE CONSTANTS
|
||||
export enum CullFace {}
|
||||
export const CullFaceNone: CullFace;
|
||||
export const CullFaceBack: CullFace;
|
||||
export const CullFaceFront: CullFace;
|
||||
export const CullFaceFrontBack: CullFace;
|
||||
|
||||
export enum FrontFaceDirection {}
|
||||
export const FrontFaceDirectionCW: FrontFaceDirection;
|
||||
export const FrontFaceDirectionCCW: FrontFaceDirection;
|
||||
|
||||
// Shadowing Type
|
||||
export enum ShadowMapType {}
|
||||
export const BasicShadowMap: ShadowMapType;
|
||||
export const PCFShadowMap: ShadowMapType;
|
||||
export const PCFSoftShadowMap: ShadowMapType;
|
||||
export const VSMShadowMap: ShadowMapType;
|
||||
|
||||
// MATERIAL CONSTANTS
|
||||
|
||||
// side
|
||||
export enum Side {}
|
||||
export const FrontSide: Side;
|
||||
export const BackSide: Side;
|
||||
export const DoubleSide: Side;
|
||||
|
||||
// shading
|
||||
export enum Shading {}
|
||||
export const FlatShading: Shading;
|
||||
export const SmoothShading: Shading;
|
||||
|
||||
// colors
|
||||
export enum Colors {}
|
||||
export const NoColors: Colors;
|
||||
export const FaceColors: Colors;
|
||||
export const VertexColors: Colors;
|
||||
|
||||
// blending modes
|
||||
export enum Blending {}
|
||||
export const NoBlending: Blending;
|
||||
export const NormalBlending: Blending;
|
||||
export const AdditiveBlending: Blending;
|
||||
export const SubtractiveBlending: Blending;
|
||||
export const MultiplyBlending: Blending;
|
||||
export const CustomBlending: Blending;
|
||||
|
||||
// custom blending equations
|
||||
// (numbers start from 100 not to clash with other
|
||||
// mappings to OpenGL constants defined in Texture.js)
|
||||
export enum BlendingEquation {}
|
||||
export const AddEquation: BlendingEquation;
|
||||
export const SubtractEquation: BlendingEquation;
|
||||
export const ReverseSubtractEquation: BlendingEquation;
|
||||
export const MinEquation: BlendingEquation;
|
||||
export const MaxEquation: BlendingEquation;
|
||||
|
||||
// custom blending destination factors
|
||||
export enum BlendingDstFactor {}
|
||||
export const ZeroFactor: BlendingDstFactor;
|
||||
export const OneFactor: BlendingDstFactor;
|
||||
export const SrcColorFactor: BlendingDstFactor;
|
||||
export const OneMinusSrcColorFactor: BlendingDstFactor;
|
||||
export const SrcAlphaFactor: BlendingDstFactor;
|
||||
export const OneMinusSrcAlphaFactor: BlendingDstFactor;
|
||||
export const DstAlphaFactor: BlendingDstFactor;
|
||||
export const OneMinusDstAlphaFactor: BlendingDstFactor;
|
||||
export const DstColorFactor: BlendingDstFactor;
|
||||
export const OneMinusDstColorFactor: BlendingDstFactor;
|
||||
|
||||
// custom blending src factors
|
||||
export enum BlendingSrcFactor {}
|
||||
export const SrcAlphaSaturateFactor: BlendingSrcFactor;
|
||||
|
||||
// depth modes
|
||||
export enum DepthModes {}
|
||||
export const NeverDepth: DepthModes;
|
||||
export const AlwaysDepth: DepthModes;
|
||||
export const LessDepth: DepthModes;
|
||||
export const LessEqualDepth: DepthModes;
|
||||
export const EqualDepth: DepthModes;
|
||||
export const GreaterEqualDepth: DepthModes;
|
||||
export const GreaterDepth: DepthModes;
|
||||
export const NotEqualDepth: DepthModes;
|
||||
|
||||
// TEXTURE CONSTANTS
|
||||
// Operations
|
||||
export enum Combine {}
|
||||
export const MultiplyOperation: Combine;
|
||||
export const MixOperation: Combine;
|
||||
export const AddOperation: Combine;
|
||||
|
||||
// Tone Mapping modes
|
||||
export enum ToneMapping {}
|
||||
export const NoToneMapping: ToneMapping;
|
||||
export const LinearToneMapping: ToneMapping;
|
||||
export const ReinhardToneMapping: ToneMapping;
|
||||
export const Uncharted2ToneMapping: ToneMapping;
|
||||
export const CineonToneMapping: ToneMapping;
|
||||
export const ACESFilmicToneMapping: ToneMapping;
|
||||
|
||||
// Mapping modes
|
||||
export enum Mapping {}
|
||||
export const UVMapping: Mapping;
|
||||
export const CubeReflectionMapping: Mapping;
|
||||
export const CubeRefractionMapping: Mapping;
|
||||
export const EquirectangularReflectionMapping: Mapping;
|
||||
export const EquirectangularRefractionMapping: Mapping;
|
||||
export const SphericalReflectionMapping: Mapping;
|
||||
export const CubeUVReflectionMapping: Mapping;
|
||||
export const CubeUVRefractionMapping: Mapping;
|
||||
|
||||
// Wrapping modes
|
||||
export enum Wrapping {}
|
||||
export const RepeatWrapping: Wrapping;
|
||||
export const ClampToEdgeWrapping: Wrapping;
|
||||
export const MirroredRepeatWrapping: Wrapping;
|
||||
|
||||
// Filters
|
||||
export enum TextureFilter {}
|
||||
export const NearestFilter: TextureFilter;
|
||||
export const NearestMipmapNearestFilter: TextureFilter;
|
||||
export const NearestMipMapNearestFilter: TextureFilter;
|
||||
export const NearestMipmapLinearFilter: TextureFilter;
|
||||
export const NearestMipMapLinearFilter: TextureFilter;
|
||||
export const LinearFilter: TextureFilter;
|
||||
export const LinearMipmapNearestFilter: TextureFilter;
|
||||
export const LinearMipMapNearestFilter: TextureFilter;
|
||||
export const LinearMipmapLinearFilter: TextureFilter;
|
||||
export const LinearMipMapLinearFilter: TextureFilter;
|
||||
|
||||
// Data types
|
||||
export enum TextureDataType {}
|
||||
export const UnsignedByteType: TextureDataType;
|
||||
export const ByteType: TextureDataType;
|
||||
export const ShortType: TextureDataType;
|
||||
export const UnsignedShortType: TextureDataType;
|
||||
export const IntType: TextureDataType;
|
||||
export const UnsignedIntType: TextureDataType;
|
||||
export const FloatType: TextureDataType;
|
||||
export const HalfFloatType: TextureDataType;
|
||||
|
||||
// Pixel types
|
||||
export enum PixelType {}
|
||||
export const UnsignedShort4444Type: PixelType;
|
||||
export const UnsignedShort5551Type: PixelType;
|
||||
export const UnsignedShort565Type: PixelType;
|
||||
export const UnsignedInt248Type: PixelType;
|
||||
|
||||
// Pixel formats
|
||||
export enum PixelFormat {}
|
||||
export const AlphaFormat: PixelFormat;
|
||||
export const RGBFormat: PixelFormat;
|
||||
export const RGBAFormat: PixelFormat;
|
||||
export const LuminanceFormat: PixelFormat;
|
||||
export const LuminanceAlphaFormat: PixelFormat;
|
||||
export const RGBEFormat: PixelFormat;
|
||||
export const DepthFormat: PixelFormat;
|
||||
export const DepthStencilFormat: PixelFormat;
|
||||
export const RedFormat: PixelFormat;
|
||||
|
||||
// Compressed texture formats
|
||||
// DDS / ST3C Compressed texture formats
|
||||
export enum CompressedPixelFormat {}
|
||||
export const RGB_S3TC_DXT1_Format: CompressedPixelFormat;
|
||||
export const RGBA_S3TC_DXT1_Format: CompressedPixelFormat;
|
||||
export const RGBA_S3TC_DXT3_Format: CompressedPixelFormat;
|
||||
export const RGBA_S3TC_DXT5_Format: CompressedPixelFormat;
|
||||
|
||||
// PVRTC compressed './texture formats
|
||||
export const RGB_PVRTC_4BPPV1_Format: CompressedPixelFormat;
|
||||
export const RGB_PVRTC_2BPPV1_Format: CompressedPixelFormat;
|
||||
export const RGBA_PVRTC_4BPPV1_Format: CompressedPixelFormat;
|
||||
export const RGBA_PVRTC_2BPPV1_Format: CompressedPixelFormat;
|
||||
|
||||
// ETC compressed texture formats
|
||||
export const RGB_ETC1_Format: CompressedPixelFormat;
|
||||
|
||||
// ASTC compressed texture formats
|
||||
export const RGBA_ASTC_4x4_Format: CompressedPixelFormat;
|
||||
export const RGBA_ASTC_5x4_Format: CompressedPixelFormat;
|
||||
export const RGBA_ASTC_5x5_Format: CompressedPixelFormat;
|
||||
export const RGBA_ASTC_6x5_Format: CompressedPixelFormat;
|
||||
export const RGBA_ASTC_6x6_Format: CompressedPixelFormat;
|
||||
export const RGBA_ASTC_8x5_Format: CompressedPixelFormat;
|
||||
export const RGBA_ASTC_8x6_Format: CompressedPixelFormat;
|
||||
export const RGBA_ASTC_8x8_Format: CompressedPixelFormat;
|
||||
export const RGBA_ASTC_10x5_Format: CompressedPixelFormat;
|
||||
export const RGBA_ASTC_10x6_Format: CompressedPixelFormat;
|
||||
export const RGBA_ASTC_10x8_Format: CompressedPixelFormat;
|
||||
export const RGBA_ASTC_10x10_Format: CompressedPixelFormat;
|
||||
export const RGBA_ASTC_12x10_Format: CompressedPixelFormat;
|
||||
export const RGBA_ASTC_12x12_Format: CompressedPixelFormat;
|
||||
|
||||
// Loop styles for AnimationAction
|
||||
export enum AnimationActionLoopStyles {}
|
||||
export const LoopOnce: AnimationActionLoopStyles;
|
||||
export const LoopRepeat: AnimationActionLoopStyles;
|
||||
export const LoopPingPong: AnimationActionLoopStyles;
|
||||
|
||||
// Interpolation
|
||||
export enum InterpolationModes {}
|
||||
export const InterpolateDiscrete: InterpolationModes;
|
||||
export const InterpolateLinear: InterpolationModes;
|
||||
export const InterpolateSmooth: InterpolationModes;
|
||||
|
||||
// Interpolant ending modes
|
||||
export enum InterpolationEndingModes {}
|
||||
export const ZeroCurvatureEnding: InterpolationEndingModes;
|
||||
export const ZeroSlopeEnding: InterpolationEndingModes;
|
||||
export const WrapAroundEnding: InterpolationEndingModes;
|
||||
|
||||
// Triangle Draw modes
|
||||
export enum TrianglesDrawModes {}
|
||||
export const TrianglesDrawMode: TrianglesDrawModes;
|
||||
export const TriangleStripDrawMode: TrianglesDrawModes;
|
||||
export const TriangleFanDrawMode: TrianglesDrawModes;
|
||||
|
||||
// Texture Encodings
|
||||
export enum TextureEncoding {}
|
||||
export const LinearEncoding: TextureEncoding;
|
||||
export const sRGBEncoding: TextureEncoding;
|
||||
export const GammaEncoding: TextureEncoding;
|
||||
export const RGBEEncoding: TextureEncoding;
|
||||
export const LogLuvEncoding: TextureEncoding;
|
||||
export const RGBM7Encoding: TextureEncoding;
|
||||
export const RGBM16Encoding: TextureEncoding;
|
||||
export const RGBDEncoding: TextureEncoding;
|
||||
|
||||
// Depth packing strategies
|
||||
export enum DepthPackingStrategies {}
|
||||
export const BasicDepthPacking: DepthPackingStrategies;
|
||||
export const RGBADepthPacking: DepthPackingStrategies;
|
||||
|
||||
// Normal Map types
|
||||
export enum NormalMapTypes {}
|
||||
export const TangentSpaceNormalMap: NormalMapTypes;
|
||||
export const ObjectSpaceNormalMap: NormalMapTypes;
|
||||
|
||||
// Stencil Op types
|
||||
export enum StencilOp {}
|
||||
export const ZeroStencilOp: StencilOp;
|
||||
export const KeepStencilOp: StencilOp;
|
||||
export const ReplaceStencilOp: StencilOp;
|
||||
export const IncrementStencilOp: StencilOp;
|
||||
export const DecrementStencilOp: StencilOp;
|
||||
export const IncrementWrapStencilOp: StencilOp;
|
||||
export const DecrementWrapStencilOp: StencilOp;
|
||||
export const InvertStencilOp: StencilOp;
|
||||
|
||||
// Stencil Func types
|
||||
export enum StencilFunc {}
|
||||
export const NeverStencilFunc: StencilFunc;
|
||||
export const LessStencilFunc: StencilFunc;
|
||||
export const EqualStencilFunc: StencilFunc;
|
||||
export const LessEqualStencilFunc: StencilFunc;
|
||||
export const GreaterStencilFunc: StencilFunc;
|
||||
export const NotEqualStencilFunc: StencilFunc;
|
||||
export const GreaterEqualStencilFunc: StencilFunc;
|
||||
export const AlwaysStencilFunc: StencilFunc;
|
||||
|
||||
// usage types
|
||||
export enum Usage {}
|
||||
export const StaticDrawUsage: Usage;
|
||||
export const DynamicDrawUsage: Usage;
|
||||
export const StreamDrawUsage: Usage;
|
||||
export const StaticReadUsage: Usage;
|
||||
export const DynamicReadUsage: Usage;
|
||||
export const StreamReadUsage: Usage;
|
||||
export const StaticCopyUsage: Usage;
|
||||
export const DynamicCopyUsage: Usage;
|
||||
export const StreamCopyUsage: Usage;
|
||||
245
apps/module/spine-ts/threejs/src/threejs/core/BufferAttribute.d.ts
vendored
Executable file
245
apps/module/spine-ts/threejs/src/threejs/core/BufferAttribute.d.ts
vendored
Executable file
@@ -0,0 +1,245 @@
|
||||
import {
|
||||
Usage
|
||||
} from '../constants';
|
||||
|
||||
/**
|
||||
* @see <a href="https://github.com/mrdoob/three.js/blob/master/src/core/BufferAttribute.js">src/core/BufferAttribute.js</a>
|
||||
*/
|
||||
export class BufferAttribute {
|
||||
|
||||
constructor( array: ArrayLike<number>, itemSize: number, normalized?: boolean ); // array parameter should be TypedArray.
|
||||
|
||||
name: string;
|
||||
array: ArrayLike<number>;
|
||||
itemSize: number;
|
||||
usage: Usage;
|
||||
updateRange: { offset: number; count: number };
|
||||
version: number;
|
||||
normalized: boolean;
|
||||
count: number;
|
||||
|
||||
set needsUpdate( value: boolean );
|
||||
|
||||
isBufferAttribute: true;
|
||||
|
||||
onUploadCallback: () => void;
|
||||
onUpload( callback: () => void ): this;
|
||||
setUsage( usage: Usage ): this;
|
||||
clone(): BufferAttribute;
|
||||
copy( source: BufferAttribute ): this;
|
||||
copyAt(
|
||||
index1: number,
|
||||
attribute: BufferAttribute,
|
||||
index2: number
|
||||
): this;
|
||||
copyArray( array: ArrayLike<number> ): this;
|
||||
copyColorsArray(
|
||||
colors: { r: number; g: number; b: number }[]
|
||||
): this;
|
||||
copyVector2sArray( vectors: { x: number; y: number }[] ): this;
|
||||
copyVector3sArray(
|
||||
vectors: { x: number; y: number; z: number }[]
|
||||
): this;
|
||||
copyVector4sArray(
|
||||
vectors: { x: number; y: number; z: number; w: number }[]
|
||||
): this;
|
||||
set(
|
||||
value: ArrayLike<number> | ArrayBufferView,
|
||||
offset?: number
|
||||
): this;
|
||||
getX( index: number ): number;
|
||||
setX( index: number, x: number ): this;
|
||||
getY( index: number ): number;
|
||||
setY( index: number, y: number ): this;
|
||||
getZ( index: number ): number;
|
||||
setZ( index: number, z: number ): this;
|
||||
getW( index: number ): number;
|
||||
setW( index: number, z: number ): this;
|
||||
setXY( index: number, x: number, y: number ): this;
|
||||
setXYZ( index: number, x: number, y: number, z: number ): this;
|
||||
setXYZW(
|
||||
index: number,
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
w: number
|
||||
): this;
|
||||
toJSON(): {
|
||||
itemSize: number,
|
||||
type: string,
|
||||
array: number[],
|
||||
normalized: boolean
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead.
|
||||
*/
|
||||
export class Int8Attribute extends BufferAttribute {
|
||||
|
||||
constructor( array: any, itemSize: number );
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead.
|
||||
*/
|
||||
export class Uint8Attribute extends BufferAttribute {
|
||||
|
||||
constructor( array: any, itemSize: number );
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead.
|
||||
*/
|
||||
export class Uint8ClampedAttribute extends BufferAttribute {
|
||||
|
||||
constructor( array: any, itemSize: number );
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead.
|
||||
*/
|
||||
export class Int16Attribute extends BufferAttribute {
|
||||
|
||||
constructor( array: any, itemSize: number );
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead.
|
||||
*/
|
||||
export class Uint16Attribute extends BufferAttribute {
|
||||
|
||||
constructor( array: any, itemSize: number );
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead.
|
||||
*/
|
||||
export class Int32Attribute extends BufferAttribute {
|
||||
|
||||
constructor( array: any, itemSize: number );
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead.
|
||||
*/
|
||||
export class Uint32Attribute extends BufferAttribute {
|
||||
|
||||
constructor( array: any, itemSize: number );
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead.
|
||||
*/
|
||||
export class Float32Attribute extends BufferAttribute {
|
||||
|
||||
constructor( array: any, itemSize: number );
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead.
|
||||
*/
|
||||
export class Float64Attribute extends BufferAttribute {
|
||||
|
||||
constructor( array: any, itemSize: number );
|
||||
|
||||
}
|
||||
|
||||
export class Int8BufferAttribute extends BufferAttribute {
|
||||
|
||||
constructor(
|
||||
array: ArrayLike<number> | ArrayBuffer | number,
|
||||
itemSize: number,
|
||||
normalized?: boolean
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
export class Uint8BufferAttribute extends BufferAttribute {
|
||||
|
||||
constructor(
|
||||
array: ArrayLike<number> | ArrayBuffer | number,
|
||||
itemSize: number,
|
||||
normalized?: boolean
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
export class Uint8ClampedBufferAttribute extends BufferAttribute {
|
||||
|
||||
constructor(
|
||||
array: ArrayLike<number> | ArrayBuffer | number,
|
||||
itemSize: number,
|
||||
normalized?: boolean
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
export class Int16BufferAttribute extends BufferAttribute {
|
||||
|
||||
constructor(
|
||||
array: ArrayLike<number> | ArrayBuffer | number,
|
||||
itemSize: number,
|
||||
normalized?: boolean
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
export class Uint16BufferAttribute extends BufferAttribute {
|
||||
|
||||
constructor(
|
||||
array: ArrayLike<number> | ArrayBuffer | number,
|
||||
itemSize: number,
|
||||
normalized?: boolean
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
export class Int32BufferAttribute extends BufferAttribute {
|
||||
|
||||
constructor(
|
||||
array: ArrayLike<number> | ArrayBuffer | number,
|
||||
itemSize: number,
|
||||
normalized?: boolean
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
export class Uint32BufferAttribute extends BufferAttribute {
|
||||
|
||||
constructor(
|
||||
array: ArrayLike<number> | ArrayBuffer | number,
|
||||
itemSize: number,
|
||||
normalized?: boolean
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
export class Float32BufferAttribute extends BufferAttribute {
|
||||
|
||||
constructor(
|
||||
array: ArrayLike<number> | ArrayBuffer | number,
|
||||
itemSize: number,
|
||||
normalized?: boolean
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
export class Float64BufferAttribute extends BufferAttribute {
|
||||
|
||||
constructor(
|
||||
array: ArrayLike<number> | ArrayBuffer | number,
|
||||
itemSize: number,
|
||||
normalized?: boolean
|
||||
);
|
||||
|
||||
}
|
||||
157
apps/module/spine-ts/threejs/src/threejs/core/BufferGeometry.d.ts
vendored
Executable file
157
apps/module/spine-ts/threejs/src/threejs/core/BufferGeometry.d.ts
vendored
Executable file
@@ -0,0 +1,157 @@
|
||||
import { BufferAttribute } from './BufferAttribute';
|
||||
import { Box3 } from '../math/Box3';
|
||||
import { Sphere } from '../math/Sphere';
|
||||
import { Matrix4 } from '../math/Matrix4';
|
||||
import { Vector2 } from '../math/Vector2';
|
||||
import { Vector3 } from '../math/Vector3';
|
||||
import { Object3D } from './Object3D';
|
||||
import { Geometry } from './Geometry';
|
||||
import { DirectGeometry } from './DirectGeometry';
|
||||
import { EventDispatcher } from './EventDispatcher';
|
||||
import { InterleavedBufferAttribute } from './InterleavedBufferAttribute';
|
||||
|
||||
/**
|
||||
* This is a superefficent class for geometries because it saves all data in buffers.
|
||||
* It reduces memory costs and cpu cycles. But it is not as easy to work with because of all the nessecary buffer calculations.
|
||||
* It is mainly interesting when working with static objects.
|
||||
*
|
||||
* @see <a href="https://github.com/mrdoob/three.js/blob/master/src/core/BufferGeometry.js">src/core/BufferGeometry.js</a>
|
||||
*/
|
||||
export class BufferGeometry extends EventDispatcher {
|
||||
|
||||
/**
|
||||
* This creates a new BufferGeometry. It also sets several properties to an default value.
|
||||
*/
|
||||
constructor();
|
||||
|
||||
static MaxIndex: number;
|
||||
|
||||
/**
|
||||
* Unique number of this buffergeometry instance
|
||||
*/
|
||||
id: number;
|
||||
uuid: string;
|
||||
name: string;
|
||||
type: string;
|
||||
index: BufferAttribute | null;
|
||||
attributes: {
|
||||
[name: string]: BufferAttribute | InterleavedBufferAttribute;
|
||||
};
|
||||
morphAttributes: {
|
||||
[name: string]: ( BufferAttribute | InterleavedBufferAttribute )[];
|
||||
};
|
||||
morphTargetsRelative: boolean;
|
||||
groups: { start: number; count: number; materialIndex?: number }[];
|
||||
boundingBox: Box3;
|
||||
boundingSphere: Sphere;
|
||||
drawRange: { start: number; count: number };
|
||||
userData: {[key: string]: any};
|
||||
isBufferGeometry: boolean;
|
||||
|
||||
getIndex(): BufferAttribute;
|
||||
setIndex( index: BufferAttribute | number[] ): void;
|
||||
|
||||
setAttribute( name: string, attribute: BufferAttribute | InterleavedBufferAttribute ): BufferGeometry;
|
||||
getAttribute( name: string ): BufferAttribute | InterleavedBufferAttribute;
|
||||
deleteAttribute( name: string ): BufferGeometry;
|
||||
|
||||
addGroup( start: number, count: number, materialIndex?: number ): void;
|
||||
clearGroups(): void;
|
||||
|
||||
setDrawRange( start: number, count: number ): void;
|
||||
|
||||
/**
|
||||
* Bakes matrix transform directly into vertex coordinates.
|
||||
*/
|
||||
applyMatrix( matrix: Matrix4 ): BufferGeometry;
|
||||
|
||||
rotateX( angle: number ): BufferGeometry;
|
||||
rotateY( angle: number ): BufferGeometry;
|
||||
rotateZ( angle: number ): BufferGeometry;
|
||||
translate( x: number, y: number, z: number ): BufferGeometry;
|
||||
scale( x: number, y: number, z: number ): BufferGeometry;
|
||||
lookAt( v: Vector3 ): void;
|
||||
|
||||
center(): BufferGeometry;
|
||||
|
||||
setFromObject( object: Object3D ): BufferGeometry;
|
||||
setFromPoints( points: Vector3[] | Vector2[] ): BufferGeometry;
|
||||
updateFromObject( object: Object3D ): void;
|
||||
|
||||
fromGeometry( geometry: Geometry, settings?: any ): BufferGeometry;
|
||||
|
||||
fromDirectGeometry( geometry: DirectGeometry ): BufferGeometry;
|
||||
|
||||
/**
|
||||
* Computes bounding box of the geometry, updating Geometry.boundingBox attribute.
|
||||
* Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.
|
||||
*/
|
||||
computeBoundingBox(): void;
|
||||
|
||||
/**
|
||||
* Computes bounding sphere of the geometry, updating Geometry.boundingSphere attribute.
|
||||
* Bounding spheres aren't' computed by default. They need to be explicitly computed, otherwise they are null.
|
||||
*/
|
||||
computeBoundingSphere(): void;
|
||||
|
||||
/**
|
||||
* Computes vertex normals by averaging face normals.
|
||||
*/
|
||||
computeVertexNormals(): void;
|
||||
|
||||
merge( geometry: BufferGeometry, offset: number ): BufferGeometry;
|
||||
normalizeNormals(): void;
|
||||
|
||||
toNonIndexed(): BufferGeometry;
|
||||
|
||||
toJSON(): any;
|
||||
clone(): this;
|
||||
copy( source: BufferGeometry ): this;
|
||||
|
||||
/**
|
||||
* Disposes the object from memory.
|
||||
* You need to call this when you want the bufferGeometry removed while the application is running.
|
||||
*/
|
||||
dispose(): void;
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link BufferGeometry#groups .groups} instead.
|
||||
*/
|
||||
drawcalls: any;
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link BufferGeometry#groups .groups} instead.
|
||||
*/
|
||||
offsets: any;
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link BufferGeometry#setIndex .setIndex()} instead.
|
||||
*/
|
||||
addIndex( index: any ): void;
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link BufferGeometry#addGroup .addGroup()} instead.
|
||||
*/
|
||||
addDrawCall( start: any, count: any, indexOffset?: any ): void;
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link BufferGeometry#clearGroups .clearGroups()} instead.
|
||||
*/
|
||||
clearDrawCalls(): void;
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link BufferGeometry#setAttribute .setAttribute()} instead.
|
||||
*/
|
||||
addAttribute(
|
||||
name: string,
|
||||
attribute: BufferAttribute | InterleavedBufferAttribute
|
||||
): BufferGeometry;
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link BufferGeometry#deleteAttribute .deleteAttribute()} instead.
|
||||
*/
|
||||
removeAttribute( name: string ): BufferGeometry;
|
||||
|
||||
addAttribute( name: any, array: any, itemSize: any ): any;
|
||||
|
||||
}
|
||||
61
apps/module/spine-ts/threejs/src/threejs/core/Clock.d.ts
vendored
Executable file
61
apps/module/spine-ts/threejs/src/threejs/core/Clock.d.ts
vendored
Executable file
@@ -0,0 +1,61 @@
|
||||
/**
|
||||
* Object for keeping track of time.
|
||||
*
|
||||
* @see <a href="https://github.com/mrdoob/three.js/blob/master/src/core/Clock.js">src/core/Clock.js</a>
|
||||
*/
|
||||
export class Clock {
|
||||
|
||||
/**
|
||||
* @param autoStart Automatically start the clock.
|
||||
*/
|
||||
constructor( autoStart?: boolean );
|
||||
|
||||
/**
|
||||
* If set, starts the clock automatically when the first update is called.
|
||||
*/
|
||||
autoStart: boolean;
|
||||
|
||||
/**
|
||||
* When the clock is running, It holds the starttime of the clock.
|
||||
* This counted from the number of milliseconds elapsed since 1 January 1970 00:00:00 UTC.
|
||||
*/
|
||||
startTime: number;
|
||||
|
||||
/**
|
||||
* When the clock is running, It holds the previous time from a update.
|
||||
* This counted from the number of milliseconds elapsed since 1 January 1970 00:00:00 UTC.
|
||||
*/
|
||||
oldTime: number;
|
||||
|
||||
/**
|
||||
* When the clock is running, It holds the time elapsed between the start of the clock to the previous update.
|
||||
* This parameter is in seconds of three decimal places.
|
||||
*/
|
||||
elapsedTime: number;
|
||||
|
||||
/**
|
||||
* This property keeps track whether the clock is running or not.
|
||||
*/
|
||||
running: boolean;
|
||||
|
||||
/**
|
||||
* Starts clock.
|
||||
*/
|
||||
start(): void;
|
||||
|
||||
/**
|
||||
* Stops clock.
|
||||
*/
|
||||
stop(): void;
|
||||
|
||||
/**
|
||||
* Get the seconds passed since the clock started.
|
||||
*/
|
||||
getElapsedTime(): number;
|
||||
|
||||
/**
|
||||
* Get the seconds passed since the last call to this method.
|
||||
*/
|
||||
getDelta(): number;
|
||||
|
||||
}
|
||||
44
apps/module/spine-ts/threejs/src/threejs/core/DirectGeometry.d.ts
vendored
Executable file
44
apps/module/spine-ts/threejs/src/threejs/core/DirectGeometry.d.ts
vendored
Executable file
@@ -0,0 +1,44 @@
|
||||
import { Vector3 } from '../math/Vector3';
|
||||
import { Color } from '../math/Color';
|
||||
import { Vector2 } from '../math/Vector2';
|
||||
import { Vector4 } from '../math/Vector4';
|
||||
import { Box3 } from '../math/Box3';
|
||||
import { Sphere } from '../math/Sphere';
|
||||
import { Geometry } from './Geometry';
|
||||
import { MorphTarget } from './Geometry';
|
||||
/**
|
||||
* @see <a href="https://github.com/mrdoob/three.js/blob/master/src/core/DirectGeometry.js">src/core/DirectGeometry.js</a>
|
||||
*/
|
||||
export class DirectGeometry {
|
||||
|
||||
constructor();
|
||||
|
||||
id: number;
|
||||
uuid: string;
|
||||
name: string;
|
||||
type: string;
|
||||
indices: number[];
|
||||
vertices: Vector3[];
|
||||
normals: Vector3[];
|
||||
colors: Color[];
|
||||
uvs: Vector2[];
|
||||
uvs2: Vector2[];
|
||||
groups: { start: number; materialIndex: number }[];
|
||||
morphTargets: MorphTarget[];
|
||||
skinWeights: Vector4[];
|
||||
skinIndices: Vector4[];
|
||||
boundingBox: Box3;
|
||||
boundingSphere: Sphere;
|
||||
verticesNeedUpdate: boolean;
|
||||
normalsNeedUpdate: boolean;
|
||||
colorsNeedUpdate: boolean;
|
||||
uvsNeedUpdate: boolean;
|
||||
groupsNeedUpdate: boolean;
|
||||
|
||||
computeBoundingBox(): void;
|
||||
computeBoundingSphere(): void;
|
||||
computeGroups( geometry: Geometry ): void;
|
||||
fromGeometry( geometry: Geometry ): DirectGeometry;
|
||||
dispose(): void;
|
||||
|
||||
}
|
||||
42
apps/module/spine-ts/threejs/src/threejs/core/EventDispatcher.d.ts
vendored
Executable file
42
apps/module/spine-ts/threejs/src/threejs/core/EventDispatcher.d.ts
vendored
Executable file
@@ -0,0 +1,42 @@
|
||||
import { Event } from './Face3';
|
||||
|
||||
/**
|
||||
* JavaScript events for custom objects
|
||||
*
|
||||
* @source src/core/EventDispatcher.js
|
||||
*/
|
||||
export class EventDispatcher {
|
||||
|
||||
/**
|
||||
* Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.
|
||||
*/
|
||||
constructor();
|
||||
|
||||
/**
|
||||
* Adds a listener to an event type.
|
||||
* @param type The type of event to listen to.
|
||||
* @param listener The function that gets called when the event is fired.
|
||||
*/
|
||||
addEventListener( type: string, listener: ( event: Event ) => void ): void;
|
||||
|
||||
/**
|
||||
* Checks if listener is added to an event type.
|
||||
* @param type The type of event to listen to.
|
||||
* @param listener The function that gets called when the event is fired.
|
||||
*/
|
||||
hasEventListener( type: string, listener: ( event: Event ) => void ): boolean;
|
||||
|
||||
/**
|
||||
* Removes a listener from an event type.
|
||||
* @param type The type of the listener that gets removed.
|
||||
* @param listener The listener function that gets removed.
|
||||
*/
|
||||
removeEventListener( type: string, listener: ( event: Event ) => void ): void;
|
||||
|
||||
/**
|
||||
* Fire an event type.
|
||||
* @param type The type of event that gets fired.
|
||||
*/
|
||||
dispatchEvent( event: { type: string; [attachment: string]: any } ): void;
|
||||
|
||||
}
|
||||
101
apps/module/spine-ts/threejs/src/threejs/core/Face3.d.ts
vendored
Executable file
101
apps/module/spine-ts/threejs/src/threejs/core/Face3.d.ts
vendored
Executable file
@@ -0,0 +1,101 @@
|
||||
import { Vector3 } from '../math/Vector3';
|
||||
import { Color } from '../math/Color';
|
||||
|
||||
export interface Event {
|
||||
type: string;
|
||||
target?: any;
|
||||
[attachment: string]: any;
|
||||
}
|
||||
|
||||
/**
|
||||
* Triangle face.
|
||||
*
|
||||
* @source https://github.com/mrdoob/three.js/blob/master/src/core/Face3.js
|
||||
*/
|
||||
export class Face3 {
|
||||
|
||||
/**
|
||||
* @param a Vertex A index.
|
||||
* @param b Vertex B index.
|
||||
* @param c Vertex C index.
|
||||
* @param normal Face normal or array of vertex normals.
|
||||
* @param color Face color or array of vertex colors.
|
||||
* @param materialIndex Material index.
|
||||
*/
|
||||
constructor(
|
||||
a: number,
|
||||
b: number,
|
||||
c: number,
|
||||
normal?: Vector3,
|
||||
color?: Color,
|
||||
materialIndex?: number
|
||||
);
|
||||
constructor(
|
||||
a: number,
|
||||
b: number,
|
||||
c: number,
|
||||
normal?: Vector3,
|
||||
vertexColors?: Color[],
|
||||
materialIndex?: number
|
||||
);
|
||||
constructor(
|
||||
a: number,
|
||||
b: number,
|
||||
c: number,
|
||||
vertexNormals?: Vector3[],
|
||||
color?: Color,
|
||||
materialIndex?: number
|
||||
);
|
||||
constructor(
|
||||
a: number,
|
||||
b: number,
|
||||
c: number,
|
||||
vertexNormals?: Vector3[],
|
||||
vertexColors?: Color[],
|
||||
materialIndex?: number
|
||||
);
|
||||
|
||||
/**
|
||||
* Vertex A index.
|
||||
*/
|
||||
a: number;
|
||||
|
||||
/**
|
||||
* Vertex B index.
|
||||
*/
|
||||
b: number;
|
||||
|
||||
/**
|
||||
* Vertex C index.
|
||||
*/
|
||||
c: number;
|
||||
|
||||
/**
|
||||
* Face normal.
|
||||
*/
|
||||
normal: Vector3;
|
||||
|
||||
/**
|
||||
* Array of 4 vertex normals.
|
||||
*/
|
||||
vertexNormals: Vector3[];
|
||||
|
||||
/**
|
||||
* Face color.
|
||||
*/
|
||||
color: Color;
|
||||
|
||||
/**
|
||||
* Array of 4 vertex normals.
|
||||
*/
|
||||
vertexColors: Color[];
|
||||
|
||||
/**
|
||||
* Material index (points to {@link Geometry.materials}).
|
||||
*/
|
||||
materialIndex: number;
|
||||
|
||||
clone(): this;
|
||||
copy( source: Face3 ): this;
|
||||
|
||||
}
|
||||
255
apps/module/spine-ts/threejs/src/threejs/core/Geometry.d.ts
vendored
Executable file
255
apps/module/spine-ts/threejs/src/threejs/core/Geometry.d.ts
vendored
Executable file
@@ -0,0 +1,255 @@
|
||||
import { Vector3 } from '../math/Vector3';
|
||||
import { Color } from '../math/Color';
|
||||
import { Face3 } from './Face3';
|
||||
import { Vector2 } from '../math/Vector2';
|
||||
import { Vector4 } from '../math/Vector4';
|
||||
import { Box3 } from '../math/Box3';
|
||||
import { Sphere } from '../math/Sphere';
|
||||
import { Matrix4 } from '../math/Matrix4';
|
||||
import { BufferGeometry } from './BufferGeometry';
|
||||
import { Matrix } from '../math/Matrix3';
|
||||
import { Mesh } from '../objects/Mesh';
|
||||
import { Bone } from '../objects/Bone';
|
||||
import { AnimationClip } from '../animation/AnimationClip';
|
||||
import { EventDispatcher } from './EventDispatcher';
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link Face3} instead.
|
||||
*/
|
||||
|
||||
export interface MorphTarget {
|
||||
name: string;
|
||||
vertices: Vector3[];
|
||||
}
|
||||
|
||||
export interface MorphColor {
|
||||
name: string;
|
||||
colors: Color[];
|
||||
}
|
||||
|
||||
export interface MorphNormals {
|
||||
name: string;
|
||||
normals: Vector3[];
|
||||
}
|
||||
|
||||
export let GeometryIdCount: number;
|
||||
|
||||
/**
|
||||
* Base class for geometries
|
||||
*
|
||||
* @see https://github.com/mrdoob/three.js/blob/master/src/core/Geometry.js
|
||||
*/
|
||||
export class Geometry extends EventDispatcher {
|
||||
|
||||
constructor();
|
||||
|
||||
/**
|
||||
* Unique number of this geometry instance
|
||||
*/
|
||||
id: number;
|
||||
|
||||
uuid: string;
|
||||
|
||||
isGeometry: boolean;
|
||||
|
||||
/**
|
||||
* Name for this geometry. Default is an empty string.
|
||||
*/
|
||||
name: string;
|
||||
|
||||
type: string;
|
||||
|
||||
/**
|
||||
* The array of vertices hold every position of points of the model.
|
||||
* To signal an update in this array, Geometry.verticesNeedUpdate needs to be set to true.
|
||||
*/
|
||||
vertices: Vector3[];
|
||||
|
||||
/**
|
||||
* Array of vertex colors, matching number and order of vertices.
|
||||
* Used in ParticleSystem, Line and Ribbon.
|
||||
* Meshes use per-face-use-of-vertex colors embedded directly in faces.
|
||||
* To signal an update in this array, Geometry.colorsNeedUpdate needs to be set to true.
|
||||
*/
|
||||
colors: Color[];
|
||||
|
||||
/**
|
||||
* Array of triangles or/and quads.
|
||||
* The array of faces describe how each vertex in the model is connected with each other.
|
||||
* To signal an update in this array, Geometry.elementsNeedUpdate needs to be set to true.
|
||||
*/
|
||||
faces: Face3[];
|
||||
|
||||
/**
|
||||
* Array of face UV layers.
|
||||
* Each UV layer is an array of UV matching order and number of vertices in faces.
|
||||
* To signal an update in this array, Geometry.uvsNeedUpdate needs to be set to true.
|
||||
*/
|
||||
faceVertexUvs: Vector2[][][];
|
||||
|
||||
/**
|
||||
* Array of morph targets. Each morph target is a Javascript object:
|
||||
*
|
||||
* { name: "targetName", vertices: [ new THREE.Vector3(), ... ] }
|
||||
*
|
||||
* Morph vertices match number and order of primary vertices.
|
||||
*/
|
||||
morphTargets: MorphTarget[];
|
||||
|
||||
/**
|
||||
* Array of morph normals. Morph normals have similar structure as morph targets, each normal set is a Javascript object:
|
||||
*
|
||||
* morphNormal = { name: "NormalName", normals: [ new THREE.Vector3(), ... ] }
|
||||
*/
|
||||
morphNormals: MorphNormals[];
|
||||
|
||||
/**
|
||||
* Array of skinning weights, matching number and order of vertices.
|
||||
*/
|
||||
skinWeights: Vector4[];
|
||||
|
||||
/**
|
||||
* Array of skinning indices, matching number and order of vertices.
|
||||
*/
|
||||
skinIndices: Vector4[];
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
lineDistances: number[];
|
||||
|
||||
/**
|
||||
* Bounding box.
|
||||
*/
|
||||
boundingBox: Box3;
|
||||
|
||||
/**
|
||||
* Bounding sphere.
|
||||
*/
|
||||
boundingSphere: Sphere;
|
||||
|
||||
/**
|
||||
* Set to true if the vertices array has been updated.
|
||||
*/
|
||||
verticesNeedUpdate: boolean;
|
||||
|
||||
/**
|
||||
* Set to true if the faces array has been updated.
|
||||
*/
|
||||
elementsNeedUpdate: boolean;
|
||||
|
||||
/**
|
||||
* Set to true if the uvs array has been updated.
|
||||
*/
|
||||
uvsNeedUpdate: boolean;
|
||||
|
||||
/**
|
||||
* Set to true if the normals array has been updated.
|
||||
*/
|
||||
normalsNeedUpdate: boolean;
|
||||
|
||||
/**
|
||||
* Set to true if the colors array has been updated.
|
||||
*/
|
||||
colorsNeedUpdate: boolean;
|
||||
|
||||
/**
|
||||
* Set to true if the linedistances array has been updated.
|
||||
*/
|
||||
lineDistancesNeedUpdate: boolean;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
groupsNeedUpdate: boolean;
|
||||
|
||||
/**
|
||||
* Bakes matrix transform directly into vertex coordinates.
|
||||
*/
|
||||
applyMatrix( matrix: Matrix4 ): Geometry;
|
||||
|
||||
rotateX( angle: number ): Geometry;
|
||||
rotateY( angle: number ): Geometry;
|
||||
rotateZ( angle: number ): Geometry;
|
||||
|
||||
translate( x: number, y: number, z: number ): Geometry;
|
||||
scale( x: number, y: number, z: number ): Geometry;
|
||||
lookAt( vector: Vector3 ): void;
|
||||
|
||||
fromBufferGeometry( geometry: BufferGeometry ): Geometry;
|
||||
|
||||
center(): Geometry;
|
||||
|
||||
normalize(): Geometry;
|
||||
|
||||
/**
|
||||
* Computes face normals.
|
||||
*/
|
||||
computeFaceNormals(): void;
|
||||
|
||||
/**
|
||||
* Computes vertex normals by averaging face normals.
|
||||
* Face normals must be existing / computed beforehand.
|
||||
*/
|
||||
computeVertexNormals( areaWeighted?: boolean ): void;
|
||||
|
||||
/**
|
||||
* Compute vertex normals, but duplicating face normals.
|
||||
*/
|
||||
computeFlatVertexNormals(): void;
|
||||
|
||||
/**
|
||||
* Computes morph normals.
|
||||
*/
|
||||
computeMorphNormals(): void;
|
||||
|
||||
/**
|
||||
* Computes bounding box of the geometry, updating {@link Geometry.boundingBox} attribute.
|
||||
*/
|
||||
computeBoundingBox(): void;
|
||||
|
||||
/**
|
||||
* Computes bounding sphere of the geometry, updating Geometry.boundingSphere attribute.
|
||||
* Neither bounding boxes or bounding spheres are computed by default. They need to be explicitly computed, otherwise they are null.
|
||||
*/
|
||||
computeBoundingSphere(): void;
|
||||
|
||||
merge(
|
||||
geometry: Geometry,
|
||||
matrix?: Matrix,
|
||||
materialIndexOffset?: number
|
||||
): void;
|
||||
|
||||
mergeMesh( mesh: Mesh ): void;
|
||||
|
||||
/**
|
||||
* Checks for duplicate vertices using hashmap.
|
||||
* Duplicated vertices are removed and faces' vertices are updated.
|
||||
*/
|
||||
mergeVertices(): number;
|
||||
|
||||
setFromPoints( points: Array<Vector2> | Array<Vector3> ): this;
|
||||
|
||||
sortFacesByMaterialIndex(): void;
|
||||
|
||||
toJSON(): any;
|
||||
|
||||
/**
|
||||
* Creates a new clone of the Geometry.
|
||||
*/
|
||||
clone(): this;
|
||||
|
||||
copy( source: Geometry ): this;
|
||||
|
||||
/**
|
||||
* Removes The object from memory.
|
||||
* Don't forget to call this method when you remove an geometry because it can cuase meomory leaks.
|
||||
*/
|
||||
dispose(): void;
|
||||
|
||||
// These properties do not exist in a normal Geometry class, but if you use the instance that was passed by JSONLoader, it will be added.
|
||||
bones: Bone[];
|
||||
animation: AnimationClip;
|
||||
animations: AnimationClip[];
|
||||
|
||||
}
|
||||
49
apps/module/spine-ts/threejs/src/threejs/core/InstancedBufferAttribute.d.ts
vendored
Executable file
49
apps/module/spine-ts/threejs/src/threejs/core/InstancedBufferAttribute.d.ts
vendored
Executable file
@@ -0,0 +1,49 @@
|
||||
import { BufferGeometry } from './BufferGeometry';
|
||||
import { BufferAttribute } from './BufferAttribute';
|
||||
|
||||
/**
|
||||
* @see <a href="https://github.com/mrdoob/three.js/blob/master/examples/js/BufferGeometryUtils.js">examples/js/BufferGeometryUtils.js</a>
|
||||
*/
|
||||
export namespace BufferGeometryUtils {
|
||||
export function mergeBufferGeometries(
|
||||
geometries: BufferGeometry[]
|
||||
): BufferGeometry;
|
||||
export function computeTangents( geometry: BufferGeometry ): null;
|
||||
export function mergeBufferAttributes(
|
||||
attributes: BufferAttribute[]
|
||||
): BufferAttribute;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
export namespace GeometryUtils {
|
||||
/**
|
||||
* @deprecated Use {@link Geometry#merge geometry.merge( geometry2, matrix, materialIndexOffset )} instead.
|
||||
*/
|
||||
export function merge(
|
||||
geometry1: any,
|
||||
geometry2: any,
|
||||
materialIndexOffset?: any
|
||||
): any;
|
||||
/**
|
||||
* @deprecated Use {@link Geometry#center geometry.center()} instead.
|
||||
*/
|
||||
export function center( geometry: any ): any;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://github.com/mrdoob/three.js/blob/master/src/core/InstancedBufferAttribute.js">src/core/InstancedBufferAttribute.js</a>
|
||||
*/
|
||||
export class InstancedBufferAttribute extends BufferAttribute {
|
||||
|
||||
constructor(
|
||||
array: ArrayLike<number>,
|
||||
itemSize: number,
|
||||
normalized?: boolean,
|
||||
meshPerAttribute?: number
|
||||
);
|
||||
|
||||
meshPerAttribute: number;
|
||||
|
||||
}
|
||||
15
apps/module/spine-ts/threejs/src/threejs/core/InstancedBufferGeometry.d.ts
vendored
Executable file
15
apps/module/spine-ts/threejs/src/threejs/core/InstancedBufferGeometry.d.ts
vendored
Executable file
@@ -0,0 +1,15 @@
|
||||
import { BufferGeometry } from './BufferGeometry';
|
||||
|
||||
/**
|
||||
* @see <a href="https://github.com/mrdoob/three.js/blob/master/src/core/InstancedBufferGeometry.js">src/core/InstancedBufferGeometry.js</a>
|
||||
*/
|
||||
export class InstancedBufferGeometry extends BufferGeometry {
|
||||
|
||||
constructor();
|
||||
|
||||
groups: { start: number; count: number; instances: number }[];
|
||||
maxInstancedCount: number;
|
||||
|
||||
addGroup( start: number, count: number, instances: number ): void;
|
||||
|
||||
}
|
||||
16
apps/module/spine-ts/threejs/src/threejs/core/InstancedInterleavedBuffer.d.ts
vendored
Executable file
16
apps/module/spine-ts/threejs/src/threejs/core/InstancedInterleavedBuffer.d.ts
vendored
Executable file
@@ -0,0 +1,16 @@
|
||||
import { InterleavedBuffer } from './InterleavedBuffer';
|
||||
|
||||
/**
|
||||
* @see <a href="https://github.com/mrdoob/three.js/blob/master/src/core/InstancedInterleavedBuffer.js">src/core/InstancedInterleavedBuffer.js</a>
|
||||
*/
|
||||
export class InstancedInterleavedBuffer extends InterleavedBuffer {
|
||||
|
||||
constructor(
|
||||
array: ArrayLike<number>,
|
||||
stride: number,
|
||||
meshPerAttribute?: number
|
||||
);
|
||||
|
||||
meshPerAttribute: number;
|
||||
|
||||
}
|
||||
30
apps/module/spine-ts/threejs/src/threejs/core/InterleavedBuffer.d.ts
vendored
Executable file
30
apps/module/spine-ts/threejs/src/threejs/core/InterleavedBuffer.d.ts
vendored
Executable file
@@ -0,0 +1,30 @@
|
||||
import { InterleavedBufferAttribute } from './InterleavedBufferAttribute';
|
||||
import { Usage } from '../constants';
|
||||
|
||||
/**
|
||||
* @see <a href="https://github.com/mrdoob/three.js/blob/master/src/core/InterleavedBuffer.js">src/core/InterleavedBuffer.js</a>
|
||||
*/
|
||||
export class InterleavedBuffer {
|
||||
|
||||
constructor( array: ArrayLike<number>, stride: number );
|
||||
|
||||
array: ArrayLike<number>;
|
||||
stride: number;
|
||||
usage: Usage;
|
||||
updateRange: { offset: number; count: number };
|
||||
version: number;
|
||||
length: number;
|
||||
count: number;
|
||||
needsUpdate: boolean;
|
||||
|
||||
setUsage( usage: Usage ): InterleavedBuffer;
|
||||
clone(): this;
|
||||
copy( source: InterleavedBuffer ): this;
|
||||
copyAt(
|
||||
index1: number,
|
||||
attribute: InterleavedBufferAttribute,
|
||||
index2: number
|
||||
): InterleavedBuffer;
|
||||
set( value: ArrayLike<number>, index: number ): InterleavedBuffer;
|
||||
|
||||
}
|
||||
47
apps/module/spine-ts/threejs/src/threejs/core/InterleavedBufferAttribute.d.ts
vendored
Executable file
47
apps/module/spine-ts/threejs/src/threejs/core/InterleavedBufferAttribute.d.ts
vendored
Executable file
@@ -0,0 +1,47 @@
|
||||
import { InterleavedBuffer } from './InterleavedBuffer';
|
||||
/**
|
||||
* @see <a href="https://github.com/mrdoob/three.js/blob/master/src/core/InterleavedBufferAttribute.js">src/core/InterleavedBufferAttribute.js</a>
|
||||
*/
|
||||
export class InterleavedBufferAttribute {
|
||||
|
||||
constructor(
|
||||
interleavedBuffer: InterleavedBuffer,
|
||||
itemSize: number,
|
||||
offset: number,
|
||||
normalized?: boolean
|
||||
);
|
||||
|
||||
data: InterleavedBuffer;
|
||||
itemSize: number;
|
||||
offset: number;
|
||||
normalized: boolean;
|
||||
|
||||
get count(): number;
|
||||
get array(): ArrayLike<number>;
|
||||
|
||||
isInterleavedBufferAttribute: true;
|
||||
|
||||
getX( index: number ): number;
|
||||
setX( index: number, x: number ): InterleavedBufferAttribute;
|
||||
getY( index: number ): number;
|
||||
setY( index: number, y: number ): InterleavedBufferAttribute;
|
||||
getZ( index: number ): number;
|
||||
setZ( index: number, z: number ): InterleavedBufferAttribute;
|
||||
getW( index: number ): number;
|
||||
setW( index: number, z: number ): InterleavedBufferAttribute;
|
||||
setXY( index: number, x: number, y: number ): InterleavedBufferAttribute;
|
||||
setXYZ(
|
||||
index: number,
|
||||
x: number,
|
||||
y: number,
|
||||
z: number
|
||||
): InterleavedBufferAttribute;
|
||||
setXYZW(
|
||||
index: number,
|
||||
x: number,
|
||||
y: number,
|
||||
z: number,
|
||||
w: number
|
||||
): InterleavedBufferAttribute;
|
||||
|
||||
}
|
||||
15
apps/module/spine-ts/threejs/src/threejs/core/Layers.d.ts
vendored
Executable file
15
apps/module/spine-ts/threejs/src/threejs/core/Layers.d.ts
vendored
Executable file
@@ -0,0 +1,15 @@
|
||||
export class Layers {
|
||||
|
||||
constructor();
|
||||
|
||||
mask: number;
|
||||
|
||||
set( channel: number ): void;
|
||||
enable( channel: number ): void;
|
||||
enableAll(): void;
|
||||
toggle( channel: number ): void;
|
||||
disable( channel: number ): void;
|
||||
disableAll(): void;
|
||||
test( layers: Layers ): boolean;
|
||||
|
||||
}
|
||||
351
apps/module/spine-ts/threejs/src/threejs/core/Object3D.d.ts
vendored
Executable file
351
apps/module/spine-ts/threejs/src/threejs/core/Object3D.d.ts
vendored
Executable file
@@ -0,0 +1,351 @@
|
||||
import { Vector3 } from '../math/Vector3';
|
||||
import { Euler } from '../math/Euler';
|
||||
import { Quaternion } from '../math/Quaternion';
|
||||
import { Matrix4 } from '../math/Matrix4';
|
||||
import { Matrix3 } from '../math/Matrix3';
|
||||
import { Layers } from './Layers';
|
||||
import { WebGLRenderer } from '../renderers/WebGLRenderer';
|
||||
import { Scene } from '../scenes/Scene';
|
||||
import { Camera } from '../cameras/Camera';
|
||||
import { Geometry } from './Geometry';
|
||||
import { Material } from '../materials/Material';
|
||||
import { Group } from '../objects/Group';
|
||||
import { Raycaster } from './Raycaster';
|
||||
import { EventDispatcher } from './EventDispatcher';
|
||||
import { BufferGeometry } from './BufferGeometry';
|
||||
import { Intersection } from './Raycaster';
|
||||
|
||||
export let Object3DIdCount: number;
|
||||
|
||||
/**
|
||||
* Base class for scene graph objects
|
||||
*/
|
||||
export class Object3D extends EventDispatcher {
|
||||
|
||||
constructor();
|
||||
|
||||
/**
|
||||
* Unique number of this object instance.
|
||||
*/
|
||||
id: number;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
uuid: string;
|
||||
|
||||
/**
|
||||
* Optional name of the object (doesn't need to be unique).
|
||||
*/
|
||||
name: string;
|
||||
|
||||
type: string;
|
||||
|
||||
/**
|
||||
* Object's parent in the scene graph.
|
||||
*/
|
||||
parent: Object3D | null;
|
||||
|
||||
/**
|
||||
* Array with object's children.
|
||||
*/
|
||||
children: Object3D[];
|
||||
|
||||
/**
|
||||
* Up direction.
|
||||
*/
|
||||
up: Vector3;
|
||||
|
||||
/**
|
||||
* Object's local position.
|
||||
*/
|
||||
position: Vector3;
|
||||
|
||||
/**
|
||||
* Object's local rotation (Euler angles), in radians.
|
||||
*/
|
||||
rotation: Euler;
|
||||
|
||||
/**
|
||||
* Global rotation.
|
||||
*/
|
||||
quaternion: Quaternion;
|
||||
|
||||
/**
|
||||
* Object's local scale.
|
||||
*/
|
||||
scale: Vector3;
|
||||
|
||||
modelViewMatrix: Matrix4;
|
||||
|
||||
normalMatrix: Matrix3;
|
||||
|
||||
/**
|
||||
* Local transform.
|
||||
*/
|
||||
matrix: Matrix4;
|
||||
|
||||
/**
|
||||
* The global transform of the object. If the Object3d has no parent, then it's identical to the local transform.
|
||||
*/
|
||||
matrixWorld: Matrix4;
|
||||
|
||||
/**
|
||||
* When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property.
|
||||
*/
|
||||
matrixAutoUpdate: boolean;
|
||||
|
||||
/**
|
||||
* When this is set, it calculates the matrixWorld in that frame and resets this property to false.
|
||||
*/
|
||||
matrixWorldNeedsUpdate: boolean;
|
||||
|
||||
layers: Layers;
|
||||
/**
|
||||
* Object gets rendered if true.
|
||||
*/
|
||||
visible: boolean;
|
||||
|
||||
/**
|
||||
* Gets rendered into shadow map.
|
||||
*/
|
||||
castShadow: boolean;
|
||||
|
||||
/**
|
||||
* Material gets baked in shadow receiving.
|
||||
*/
|
||||
receiveShadow: boolean;
|
||||
|
||||
/**
|
||||
* When this is set, it checks every frame if the object is in the frustum of the camera. Otherwise the object gets drawn every frame even if it isn't visible.
|
||||
*/
|
||||
frustumCulled: boolean;
|
||||
|
||||
/**
|
||||
* Overrides the default rendering order of scene graph objects, from lowest to highest renderOrder. Opaque and transparent objects remain sorted independently though. When this property is set for an instance of Group, all descendants objects will be sorted and rendered together.
|
||||
*/
|
||||
renderOrder: number;
|
||||
|
||||
/**
|
||||
* An object that can be used to store custom data about the Object3d. It should not hold references to functions as these will not be cloned.
|
||||
*/
|
||||
userData: { [key: string]: any };
|
||||
|
||||
/**
|
||||
* Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes.
|
||||
* When shadow-casting with a DirectionalLight or SpotLight, if you are (a) modifying vertex positions in
|
||||
* the vertex shader, (b) using a displacement map, (c) using an alpha map with alphaTest, or (d) using a
|
||||
* transparent texture with alphaTest, you must specify a customDepthMaterial for proper shadows.
|
||||
*/
|
||||
customDepthMaterial: Material;
|
||||
|
||||
/**
|
||||
* Same as customDepthMaterial, but used with PointLight.
|
||||
*/
|
||||
customDistanceMaterial: Material;
|
||||
|
||||
/**
|
||||
* Used to check whether this or derived classes are Object3Ds. Default is true.
|
||||
* You should not change this, as it is used internally for optimisation.
|
||||
*/
|
||||
isObject3D: true;
|
||||
|
||||
/**
|
||||
* Calls before rendering object
|
||||
*/
|
||||
onBeforeRender: (
|
||||
renderer: WebGLRenderer,
|
||||
scene: Scene,
|
||||
camera: Camera,
|
||||
geometry: Geometry | BufferGeometry,
|
||||
material: Material,
|
||||
group: Group
|
||||
) => void;
|
||||
|
||||
/**
|
||||
* Calls after rendering object
|
||||
*/
|
||||
onAfterRender: (
|
||||
renderer: WebGLRenderer,
|
||||
scene: Scene,
|
||||
camera: Camera,
|
||||
geometry: Geometry | BufferGeometry,
|
||||
material: Material,
|
||||
group: Group
|
||||
) => void;
|
||||
|
||||
static DefaultUp: Vector3;
|
||||
static DefaultMatrixAutoUpdate: boolean;
|
||||
|
||||
/**
|
||||
* This updates the position, rotation and scale with the matrix.
|
||||
*/
|
||||
applyMatrix( matrix: Matrix4 ): void;
|
||||
|
||||
applyQuaternion( quaternion: Quaternion ): this;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
setRotationFromAxisAngle( axis: Vector3, angle: number ): void;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
setRotationFromEuler( euler: Euler ): void;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
setRotationFromMatrix( m: Matrix4 ): void;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
setRotationFromQuaternion( q: Quaternion ): void;
|
||||
|
||||
/**
|
||||
* Rotate an object along an axis in object space. The axis is assumed to be normalized.
|
||||
* @param axis A normalized vector in object space.
|
||||
* @param angle The angle in radians.
|
||||
*/
|
||||
rotateOnAxis( axis: Vector3, angle: number ): this;
|
||||
|
||||
/**
|
||||
* Rotate an object along an axis in world space. The axis is assumed to be normalized. Method Assumes no rotated parent.
|
||||
* @param axis A normalized vector in object space.
|
||||
* @param angle The angle in radians.
|
||||
*/
|
||||
rotateOnWorldAxis( axis: Vector3, angle: number ): this;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param angle
|
||||
*/
|
||||
rotateX( angle: number ): this;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param angle
|
||||
*/
|
||||
rotateY( angle: number ): this;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param angle
|
||||
*/
|
||||
rotateZ( angle: number ): this;
|
||||
|
||||
/**
|
||||
* @param axis A normalized vector in object space.
|
||||
* @param distance The distance to translate.
|
||||
*/
|
||||
translateOnAxis( axis: Vector3, distance: number ): this;
|
||||
|
||||
/**
|
||||
* Translates object along x axis by distance.
|
||||
* @param distance Distance.
|
||||
*/
|
||||
translateX( distance: number ): this;
|
||||
|
||||
/**
|
||||
* Translates object along y axis by distance.
|
||||
* @param distance Distance.
|
||||
*/
|
||||
translateY( distance: number ): this;
|
||||
|
||||
/**
|
||||
* Translates object along z axis by distance.
|
||||
* @param distance Distance.
|
||||
*/
|
||||
translateZ( distance: number ): this;
|
||||
|
||||
/**
|
||||
* Updates the vector from local space to world space.
|
||||
* @param vector A local vector.
|
||||
*/
|
||||
localToWorld( vector: Vector3 ): Vector3;
|
||||
|
||||
/**
|
||||
* Updates the vector from world space to local space.
|
||||
* @param vector A world vector.
|
||||
*/
|
||||
worldToLocal( vector: Vector3 ): Vector3;
|
||||
|
||||
/**
|
||||
* Rotates object to face point in space.
|
||||
* @param vector A world vector to look at.
|
||||
*/
|
||||
lookAt( vector: Vector3 | number, y?: number, z?: number ): void;
|
||||
|
||||
/**
|
||||
* Adds object as child of this object.
|
||||
*/
|
||||
add( ...object: Object3D[] ): this;
|
||||
|
||||
/**
|
||||
* Removes object as child of this object.
|
||||
*/
|
||||
remove( ...object: Object3D[] ): this;
|
||||
|
||||
/**
|
||||
* Adds object as a child of this, while maintaining the object's world transform.
|
||||
*/
|
||||
attach( object: Object3D ): this;
|
||||
|
||||
/**
|
||||
* Searches through the object's children and returns the first with a matching id.
|
||||
* @param id Unique number of the object instance
|
||||
*/
|
||||
getObjectById( id: number ): Object3D | undefined;
|
||||
|
||||
/**
|
||||
* Searches through the object's children and returns the first with a matching name.
|
||||
* @param name String to match to the children's Object3d.name property.
|
||||
*/
|
||||
getObjectByName( name: string ): Object3D | undefined;
|
||||
|
||||
getObjectByProperty( name: string, value: string ): Object3D | undefined;
|
||||
|
||||
getWorldPosition( target: Vector3 ): Vector3;
|
||||
getWorldQuaternion( target: Quaternion ): Quaternion;
|
||||
getWorldScale( target: Vector3 ): Vector3;
|
||||
getWorldDirection( target: Vector3 ): Vector3;
|
||||
|
||||
raycast( raycaster: Raycaster, intersects: Intersection[] ): void;
|
||||
|
||||
traverse( callback: ( object: Object3D ) => any ): void;
|
||||
|
||||
traverseVisible( callback: ( object: Object3D ) => any ): void;
|
||||
|
||||
traverseAncestors( callback: ( object: Object3D ) => any ): void;
|
||||
|
||||
/**
|
||||
* Updates local transform.
|
||||
*/
|
||||
updateMatrix(): void;
|
||||
|
||||
/**
|
||||
* Updates global transform of the object and its children.
|
||||
*/
|
||||
updateMatrixWorld( force?: boolean ): void;
|
||||
|
||||
updateWorldMatrix( updateParents: boolean, updateChildren: boolean ): void;
|
||||
|
||||
toJSON( meta?: {
|
||||
geometries: any;
|
||||
materials: any;
|
||||
textures: any;
|
||||
images: any;
|
||||
} ): any;
|
||||
|
||||
clone( recursive?: boolean ): this;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param object
|
||||
* @param recursive
|
||||
*/
|
||||
copy( source: this, recursive?: boolean ): this;
|
||||
|
||||
}
|
||||
109
apps/module/spine-ts/threejs/src/threejs/core/Raycaster.d.ts
vendored
Executable file
109
apps/module/spine-ts/threejs/src/threejs/core/Raycaster.d.ts
vendored
Executable file
@@ -0,0 +1,109 @@
|
||||
import { Vector3 } from '../math/Vector3';
|
||||
import { Face3 } from './Face3';
|
||||
import { Object3D } from './Object3D';
|
||||
import { Vector2 } from '../math/Vector2';
|
||||
import { Ray } from '../math/Ray';
|
||||
import { Camera } from '../cameras/Camera';
|
||||
|
||||
export interface Intersection {
|
||||
distance: number;
|
||||
distanceToRay?: number;
|
||||
point: Vector3;
|
||||
index?: number;
|
||||
face?: Face3 | null;
|
||||
faceIndex?: number;
|
||||
object: Object3D;
|
||||
uv?: Vector2;
|
||||
}
|
||||
|
||||
export interface RaycasterParameters {
|
||||
Mesh?: any;
|
||||
Line?: any;
|
||||
LOD?: any;
|
||||
Points?: { threshold: number };
|
||||
Sprite?: any;
|
||||
}
|
||||
|
||||
export class Raycaster {
|
||||
|
||||
/**
|
||||
* This creates a new raycaster object.
|
||||
* @param origin The origin vector where the ray casts from.
|
||||
* @param direction The direction vector that gives direction to the ray. Should be normalized.
|
||||
* @param near All results returned are further away than near. Near can't be negative. Default value is 0.
|
||||
* @param far All results returned are closer then far. Far can't be lower then near . Default value is Infinity.
|
||||
*/
|
||||
constructor(
|
||||
origin?: Vector3,
|
||||
direction?: Vector3,
|
||||
near?: number,
|
||||
far?: number
|
||||
);
|
||||
|
||||
/** The Ray used for the raycasting. */
|
||||
ray: Ray;
|
||||
|
||||
/**
|
||||
* The near factor of the raycaster. This value indicates which objects can be discarded based on the
|
||||
* distance. This value shouldn't be negative and should be smaller than the far property.
|
||||
*/
|
||||
near: number;
|
||||
|
||||
/**
|
||||
* The far factor of the raycaster. This value indicates which objects can be discarded based on the
|
||||
* distance. This value shouldn't be negative and should be larger than the near property.
|
||||
*/
|
||||
far: number;
|
||||
|
||||
/**
|
||||
* The camera to use when raycasting against view-dependent objects such as billboarded objects like Sprites. This field
|
||||
* can be set manually or is set when calling "setFromCamera".
|
||||
*/
|
||||
camera: Camera;
|
||||
|
||||
params: RaycasterParameters;
|
||||
|
||||
/**
|
||||
* The precision factor of the raycaster when intersecting Line objects.
|
||||
*/
|
||||
linePrecision: number;
|
||||
|
||||
/**
|
||||
* Updates the ray with a new origin and direction.
|
||||
* @param origin The origin vector where the ray casts from.
|
||||
* @param direction The normalized direction vector that gives direction to the ray.
|
||||
*/
|
||||
set( origin: Vector3, direction: Vector3 ): void;
|
||||
|
||||
/**
|
||||
* Updates the ray with a new origin and direction.
|
||||
* @param coords 2D coordinates of the mouse, in normalized device coordinates (NDC)---X and Y components should be between -1 and 1.
|
||||
* @param camera camera from which the ray should originate
|
||||
*/
|
||||
setFromCamera( coords: { x: number; y: number }, camera: Camera ): void;
|
||||
|
||||
/**
|
||||
* Checks all intersection between the ray and the object with or without the descendants. Intersections are returned sorted by distance, closest first.
|
||||
* @param object The object to check for intersection with the ray.
|
||||
* @param recursive If true, it also checks all descendants. Otherwise it only checks intersecton with the object. Default is false.
|
||||
* @param optionalTarget (optional) target to set the result. Otherwise a new Array is instantiated. If set, you must clear this array prior to each call (i.e., array.length = 0;).
|
||||
*/
|
||||
intersectObject(
|
||||
object: Object3D,
|
||||
recursive?: boolean,
|
||||
optionalTarget?: Intersection[]
|
||||
): Intersection[];
|
||||
|
||||
/**
|
||||
* Checks all intersection between the ray and the objects with or without the descendants. Intersections are returned sorted by distance, closest first. Intersections are of the same form as those returned by .intersectObject.
|
||||
* @param objects The objects to check for intersection with the ray.
|
||||
* @param recursive If true, it also checks all descendants of the objects. Otherwise it only checks intersecton with the objects. Default is false.
|
||||
* @param optionalTarget (optional) target to set the result. Otherwise a new Array is instantiated. If set, you must clear this array prior to each call (i.e., array.length = 0;).
|
||||
*/
|
||||
intersectObjects(
|
||||
objects: Object3D[],
|
||||
recursive?: boolean,
|
||||
optionalTarget?: Intersection[]
|
||||
): Intersection[];
|
||||
|
||||
}
|
||||
24
apps/module/spine-ts/threejs/src/threejs/core/Uniform.d.ts
vendored
Executable file
24
apps/module/spine-ts/threejs/src/threejs/core/Uniform.d.ts
vendored
Executable file
@@ -0,0 +1,24 @@
|
||||
export class Uniform {
|
||||
|
||||
constructor( value: any );
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
constructor( type: string, value: any );
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
type: string;
|
||||
value: any;
|
||||
/**
|
||||
* @deprecated Use {@link Object3D#onBeforeRender object.onBeforeRender()} instead.
|
||||
*/
|
||||
dynamic: boolean;
|
||||
onUpdateCallback: Function;
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link Object3D#onBeforeRender object.onBeforeRender()} instead.
|
||||
*/
|
||||
onUpdate( callback: Function ): Uniform;
|
||||
|
||||
}
|
||||
34
apps/module/spine-ts/threejs/src/threejs/extras/ImageUtils.d.ts
vendored
Executable file
34
apps/module/spine-ts/threejs/src/threejs/extras/ImageUtils.d.ts
vendored
Executable file
@@ -0,0 +1,34 @@
|
||||
import { Mapping } from '../constants';
|
||||
import { Texture } from '../textures/Texture';
|
||||
|
||||
export namespace ImageUtils {
|
||||
|
||||
export function getDataURL(
|
||||
image: any,
|
||||
): string;
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
export let crossOrigin: string;
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link TextureLoader THREE.TextureLoader()} instead.
|
||||
*/
|
||||
export function loadTexture(
|
||||
url: string,
|
||||
mapping?: Mapping,
|
||||
onLoad?: ( texture: Texture ) => void,
|
||||
onError?: ( message: string ) => void
|
||||
): Texture;
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link CubeTextureLoader THREE.CubeTextureLoader()} instead.
|
||||
*/
|
||||
export function loadTextureCube(
|
||||
array: string[],
|
||||
mapping?: Mapping,
|
||||
onLoad?: ( texture: Texture ) => void,
|
||||
onError?: ( message: string ) => void
|
||||
): Texture;
|
||||
}
|
||||
10
apps/module/spine-ts/threejs/src/threejs/extras/ShapeUtils.d.ts
vendored
Executable file
10
apps/module/spine-ts/threejs/src/threejs/extras/ShapeUtils.d.ts
vendored
Executable file
@@ -0,0 +1,10 @@
|
||||
interface Vec2 {
|
||||
x: number;
|
||||
y: number;
|
||||
}
|
||||
|
||||
export namespace ShapeUtils {
|
||||
export function area( contour: Vec2[] ): number;
|
||||
export function triangulateShape( contour: Vec2[], holes: Vec2[][] ): number[][];
|
||||
export function isClockWise( pts: Vec2[] ): boolean;
|
||||
}
|
||||
79
apps/module/spine-ts/threejs/src/threejs/extras/core/Curve.d.ts
vendored
Executable file
79
apps/module/spine-ts/threejs/src/threejs/extras/core/Curve.d.ts
vendored
Executable file
@@ -0,0 +1,79 @@
|
||||
import { Vector } from '../../math/Vector2';
|
||||
|
||||
// Extras / Core /////////////////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* An extensible curve object which contains methods for interpolation
|
||||
* class Curve<T extends Vector>
|
||||
*/
|
||||
export class Curve<T extends Vector> {
|
||||
|
||||
/**
|
||||
* This value determines the amount of divisions when calculating the cumulative segment lengths of a curve via .getLengths.
|
||||
* To ensure precision when using methods like .getSpacedPoints, it is recommended to increase .arcLengthDivisions if the curve is very large.
|
||||
* Default is 200.
|
||||
*/
|
||||
arcLengthDivisions: number;
|
||||
|
||||
/**
|
||||
* Returns a vector for point t of the curve where t is between 0 and 1
|
||||
* getPoint(t: number): T;
|
||||
*/
|
||||
getPoint( t: number, optionalTarget?: T ): T;
|
||||
|
||||
/**
|
||||
* Returns a vector for point at relative position in curve according to arc length
|
||||
* getPointAt(u: number): T;
|
||||
*/
|
||||
getPointAt( u: number, optionalTarget?: T ): T;
|
||||
|
||||
/**
|
||||
* Get sequence of points using getPoint( t )
|
||||
* getPoints(divisions?: number): T[];
|
||||
*/
|
||||
getPoints( divisions?: number ): T[];
|
||||
|
||||
/**
|
||||
* Get sequence of equi-spaced points using getPointAt( u )
|
||||
* getSpacedPoints(divisions?: number): T[];
|
||||
*/
|
||||
getSpacedPoints( divisions?: number ): T[];
|
||||
|
||||
/**
|
||||
* Get total curve arc length
|
||||
*/
|
||||
getLength(): number;
|
||||
|
||||
/**
|
||||
* Get list of cumulative segment lengths
|
||||
*/
|
||||
getLengths( divisions?: number ): number[];
|
||||
|
||||
/**
|
||||
* Update the cumlative segment distance cache
|
||||
*/
|
||||
updateArcLengths(): void;
|
||||
|
||||
/**
|
||||
* Given u ( 0 .. 1 ), get a t to find p. This gives you points which are equi distance
|
||||
*/
|
||||
getUtoTmapping( u: number, distance: number ): number;
|
||||
|
||||
/**
|
||||
* Returns a unit vector tangent at t. If the subclassed curve do not implement its tangent derivation, 2 points a small delta apart will be used to find its gradient which seems to give a reasonable approximation
|
||||
* getTangent(t: number): T;
|
||||
*/
|
||||
getTangent( t: number ): T;
|
||||
|
||||
/**
|
||||
* Returns tangent at equidistance point u on the curve
|
||||
* getTangentAt(u: number): T;
|
||||
*/
|
||||
getTangentAt( u: number ): T;
|
||||
|
||||
/**
|
||||
* @deprecated since r84.
|
||||
*/
|
||||
static create( constructorFunc: Function, getPointFunc: Function ): Function;
|
||||
|
||||
}
|
||||
35
apps/module/spine-ts/threejs/src/threejs/extras/core/CurvePath.d.ts
vendored
Executable file
35
apps/module/spine-ts/threejs/src/threejs/extras/core/CurvePath.d.ts
vendored
Executable file
@@ -0,0 +1,35 @@
|
||||
import { Curve } from './Curve';
|
||||
import { Geometry } from '../../core/Geometry';
|
||||
import { Vector } from '../../math/Vector2';
|
||||
|
||||
export class CurvePath<T extends Vector> extends Curve<T> {
|
||||
|
||||
constructor();
|
||||
|
||||
curves: Curve<T>[];
|
||||
autoClose: boolean;
|
||||
|
||||
add( curve: Curve<T> ): void;
|
||||
checkConnection(): boolean;
|
||||
closePath(): void;
|
||||
getPoint( t: number ): T;
|
||||
getLength(): number;
|
||||
updateArcLengths(): void;
|
||||
getCurveLengths(): number[];
|
||||
getSpacedPoints( divisions?: number ): T[];
|
||||
getPoints( divisions?: number ): T[];
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link Geometry#setFromPoints new THREE.Geometry().setFromPoints( points )} instead.
|
||||
*/
|
||||
createPointsGeometry( divisions: number ): Geometry;
|
||||
/**
|
||||
* @deprecated Use {@link Geometry#setFromPoints new THREE.Geometry().setFromPoints( points )} instead.
|
||||
*/
|
||||
createSpacedPointsGeometry( divisions: number ): Geometry;
|
||||
/**
|
||||
* @deprecated Use {@link Geometry#setFromPoints new THREE.Geometry().setFromPoints( points )} instead.
|
||||
*/
|
||||
createGeometry( points: T[] ): Geometry;
|
||||
|
||||
}
|
||||
9
apps/module/spine-ts/threejs/src/threejs/extras/core/Font.d.ts
vendored
Executable file
9
apps/module/spine-ts/threejs/src/threejs/extras/core/Font.d.ts
vendored
Executable file
@@ -0,0 +1,9 @@
|
||||
export class Font {
|
||||
|
||||
constructor( jsondata: any );
|
||||
|
||||
data: string;
|
||||
|
||||
generateShapes( text: string, size: number, divisions: number ): any[];
|
||||
|
||||
}
|
||||
5
apps/module/spine-ts/threejs/src/threejs/extras/core/Interpolations.d.ts
vendored
Executable file
5
apps/module/spine-ts/threejs/src/threejs/extras/core/Interpolations.d.ts
vendored
Executable file
@@ -0,0 +1,5 @@
|
||||
export namespace Interpolations {
|
||||
export function CatmullRom( t: number, p0: number, p1: number, p2: number, p3: number ): number;
|
||||
export function QuadraticBezier( t: number, p0: number, p1: number, p2: number ): number;
|
||||
export function CubicBezier( t: number, p0: number, p1: number, p2: number, p3: number ): number;
|
||||
}
|
||||
82
apps/module/spine-ts/threejs/src/threejs/extras/core/Path.d.ts
vendored
Executable file
82
apps/module/spine-ts/threejs/src/threejs/extras/core/Path.d.ts
vendored
Executable file
@@ -0,0 +1,82 @@
|
||||
import { Vector2 } from '../../math/Vector2';
|
||||
import { CurvePath } from './CurvePath';
|
||||
|
||||
export enum PathActions {
|
||||
MOVE_TO,
|
||||
LINE_TO,
|
||||
QUADRATIC_CURVE_TO, // Bezier quadratic curve
|
||||
BEZIER_CURVE_TO, // Bezier cubic curve
|
||||
CSPLINE_THRU, // Catmull-rom spline
|
||||
ARC, // Circle
|
||||
ELLIPSE,
|
||||
}
|
||||
|
||||
export interface PathAction {
|
||||
action: PathActions;
|
||||
args: any;
|
||||
}
|
||||
|
||||
/**
|
||||
* a 2d path representation, comprising of points, lines, and cubes, similar to the html5 2d canvas api. It extends CurvePath.
|
||||
*/
|
||||
export class Path extends CurvePath<Vector2> {
|
||||
|
||||
constructor( points?: Vector2[] );
|
||||
|
||||
currentPoint: Vector2;
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link Path#setFromPoints .setFromPoints()} instead.
|
||||
*/
|
||||
fromPoints( vectors: Vector2[] ): this;
|
||||
setFromPoints( vectors: Vector2[] ): this;
|
||||
moveTo( x: number, y: number ): this;
|
||||
lineTo( x: number, y: number ): this;
|
||||
quadraticCurveTo( aCPx: number, aCPy: number, aX: number, aY: number ): this;
|
||||
bezierCurveTo(
|
||||
aCP1x: number,
|
||||
aCP1y: number,
|
||||
aCP2x: number,
|
||||
aCP2y: number,
|
||||
aX: number,
|
||||
aY: number
|
||||
): this;
|
||||
splineThru( pts: Vector2[] ): this;
|
||||
arc(
|
||||
aX: number,
|
||||
aY: number,
|
||||
aRadius: number,
|
||||
aStartAngle: number,
|
||||
aEndAngle: number,
|
||||
aClockwise: boolean
|
||||
): this;
|
||||
absarc(
|
||||
aX: number,
|
||||
aY: number,
|
||||
aRadius: number,
|
||||
aStartAngle: number,
|
||||
aEndAngle: number,
|
||||
aClockwise: boolean
|
||||
): this;
|
||||
ellipse(
|
||||
aX: number,
|
||||
aY: number,
|
||||
xRadius: number,
|
||||
yRadius: number,
|
||||
aStartAngle: number,
|
||||
aEndAngle: number,
|
||||
aClockwise: boolean,
|
||||
aRotation: number
|
||||
): this;
|
||||
absellipse(
|
||||
aX: number,
|
||||
aY: number,
|
||||
xRadius: number,
|
||||
yRadius: number,
|
||||
aStartAngle: number,
|
||||
aEndAngle: number,
|
||||
aClockwise: boolean,
|
||||
aRotation: number
|
||||
): this;
|
||||
|
||||
}
|
||||
40
apps/module/spine-ts/threejs/src/threejs/extras/core/Shape.d.ts
vendored
Executable file
40
apps/module/spine-ts/threejs/src/threejs/extras/core/Shape.d.ts
vendored
Executable file
@@ -0,0 +1,40 @@
|
||||
import { Vector2 } from '../../math/Vector2';
|
||||
import { Path } from './Path';
|
||||
import { ExtrudeGeometry } from '../../geometries/ExtrudeGeometry';
|
||||
import { ShapeGeometry } from '../../geometries/ShapeGeometry';
|
||||
|
||||
/**
|
||||
* Defines a 2d shape plane using paths.
|
||||
*/
|
||||
export class Shape extends Path {
|
||||
|
||||
constructor( points?: Vector2[] );
|
||||
|
||||
holes: Path[];
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link ExtrudeGeometry ExtrudeGeometry()} instead.
|
||||
*/
|
||||
extrude( options?: any ): ExtrudeGeometry;
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link ShapeGeometry ShapeGeometry()} instead.
|
||||
*/
|
||||
makeGeometry( options?: any ): ShapeGeometry;
|
||||
getPointsHoles( divisions: number ): Vector2[][];
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link Shape#extractPoints .extractPoints()} instead.
|
||||
*/
|
||||
extractAllPoints(
|
||||
divisions: number
|
||||
): {
|
||||
shape: Vector2[];
|
||||
holes: Vector2[][];
|
||||
};
|
||||
extractPoints( divisions: number ): {
|
||||
shape: Vector2[];
|
||||
holes: Vector2[][];
|
||||
};
|
||||
|
||||
}
|
||||
25
apps/module/spine-ts/threejs/src/threejs/extras/core/ShapePath.d.ts
vendored
Executable file
25
apps/module/spine-ts/threejs/src/threejs/extras/core/ShapePath.d.ts
vendored
Executable file
@@ -0,0 +1,25 @@
|
||||
import { Vector2 } from '../../math/Vector2';
|
||||
import { Shape } from './Shape';
|
||||
|
||||
export class ShapePath {
|
||||
|
||||
constructor();
|
||||
|
||||
subPaths: any[];
|
||||
currentPath: any;
|
||||
|
||||
moveTo( x: number, y: number ): this;
|
||||
lineTo( x: number, y: number ): this;
|
||||
quadraticCurveTo( aCPx: number, aCPy: number, aX: number, aY: number ): this;
|
||||
bezierCurveTo(
|
||||
aCP1x: number,
|
||||
aCP1y: number,
|
||||
aCP2x: number,
|
||||
aCP2y: number,
|
||||
aX: number,
|
||||
aY: number
|
||||
): this;
|
||||
splineThru( pts: Vector2[] ): this;
|
||||
toShapes( isCCW: boolean, noHoles?: boolean ): Shape[];
|
||||
|
||||
}
|
||||
13
apps/module/spine-ts/threejs/src/threejs/extras/curves/ArcCurve.d.ts
vendored
Executable file
13
apps/module/spine-ts/threejs/src/threejs/extras/curves/ArcCurve.d.ts
vendored
Executable file
@@ -0,0 +1,13 @@
|
||||
import { EllipseCurve } from './EllipseCurve';
|
||||
export class ArcCurve extends EllipseCurve {
|
||||
|
||||
constructor(
|
||||
aX: number,
|
||||
aY: number,
|
||||
aRadius: number,
|
||||
aStartAngle: number,
|
||||
aEndAngle: number,
|
||||
aClockwise: boolean
|
||||
);
|
||||
|
||||
}
|
||||
48
apps/module/spine-ts/threejs/src/threejs/extras/curves/CatmullRomCurve3.d.ts
vendored
Executable file
48
apps/module/spine-ts/threejs/src/threejs/extras/curves/CatmullRomCurve3.d.ts
vendored
Executable file
@@ -0,0 +1,48 @@
|
||||
import { Vector3 } from '../../math/Vector3';
|
||||
import { Curve } from '../core/Curve';
|
||||
|
||||
// Extras / Curves /////////////////////////////////////////////////////////////////////
|
||||
export namespace CurveUtils {
|
||||
export function tangentQuadraticBezier(
|
||||
t: number,
|
||||
p0: number,
|
||||
p1: number,
|
||||
p2: number
|
||||
): number;
|
||||
export function tangentCubicBezier(
|
||||
t: number,
|
||||
p0: number,
|
||||
p1: number,
|
||||
p2: number,
|
||||
p3: number
|
||||
): number;
|
||||
export function tangentSpline(
|
||||
t: number,
|
||||
p0: number,
|
||||
p1: number,
|
||||
p2: number,
|
||||
p3: number
|
||||
): number;
|
||||
export function interpolate(
|
||||
p0: number,
|
||||
p1: number,
|
||||
p2: number,
|
||||
p3: number,
|
||||
t: number
|
||||
): number;
|
||||
}
|
||||
|
||||
export class CatmullRomCurve3 extends Curve<Vector3> {
|
||||
|
||||
constructor(
|
||||
points?: Vector3[],
|
||||
closed?: boolean,
|
||||
curveType?: string,
|
||||
tension?: number
|
||||
);
|
||||
|
||||
points: Vector3[];
|
||||
|
||||
getPoint( t: number ): Vector3;
|
||||
|
||||
}
|
||||
13
apps/module/spine-ts/threejs/src/threejs/extras/curves/CubicBezierCurve.d.ts
vendored
Executable file
13
apps/module/spine-ts/threejs/src/threejs/extras/curves/CubicBezierCurve.d.ts
vendored
Executable file
@@ -0,0 +1,13 @@
|
||||
import { Vector2 } from '../../math/Vector2';
|
||||
import { Curve } from '../core/Curve';
|
||||
|
||||
export class CubicBezierCurve extends Curve<Vector2> {
|
||||
|
||||
constructor( v0: Vector2, v1: Vector2, v2: Vector2, v3: Vector2 );
|
||||
|
||||
v0: Vector2;
|
||||
v1: Vector2;
|
||||
v2: Vector2;
|
||||
v3: Vector2;
|
||||
|
||||
}
|
||||
15
apps/module/spine-ts/threejs/src/threejs/extras/curves/CubicBezierCurve3.d.ts
vendored
Executable file
15
apps/module/spine-ts/threejs/src/threejs/extras/curves/CubicBezierCurve3.d.ts
vendored
Executable file
@@ -0,0 +1,15 @@
|
||||
import { Vector3 } from '../../math/Vector3';
|
||||
import { Curve } from '../core/Curve';
|
||||
|
||||
export class CubicBezierCurve3 extends Curve<Vector3> {
|
||||
|
||||
constructor( v0: Vector3, v1: Vector3, v2: Vector3, v3: Vector3 );
|
||||
|
||||
v0: Vector3;
|
||||
v1: Vector3;
|
||||
v2: Vector3;
|
||||
v3: Vector3;
|
||||
|
||||
getPoint( t: number ): Vector3;
|
||||
|
||||
}
|
||||
10
apps/module/spine-ts/threejs/src/threejs/extras/curves/Curves.d.ts
vendored
Executable file
10
apps/module/spine-ts/threejs/src/threejs/extras/curves/Curves.d.ts
vendored
Executable file
@@ -0,0 +1,10 @@
|
||||
export * from './ArcCurve';
|
||||
export * from './CatmullRomCurve3';
|
||||
export * from './CubicBezierCurve';
|
||||
export * from './CubicBezierCurve3';
|
||||
export * from './EllipseCurve';
|
||||
export * from './LineCurve';
|
||||
export * from './LineCurve3';
|
||||
export * from './QuadraticBezierCurve';
|
||||
export * from './QuadraticBezierCurve3';
|
||||
export * from './SplineCurve';
|
||||
26
apps/module/spine-ts/threejs/src/threejs/extras/curves/EllipseCurve.d.ts
vendored
Executable file
26
apps/module/spine-ts/threejs/src/threejs/extras/curves/EllipseCurve.d.ts
vendored
Executable file
@@ -0,0 +1,26 @@
|
||||
import { Curve } from '../core/Curve';
|
||||
import { Vector2 } from '../../math/Vector2';
|
||||
|
||||
export class EllipseCurve extends Curve<Vector2> {
|
||||
|
||||
constructor(
|
||||
aX: number,
|
||||
aY: number,
|
||||
xRadius: number,
|
||||
yRadius: number,
|
||||
aStartAngle: number,
|
||||
aEndAngle: number,
|
||||
aClockwise: boolean,
|
||||
aRotation: number
|
||||
);
|
||||
|
||||
aX: number;
|
||||
aY: number;
|
||||
xRadius: number;
|
||||
yRadius: number;
|
||||
aStartAngle: number;
|
||||
aEndAngle: number;
|
||||
aClockwise: boolean;
|
||||
aRotation: number;
|
||||
|
||||
}
|
||||
11
apps/module/spine-ts/threejs/src/threejs/extras/curves/LineCurve.d.ts
vendored
Executable file
11
apps/module/spine-ts/threejs/src/threejs/extras/curves/LineCurve.d.ts
vendored
Executable file
@@ -0,0 +1,11 @@
|
||||
import { Vector2 } from '../../math/Vector2';
|
||||
import { Curve } from '../core/Curve';
|
||||
|
||||
export class LineCurve extends Curve<Vector2> {
|
||||
|
||||
constructor( v1: Vector2, v2: Vector2 );
|
||||
|
||||
v1: Vector2;
|
||||
v2: Vector2;
|
||||
|
||||
}
|
||||
13
apps/module/spine-ts/threejs/src/threejs/extras/curves/LineCurve3.d.ts
vendored
Executable file
13
apps/module/spine-ts/threejs/src/threejs/extras/curves/LineCurve3.d.ts
vendored
Executable file
@@ -0,0 +1,13 @@
|
||||
import { Vector3 } from '../../math/Vector3';
|
||||
import { Curve } from '../core/Curve';
|
||||
|
||||
export class LineCurve3 extends Curve<Vector3> {
|
||||
|
||||
constructor( v1: Vector3, v2: Vector3 );
|
||||
|
||||
v1: Vector3;
|
||||
v2: Vector3;
|
||||
|
||||
getPoint( t: number ): Vector3;
|
||||
|
||||
}
|
||||
12
apps/module/spine-ts/threejs/src/threejs/extras/curves/QuadraticBezierCurve.d.ts
vendored
Executable file
12
apps/module/spine-ts/threejs/src/threejs/extras/curves/QuadraticBezierCurve.d.ts
vendored
Executable file
@@ -0,0 +1,12 @@
|
||||
import { Vector2 } from '../../math/Vector2';
|
||||
import { Curve } from '../core/Curve';
|
||||
|
||||
export class QuadraticBezierCurve extends Curve<Vector2> {
|
||||
|
||||
constructor( v0: Vector2, v1: Vector2, v2: Vector2 );
|
||||
|
||||
v0: Vector2;
|
||||
v1: Vector2;
|
||||
v2: Vector2;
|
||||
|
||||
}
|
||||
14
apps/module/spine-ts/threejs/src/threejs/extras/curves/QuadraticBezierCurve3.d.ts
vendored
Executable file
14
apps/module/spine-ts/threejs/src/threejs/extras/curves/QuadraticBezierCurve3.d.ts
vendored
Executable file
@@ -0,0 +1,14 @@
|
||||
import { Vector3 } from '../../math/Vector3';
|
||||
import { Curve } from '../core/Curve';
|
||||
|
||||
export class QuadraticBezierCurve3 extends Curve<Vector3> {
|
||||
|
||||
constructor( v0: Vector3, v1: Vector3, v2: Vector3 );
|
||||
|
||||
v0: Vector3;
|
||||
v1: Vector3;
|
||||
v2: Vector3;
|
||||
|
||||
getPoint( t: number ): Vector3;
|
||||
|
||||
}
|
||||
10
apps/module/spine-ts/threejs/src/threejs/extras/curves/SplineCurve.d.ts
vendored
Executable file
10
apps/module/spine-ts/threejs/src/threejs/extras/curves/SplineCurve.d.ts
vendored
Executable file
@@ -0,0 +1,10 @@
|
||||
import { Vector2 } from '../../math/Vector2';
|
||||
import { Curve } from '../core/Curve';
|
||||
|
||||
export class SplineCurve extends Curve<Vector2> {
|
||||
|
||||
constructor( points?: Vector2[] );
|
||||
|
||||
points: Vector2[];
|
||||
|
||||
}
|
||||
13
apps/module/spine-ts/threejs/src/threejs/extras/objects/ImmediateRenderObject.d.ts
vendored
Executable file
13
apps/module/spine-ts/threejs/src/threejs/extras/objects/ImmediateRenderObject.d.ts
vendored
Executable file
@@ -0,0 +1,13 @@
|
||||
import { Object3D } from '../../core/Object3D';
|
||||
import { Material } from '../../materials/Material';
|
||||
|
||||
// Extras / Objects /////////////////////////////////////////////////////////////////////
|
||||
|
||||
export class ImmediateRenderObject extends Object3D {
|
||||
|
||||
constructor( material: Material );
|
||||
|
||||
material: Material;
|
||||
render( renderCallback: Function ): void;
|
||||
|
||||
}
|
||||
58
apps/module/spine-ts/threejs/src/threejs/geometries/BoxGeometry.d.ts
vendored
Executable file
58
apps/module/spine-ts/threejs/src/threejs/geometries/BoxGeometry.d.ts
vendored
Executable file
@@ -0,0 +1,58 @@
|
||||
import { Geometry } from '../core/Geometry';
|
||||
import { BufferGeometry } from '../core/BufferGeometry';
|
||||
|
||||
// Extras / Geometries /////////////////////////////////////////////////////////////////////
|
||||
export class BoxBufferGeometry extends BufferGeometry {
|
||||
|
||||
constructor(
|
||||
width?: number,
|
||||
height?: number,
|
||||
depth?: number,
|
||||
widthSegments?: number,
|
||||
heightSegments?: number,
|
||||
depthSegments?: number
|
||||
);
|
||||
|
||||
parameters: {
|
||||
width: number;
|
||||
height: number;
|
||||
depth: number;
|
||||
widthSegments: number;
|
||||
heightSegments: number;
|
||||
depthSegments: number;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* BoxGeometry is the quadrilateral primitive geometry class. It is typically used for creating a cube or irregular quadrilateral of the dimensions provided within the (optional) 'width', 'height', & 'depth' constructor arguments.
|
||||
*/
|
||||
export class BoxGeometry extends Geometry {
|
||||
|
||||
/**
|
||||
* @param width — Width of the sides on the X axis.
|
||||
* @param height — Height of the sides on the Y axis.
|
||||
* @param depth — Depth of the sides on the Z axis.
|
||||
* @param widthSegments — Number of segmented faces along the width of the sides.
|
||||
* @param heightSegments — Number of segmented faces along the height of the sides.
|
||||
* @param depthSegments — Number of segmented faces along the depth of the sides.
|
||||
*/
|
||||
constructor(
|
||||
width?: number,
|
||||
height?: number,
|
||||
depth?: number,
|
||||
widthSegments?: number,
|
||||
heightSegments?: number,
|
||||
depthSegments?: number
|
||||
);
|
||||
|
||||
parameters: {
|
||||
width: number;
|
||||
height: number;
|
||||
depth: number;
|
||||
widthSegments: number;
|
||||
heightSegments: number;
|
||||
depthSegments: number;
|
||||
};
|
||||
|
||||
}
|
||||
38
apps/module/spine-ts/threejs/src/threejs/geometries/CircleGeometry.d.ts
vendored
Executable file
38
apps/module/spine-ts/threejs/src/threejs/geometries/CircleGeometry.d.ts
vendored
Executable file
@@ -0,0 +1,38 @@
|
||||
import { Geometry } from '../core/Geometry';
|
||||
import { BufferGeometry } from '../core/BufferGeometry';
|
||||
|
||||
export class CircleBufferGeometry extends BufferGeometry {
|
||||
|
||||
constructor(
|
||||
radius?: number,
|
||||
segments?: number,
|
||||
thetaStart?: number,
|
||||
thetaLength?: number
|
||||
);
|
||||
|
||||
parameters: {
|
||||
radius: number;
|
||||
segments: number;
|
||||
thetaStart: number;
|
||||
thetaLength: number;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
export class CircleGeometry extends Geometry {
|
||||
|
||||
constructor(
|
||||
radius?: number,
|
||||
segments?: number,
|
||||
thetaStart?: number,
|
||||
thetaLength?: number
|
||||
);
|
||||
|
||||
parameters: {
|
||||
radius: number;
|
||||
segments: number;
|
||||
thetaStart: number;
|
||||
thetaLength: number;
|
||||
};
|
||||
|
||||
}
|
||||
30
apps/module/spine-ts/threejs/src/threejs/geometries/ConeGeometry.d.ts
vendored
Executable file
30
apps/module/spine-ts/threejs/src/threejs/geometries/ConeGeometry.d.ts
vendored
Executable file
@@ -0,0 +1,30 @@
|
||||
import { CylinderGeometry } from './CylinderGeometry';
|
||||
import { CylinderBufferGeometry } from './CylinderGeometry';
|
||||
|
||||
export class ConeBufferGeometry extends CylinderBufferGeometry {
|
||||
|
||||
constructor(
|
||||
radius?: number,
|
||||
height?: number,
|
||||
radialSegment?: number,
|
||||
heightSegment?: number,
|
||||
openEnded?: boolean,
|
||||
thetaStart?: number,
|
||||
thetaLength?: number
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
export class ConeGeometry extends CylinderGeometry {
|
||||
|
||||
constructor(
|
||||
radius?: number,
|
||||
height?: number,
|
||||
radialSegment?: number,
|
||||
heightSegment?: number,
|
||||
openEnded?: boolean,
|
||||
thetaStart?: number,
|
||||
thetaLength?: number
|
||||
);
|
||||
|
||||
}
|
||||
62
apps/module/spine-ts/threejs/src/threejs/geometries/CylinderGeometry.d.ts
vendored
Executable file
62
apps/module/spine-ts/threejs/src/threejs/geometries/CylinderGeometry.d.ts
vendored
Executable file
@@ -0,0 +1,62 @@
|
||||
import { Geometry } from '../core/Geometry';
|
||||
import { BufferGeometry } from '../core/BufferGeometry';
|
||||
|
||||
export class CylinderBufferGeometry extends BufferGeometry {
|
||||
|
||||
constructor(
|
||||
radiusTop?: number,
|
||||
radiusBottom?: number,
|
||||
height?: number,
|
||||
radialSegments?: number,
|
||||
heightSegments?: number,
|
||||
openEnded?: boolean,
|
||||
thetaStart?: number,
|
||||
thetaLength?: number
|
||||
);
|
||||
|
||||
parameters: {
|
||||
radiusTop: number;
|
||||
radiusBottom: number;
|
||||
height: number;
|
||||
radialSegments: number;
|
||||
heightSegments: number;
|
||||
openEnded: boolean;
|
||||
thetaStart: number;
|
||||
thetaLength: number;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
export class CylinderGeometry extends Geometry {
|
||||
|
||||
/**
|
||||
* @param radiusTop — Radius of the cylinder at the top.
|
||||
* @param radiusBottom — Radius of the cylinder at the bottom.
|
||||
* @param height — Height of the cylinder.
|
||||
* @param radiusSegments — Number of segmented faces around the circumference of the cylinder.
|
||||
* @param heightSegments — Number of rows of faces along the height of the cylinder.
|
||||
* @param openEnded - A Boolean indicating whether or not to cap the ends of the cylinder.
|
||||
*/
|
||||
constructor(
|
||||
radiusTop?: number,
|
||||
radiusBottom?: number,
|
||||
height?: number,
|
||||
radiusSegments?: number,
|
||||
heightSegments?: number,
|
||||
openEnded?: boolean,
|
||||
thetaStart?: number,
|
||||
thetaLength?: number
|
||||
);
|
||||
|
||||
parameters: {
|
||||
radiusTop: number;
|
||||
radiusBottom: number;
|
||||
height: number;
|
||||
radialSegments: number;
|
||||
heightSegments: number;
|
||||
openEnded: boolean;
|
||||
thetaStart: number;
|
||||
thetaLength: number;
|
||||
};
|
||||
|
||||
}
|
||||
19
apps/module/spine-ts/threejs/src/threejs/geometries/DodecahedronGeometry.d.ts
vendored
Executable file
19
apps/module/spine-ts/threejs/src/threejs/geometries/DodecahedronGeometry.d.ts
vendored
Executable file
@@ -0,0 +1,19 @@
|
||||
import { Geometry } from '../core/Geometry';
|
||||
import { PolyhedronBufferGeometry } from './PolyhedronGeometry';
|
||||
|
||||
export class DodecahedronBufferGeometry extends PolyhedronBufferGeometry {
|
||||
|
||||
constructor( radius?: number, detail?: number );
|
||||
|
||||
}
|
||||
|
||||
export class DodecahedronGeometry extends Geometry {
|
||||
|
||||
constructor( radius?: number, detail?: number );
|
||||
|
||||
parameters: {
|
||||
radius: number;
|
||||
detail: number;
|
||||
};
|
||||
|
||||
}
|
||||
8
apps/module/spine-ts/threejs/src/threejs/geometries/EdgesGeometry.d.ts
vendored
Executable file
8
apps/module/spine-ts/threejs/src/threejs/geometries/EdgesGeometry.d.ts
vendored
Executable file
@@ -0,0 +1,8 @@
|
||||
import { BufferGeometry } from '../core/BufferGeometry';
|
||||
import { Geometry } from '../core/Geometry';
|
||||
|
||||
export class EdgesGeometry extends BufferGeometry {
|
||||
|
||||
constructor( geometry: BufferGeometry | Geometry, thresholdAngle?: number );
|
||||
|
||||
}
|
||||
59
apps/module/spine-ts/threejs/src/threejs/geometries/ExtrudeGeometry.d.ts
vendored
Executable file
59
apps/module/spine-ts/threejs/src/threejs/geometries/ExtrudeGeometry.d.ts
vendored
Executable file
@@ -0,0 +1,59 @@
|
||||
import { Curve } from '../extras/core/Curve';
|
||||
import { Vector2 } from '../math/Vector2';
|
||||
import { Vector3 } from '../math/Vector3';
|
||||
import { Shape } from '../extras/core/Shape';
|
||||
import { Geometry } from '../core/Geometry';
|
||||
import { BufferGeometry } from '../core/BufferGeometry';
|
||||
|
||||
export interface ExtrudeGeometryOptions {
|
||||
curveSegments?: number;
|
||||
steps?: number;
|
||||
depth?: number;
|
||||
bevelEnabled?: boolean;
|
||||
bevelThickness?: number;
|
||||
bevelSize?: number;
|
||||
bevelOffset?: number;
|
||||
bevelSegments?: number;
|
||||
extrudePath?: Curve<Vector3>;
|
||||
UVGenerator?: UVGenerator;
|
||||
}
|
||||
|
||||
export interface UVGenerator {
|
||||
generateTopUV(
|
||||
geometry: ExtrudeBufferGeometry,
|
||||
vertices: number[],
|
||||
indexA: number,
|
||||
indexB: number,
|
||||
indexC: number
|
||||
): Vector2[];
|
||||
generateSideWallUV(
|
||||
geometry: ExtrudeBufferGeometry,
|
||||
vertices: number[],
|
||||
indexA: number,
|
||||
indexB: number,
|
||||
indexC: number,
|
||||
indexD: number
|
||||
): Vector2[];
|
||||
}
|
||||
|
||||
export class ExtrudeBufferGeometry extends BufferGeometry {
|
||||
|
||||
constructor( shapes: Shape | Shape[], options?: ExtrudeGeometryOptions );
|
||||
|
||||
static WorldUVGenerator: UVGenerator;
|
||||
|
||||
addShapeList( shapes: Shape[], options?: any ): void;
|
||||
addShape( shape: Shape, options?: any ): void;
|
||||
|
||||
}
|
||||
|
||||
export class ExtrudeGeometry extends Geometry {
|
||||
|
||||
constructor( shapes: Shape | Shape[], options?: ExtrudeGeometryOptions );
|
||||
|
||||
static WorldUVGenerator: UVGenerator;
|
||||
|
||||
addShapeList( shapes: Shape[], options?: any ): void;
|
||||
addShape( shape: Shape, options?: any ): void;
|
||||
|
||||
}
|
||||
22
apps/module/spine-ts/threejs/src/threejs/geometries/Geometries.d.ts
vendored
Executable file
22
apps/module/spine-ts/threejs/src/threejs/geometries/Geometries.d.ts
vendored
Executable file
@@ -0,0 +1,22 @@
|
||||
export * from './WireframeGeometry';
|
||||
export * from './ParametricGeometry';
|
||||
export * from './TetrahedronGeometry';
|
||||
export * from './OctahedronGeometry';
|
||||
export * from './IcosahedronGeometry';
|
||||
export * from './DodecahedronGeometry';
|
||||
export * from './PolyhedronGeometry';
|
||||
export * from './TubeGeometry';
|
||||
export * from './TorusKnotGeometry';
|
||||
export * from './TorusGeometry';
|
||||
export * from './TextGeometry';
|
||||
export * from './SphereGeometry';
|
||||
export * from './RingGeometry';
|
||||
export * from './PlaneGeometry';
|
||||
export * from './LatheGeometry';
|
||||
export * from './ShapeGeometry';
|
||||
export * from './ExtrudeGeometry';
|
||||
export * from './EdgesGeometry';
|
||||
export * from './ConeGeometry';
|
||||
export * from './CylinderGeometry';
|
||||
export * from './CircleGeometry';
|
||||
export * from './BoxGeometry';
|
||||
16
apps/module/spine-ts/threejs/src/threejs/geometries/IcosahedronGeometry.d.ts
vendored
Executable file
16
apps/module/spine-ts/threejs/src/threejs/geometries/IcosahedronGeometry.d.ts
vendored
Executable file
@@ -0,0 +1,16 @@
|
||||
import {
|
||||
PolyhedronGeometry,
|
||||
PolyhedronBufferGeometry,
|
||||
} from './PolyhedronGeometry';
|
||||
|
||||
export class IcosahedronBufferGeometry extends PolyhedronBufferGeometry {
|
||||
|
||||
constructor( radius?: number, detail?: number );
|
||||
|
||||
}
|
||||
|
||||
export class IcosahedronGeometry extends PolyhedronGeometry {
|
||||
|
||||
constructor( radius?: number, detail?: number );
|
||||
|
||||
}
|
||||
39
apps/module/spine-ts/threejs/src/threejs/geometries/LatheGeometry.d.ts
vendored
Executable file
39
apps/module/spine-ts/threejs/src/threejs/geometries/LatheGeometry.d.ts
vendored
Executable file
@@ -0,0 +1,39 @@
|
||||
import { Vector2 } from '../math/Vector2';
|
||||
import { Geometry } from '../core/Geometry';
|
||||
import { BufferGeometry } from '../core/BufferGeometry';
|
||||
|
||||
export class LatheBufferGeometry extends BufferGeometry {
|
||||
|
||||
constructor(
|
||||
points: Vector2[],
|
||||
segments?: number,
|
||||
phiStart?: number,
|
||||
phiLength?: number
|
||||
);
|
||||
|
||||
parameters: {
|
||||
points: Vector2[];
|
||||
segments: number;
|
||||
phiStart: number;
|
||||
phiLength: number;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
export class LatheGeometry extends Geometry {
|
||||
|
||||
constructor(
|
||||
points: Vector2[],
|
||||
segments?: number,
|
||||
phiStart?: number,
|
||||
phiLength?: number
|
||||
);
|
||||
|
||||
parameters: {
|
||||
points: Vector2[];
|
||||
segments: number;
|
||||
phiStart: number;
|
||||
phiLength: number;
|
||||
};
|
||||
|
||||
}
|
||||
16
apps/module/spine-ts/threejs/src/threejs/geometries/OctahedronGeometry.d.ts
vendored
Executable file
16
apps/module/spine-ts/threejs/src/threejs/geometries/OctahedronGeometry.d.ts
vendored
Executable file
@@ -0,0 +1,16 @@
|
||||
import {
|
||||
PolyhedronGeometry,
|
||||
PolyhedronBufferGeometry,
|
||||
} from './PolyhedronGeometry';
|
||||
|
||||
export class OctahedronBufferGeometry extends PolyhedronBufferGeometry {
|
||||
|
||||
constructor( radius?: number, detail?: number );
|
||||
|
||||
}
|
||||
|
||||
export class OctahedronGeometry extends PolyhedronGeometry {
|
||||
|
||||
constructor( radius?: number, detail?: number );
|
||||
|
||||
}
|
||||
35
apps/module/spine-ts/threejs/src/threejs/geometries/ParametricGeometry.d.ts
vendored
Executable file
35
apps/module/spine-ts/threejs/src/threejs/geometries/ParametricGeometry.d.ts
vendored
Executable file
@@ -0,0 +1,35 @@
|
||||
import { Vector3 } from '../math/Vector3';
|
||||
import { Geometry } from '../core/Geometry';
|
||||
import { BufferGeometry } from '../core/BufferGeometry';
|
||||
|
||||
export class ParametricBufferGeometry extends BufferGeometry {
|
||||
|
||||
constructor(
|
||||
func: ( u: number, v: number, dest: Vector3 ) => void,
|
||||
slices: number,
|
||||
stacks: number
|
||||
);
|
||||
|
||||
parameters: {
|
||||
func: ( u: number, v: number, dest: Vector3 ) => void;
|
||||
slices: number;
|
||||
stacks: number;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
export class ParametricGeometry extends Geometry {
|
||||
|
||||
constructor(
|
||||
func: ( u: number, v: number, dest: Vector3 ) => void,
|
||||
slices: number,
|
||||
stacks: number
|
||||
);
|
||||
|
||||
parameters: {
|
||||
func: ( u: number, v: number, dest: Vector3 ) => void;
|
||||
slices: number;
|
||||
stacks: number;
|
||||
};
|
||||
|
||||
}
|
||||
38
apps/module/spine-ts/threejs/src/threejs/geometries/PlaneGeometry.d.ts
vendored
Executable file
38
apps/module/spine-ts/threejs/src/threejs/geometries/PlaneGeometry.d.ts
vendored
Executable file
@@ -0,0 +1,38 @@
|
||||
import { Geometry } from '../core/Geometry';
|
||||
import { BufferGeometry } from '../core/BufferGeometry';
|
||||
|
||||
export class PlaneBufferGeometry extends BufferGeometry {
|
||||
|
||||
constructor(
|
||||
width?: number,
|
||||
height?: number,
|
||||
widthSegments?: number,
|
||||
heightSegments?: number
|
||||
);
|
||||
|
||||
parameters: {
|
||||
width: number;
|
||||
height: number;
|
||||
widthSegments: number;
|
||||
heightSegments: number;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
export class PlaneGeometry extends Geometry {
|
||||
|
||||
constructor(
|
||||
width?: number,
|
||||
height?: number,
|
||||
widthSegments?: number,
|
||||
heightSegments?: number
|
||||
);
|
||||
|
||||
parameters: {
|
||||
width: number;
|
||||
height: number;
|
||||
widthSegments: number;
|
||||
heightSegments: number;
|
||||
};
|
||||
|
||||
}
|
||||
40
apps/module/spine-ts/threejs/src/threejs/geometries/PolyhedronGeometry.d.ts
vendored
Executable file
40
apps/module/spine-ts/threejs/src/threejs/geometries/PolyhedronGeometry.d.ts
vendored
Executable file
@@ -0,0 +1,40 @@
|
||||
import { Sphere } from '../math/Sphere';
|
||||
import { Geometry } from '../core/Geometry';
|
||||
import { BufferGeometry } from '../core/BufferGeometry';
|
||||
|
||||
export class PolyhedronBufferGeometry extends BufferGeometry {
|
||||
|
||||
constructor(
|
||||
vertices: number[],
|
||||
indices: number[],
|
||||
radius?: number,
|
||||
detail?: number
|
||||
);
|
||||
|
||||
parameters: {
|
||||
vertices: number[];
|
||||
indices: number[];
|
||||
radius: number;
|
||||
detail: number;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
export class PolyhedronGeometry extends Geometry {
|
||||
|
||||
constructor(
|
||||
vertices: number[],
|
||||
indices: number[],
|
||||
radius?: number,
|
||||
detail?: number
|
||||
);
|
||||
|
||||
parameters: {
|
||||
vertices: number[];
|
||||
indices: number[];
|
||||
radius: number;
|
||||
detail: number;
|
||||
};
|
||||
boundingSphere: Sphere;
|
||||
|
||||
}
|
||||
46
apps/module/spine-ts/threejs/src/threejs/geometries/RingGeometry.d.ts
vendored
Executable file
46
apps/module/spine-ts/threejs/src/threejs/geometries/RingGeometry.d.ts
vendored
Executable file
@@ -0,0 +1,46 @@
|
||||
import { Geometry } from '../core/Geometry';
|
||||
import { BufferGeometry } from '../core/BufferGeometry';
|
||||
|
||||
export class RingBufferGeometry extends BufferGeometry {
|
||||
|
||||
constructor(
|
||||
innerRadius?: number,
|
||||
outerRadius?: number,
|
||||
thetaSegments?: number,
|
||||
phiSegments?: number,
|
||||
thetaStart?: number,
|
||||
thetaLength?: number
|
||||
);
|
||||
|
||||
parameters: {
|
||||
innerRadius: number;
|
||||
outerRadius: number;
|
||||
thetaSegments: number;
|
||||
phiSegments: number;
|
||||
thetaStart: number;
|
||||
thetaLength: number;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
export class RingGeometry extends Geometry {
|
||||
|
||||
constructor(
|
||||
innerRadius?: number,
|
||||
outerRadius?: number,
|
||||
thetaSegments?: number,
|
||||
phiSegments?: number,
|
||||
thetaStart?: number,
|
||||
thetaLength?: number
|
||||
);
|
||||
|
||||
parameters: {
|
||||
innerRadius: number;
|
||||
outerRadius: number;
|
||||
thetaSegments: number;
|
||||
phiSegments: number;
|
||||
thetaStart: number;
|
||||
thetaLength: number;
|
||||
};
|
||||
|
||||
}
|
||||
18
apps/module/spine-ts/threejs/src/threejs/geometries/ShapeGeometry.d.ts
vendored
Executable file
18
apps/module/spine-ts/threejs/src/threejs/geometries/ShapeGeometry.d.ts
vendored
Executable file
@@ -0,0 +1,18 @@
|
||||
import { Shape } from '../extras/core/Shape';
|
||||
import { Geometry } from '../core/Geometry';
|
||||
import { BufferGeometry } from '../core/BufferGeometry';
|
||||
|
||||
export class ShapeBufferGeometry extends BufferGeometry {
|
||||
|
||||
constructor( shapes: Shape | Shape[], curveSegments?: number );
|
||||
|
||||
}
|
||||
|
||||
export class ShapeGeometry extends Geometry {
|
||||
|
||||
constructor( shapes: Shape | Shape[], curveSegments?: number );
|
||||
|
||||
addShapeList( shapes: Shape[], options: any ): ShapeGeometry;
|
||||
addShape( shape: Shape, options?: any ): void;
|
||||
|
||||
}
|
||||
64
apps/module/spine-ts/threejs/src/threejs/geometries/SphereGeometry.d.ts
vendored
Executable file
64
apps/module/spine-ts/threejs/src/threejs/geometries/SphereGeometry.d.ts
vendored
Executable file
@@ -0,0 +1,64 @@
|
||||
import { Geometry } from '../core/Geometry';
|
||||
import { BufferGeometry } from '../core/BufferGeometry';
|
||||
|
||||
export class SphereBufferGeometry extends BufferGeometry {
|
||||
|
||||
constructor(
|
||||
radius?: number,
|
||||
widthSegments?: number,
|
||||
heightSegments?: number,
|
||||
phiStart?: number,
|
||||
phiLength?: number,
|
||||
thetaStart?: number,
|
||||
thetaLength?: number
|
||||
);
|
||||
|
||||
parameters: {
|
||||
radius: number;
|
||||
widthSegments: number;
|
||||
heightSegments: number;
|
||||
phiStart: number;
|
||||
phiLength: number;
|
||||
thetaStart: number;
|
||||
thetaLength: number;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* A class for generating sphere geometries
|
||||
*/
|
||||
export class SphereGeometry extends Geometry {
|
||||
|
||||
/**
|
||||
* The geometry is created by sweeping and calculating vertexes around the Y axis (horizontal sweep) and the Z axis (vertical sweep). Thus, incomplete spheres (akin to 'sphere slices') can be created through the use of different values of phiStart, phiLength, thetaStart and thetaLength, in order to define the points in which we start (or end) calculating those vertices.
|
||||
*
|
||||
* @param radius — sphere radius. Default is 50.
|
||||
* @param widthSegments — number of horizontal segments. Minimum value is 3, and the default is 8.
|
||||
* @param heightSegments — number of vertical segments. Minimum value is 2, and the default is 6.
|
||||
* @param phiStart — specify horizontal starting angle. Default is 0.
|
||||
* @param phiLength — specify horizontal sweep angle size. Default is Math.PI * 2.
|
||||
* @param thetaStart — specify vertical starting angle. Default is 0.
|
||||
* @param thetaLength — specify vertical sweep angle size. Default is Math.PI.
|
||||
*/
|
||||
constructor(
|
||||
radius?: number,
|
||||
widthSegments?: number,
|
||||
heightSegments?: number,
|
||||
phiStart?: number,
|
||||
phiLength?: number,
|
||||
thetaStart?: number,
|
||||
thetaLength?: number
|
||||
);
|
||||
|
||||
parameters: {
|
||||
radius: number;
|
||||
widthSegments: number;
|
||||
heightSegments: number;
|
||||
phiStart: number;
|
||||
phiLength: number;
|
||||
thetaStart: number;
|
||||
thetaLength: number;
|
||||
};
|
||||
|
||||
}
|
||||
13
apps/module/spine-ts/threejs/src/threejs/geometries/TetrahedronGeometry.d.ts
vendored
Executable file
13
apps/module/spine-ts/threejs/src/threejs/geometries/TetrahedronGeometry.d.ts
vendored
Executable file
@@ -0,0 +1,13 @@
|
||||
import { PolyhedronGeometry, PolyhedronBufferGeometry } from './PolyhedronGeometry';
|
||||
|
||||
export class TetrahedronBufferGeometry extends PolyhedronBufferGeometry {
|
||||
|
||||
constructor( radius?: number, detail?: number );
|
||||
|
||||
}
|
||||
|
||||
export class TetrahedronGeometry extends PolyhedronGeometry {
|
||||
|
||||
constructor( radius?: number, detail?: number );
|
||||
|
||||
}
|
||||
50
apps/module/spine-ts/threejs/src/threejs/geometries/TextGeometry.d.ts
vendored
Executable file
50
apps/module/spine-ts/threejs/src/threejs/geometries/TextGeometry.d.ts
vendored
Executable file
@@ -0,0 +1,50 @@
|
||||
import { Font } from '../extras/core/Font';
|
||||
import { ExtrudeGeometry, ExtrudeBufferGeometry } from './ExtrudeGeometry';
|
||||
|
||||
export interface TextGeometryParameters {
|
||||
font?: Font;
|
||||
size?: number;
|
||||
height?: number;
|
||||
curveSegments?: number;
|
||||
bevelEnabled?: boolean;
|
||||
bevelThickness?: number;
|
||||
bevelSize?: number;
|
||||
bevelOffset?: number;
|
||||
bevelSegments?: number;
|
||||
}
|
||||
|
||||
export class TextBufferGeometry extends ExtrudeBufferGeometry {
|
||||
|
||||
constructor( text: string, parameters?: TextGeometryParameters );
|
||||
|
||||
parameters: {
|
||||
font: Font;
|
||||
size: number;
|
||||
height: number;
|
||||
curveSegments: number;
|
||||
bevelEnabled: boolean;
|
||||
bevelThickness: number;
|
||||
bevelSize: number;
|
||||
bevelOffset: number;
|
||||
bevelSegments: number;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
export class TextGeometry extends ExtrudeGeometry {
|
||||
|
||||
constructor( text: string, parameters?: TextGeometryParameters );
|
||||
|
||||
parameters: {
|
||||
font: Font;
|
||||
size: number;
|
||||
height: number;
|
||||
curveSegments: number;
|
||||
bevelEnabled: boolean;
|
||||
bevelThickness: number;
|
||||
bevelSize: number;
|
||||
bevelOffset: number;
|
||||
bevelSegments: number;
|
||||
};
|
||||
|
||||
}
|
||||
42
apps/module/spine-ts/threejs/src/threejs/geometries/TorusGeometry.d.ts
vendored
Executable file
42
apps/module/spine-ts/threejs/src/threejs/geometries/TorusGeometry.d.ts
vendored
Executable file
@@ -0,0 +1,42 @@
|
||||
import { Geometry } from '../core/Geometry';
|
||||
import { BufferGeometry } from '../core/BufferGeometry';
|
||||
|
||||
export class TorusBufferGeometry extends BufferGeometry {
|
||||
|
||||
constructor(
|
||||
radius?: number,
|
||||
tube?: number,
|
||||
radialSegments?: number,
|
||||
tubularSegments?: number,
|
||||
arc?: number
|
||||
);
|
||||
|
||||
parameters: {
|
||||
radius: number;
|
||||
tube: number;
|
||||
radialSegments: number;
|
||||
tubularSegments: number;
|
||||
arc: number;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
export class TorusGeometry extends Geometry {
|
||||
|
||||
constructor(
|
||||
radius?: number,
|
||||
tube?: number,
|
||||
radialSegments?: number,
|
||||
tubularSegments?: number,
|
||||
arc?: number
|
||||
);
|
||||
|
||||
parameters: {
|
||||
radius: number;
|
||||
tube: number;
|
||||
radialSegments: number;
|
||||
tubularSegments: number;
|
||||
arc: number;
|
||||
};
|
||||
|
||||
}
|
||||
48
apps/module/spine-ts/threejs/src/threejs/geometries/TorusKnotGeometry.d.ts
vendored
Executable file
48
apps/module/spine-ts/threejs/src/threejs/geometries/TorusKnotGeometry.d.ts
vendored
Executable file
@@ -0,0 +1,48 @@
|
||||
import { Geometry } from '../core/Geometry';
|
||||
import { BufferGeometry } from '../core/BufferGeometry';
|
||||
|
||||
export class TorusKnotBufferGeometry extends BufferGeometry {
|
||||
|
||||
constructor(
|
||||
radius?: number,
|
||||
tube?: number,
|
||||
tubularSegments?: number,
|
||||
radialSegments?: number,
|
||||
p?: number,
|
||||
q?: number
|
||||
);
|
||||
|
||||
parameters: {
|
||||
radius: number;
|
||||
tube: number;
|
||||
tubularSegments: number;
|
||||
radialSegments: number;
|
||||
p: number;
|
||||
q: number;
|
||||
heightScale: number;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
export class TorusKnotGeometry extends Geometry {
|
||||
|
||||
constructor(
|
||||
radius?: number,
|
||||
tube?: number,
|
||||
tubularSegments?: number,
|
||||
radialSegments?: number,
|
||||
p?: number,
|
||||
q?: number
|
||||
);
|
||||
|
||||
parameters: {
|
||||
radius: number;
|
||||
tube: number;
|
||||
tubularSegments: number;
|
||||
radialSegments: number;
|
||||
p: number;
|
||||
q: number;
|
||||
heightScale: number;
|
||||
};
|
||||
|
||||
}
|
||||
50
apps/module/spine-ts/threejs/src/threejs/geometries/TubeGeometry.d.ts
vendored
Executable file
50
apps/module/spine-ts/threejs/src/threejs/geometries/TubeGeometry.d.ts
vendored
Executable file
@@ -0,0 +1,50 @@
|
||||
import { Curve } from '../extras/core/Curve';
|
||||
import { Vector3 } from '../math/Vector3';
|
||||
import { Geometry } from '../core/Geometry';
|
||||
import { BufferGeometry } from '../core/BufferGeometry';
|
||||
|
||||
export class TubeBufferGeometry extends BufferGeometry {
|
||||
|
||||
constructor(
|
||||
path: Curve<Vector3>,
|
||||
tubularSegments?: number,
|
||||
radius?: number,
|
||||
radiusSegments?: number,
|
||||
closed?: boolean
|
||||
);
|
||||
|
||||
parameters: {
|
||||
path: Curve<Vector3>;
|
||||
tubularSegments: number;
|
||||
radius: number;
|
||||
radialSegments: number;
|
||||
closed: boolean;
|
||||
};
|
||||
tangents: Vector3[];
|
||||
normals: Vector3[];
|
||||
binormals: Vector3[];
|
||||
|
||||
}
|
||||
|
||||
export class TubeGeometry extends Geometry {
|
||||
|
||||
constructor(
|
||||
path: Curve<Vector3>,
|
||||
tubularSegments?: number,
|
||||
radius?: number,
|
||||
radiusSegments?: number,
|
||||
closed?: boolean
|
||||
);
|
||||
|
||||
parameters: {
|
||||
path: Curve<Vector3>;
|
||||
tubularSegments: number;
|
||||
radius: number;
|
||||
radialSegments: number;
|
||||
closed: boolean;
|
||||
};
|
||||
tangents: Vector3[];
|
||||
normals: Vector3[];
|
||||
binormals: Vector3[];
|
||||
|
||||
}
|
||||
8
apps/module/spine-ts/threejs/src/threejs/geometries/WireframeGeometry.d.ts
vendored
Executable file
8
apps/module/spine-ts/threejs/src/threejs/geometries/WireframeGeometry.d.ts
vendored
Executable file
@@ -0,0 +1,8 @@
|
||||
import { Geometry } from '../core/Geometry';
|
||||
import { BufferGeometry } from '../core/BufferGeometry';
|
||||
|
||||
export class WireframeGeometry extends BufferGeometry {
|
||||
|
||||
constructor( geometry: Geometry | BufferGeometry );
|
||||
|
||||
}
|
||||
27
apps/module/spine-ts/threejs/src/threejs/helpers/ArrowHelper.d.ts
vendored
Executable file
27
apps/module/spine-ts/threejs/src/threejs/helpers/ArrowHelper.d.ts
vendored
Executable file
@@ -0,0 +1,27 @@
|
||||
import { Vector3 } from '../math/Vector3';
|
||||
import { Line } from '../objects/Line';
|
||||
import { Mesh } from '../objects/Mesh';
|
||||
import { Color } from '../math/Color';
|
||||
import { Object3D } from '../core/Object3D';
|
||||
|
||||
// Extras / Helpers /////////////////////////////////////////////////////////////////////
|
||||
|
||||
export class ArrowHelper extends Object3D {
|
||||
|
||||
constructor(
|
||||
dir: Vector3,
|
||||
origin?: Vector3,
|
||||
length?: number,
|
||||
hex?: number,
|
||||
headLength?: number,
|
||||
headWidth?: number
|
||||
);
|
||||
|
||||
line: Line;
|
||||
cone: Mesh;
|
||||
|
||||
setDirection( dir: Vector3 ): void;
|
||||
setLength( length: number, headLength?: number, headWidth?: number ): void;
|
||||
setColor( color: Color | string | number ): void;
|
||||
|
||||
}
|
||||
7
apps/module/spine-ts/threejs/src/threejs/helpers/AxesHelper.d.ts
vendored
Executable file
7
apps/module/spine-ts/threejs/src/threejs/helpers/AxesHelper.d.ts
vendored
Executable file
@@ -0,0 +1,7 @@
|
||||
import { LineSegments } from '../objects/LineSegments';
|
||||
|
||||
export class AxesHelper extends LineSegments {
|
||||
|
||||
constructor( size?: number );
|
||||
|
||||
}
|
||||
11
apps/module/spine-ts/threejs/src/threejs/helpers/Box3Helper.d.ts
vendored
Executable file
11
apps/module/spine-ts/threejs/src/threejs/helpers/Box3Helper.d.ts
vendored
Executable file
@@ -0,0 +1,11 @@
|
||||
import { Box3 } from '../math/Box3';
|
||||
import { Color } from '../math/Color';
|
||||
import { LineSegments } from '../objects/LineSegments';
|
||||
|
||||
export class Box3Helper extends LineSegments {
|
||||
|
||||
constructor( box: Box3, color?: Color );
|
||||
|
||||
box: Box3;
|
||||
|
||||
}
|
||||
13
apps/module/spine-ts/threejs/src/threejs/helpers/BoxHelper.d.ts
vendored
Executable file
13
apps/module/spine-ts/threejs/src/threejs/helpers/BoxHelper.d.ts
vendored
Executable file
@@ -0,0 +1,13 @@
|
||||
import { Object3D } from '../core/Object3D';
|
||||
import { Color } from '../math/Color';
|
||||
import { LineSegments } from '../objects/LineSegments';
|
||||
|
||||
export class BoxHelper extends LineSegments {
|
||||
|
||||
constructor( object: Object3D, color?: Color );
|
||||
|
||||
update( object?: Object3D ): void;
|
||||
|
||||
setFromObject( object: Object3D ): this;
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user