mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-20 09:16:01 +08:00
[threejs] Closes #1412, added dispose() method to SkeletonMesh and required underlying code.
This commit is contained in:
parent
4a357f23f2
commit
2b5e521c34
2
spine-ts/build/spine-all.d.ts
vendored
2
spine-ts/build/spine-all.d.ts
vendored
@ -1807,6 +1807,7 @@ declare module spine.threejs {
|
||||
private indices;
|
||||
private indicesLength;
|
||||
constructor(maxVertices?: number);
|
||||
dispose(): void;
|
||||
clear(): void;
|
||||
begin(): void;
|
||||
canBatch(verticesLength: number, indicesLength: number): boolean;
|
||||
@ -1836,6 +1837,7 @@ declare module spine.threejs {
|
||||
private tempColor;
|
||||
constructor(skeletonData: SkeletonData);
|
||||
update(deltaTime: number): void;
|
||||
dispose(): void;
|
||||
private clearBatches();
|
||||
private nextBatch();
|
||||
private updateGeometry();
|
||||
|
||||
@ -11048,6 +11048,10 @@ var spine;
|
||||
_this.material = new threejs.SkeletonMeshMaterial();
|
||||
return _this;
|
||||
}
|
||||
MeshBatcher.prototype.dispose = function () {
|
||||
this.geometry.dispose();
|
||||
this.material.dispose();
|
||||
};
|
||||
MeshBatcher.prototype.clear = function () {
|
||||
var geo = this.geometry;
|
||||
geo.drawRange.start = 0;
|
||||
@ -11159,6 +11163,11 @@ var spine;
|
||||
skeleton.updateWorldTransform();
|
||||
this.updateGeometry();
|
||||
};
|
||||
SkeletonMesh.prototype.dispose = function () {
|
||||
for (var i = 0; i < this.batches.length; i++) {
|
||||
this.batches[i].dispose();
|
||||
}
|
||||
};
|
||||
SkeletonMesh.prototype.clearBatches = function () {
|
||||
for (var i = 0; i < this.batches.length; i++) {
|
||||
this.batches[i].clear();
|
||||
|
||||
File diff suppressed because one or more lines are too long
2
spine-ts/build/spine-threejs.d.ts
vendored
2
spine-ts/build/spine-threejs.d.ts
vendored
@ -1341,6 +1341,7 @@ declare module spine.threejs {
|
||||
private indices;
|
||||
private indicesLength;
|
||||
constructor(maxVertices?: number);
|
||||
dispose(): void;
|
||||
clear(): void;
|
||||
begin(): void;
|
||||
canBatch(verticesLength: number, indicesLength: number): boolean;
|
||||
@ -1370,6 +1371,7 @@ declare module spine.threejs {
|
||||
private tempColor;
|
||||
constructor(skeletonData: SkeletonData);
|
||||
update(deltaTime: number): void;
|
||||
dispose(): void;
|
||||
private clearBatches();
|
||||
private nextBatch();
|
||||
private updateGeometry();
|
||||
|
||||
@ -8166,6 +8166,10 @@ var spine;
|
||||
_this.material = new threejs.SkeletonMeshMaterial();
|
||||
return _this;
|
||||
}
|
||||
MeshBatcher.prototype.dispose = function () {
|
||||
this.geometry.dispose();
|
||||
this.material.dispose();
|
||||
};
|
||||
MeshBatcher.prototype.clear = function () {
|
||||
var geo = this.geometry;
|
||||
geo.drawRange.start = 0;
|
||||
@ -8277,6 +8281,11 @@ var spine;
|
||||
skeleton.updateWorldTransform();
|
||||
this.updateGeometry();
|
||||
};
|
||||
SkeletonMesh.prototype.dispose = function () {
|
||||
for (var i = 0; i < this.batches.length; i++) {
|
||||
this.batches[i].dispose();
|
||||
}
|
||||
};
|
||||
SkeletonMesh.prototype.clearBatches = function () {
|
||||
for (var i = 0; i < this.batches.length; i++) {
|
||||
this.batches[i].clear();
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -2,7 +2,7 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>spine-threejs</title>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r79/three.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/106/three.min.js"></script>
|
||||
<script src="../../build/spine-threejs.js"></script>
|
||||
</head>
|
||||
<style>
|
||||
|
||||
@ -55,6 +55,11 @@ module spine.threejs {
|
||||
this.material = new SkeletonMeshMaterial();
|
||||
}
|
||||
|
||||
dispose () {
|
||||
this.geometry.dispose();
|
||||
this.material.dispose();
|
||||
}
|
||||
|
||||
clear () {
|
||||
let geo = (<THREE.BufferGeometry>this.geometry);
|
||||
geo.drawRange.start = 0;
|
||||
|
||||
@ -102,6 +102,12 @@ module spine.threejs {
|
||||
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();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user