Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
2eac7fb4
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,发现更多精彩内容 >>
提交
2eac7fb4
编写于
12月 14, 2016
作者:
M
Mr.doob
提交者:
GitHub
12月 14, 2016
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #10352 from sunag/sea3d_1.8.1
Sea3d 1.8.1 - tjs2
上级
d206f16e
8dde9d16
变更
20
隐藏空白更改
内联
并排
Showing
20 changed file
with
155 addition
and
57 deletion
+155
-57
examples/js/loaders/sea3d/SEA3D.js
examples/js/loaders/sea3d/SEA3D.js
+3
-1
examples/js/loaders/sea3d/SEA3DLegacy.js
examples/js/loaders/sea3d/SEA3DLegacy.js
+26
-26
examples/js/loaders/sea3d/SEA3DLoader.js
examples/js/loaders/sea3d/SEA3DLoader.js
+45
-2
examples/js/loaders/sea3d/physics/SEA3DAmmo.js
examples/js/loaders/sea3d/physics/SEA3DAmmo.js
+20
-16
examples/js/loaders/sea3d/physics/SEA3DAmmoLoader.js
examples/js/loaders/sea3d/physics/SEA3DAmmoLoader.js
+36
-3
examples/js/loaders/sea3d/physics/SEA3DRigidBody.js
examples/js/loaders/sea3d/physics/SEA3DRigidBody.js
+19
-3
examples/models/sea3d/car.sea
examples/models/sea3d/car.sea
+0
-0
examples/models/sea3d/car.tjs.sea
examples/models/sea3d/car.tjs.sea
+0
-0
examples/models/sea3d/keyframe.tjs.sea
examples/models/sea3d/keyframe.tjs.sea
+0
-0
examples/models/sea3d/mascot.tjs.sea
examples/models/sea3d/mascot.tjs.sea
+0
-0
examples/models/sea3d/morph.tjs.sea
examples/models/sea3d/morph.tjs.sea
+0
-0
examples/models/sea3d/robot.o3dgc.tjs.sea
examples/models/sea3d/robot.o3dgc.tjs.sea
+0
-0
examples/models/sea3d/robot.tjs.sea
examples/models/sea3d/robot.tjs.sea
+0
-0
examples/models/sea3d/skin.tjs.sea
examples/models/sea3d/skin.tjs.sea
+0
-0
examples/models/sea3d/sound.sea
examples/models/sea3d/sound.sea
+0
-0
examples/models/sea3d/sound.tjs.sea
examples/models/sea3d/sound.tjs.sea
+0
-0
examples/webgl_loader_sea3d_hierarchy.html
examples/webgl_loader_sea3d_hierarchy.html
+1
-1
examples/webgl_loader_sea3d_physics.html
examples/webgl_loader_sea3d_physics.html
+3
-3
examples/webgl_loader_sea3d_skinning.html
examples/webgl_loader_sea3d_skinning.html
+1
-1
examples/webgl_loader_sea3d_sound.html
examples/webgl_loader_sea3d_sound.html
+1
-1
未找到文件。
examples/js/loaders/sea3d/SEA3D.js
浏览文件 @
2eac7fb4
...
...
@@ -2130,9 +2130,11 @@ SEA3D.Material = function ( name, data, sea3d ) {
if
(
this
.
attrib
&
128
)
this
.
animations
=
data
.
readAnimationList
(
sea3d
);
this
.
depth
Mask
=
(
this
.
attrib
&
256
)
==
0
;
this
.
depth
Write
=
(
this
.
attrib
&
256
)
==
0
;
this
.
depthTest
=
(
this
.
attrib
&
512
)
==
0
;
this
.
premultipliedAlpha
=
(
this
.
attrib
&
1024
)
!=
0
;
var
count
=
data
.
readUByte
();
for
(
var
i
=
0
;
i
<
count
;
++
i
)
{
...
...
examples/js/loaders/sea3d/SEA3DLegacy.js
浏览文件 @
2eac7fb4
...
...
@@ -41,11 +41,11 @@ THREE.SEA3D.prototype.isLegacy = function ( sea ) {
};
THREE
.
SEA3D
.
prototype
.
flip
X
Vec3
=
function
(
v
)
{
THREE
.
SEA3D
.
prototype
.
flipVec3
=
function
(
v
)
{
if
(
!
v
)
return
;
var
i
=
0
;
// z
var
i
=
2
;
while
(
i
<
v
.
length
)
{
...
...
@@ -133,7 +133,7 @@ THREE.SEA3D.prototype.compressJoints = function ( sea ) {
};
THREE
.
SEA3D
.
prototype
.
flip
YZIndex
=
function
(
v
)
{
THREE
.
SEA3D
.
prototype
.
flip
Indexes
=
function
(
v
)
{
var
i
=
1
;
// y >-< z
...
...
@@ -151,17 +151,17 @@ THREE.SEA3D.prototype.flipYZIndex = function ( v ) {
};
THREE
.
SEA3D
.
prototype
.
flip
MatrixBone
=
function
()
{
THREE
.
SEA3D
.
prototype
.
flip
BoneMatrix
=
function
()
{
var
zero
=
new
THREE
.
Vector3
();
return
function
(
mtx
)
{
var
pos
=
THREE
.
SEA3D
.
VECBUF
.
setFromMatrixPosition
(
mtx
);
pos
.
x
=
-
pos
.
x
;
pos
.
z
=
-
pos
.
z
;
mtx
.
setPosition
(
zero
);
mtx
.
multiplyMatrices
(
THREE
.
SEA3D
.
MTXBUF
.
makeRotation
X
(
THREE
.
Math
.
degToRad
(
180
)
),
mtx
);
mtx
.
multiplyMatrices
(
THREE
.
SEA3D
.
MTXBUF
.
makeRotation
Z
(
THREE
.
Math
.
degToRad
(
180
)
),
mtx
);
mtx
.
setPosition
(
pos
);
return
mtx
;
...
...
@@ -170,7 +170,7 @@ THREE.SEA3D.prototype.flipMatrixBone = function () {
}();
THREE
.
SEA3D
.
prototype
.
flip
MatrixScale
=
function
()
{
THREE
.
SEA3D
.
prototype
.
flip
ScaleMatrix
=
function
()
{
var
pos
=
new
THREE
.
Vector3
();
var
qua
=
new
THREE
.
Quaternion
();
...
...
@@ -182,13 +182,13 @@ THREE.SEA3D.prototype.flipMatrixScale = function () {
local
.
decompose
(
pos
,
qua
,
slc
);
slc
.
x
=
-
slc
.
x
;
slc
.
z
=
-
slc
.
z
;
local
.
compose
(
pos
,
qua
,
slc
);
if
(
rotate
)
{
local
.
multiplyMatrices
(
local
,
THREE
.
SEA3D
.
MTXBUF
.
makeRotation
X
(
THREE
.
Math
.
degToRad
(
180
)
)
);
local
.
multiplyMatrices
(
local
,
THREE
.
SEA3D
.
MTXBUF
.
makeRotation
Z
(
THREE
.
Math
.
degToRad
(
180
)
)
);
}
...
...
@@ -196,7 +196,7 @@ THREE.SEA3D.prototype.flipMatrixScale = function () {
parent
=
parent
.
clone
();
this
.
flip
MatrixScale
(
parent
,
parentRotate
);
this
.
flip
ScaleMatrix
(
parent
,
parentRotate
);
local
.
multiplyMatrices
(
parent
.
getInverse
(
parent
),
local
);
...
...
@@ -265,17 +265,17 @@ THREE.SEA3D.prototype.flipDefaultAnimation = function () {
if
(
relative
)
{
buf1
.
identity
();
parent
=
this
.
flip
MatrixScale
(
buf2
.
copy
(
obj3d
.
matrixWorld
)
);
parent
=
this
.
flip
ScaleMatrix
(
buf2
.
copy
(
obj3d
.
matrixWorld
)
);
}
else
{
if
(
obj3d
.
parent
)
{
parent
=
this
.
flip
MatrixScale
(
buf2
.
copy
(
obj3d
.
parent
.
matrixWorld
)
);
parent
=
this
.
flip
ScaleMatrix
(
buf2
.
copy
(
obj3d
.
parent
.
matrixWorld
)
);
}
this
.
flip
MatrixScale
(
buf1
.
copy
(
obj3d
.
matrix
),
false
,
parent
);
this
.
flip
ScaleMatrix
(
buf1
.
copy
(
obj3d
.
matrix
),
false
,
parent
);
}
...
...
@@ -333,7 +333,7 @@ THREE.SEA3D.prototype.flipDefaultAnimation = function () {
buf1
.
compose
(
pos
,
qua
,
slc
);
this
.
flip
MatrixScale
(
buf1
,
false
,
buf2
);
this
.
flip
ScaleMatrix
(
buf1
,
false
,
buf2
);
buf1
.
decompose
(
to_pos
,
to_qua
,
to_slc
);
...
...
@@ -449,7 +449,7 @@ THREE.SEA3D.prototype.updateTransform = function () {
if
(
sea
.
transform
)
buf1
.
elements
.
set
(
sea
.
transform
);
else
buf1
.
makeTranslation
(
sea
.
position
.
x
,
sea
.
position
.
y
,
sea
.
position
.
z
);
this
.
flip
MatrixScale
(
this
.
flip
ScaleMatrix
(
buf1
,
false
,
obj3d
.
parent
?
obj3d
.
parent
.
matrixWorld
:
identity
,
obj3d
.
parent
instanceof
THREE
.
Bone
...
...
@@ -502,7 +502,7 @@ THREE.SEA3D.prototype.readSkeleton = function () {
// convert to three.js order
if
(
isLegacy
)
this
.
flip
MatrixBone
(
mtx_local
);
if
(
isLegacy
)
this
.
flip
BoneMatrix
(
mtx_local
);
if
(
bone
.
parentIndex
>
-
1
)
{
...
...
@@ -513,7 +513,7 @@ THREE.SEA3D.prototype.readSkeleton = function () {
// convert parent to three.js order
if
(
isLegacy
)
this
.
flip
MatrixBone
(
mtx_parent
);
if
(
isLegacy
)
this
.
flip
BoneMatrix
(
mtx_parent
);
// to local
...
...
@@ -603,11 +603,11 @@ THREE.SEA3D.prototype.readSkeletonAnimationLegacy = function () {
// convert to three.js matrix
this
.
flip
MatrixBone
(
mtx_global
);
this
.
flip
BoneMatrix
(
mtx_global
);
// flip parent inverse
this
.
flip
MatrixBone
(
mtx_parent
);
this
.
flip
BoneMatrix
(
mtx_parent
);
// to local
...
...
@@ -617,7 +617,7 @@ THREE.SEA3D.prototype.readSkeletonAnimationLegacy = function () {
}
else
{
this
.
flip
MatrixBone
(
mtx_local
);
this
.
flip
BoneMatrix
(
mtx_local
);
}
...
...
@@ -658,8 +658,8 @@ THREE.SEA3D.prototype.readVertexAnimation = function ( sea ) {
var
frame
=
sea
.
frame
[
i
];
this
.
flip
X
Vec3
(
frame
.
vertex
);
this
.
flip
X
Vec3
(
frame
.
normal
);
this
.
flipVec3
(
frame
.
vertex
);
this
.
flipVec3
(
frame
.
normal
);
}
...
...
@@ -673,10 +673,10 @@ THREE.SEA3D.prototype.readGeometryBuffer = function ( sea ) {
if
(
this
.
isLegacy
(
sea
)
)
{
this
.
flip
XVec3
(
sea
.
vertex
);
this
.
flip
XVec3
(
sea
.
normal
);
this
.
flip
Vec3
(
sea
.
vertex
,
true
);
this
.
flip
Vec3
(
sea
.
normal
,
true
);
this
.
flip
YZIndex
(
sea
.
indexes
);
this
.
flip
Indexes
(
sea
.
indexes
);
if
(
sea
.
jointPerVertex
>
4
)
this
.
compressJoints
(
sea
);
else
if
(
sea
.
jointPerVertex
<
4
)
this
.
expandJoints
(
sea
);
...
...
@@ -691,7 +691,7 @@ THREE.SEA3D.prototype.readLines = function ( sea ) {
if
(
this
.
isLegacy
(
sea
)
)
{
this
.
flip
X
Vec3
(
sea
.
vertex
);
this
.
flipVec3
(
sea
.
vertex
);
}
...
...
examples/js/loaders/sea3d/SEA3DLoader.js
浏览文件 @
2eac7fb4
...
...
@@ -35,7 +35,6 @@ THREE.SEA3D = function ( config ) {
useEnvironment
:
true
,
useVertexTexture
:
true
,
forceStatic
:
false
,
forcePremultipliedAlpha
:
false
,
streaming
:
true
,
async
:
true
,
paths
:
{},
...
...
@@ -100,6 +99,16 @@ Object.defineProperties( THREE.SEA3D.prototype, {
}
},
elapsedTime
:
{
get
:
function
()
{
return
this
.
file
.
timer
.
elapsedTime
;
}
}
}
);
...
...
@@ -1147,6 +1156,19 @@ THREE.SEA3D.Object3D.prototype = Object.assign( Object.create( THREE.Object3D.pr
return
this
.
animate
!=
undefined
;
},
copy
:
function
(
source
)
{
THREE
.
Object3D
.
prototype
.
copy
.
call
(
this
,
source
);
this
.
attribs
=
source
.
attribs
;
this
.
scripts
=
source
.
scripts
;
if
(
source
.
animator
)
this
.
animator
=
source
.
animator
.
clone
(
this
);
return
this
;
}
}
);
...
...
@@ -2019,6 +2041,7 @@ THREE.SEA3D.prototype.readMesh = function ( sea ) {
}
mesh
.
name
=
sea
.
name
;
mesh
.
castShadow
=
sea
.
castShadows
;
...
...
@@ -2519,6 +2542,22 @@ THREE.SEA3D.prototype.materialTechnique =
};
// EMISSIVE
techniques
[
SEA3D
.
Material
.
EMISSIVE
]
=
function
(
mat
,
tech
)
{
mat
.
emissive
.
setHex
(
tech
.
color
);
};
// EMISSIVE_MAP
techniques
[
SEA3D
.
Material
.
EMISSIVE_MAP
]
=
function
(
mat
,
tech
)
{
mat
.
emissiveMap
=
tech
.
texture
.
tag
;
};
// ALPHA_MAP
techniques
[
SEA3D
.
Material
.
ALPHA_MAP
]
=
function
(
mat
,
tech
,
sea
)
{
...
...
@@ -2594,7 +2633,11 @@ THREE.SEA3D.prototype.readMaterial = function ( sea ) {
var
mat
=
this
.
createMaterial
(
sea
);
mat
.
name
=
sea
.
name
;
mat
.
premultipliedAlpha
=
this
.
config
.
forcePremultipliedAlpha
;
mat
.
depthWrite
=
sea
.
depthWrite
;
mat
.
depthTest
=
sea
.
depthTest
;
mat
.
premultipliedAlpha
=
sea
.
premultipliedAlpha
;
mat
.
side
=
sea
.
bothSides
?
THREE
.
DoubleSide
:
THREE
.
FrontSide
;
this
.
setBlending
(
mat
,
sea
.
blendMode
);
...
...
examples/js/loaders/sea3d/physics/SEA3DAmmo.js
浏览文件 @
2eac7fb4
...
...
@@ -11,12 +11,15 @@
'
use strict
'
;
SEA3D
.
AMMO
=
{
world
:
null
,
rigidBodies
:
[],
rigidBodiesTarget
:
[],
rigidBodiesOffset
:
[],
rigidBodiesEnabled
:
[],
constraints
:
[],
vehicles
:
[],
vehiclesWheels
:
[],
...
...
@@ -89,26 +92,29 @@ SEA3D.AMMO = {
setEnabledRigidBody
:
function
(
rb
,
enabled
)
{
if
(
this
.
getEnabledRigidBody
(
rb
)
==
enabled
)
return
;
var
index
=
this
.
rigidBodies
.
indexOf
(
rb
);
if
(
this
.
rigidBodiesEnabled
[
index
]
==
enabled
)
return
;
if
(
enabled
)
this
.
world
.
addRigidBody
(
rb
);
else
this
.
world
.
removeRigidBody
(
rb
);
this
.
rigidBodiesEnabled
[
index
]
=
true
;
return
this
;
},
getEnabledRigidBody
:
function
(
rb
)
{
return
this
.
rigidBodiesEnabled
[
this
.
rigidBodies
.
indexOf
(
rb
)
]
===
true
;
return
this
.
rigidBodiesEnabled
[
this
.
rigidBodies
.
indexOf
(
rb
)
];
},
addRigidBody
:
function
(
rb
,
target
,
offset
,
enabled
)
{
addRigidBody
:
function
(
rb
,
target
,
enabled
)
{
enabled
=
enabled
!==
undefined
?
enabled
:
true
;
this
.
rigidBodies
.
push
(
rb
);
this
.
rigidBodiesTarget
.
push
(
target
);
this
.
rigidBodiesOffset
.
push
(
offset
);
this
.
rigidBodiesEnabled
.
push
(
false
);
this
.
setEnabledRigidBody
(
rb
,
enabled
);
...
...
@@ -124,7 +130,6 @@ SEA3D.AMMO = {
this
.
rigidBodies
.
splice
(
index
,
1
);
this
.
rigidBodiesTarget
.
splice
(
index
,
1
);
this
.
rigidBodiesOffset
.
splice
(
index
,
1
);
this
.
rigidBodiesEnabled
.
splice
(
index
,
1
);
if
(
destroy
)
Ammo
.
destroy
(
rb
);
...
...
@@ -332,12 +337,7 @@ SEA3D.AMMO = {
var
pos
=
transform
.
getOrigin
(),
quat
=
transform
.
getRotation
();
if
(
offset
==
undefined
)
{
obj3d
.
position
.
set
(
pos
.
x
(),
pos
.
y
(),
pos
.
z
()
);
obj3d
.
quaternion
.
set
(
quat
.
x
(),
quat
.
y
(),
quat
.
z
(),
quat
.
w
()
);
}
else
{
if
(
offset
)
{
position
.
set
(
pos
.
x
(),
pos
.
y
(),
pos
.
z
()
);
quaternion
.
set
(
quat
.
x
(),
quat
.
y
(),
quat
.
z
(),
quat
.
w
()
);
...
...
@@ -349,6 +349,11 @@ SEA3D.AMMO = {
obj3d
.
position
.
setFromMatrixPosition
(
matrix
);
obj3d
.
quaternion
.
setFromRotationMatrix
(
matrix
);
}
else
{
obj3d
.
position
.
set
(
pos
.
x
(),
pos
.
y
(),
pos
.
z
()
);
obj3d
.
quaternion
.
set
(
quat
.
x
(),
quat
.
y
(),
quat
.
z
(),
quat
.
w
()
);
}
return
this
;
...
...
@@ -377,7 +382,7 @@ SEA3D.AMMO = {
if
(
wheelTarget
)
{
this
.
updateTargetTransform
(
wheelTarget
,
wheelsTransform
);
this
.
updateTargetTransform
(
wheelTarget
,
wheelsTransform
,
wheelTarget
.
physics
?
wheelTarget
.
physics
.
offset
:
null
);
}
...
...
@@ -388,12 +393,11 @@ SEA3D.AMMO = {
for
(
i
=
0
;
i
<
this
.
rigidBodies
.
length
;
i
++
)
{
var
rb
=
this
.
rigidBodies
[
i
],
target
=
this
.
rigidBodiesTarget
[
i
],
offset
=
this
.
rigidBodiesOffset
[
i
];
target
=
this
.
rigidBodiesTarget
[
i
];
if
(
target
&&
rb
.
isActive
()
)
{
this
.
updateTargetTransform
(
target
,
rb
.
getWorldTransform
(),
offset
);
this
.
updateTargetTransform
(
target
,
rb
.
getWorldTransform
(),
target
.
physics
?
target
.
physics
.
offset
:
null
);
}
...
...
examples/js/loaders/sea3d/physics/SEA3DAmmoLoader.js
浏览文件 @
2eac7fb4
...
...
@@ -146,10 +146,15 @@ THREE.SEA3D.prototype.readCompound = function ( sea ) {
THREE
.
SEA3D
.
prototype
.
readRigidBodyBase
=
function
(
sea
)
{
var
shape
=
sea
.
shape
.
tag
,
transform
;
transform
,
target
;
if
(
sea
.
target
)
{
target
=
sea
.
target
.
tag
;
target
.
physics
=
{
enabled
:
true
};
target
.
updateMatrix
();
transform
=
SEA3D
.
AMMO
.
getTransformFromMatrix
(
sea
.
target
.
tag
.
matrix
);
}
else
{
...
...
@@ -173,6 +178,23 @@ THREE.SEA3D.prototype.readRigidBodyBase = function ( sea ) {
var
rb
=
new
Ammo
.
btRigidBody
(
info
);
if
(
target
)
{
target
.
physics
.
rigidBody
=
rb
;
if
(
sea
.
offset
)
{
var
offset
=
new
THREE
.
Matrix4
();
offset
.
elements
.
set
(
sea
.
offset
);
target
.
physics
.
offset
=
offset
;
}
}
Ammo
.
destroy
(
info
);
this
.
domain
.
rigidBodies
=
this
.
rigidBodies
=
this
.
rigidBodies
||
[];
this
.
rigidBodies
.
push
(
this
.
objects
[
"
rb/
"
+
sea
.
name
]
=
sea
.
tag
=
rb
);
...
...
@@ -188,7 +210,7 @@ THREE.SEA3D.prototype.readRigidBody = function ( sea ) {
var
rb
=
this
.
readRigidBodyBase
(
sea
);
SEA3D
.
AMMO
.
addRigidBody
(
rb
,
sea
.
target
?
sea
.
target
.
tag
:
undefined
,
sea
.
offset
?
new
THREE
.
Matrix4
().
elements
.
set
(
sea
.
offset
)
:
undefined
,
this
.
config
.
enabledPhysics
);
SEA3D
.
AMMO
.
addRigidBody
(
rb
,
sea
.
target
?
sea
.
target
.
tag
:
undefined
,
this
.
config
.
enabledPhysics
);
};
...
...
@@ -238,6 +260,17 @@ THREE.SEA3D.prototype.readCarController = function ( sea ) {
if
(
target
)
{
target
.
physics
=
{
enabled
:
true
,
rigidBody
:
wheelInfo
};
if
(
wheel
.
offset
)
{
var
offset
=
new
THREE
.
Matrix4
();
offset
.
elements
.
set
(
wheel
.
offset
);
target
.
physics
.
offset
=
offset
;
}
if
(
target
.
parent
)
{
target
.
parent
.
remove
(
target
);
...
...
@@ -260,7 +293,7 @@ THREE.SEA3D.prototype.readCarController = function ( sea ) {
}
SEA3D
.
AMMO
.
addVehicle
(
vehicle
,
wheels
);
SEA3D
.
AMMO
.
addRigidBody
(
body
,
sea
.
target
?
sea
.
target
.
tag
:
undefined
,
sea
.
offset
?
new
THREE
.
Matrix4
().
elements
.
set
(
sea
.
offset
)
:
undefined
,
this
.
config
.
enabledPhysics
);
SEA3D
.
AMMO
.
addRigidBody
(
body
,
sea
.
target
?
sea
.
target
.
tag
:
undefined
,
this
.
config
.
enabledPhysics
);
this
.
domain
.
vehicles
=
this
.
vehicles
=
this
.
vehicles
||
[];
this
.
vehicles
.
push
(
this
.
objects
[
"
vhc/
"
+
sea
.
name
]
=
sea
.
tag
=
vehicle
);
...
...
examples/js/loaders/sea3d/physics/SEA3DRigidBody.js
浏览文件 @
2eac7fb4
...
...
@@ -168,6 +168,12 @@ SEA3D.Physics = function ( name, data, sea3d ) {
if
(
this
.
attrib
&
1
)
this
.
target
=
sea3d
.
getObject
(
data
.
readUInt
()
);
else
this
.
transform
=
data
.
readMatrix
();
if
(
this
.
attrib
&
2
)
this
.
offset
=
data
.
readMatrix
();
if
(
this
.
attrib
&
4
)
this
.
scripts
=
data
.
readScriptList
(
sea3d
);
if
(
this
.
attrib
&
16
)
this
.
attributes
=
sea3d
.
getObject
(
data
.
readUInt
()
);
};
SEA3D
.
Physics
.
prototype
.
readTag
=
function
(
kind
,
data
,
size
)
{
...
...
@@ -257,11 +263,21 @@ SEA3D.CarController.Wheel = function ( data, sea3d ) {
this
.
data
=
data
;
this
.
sea3d
=
sea3d
;
var
attrib
=
data
.
readUShort
();
this
.
attrib
=
data
.
readUShort
();
this
.
isFront
=
(
this
.
attrib
&
1
)
!=
0
;
if
(
this
.
attrib
&
2
)
{
this
.
isFront
=
(
attrib
&
1
)
!=
0
,
this
.
target
=
sea3d
.
getObject
(
data
.
readUInt
()
);
this
.
target
=
sea3d
.
getObject
(
data
.
readUInt
()
);
}
if
(
this
.
attrib
&
4
)
{
this
.
offset
=
data
.
readMatrix
();
}
this
.
pos
=
data
.
readVector3
();
this
.
dir
=
data
.
readVector3
();
...
...
examples/models/sea3d/car.sea
浏览文件 @
2eac7fb4
无法预览此类型文件
examples/models/sea3d/car.tjs.sea
浏览文件 @
2eac7fb4
无法预览此类型文件
examples/models/sea3d/keyframe.tjs.sea
浏览文件 @
2eac7fb4
无法预览此类型文件
examples/models/sea3d/mascot.tjs.sea
浏览文件 @
2eac7fb4
无法预览此类型文件
examples/models/sea3d/morph.tjs.sea
浏览文件 @
2eac7fb4
无法预览此类型文件
examples/models/sea3d/robot.o3dgc.tjs.sea
已删除
100644 → 0
浏览文件 @
d206f16e
文件已删除
examples/models/sea3d/robot.tjs.sea
浏览文件 @
2eac7fb4
无法预览此类型文件
examples/models/sea3d/skin.tjs.sea
浏览文件 @
2eac7fb4
无法预览此类型文件
examples/models/sea3d/sound.sea
浏览文件 @
2eac7fb4
无法预览此类型文件
examples/models/sea3d/sound.tjs.sea
浏览文件 @
2eac7fb4
无法预览此类型文件
examples/webgl_loader_sea3d_hierarchy.html
浏览文件 @
2eac7fb4
...
...
@@ -107,7 +107,7 @@
};
// Open3DGC - Export by SEA3D Studio
loader
.
load
(
'
./models/sea3d/robot.
o3dgc.
tjs.sea
'
);
loader
.
load
(
'
./models/sea3d/robot.tjs.sea
'
);
//
...
...
examples/webgl_loader_sea3d_physics.html
浏览文件 @
2eac7fb4
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<title>
three.js webgl - sea3d /
keyframe
</title>
<title>
three.js webgl - sea3d /
physics
</title>
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"
>
<style>
...
...
@@ -115,7 +115,7 @@
var
domain
=
this
.
loader
.
clone
(
{
lights
:
false
,
runScripts
:
false
,
autoPlay
:
false
,
enabledPhysics
:
false
}
);
offset
+
=
180
;
offset
-
=
180
;
domain
.
container
.
position
.
x
+=
offset
;
domain
.
applyContainerTransform
();
...
...
@@ -138,7 +138,7 @@
document
.
body
.
appendChild
(
container
);
camera
=
new
THREE
.
PerspectiveCamera
(
45
,
window
.
innerWidth
/
window
.
innerHeight
,
1
,
15000
);
camera
.
position
.
set
(
-
300
,
200
,
300
);
camera
.
position
.
set
(
300
,
200
,
-
300
);
renderer
=
new
THREE
.
WebGLRenderer
();
renderer
.
setPixelRatio
(
window
.
devicePixelRatio
);
...
...
examples/webgl_loader_sea3d_skinning.html
浏览文件 @
2eac7fb4
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<title>
three.js webgl - sea3d / skin
</title>
<title>
three.js webgl - sea3d / skin
ning
</title>
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"
>
<style>
...
...
examples/webgl_loader_sea3d_sound.html
浏览文件 @
2eac7fb4
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<title>
three.js webgl - sea3d
</title>
<title>
three.js webgl - sea3d
/ sound
</title>
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"
>
<style>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录