Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
e62a722e
T
three.js
项目概览
车家大少爷
/
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,发现更多精彩内容 >>
提交
e62a722e
编写于
8月 24, 2017
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Helpers: Replaced onBeforeRender usage with updateMatrixWorld. See #11638
上级
da94a7e9
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
12 addition
and
13 deletion
+12
-13
src/helpers/Box3Helper.js
src/helpers/Box3Helper.js
+4
-3
src/helpers/PlaneHelper.js
src/helpers/PlaneHelper.js
+3
-6
src/helpers/SkeletonHelper.js
src/helpers/SkeletonHelper.js
+5
-4
未找到文件。
src/helpers/Box3Helper.js
浏览文件 @
e62a722e
...
...
@@ -7,6 +7,7 @@ import { LineBasicMaterial } from '../materials/LineBasicMaterial';
import
{
BufferAttribute
}
from
'
../core/BufferAttribute
'
;
import
{
Float32BufferAttribute
}
from
'
../core/BufferAttribute
'
;
import
{
BufferGeometry
}
from
'
../core/BufferGeometry
'
;
import
{
Object3D
}
from
'
../core/Object3D
'
;
function
Box3Helper
(
box
,
hex
)
{
...
...
@@ -30,14 +31,12 @@ function Box3Helper( box, hex ) {
this
.
geometry
.
computeBoundingSphere
();
this
.
onBeforeRender
();
}
Box3Helper
.
prototype
=
Object
.
create
(
LineSegments
.
prototype
);
Box3Helper
.
prototype
.
constructor
=
Box3Helper
;
Box3Helper
.
prototype
.
onBeforeRender
=
function
(
)
{
Box3Helper
.
prototype
.
updateMatrixWorld
=
function
(
force
)
{
var
box
=
this
.
box
;
...
...
@@ -49,6 +48,8 @@ Box3Helper.prototype.onBeforeRender = function () {
this
.
scale
.
multiplyScalar
(
0.5
);
Object3D
.
prototype
.
updateMatrixWorld
.
call
(
this
,
force
);
};
export
{
Box3Helper
};
src/helpers/PlaneHelper.js
浏览文件 @
e62a722e
...
...
@@ -8,6 +8,7 @@ import { LineBasicMaterial } from '../materials/LineBasicMaterial';
import
{
MeshBasicMaterial
}
from
'
../materials/MeshBasicMaterial
'
;
import
{
Float32BufferAttribute
}
from
'
../core/BufferAttribute
'
;
import
{
BufferGeometry
}
from
'
../core/BufferGeometry
'
;
import
{
Object3D
}
from
'
../core/Object3D
'
;
function
PlaneHelper
(
plane
,
size
,
hex
)
{
...
...
@@ -37,16 +38,12 @@ function PlaneHelper( plane, size, hex ) {
this
.
add
(
new
Mesh
(
geometry2
,
new
MeshBasicMaterial
(
{
color
:
color
,
opacity
:
0.2
,
transparent
:
true
,
depthWrite
:
false
}
)
)
);
//
this
.
onBeforeRender
();
}
PlaneHelper
.
prototype
=
Object
.
create
(
Line
.
prototype
);
PlaneHelper
.
prototype
.
constructor
=
PlaneHelper
;
PlaneHelper
.
prototype
.
onBeforeRender
=
function
(
)
{
PlaneHelper
.
prototype
.
updateMatrixWorld
=
function
(
force
)
{
var
scale
=
-
this
.
plane
.
constant
;
...
...
@@ -56,7 +53,7 @@ PlaneHelper.prototype.onBeforeRender = function () {
this
.
lookAt
(
this
.
plane
.
normal
);
this
.
updateMatrixWorld
(
);
Object3D
.
prototype
.
updateMatrixWorld
.
call
(
this
,
force
);
};
...
...
src/helpers/SkeletonHelper.js
浏览文件 @
e62a722e
...
...
@@ -14,6 +14,7 @@ import { Color } from '../math/Color';
import
{
Vector3
}
from
'
../math/Vector3
'
;
import
{
BufferGeometry
}
from
'
../core/BufferGeometry
'
;
import
{
Float32BufferAttribute
}
from
'
../core/BufferAttribute
'
;
import
{
Object3D
}
from
'
../core/Object3D
'
;
function
getBoneList
(
object
)
{
...
...
@@ -75,21 +76,19 @@ function SkeletonHelper( object ) {
this
.
matrix
=
object
.
matrixWorld
;
this
.
matrixAutoUpdate
=
false
;
this
.
onBeforeRender
();
}
SkeletonHelper
.
prototype
=
Object
.
create
(
LineSegments
.
prototype
);
SkeletonHelper
.
prototype
.
constructor
=
SkeletonHelper
;
SkeletonHelper
.
prototype
.
onBeforeRender
=
function
()
{
SkeletonHelper
.
prototype
.
updateMatrixWorld
=
function
()
{
var
vector
=
new
Vector3
();
var
boneMatrix
=
new
Matrix4
();
var
matrixWorldInv
=
new
Matrix4
();
return
function
onBeforeRender
(
)
{
return
function
updateMatrixWorld
(
force
)
{
var
bones
=
this
.
bones
;
...
...
@@ -120,6 +119,8 @@ SkeletonHelper.prototype.onBeforeRender = function () {
geometry
.
getAttribute
(
'
position
'
).
needsUpdate
=
true
;
Object3D
.
prototype
.
updateMatrixWorld
.
call
(
this
,
force
);
};
}();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录