提交 83d081ec 编写于 作者: M Mr.doob 提交者: GitHub

Merge pull request #11334 from WestLangley/dev-quat

Object3D: add applyQuaternion()
......@@ -196,7 +196,10 @@
</div>
<h3>[method:null applyMatrix]( [page:Matrix4 matrix] )</h3>
<div>This updates the position, rotation and scale with the matrix.</div>
<div>Applies the matrix transform to the object and updates the object's position, rotation and scale.</div>
<h3>[method:Object3D applyQuaternion]( [page:Quaternion quaternion] )</h3>
<div>Applies the rotation represented by the quaternion to the object.</div>
<h3>[method:Object3D clone]( [page:Boolean recursive] )</h3>
<div>
......
......@@ -112,6 +112,14 @@ Object.assign( Object3D.prototype, EventDispatcher.prototype, {
},
applyQuaternion: function ( q ) {
this.quaternion.premultiply( q );
return this;
},
setRotationFromAxisAngle: function ( axis, angle ) {
// assumes axis is normalized
......@@ -272,7 +280,7 @@ Object.assign( Object3D.prototype, EventDispatcher.prototype, {
lookAt: function () {
// This routine does not support objects with rotated and/or translated parent(s)
// This method does not support objects with rotated and/or translated parent(s)
var m1 = new Matrix4();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册