未验证 提交 e9b90563 编写于 作者: M Michael Herzog 提交者: GitHub

OBB: Use Matrix4.setFromMatrix3(). (#21562)

上级 71759eb2
......@@ -320,7 +320,7 @@ Object.assign( OBB.prototype, {
// create a 4x4 transformation matrix
matrix4FromRotationMatrix( matrix, this.rotation );
matrix.setFromMatrix3( this.rotation );
matrix.setPosition( this.center );
// transform ray to the local space of the OBB
......@@ -418,33 +418,6 @@ Object.assign( OBB.prototype, {
} );
function matrix4FromRotationMatrix( matrix4, matrix3 ) {
var e = matrix4.elements;
var me = matrix3.elements;
e[ 0 ] = me[ 0 ];
e[ 1 ] = me[ 1 ];
e[ 2 ] = me[ 2 ];
e[ 3 ] = 0;
e[ 4 ] = me[ 3 ];
e[ 5 ] = me[ 4 ];
e[ 6 ] = me[ 5 ];
e[ 7 ] = 0;
e[ 8 ] = me[ 6 ];
e[ 9 ] = me[ 7 ];
e[ 10 ] = me[ 8 ];
e[ 11 ] = 0;
e[ 12 ] = 0;
e[ 13 ] = 0;
e[ 14 ] = 0;
e[ 15 ] = 1;
}
var obb = new OBB();
export { OBB };
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册