Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
089ae05f
T
three.js
项目概览
Ablesons
/
three.js
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
three.js
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
089ae05f
编写于
3月 29, 2019
作者:
Y
yomboprime
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update Ammo.js to current version
上级
d8746022
变更
10
展开全部
隐藏空白更改
内联
并排
Showing
10 changed file
with
766 addition
and
77 deletion
+766
-77
examples/js/libs/ammo.js
examples/js/libs/ammo.js
+643
-20
examples/webgl_loader_mmd.html
examples/webgl_loader_mmd.html
+9
-2
examples/webgl_loader_mmd_audio.html
examples/webgl_loader_mmd_audio.html
+8
-2
examples/webgl_loader_mmd_pose.html
examples/webgl_loader_mmd_pose.html
+8
-2
examples/webgl_loader_sea3d_physics.html
examples/webgl_loader_sea3d_physics.html
+40
-34
examples/webgl_physics_cloth.html
examples/webgl_physics_cloth.html
+11
-3
examples/webgl_physics_convex_break.html
examples/webgl_physics_convex_break.html
+12
-4
examples/webgl_physics_rope.html
examples/webgl_physics_rope.html
+11
-3
examples/webgl_physics_terrain.html
examples/webgl_physics_terrain.html
+11
-3
examples/webgl_physics_volume.html
examples/webgl_physics_volume.html
+13
-4
未找到文件。
examples/js/libs/ammo.js
浏览文件 @
089ae05f
此差异已折叠。
点击以展开。
examples/webgl_loader_mmd.html
浏览文件 @
089ae05f
...
...
@@ -59,8 +59,15 @@
var
clock
=
new
THREE
.
Clock
();
init
();
animate
();
Ammo
().
then
(
function
(
AmmoLib
)
{
Ammo
=
AmmoLib
;
init
();
animate
();
}
);
function
init
()
{
...
...
examples/webgl_loader_mmd_audio.html
浏览文件 @
089ae05f
...
...
@@ -60,8 +60,14 @@
var
clock
=
new
THREE
.
Clock
();
init
();
animate
();
Ammo
().
then
(
function
(
AmmoLib
)
{
Ammo
=
AmmoLib
;
init
();
animate
();
}
);
function
init
()
{
...
...
examples/webgl_loader_mmd_pose.html
浏览文件 @
089ae05f
...
...
@@ -57,8 +57,14 @@
var
vpds
=
[];
init
();
animate
();
Ammo
().
then
(
function
(
AmmoLib
)
{
Ammo
=
AmmoLib
;
init
();
animate
();
}
);
function
init
()
{
...
...
examples/webgl_loader_sea3d_physics.html
浏览文件 @
089ae05f
...
...
@@ -73,68 +73,74 @@
var
loader
;
// Initialize Three.JS
Ammo
().
then
(
function
(
AmmoLib
)
{
init
();
// Initialize Three.JS
// Initialize Physics Engine
init
();
SEA3D
.
AMMO
.
init
();
// Initialize Physics Engine
//
// SEA3D Loader
//
Ammo
=
AmmoLib
;
SEA3D
.
AMMO
.
init
();
loader
=
new
THREE
.
SEA3D
(
{
//
// SEA3D Loader
//
container
:
scene
// Container to add models
loader
=
new
THREE
.
SEA3D
(
{
}
);
container
:
scene
// Container to add models
loader
.
onComplete
=
function
()
{
}
);
new
THREE
.
OrbitControls
(
camera
);
loader
.
onComplete
=
function
()
{
// events
new
THREE
.
OrbitControls
(
camera
);
window
.
addEventListener
(
'
contextmenu
'
,
function
(
e
)
{
// events
e
.
preventDefault
();
window
.
addEventListener
(
'
contextmenu
'
,
function
(
e
)
{
cloneAsse
t
();
e
.
preventDefaul
t
();
}
);
cloneAsset
(
);
// prevent material compilation in render loop
}
);
renderer
.
compile
(
scene
,
camera
);
// prevent material compilation in render loop
animate
(
);
renderer
.
compile
(
scene
,
camera
);
}
;
animate
()
;
loader
.
load
(
'
./models/sea3d/car.tjs.sea
'
)
;
}
;
var
cloneAsset
=
function
()
{
loader
.
load
(
'
./models/sea3d/car.tjs.sea
'
);
var
offset
=
0
;
var
cloneAsset
=
function
()
{
return
function
()
{
var
offset
=
0
;
var
domain
=
this
.
loader
.
clone
(
{
lights
:
false
,
runScripts
:
false
,
autoPlay
:
false
,
enabledPhysics
:
false
}
);
return
function
()
{
offset
-=
180
;
var
domain
=
this
.
loader
.
clone
(
{
lights
:
false
,
runScripts
:
false
,
autoPlay
:
false
,
enabledPhysics
:
false
}
)
;
domain
.
container
.
position
.
x
+=
offset
;
domain
.
applyContainerTransform
();
domain
.
enabledPhysics
(
true
);
domain
.
runScripts
();
offset
-=
180
;
this
.
scene
.
add
(
domain
.
container
);
domain
.
container
.
position
.
x
+=
offset
;
domain
.
applyContainerTransform
();
domain
.
enabledPhysics
(
true
);
domain
.
runScripts
();
};
this
.
scene
.
add
(
domain
.
container
);
};
}();
}();
}
);
//
...
...
examples/webgl_physics_cloth.html
浏览文件 @
089ae05f
...
...
@@ -58,12 +58,18 @@
var
margin
=
0.05
;
var
hinge
;
var
cloth
;
var
transformAux1
=
new
Ammo
.
btTransform
()
;
var
transformAux1
;
var
armMovement
=
0
;
init
();
animate
();
Ammo
().
then
(
function
(
AmmoLib
)
{
Ammo
=
AmmoLib
;
init
();
animate
();
}
);
function
init
()
{
...
...
@@ -148,6 +154,8 @@
physicsWorld
.
setGravity
(
new
Ammo
.
btVector3
(
0
,
gravityConstant
,
0
)
);
physicsWorld
.
getWorldInfo
().
set_m_gravity
(
new
Ammo
.
btVector3
(
0
,
gravityConstant
,
0
)
);
transformAux1
=
new
Ammo
.
btTransform
();
}
function
createObjects
()
{
...
...
examples/webgl_physics_convex_break.html
浏览文件 @
089ae05f
...
...
@@ -80,8 +80,8 @@
var
pos
=
new
THREE
.
Vector3
();
var
quat
=
new
THREE
.
Quaternion
();
var
transformAux1
=
new
Ammo
.
btTransform
()
;
var
tempBtVec3_1
=
new
Ammo
.
btVector3
(
0
,
0
,
0
)
;
var
transformAux1
;
var
tempBtVec3_1
;
var
time
=
0
;
...
...
@@ -96,8 +96,14 @@
// - Main code -
init
();
animate
();
Ammo
().
then
(
function
(
AmmoLib
)
{
Ammo
=
AmmoLib
;
init
();
animate
();
}
);
// - Functions -
...
...
@@ -183,6 +189,8 @@
physicsWorld
=
new
Ammo
.
btDiscreteDynamicsWorld
(
dispatcher
,
broadphase
,
solver
,
collisionConfiguration
);
physicsWorld
.
setGravity
(
new
Ammo
.
btVector3
(
0
,
-
gravityConstant
,
0
)
);
transformAux1
=
new
Ammo
.
btTransform
();
tempBtVec3_1
=
new
Ammo
.
btVector3
(
0
,
0
,
0
);
}
function
createObject
(
mass
,
halfExtents
,
pos
,
quat
,
material
)
{
...
...
examples/webgl_physics_rope.html
浏览文件 @
089ae05f
...
...
@@ -64,12 +64,18 @@
var
margin
=
0.05
;
var
hinge
;
var
rope
;
var
transformAux1
=
new
Ammo
.
btTransform
()
;
var
transformAux1
;
var
armMovement
=
0
;
init
();
animate
();
Ammo
().
then
(
function
(
AmmoLib
)
{
Ammo
=
AmmoLib
;
init
();
animate
();
}
);
function
init
()
{
...
...
@@ -153,6 +159,8 @@
physicsWorld
.
setGravity
(
new
Ammo
.
btVector3
(
0
,
gravityConstant
,
0
)
);
physicsWorld
.
getWorldInfo
().
set_m_gravity
(
new
Ammo
.
btVector3
(
0
,
gravityConstant
,
0
)
);
transformAux1
=
new
Ammo
.
btTransform
();
}
function
createObjects
()
{
...
...
examples/webgl_physics_terrain.html
浏览文件 @
089ae05f
...
...
@@ -68,7 +68,7 @@
var
solver
;
var
physicsWorld
;
var
dynamicObjects
=
[];
var
transformAux1
=
new
Ammo
.
btTransform
()
;
var
transformAux1
;
var
heightData
=
null
;
var
ammoHeightData
=
null
;
...
...
@@ -78,8 +78,14 @@
var
timeNextSpawn
=
time
+
objectTimePeriod
;
var
maxNumObjects
=
30
;
init
();
animate
();
Ammo
().
then
(
function
(
AmmoLib
)
{
Ammo
=
AmmoLib
;
init
();
animate
();
}
);
function
init
()
{
...
...
@@ -210,6 +216,8 @@
var
groundBody
=
new
Ammo
.
btRigidBody
(
new
Ammo
.
btRigidBodyConstructionInfo
(
groundMass
,
groundMotionState
,
groundShape
,
groundLocalInertia
)
);
physicsWorld
.
addRigidBody
(
groundBody
);
transformAux1
=
new
Ammo
.
btTransform
();
}
function
generateHeight
(
width
,
depth
,
minHeight
,
maxHeight
)
{
...
...
examples/webgl_physics_volume.html
浏览文件 @
089ae05f
...
...
@@ -62,11 +62,17 @@
var
rigidBodies
=
[];
var
softBodies
=
[];
var
margin
=
0.05
;
var
transformAux1
=
new
Ammo
.
btTransform
()
;
var
softBodyHelpers
=
new
Ammo
.
btSoftBodyHelpers
()
;
var
transformAux1
;
var
softBodyHelpers
;
init
();
animate
();
Ammo
().
then
(
function
(
AmmoLib
)
{
Ammo
=
AmmoLib
;
init
();
animate
();
}
);
function
init
()
{
...
...
@@ -149,6 +155,9 @@
physicsWorld
.
setGravity
(
new
Ammo
.
btVector3
(
0
,
gravityConstant
,
0
)
);
physicsWorld
.
getWorldInfo
().
set_m_gravity
(
new
Ammo
.
btVector3
(
0
,
gravityConstant
,
0
)
);
transformAux1
=
new
Ammo
.
btTransform
();
softBodyHelpers
=
new
Ammo
.
btSoftBodyHelpers
();
}
function
createObjects
()
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录