three-stdlib 2.23.6 → 2.23.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const THREE = require("three");
4
+ class CapsuleGeometry extends THREE.LatheGeometry {
5
+ constructor(radius = 1, length = 1, capSegments = 4, radialSegments = 8) {
6
+ const path = new THREE.Path();
7
+ path.absarc(0, -length / 2, radius, Math.PI * 1.5, 0);
8
+ path.absarc(0, length / 2, radius, 0, Math.PI * 0.5);
9
+ super(path.getPoints(capSegments), radialSegments);
10
+ this.type = "CapsuleGeometry";
11
+ this.parameters = {
12
+ radius,
13
+ height: length,
14
+ capSegments,
15
+ radialSegments
16
+ };
17
+ }
18
+ static fromJSON(data) {
19
+ return new CapsuleGeometry(data.radius, data.length, data.capSegments, data.radialSegments);
20
+ }
21
+ }
22
+ exports.CapsuleGeometry = CapsuleGeometry;
@@ -0,0 +1,22 @@
1
+ import { LatheGeometry, Path } from "three";
2
+ class CapsuleGeometry extends LatheGeometry {
3
+ constructor(radius = 1, length = 1, capSegments = 4, radialSegments = 8) {
4
+ const path = new Path();
5
+ path.absarc(0, -length / 2, radius, Math.PI * 1.5, 0);
6
+ path.absarc(0, length / 2, radius, 0, Math.PI * 0.5);
7
+ super(path.getPoints(capSegments), radialSegments);
8
+ this.type = "CapsuleGeometry";
9
+ this.parameters = {
10
+ radius,
11
+ height: length,
12
+ capSegments,
13
+ radialSegments
14
+ };
15
+ }
16
+ static fromJSON(data) {
17
+ return new CapsuleGeometry(data.radius, data.length, data.capSegments, data.radialSegments);
18
+ }
19
+ }
20
+ export {
21
+ CapsuleGeometry
22
+ };
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const THREE = require("three");
4
+ const CapsuleGeometry = require("../_polyfill/CapsuleGeometry.cjs");
4
5
  class MMDPhysics {
5
6
  /**
6
7
  * @param {THREE.SkinnedMesh} mesh
@@ -815,7 +816,7 @@ class MMDPhysicsHelper extends THREE.Object3D {
815
816
  case 1:
816
817
  return new THREE.BoxGeometry(param2.width * 2, param2.height * 2, param2.depth * 2, 8, 8, 8);
817
818
  case 2:
818
- return new THREE.CapsuleGeometry(param2.width, param2.height, 8, 16);
819
+ return new CapsuleGeometry.CapsuleGeometry(param2.width, param2.height, 8, 16);
819
820
  default:
820
821
  return null;
821
822
  }
@@ -1,4 +1,5 @@
1
- import { Vector3, Matrix4, Quaternion, Euler, Bone, Object3D, MeshBasicMaterial, Color, CapsuleGeometry, BoxGeometry, SphereGeometry, Mesh } from "three";
1
+ import { Vector3, Matrix4, Quaternion, Euler, Bone, Object3D, MeshBasicMaterial, Color, BoxGeometry, SphereGeometry, Mesh } from "three";
2
+ import { CapsuleGeometry } from "../_polyfill/CapsuleGeometry.js";
2
3
  class MMDPhysics {
3
4
  /**
4
5
  * @param {THREE.SkinnedMesh} mesh
@@ -560,7 +560,7 @@ class GLTFWriter {
560
560
  context.putImageData(composite, 0, 0);
561
561
  const reference = metalnessMap || roughnessMap;
562
562
  const texture = reference.clone();
563
- texture.source = new THREE.Source(canvas);
563
+ texture.source = new THREE.Texture(canvas).source;
564
564
  if ("colorSpace" in texture)
565
565
  texture.colorSpace = "";
566
566
  else
@@ -1,4 +1,4 @@
1
- import { PlaneGeometry, ShaderMaterial, Uniform, Mesh, PerspectiveCamera, Scene, WebGLRenderer, Texture, NearestFilter, NearestMipmapNearestFilter, NearestMipmapLinearFilter, LinearFilter, LinearMipmapNearestFilter, LinearMipmapLinearFilter, ClampToEdgeWrapping, RepeatWrapping, MirroredRepeatWrapping, Color, MathUtils, Vector3, CompressedTexture, Source, RGBAFormat, DoubleSide, REVISION, BufferAttribute, PropertyBinding, InterpolateDiscrete, Matrix4, InterpolateLinear } from "three";
1
+ import { PlaneGeometry, ShaderMaterial, Uniform, Mesh, PerspectiveCamera, Scene, WebGLRenderer, Texture, NearestFilter, NearestMipmapNearestFilter, NearestMipmapLinearFilter, LinearFilter, LinearMipmapNearestFilter, LinearMipmapLinearFilter, ClampToEdgeWrapping, RepeatWrapping, MirroredRepeatWrapping, Color, MathUtils, Vector3, CompressedTexture, RGBAFormat, DoubleSide, REVISION, BufferAttribute, PropertyBinding, InterpolateDiscrete, Matrix4, InterpolateLinear } from "three";
2
2
  let _renderer;
3
3
  let fullscreenQuadGeometry;
4
4
  let fullscreenQuadMaterial;
@@ -558,7 +558,7 @@ class GLTFWriter {
558
558
  context.putImageData(composite, 0, 0);
559
559
  const reference = metalnessMap || roughnessMap;
560
560
  const texture = reference.clone();
561
- texture.source = new Source(canvas);
561
+ texture.source = new Texture(canvas).source;
562
562
  if ("colorSpace" in texture)
563
563
  texture.colorSpace = "";
564
564
  else
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "three-stdlib",
3
- "version": "2.23.6",
3
+ "version": "2.23.7",
4
4
  "description": "stand-alone library of threejs examples",
5
5
  "keywords": [
6
6
  "three",