Skip to content

Commit 7871aaa

Browse files
committed
up fracture
1 parent 6e20d72 commit 7871aaa

14 files changed

Lines changed: 268 additions & 85 deletions

File tree

assets/models/kart.glb

248 Bytes
Binary file not shown.

build/Phy.cjs

Lines changed: 69 additions & 25 deletions
Large diffs are not rendered by default.

build/Phy.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/Phy.module.js

Lines changed: 69 additions & 25 deletions
Large diffs are not rendered by default.

build/Phy.module.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demos/dev/break.js

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,16 +90,32 @@ test_0 = ( d ) => {
9090
})
9191

9292
phy.add({
93-
name:'vase',
93+
name:'vase1',
9494
type:'mesh',
9595
mesh:model['vase_'+math.randInt(1,8)],
9696
mass:100,
9797
//density:5,
98-
pos:[0,0.01,0],
98+
pos:[-3,0.01,0],
9999
breakable:true,
100100
// breakOption: [ maxImpulse, maxRadial, maxRandom, levelOfSubdivision ]
101101
//breakOption:[ 60, 6, 2, 2, false ],
102-
breakOption:[ 60, 3, 6, 2, false ],
102+
breakOption:[ 100, 3, 6, 3, false ],
103+
//material:'B',
104+
//autoUV:true
105+
//massInfo:true
106+
});
107+
108+
phy.add({
109+
name:'vase2',
110+
type:'mesh',
111+
mesh:model['vase_'+math.randInt(1,8)],
112+
mass:100,
113+
//density:5,
114+
pos:[3,0.01,0],
115+
breakable:true,
116+
// breakOption: [ maxImpulse, maxRadial, maxRandom, levelOfSubdivision ]
117+
//breakOption:[ 60, 6, 2, 2, false ],
118+
breakOption:[ 100, 3, 6, 3, false ],
103119
//material:'B',
104120
//autoUV:true
105121
//massInfo:true
@@ -119,7 +135,7 @@ test_0 = ( d ) => {
119135
autoUV:true
120136
});*/
121137

122-
phy.mouseMode('shoot', { size:0.2, mass:100, velocity:60 })
138+
phy.mouseMode('shoot', { size:0.1, mass:100, velocity:100 })
123139

124140

125141
}

demos/kart.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ function demo() {
2828

2929
phy.add({ type:'box', size:[1000,1,1000], pos:[0,-0.5,0], density:0, visible:false });
3030

31+
phy.add({ type:'box', size:[10,100,10], pos:[-10,-0.5,0], density:0, visible:true });
32+
3133
phy.load(['./assets/models/kart.glb'], onComplete )
3234

3335
}
@@ -36,7 +38,7 @@ onComplete = (delta) => {
3638

3739
const model = phy.getMesh('kart');
3840

39-
v = phy.vehicle({type:'kart', pos:[0,py,0], model:model, debug:false })
41+
v = phy.vehicle({type:'kart', pos:[0,py,0], model:model, debug:true })
4042
phy.follow('baser', { direct:true, simple:true, decal:[0.3, 0.5, -0.3] })
4143
phy.setPostUpdate ( update )
4244
addGui()

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "phy-engine",
3-
"version": "0.6.2",
3+
"version": "0.6.3",
44
"description": "JavaScript 3D Physics for three.js",
55
"type": "module",
66
"main": "./build/Phy.cjs",
@@ -33,6 +33,7 @@
3333
"main": "rollup -c rollup/rollup.config.main.js",
3434
"smoke": "rollup -c rollup/extra.smoke.js",
3535
"fracture": "rollup -c rollup/extra.fracture.js",
36+
"wiggle": "rollup -c rollup/extra.wiggle.js",
3637
"codeflask": "rollup -c rollup/extra.codeflask.js",
3738
"phy": "rollup -c rollup/rollup.config.phy.js",
3839
"oimo": "rollup -c rollup/rollup.config.oimo.js",

rollup/extra.wiggle.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import terser from '@rollup/plugin-terser';
2+
3+
export default [
4+
{
5+
input: 'private/Wiggle/src/Wiggle.js',
6+
external: ['three'],
7+
plugins: [
8+
terser()
9+
],
10+
output: [
11+
{
12+
format: 'esm',
13+
file: 'src/libs/wiggle.module.js'
14+
}
15+
]
16+
}
17+
];

src/libs/fracture.module.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)