From 96709ccd1070a81de70557d48a70d43275a5d0c7 Mon Sep 17 00:00:00 2001 From: liteng <930372551@qq.com> Date: Fri, 4 Jan 2019 19:56:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=84=E7=A7=8D=E7=B1=BB=E5=9E=8B=E5=87=A0?= =?UTF-8?q?=E4=BD=95=E4=BD=93=E6=B7=BB=E5=8A=A0=E7=89=A9=E7=90=86=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ShadowEditor.Web/src/object/geometry/Circle.js | 11 +++++++++++ ShadowEditor.Web/src/object/geometry/Cylinder.js | 11 +++++++++++ ShadowEditor.Web/src/object/geometry/Icosahedron.js | 11 +++++++++++ ShadowEditor.Web/src/object/geometry/Lathe.js | 11 +++++++++++ ShadowEditor.Web/src/object/geometry/Plane.js | 11 +++++++++++ ShadowEditor.Web/src/object/geometry/Sphere.js | 11 +++++++++++ ShadowEditor.Web/src/object/geometry/Teapot.js | 11 +++++++++++ ShadowEditor.Web/src/object/geometry/Torus.js | 11 +++++++++++ ShadowEditor.Web/src/object/geometry/TorusKnot.js | 11 +++++++++++ 9 files changed, 99 insertions(+) diff --git a/ShadowEditor.Web/src/object/geometry/Circle.js b/ShadowEditor.Web/src/object/geometry/Circle.js index 4951855a..11181a11 100644 --- a/ShadowEditor.Web/src/object/geometry/Circle.js +++ b/ShadowEditor.Web/src/object/geometry/Circle.js @@ -9,6 +9,17 @@ function Circle(geometry = new THREE.CircleBufferGeometry(1, 32), material = new this.name = '圆'; this.castShadow = true; this.receiveShadow = true; + + this.userData.physics = this.userData.physics || { + enabled: false, + shape: 'btBoxShape', + mass: 1, + inertia: { + x: 0, + y: 0, + z: 0, + } + }; } Circle.prototype = Object.create(THREE.Mesh.prototype); diff --git a/ShadowEditor.Web/src/object/geometry/Cylinder.js b/ShadowEditor.Web/src/object/geometry/Cylinder.js index 9f666840..33ae4c1c 100644 --- a/ShadowEditor.Web/src/object/geometry/Cylinder.js +++ b/ShadowEditor.Web/src/object/geometry/Cylinder.js @@ -9,6 +9,17 @@ function Cylinder(geometry = new THREE.CylinderBufferGeometry(1, 1, 2, 32, 1, fa this.name = '圆柱体'; this.castShadow = true; this.receiveShadow = true; + + this.userData.physics = this.userData.physics || { + enabled: false, + shape: 'btBoxShape', + mass: 1, + inertia: { + x: 0, + y: 0, + z: 0, + } + }; } Cylinder.prototype = Object.create(THREE.Mesh.prototype); diff --git a/ShadowEditor.Web/src/object/geometry/Icosahedron.js b/ShadowEditor.Web/src/object/geometry/Icosahedron.js index 1fe7e7b6..88b6395b 100644 --- a/ShadowEditor.Web/src/object/geometry/Icosahedron.js +++ b/ShadowEditor.Web/src/object/geometry/Icosahedron.js @@ -9,6 +9,17 @@ function Icosahedron(geometry = new THREE.IcosahedronBufferGeometry(1, 2), mater this.name = '二十面体'; this.castShadow = true; this.receiveShadow = true; + + this.userData.physics = this.userData.physics || { + enabled: false, + shape: 'btBoxShape', + mass: 1, + inertia: { + x: 0, + y: 0, + z: 0, + } + }; } Icosahedron.prototype = Object.create(THREE.Mesh.prototype); diff --git a/ShadowEditor.Web/src/object/geometry/Lathe.js b/ShadowEditor.Web/src/object/geometry/Lathe.js index b060f07d..ef0fd35d 100644 --- a/ShadowEditor.Web/src/object/geometry/Lathe.js +++ b/ShadowEditor.Web/src/object/geometry/Lathe.js @@ -23,6 +23,17 @@ function Lathe(geometry = new THREE.LatheBufferGeometry(points, 20, 0, 2 * Math. this.name = '酒杯'; this.castShadow = true; this.receiveShadow = true; + + this.userData.physics = this.userData.physics || { + enabled: false, + shape: 'btBoxShape', + mass: 1, + inertia: { + x: 0, + y: 0, + z: 0, + } + }; } Lathe.prototype = Object.create(THREE.Mesh.prototype); diff --git a/ShadowEditor.Web/src/object/geometry/Plane.js b/ShadowEditor.Web/src/object/geometry/Plane.js index 9f676383..525d7c24 100644 --- a/ShadowEditor.Web/src/object/geometry/Plane.js +++ b/ShadowEditor.Web/src/object/geometry/Plane.js @@ -10,6 +10,17 @@ function Plane(geometry = new THREE.PlaneBufferGeometry(50, 50), material = new this.rotation.x = -Math.PI / 2; this.castShadow = true; this.receiveShadow = true; + + this.userData.physics = this.userData.physics || { + enabled: false, + shape: 'btStaticPlaneShape', + mass: 0, + inertia: { + x: 0, + y: 0, + z: 0, + } + }; } Plane.prototype = Object.create(THREE.Mesh.prototype); diff --git a/ShadowEditor.Web/src/object/geometry/Sphere.js b/ShadowEditor.Web/src/object/geometry/Sphere.js index 21c51721..04ea3f12 100644 --- a/ShadowEditor.Web/src/object/geometry/Sphere.js +++ b/ShadowEditor.Web/src/object/geometry/Sphere.js @@ -9,6 +9,17 @@ function Sphere(geometry = new THREE.SphereBufferGeometry(1, 32, 16, 0, Math.PI this.name = '球体'; this.castShadow = true; this.receiveShadow = true; + + this.userData.physics = this.userData.physics || { + enabled: false, + shape: 'btSphereShape', + mass: 0, + inertia: { + x: 0, + y: 0, + z: 0, + } + }; } Sphere.prototype = Object.create(THREE.Mesh.prototype); diff --git a/ShadowEditor.Web/src/object/geometry/Teapot.js b/ShadowEditor.Web/src/object/geometry/Teapot.js index eaf17f06..42916c18 100644 --- a/ShadowEditor.Web/src/object/geometry/Teapot.js +++ b/ShadowEditor.Web/src/object/geometry/Teapot.js @@ -23,6 +23,17 @@ function Teapot(geometry = new THREE.TeapotBufferGeometry(3, 10, true, true, tru this.name = '茶壶'; this.castShadow = true; this.receiveShadow = true; + + this.userData.physics = this.userData.physics || { + enabled: false, + shape: 'btBoxShape', + mass: 1, + inertia: { + x: 0, + y: 0, + z: 0, + } + }; } Teapot.prototype = Object.create(THREE.Mesh.prototype); diff --git a/ShadowEditor.Web/src/object/geometry/Torus.js b/ShadowEditor.Web/src/object/geometry/Torus.js index 34a7cee4..e464431e 100644 --- a/ShadowEditor.Web/src/object/geometry/Torus.js +++ b/ShadowEditor.Web/src/object/geometry/Torus.js @@ -9,6 +9,17 @@ function Torus(geometry = new THREE.TorusBufferGeometry(2, 1, 32, 32, Math.PI * this.name = '轮胎'; this.castShadow = true; this.receiveShadow = true; + + this.userData.physics = this.userData.physics || { + enabled: false, + shape: 'btBoxShape', + mass: 1, + inertia: { + x: 0, + y: 0, + z: 0, + } + }; } Torus.prototype = Object.create(THREE.Mesh.prototype); diff --git a/ShadowEditor.Web/src/object/geometry/TorusKnot.js b/ShadowEditor.Web/src/object/geometry/TorusKnot.js index e4490ea9..a7f74eef 100644 --- a/ShadowEditor.Web/src/object/geometry/TorusKnot.js +++ b/ShadowEditor.Web/src/object/geometry/TorusKnot.js @@ -9,6 +9,17 @@ function TorusKnot(geometry = new THREE.TorusKnotBufferGeometry(2, 0.8, 64, 12, this.name = '纽结'; this.castShadow = true; this.receiveShadow = true; + + this.userData.physics = this.userData.physics || { + enabled: false, + shape: 'btBoxShape', + mass: 1, + inertia: { + x: 0, + y: 0, + z: 0, + } + }; } TorusKnot.prototype = Object.create(THREE.Mesh.prototype);