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);