未验证 提交 8d12d49d 编写于 作者: M Mr.doob 提交者: GitHub

Merge pull request #16613 from takahirox/UpdateSkeletonOnce

Update skeleton only once in a frame
......@@ -19,6 +19,8 @@ function Skeleton( bones, boneInverses ) {
this.bones = bones.slice( 0 );
this.boneMatrices = new Float32Array( this.bones.length * 16 );
this.frame = - 1;
// use the supplied bone inverses or calculate the inverses
if ( boneInverses === undefined ) {
......
......@@ -1322,7 +1322,14 @@ function WebGLRenderer( parameters ) {
if ( object.isSkinnedMesh ) {
object.skeleton.update();
// update skeleton only once in a frame
if ( object.skeleton.frame !== info.render.frame ) {
object.skeleton.update();
object.skeleton.frame = info.render.frame;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册