|
@@ -132,26 +132,23 @@
|
|
</p>
|
|
</p>
|
|
|
|
|
|
<h3>[method:Quaternion premultiply]( [param:Quaternion q] )</h3>
|
|
<h3>[method:Quaternion premultiply]( [param:Quaternion q] )</h3>
|
|
- <p>Pre-multiplies this quaternion by [page:Quaternion q].</p>
|
|
|
|
|
|
+ <p>使用 [page:Quaternion q] 乘以该四元数。</p>
|
|
|
|
|
|
<h3>[method:Quaternion rotateTowards]( [param:Quaternion q], [param:Float step] )</h3>
|
|
<h3>[method:Quaternion rotateTowards]( [param:Quaternion q], [param:Float step] )</h3>
|
|
<p>
|
|
<p>
|
|
- [page:Quaternion q] - The target quaternion.<br />
|
|
|
|
- [page:Float step] - The angular step in radians.<br /><br />
|
|
|
|
|
|
+ [page:Quaternion q] - 目标四元数<br />
|
|
|
|
+ [page:Float step] - 以弧度为单位的角度步长<br /><br />
|
|
|
|
|
|
- Rotates this quaternion by a given angular step to the defined quaternion *q*.
|
|
|
|
- The method ensures that the final quaternion will not overshoot *q*.
|
|
|
|
|
|
+ 将该四元数按照步长 step 向目标 *q* 进行旋转。该方法确保最终的四元数不会超过 *q*。
|
|
</p>
|
|
</p>
|
|
|
|
|
|
<h3>[method:Quaternion slerp]( [param:Quaternion qb], [param:Float t] )</h3>
|
|
<h3>[method:Quaternion slerp]( [param:Quaternion qb], [param:Float t] )</h3>
|
|
<p>
|
|
<p>
|
|
- [page:Quaternion qb] - The other quaternion rotation<br />
|
|
|
|
- [page:Float t] - interpolation factor in the closed interval [0, 1].<br /><br />
|
|
|
|
|
|
+ [page:Quaternion qb] - 另一个四元数旋转<br />
|
|
|
|
+ [page:Float t] - 闭区间 [0, 1] 中的插值因子<br /><br />
|
|
|
|
|
|
- Handles the spherical linear interpolation between quaternions. [page:Float t] represents the
|
|
|
|
- amount of rotation between this quaternion (where [page:Float t] is 0) and [page:Quaternion qb] (where
|
|
|
|
- [page:Float t] is 1). This quaternion is set to the result. Also see the static version of the
|
|
|
|
- *slerp* below.
|
|
|
|
|
|
+ 处理四元数之间的球面线性插值。[page:Float t] 表示该四元数(其中 [page:Float t] 为 0) 和 [page:Quaternion qb] (其中 [page:Float t] 为1) 之间的旋转量。
|
|
|
|
+ 该四元数会被设置为上述计算的结果。另请参阅下面 *slerp* 的静态版本。
|
|
|
|
|
|
<code>
|
|
<code>
|
|
// rotate a mesh towards a target quaternion
|
|
// rotate a mesh towards a target quaternion
|
|
@@ -160,7 +157,7 @@
|
|
</p>
|
|
</p>
|
|
|
|
|
|
<h3>[method:this slerpQuaternions]( [param:Quaternion qa], [param:Quaternion qb], [param:Float t] )</h3>
|
|
<h3>[method:this slerpQuaternions]( [param:Quaternion qa], [param:Quaternion qb], [param:Float t] )</h3>
|
|
- <p>Performs a spherical linear interpolation between the given quaternions and stores the result in this quaternion.</p>
|
|
|
|
|
|
+ <p>在给定的四元数之间执行球面线性插值,并将结果存储在这个四元数中</p>
|
|
|
|
|
|
<h3>[method:Quaternion set]( [param:Float x], [param:Float y], [param:Float z], [param:Float w] )</h3>
|
|
<h3>[method:Quaternion set]( [param:Float x], [param:Float y], [param:Float z], [param:Float w] )</h3>
|
|
<p>设置该四元数的 [page:.x x]、[page:.y y]、[page:.z z]和[page:.w w]属性。</p>
|
|
<p>设置该四元数的 [page:.x x]、[page:.y y]、[page:.z z]和[page:.w w]属性。</p>
|
|
@@ -183,10 +180,9 @@
|
|
|
|
|
|
<h3>[method:Quaternion setFromUnitVectors]( [param:Vector3 vFrom], [param:Vector3 vTo] )</h3>
|
|
<h3>[method:Quaternion setFromUnitVectors]( [param:Vector3 vFrom], [param:Vector3 vTo] )</h3>
|
|
<p>
|
|
<p>
|
|
- Sets this quaternion to the rotation required to rotate direction vector [page:Vector3 vFrom] to
|
|
|
|
- direction vector [page:Vector3 vTo].<br />
|
|
|
|
- Adapted from the method [link:http://lolengine.net/blog/2013/09/18/beautiful-maths-quaternion-from-vectors here].<br />
|
|
|
|
- [page:Vector3 vFrom] and [page:Vector3 vTo] are assumed to be normalized.
|
|
|
|
|
|
+ 将该四元数设置为从方向向量 [page:Vector3 vFrom] 旋转到方向向量 [page:Vector3 vTo] 所需的旋转。<br />
|
|
|
|
+ 改编自方法 [link:http://lolengine.net/blog/2013/09/18/beautiful-maths-quaternion-from-vectors here]。<br />
|
|
|
|
+ 假设 [page:Vector3 vFrom] 和 [page:Vector3 vTo] 都已归一化。
|
|
</p>
|
|
</p>
|
|
|
|
|
|
<h3>[method:Array toArray]( [param:Array array], [param:Integer offset] )</h3>
|
|
<h3>[method:Array toArray]( [param:Array array], [param:Integer offset] )</h3>
|
|
@@ -210,16 +206,16 @@
|
|
|
|
|
|
<h3>[method:null slerpFlat]( [param:Array dst], [param:Integer dstOffset], [param:Array src0], [param:Integer srcOffset0], [param:Array src1], [param:Integer srcOffset1], [param:Float t] )</h3>
|
|
<h3>[method:null slerpFlat]( [param:Array dst], [param:Integer dstOffset], [param:Array src0], [param:Integer srcOffset0], [param:Array src1], [param:Integer srcOffset1], [param:Float t] )</h3>
|
|
<p>
|
|
<p>
|
|
- [page:Array dst] - The output array.<br />
|
|
|
|
- [page:Integer dstOffset] - An offset into the output array.<br />
|
|
|
|
- [page:Array src0] - The source array of the starting quaternion.<br />
|
|
|
|
- [page:Integer srcOffset0] - An offset into the array *src0*.<br />
|
|
|
|
- [page:Array src1] - The source array of the target quatnerion.<br />
|
|
|
|
- [page:Integer srcOffset1] - An offset into the array *src1*.<br />
|
|
|
|
- [page:Float t] - Normalized interpolation factor (between 0 and 1).<br /><br />
|
|
|
|
|
|
+ [page:Array dst] - 输出数组<br />
|
|
|
|
+ [page:Integer dstOffset] - 输出数组的偏移量<br />
|
|
|
|
+ [page:Array src0] - 起始四元数的源数组<br />
|
|
|
|
+ [page:Integer srcOffset0] - 数组 *src0* 的偏移量<br />
|
|
|
|
+ [page:Array src1] - 目标四元数的源数组<br />
|
|
|
|
+ [page:Integer srcOffset1] - 数组 *src1* 的偏移量<br />
|
|
|
|
+ [page:Float t] - 归一化插值因子(介于 0 和 1 之间)<br /><br />
|
|
</p>
|
|
</p>
|
|
<p>
|
|
<p>
|
|
- Like the static *slerp* method above, but operates directly on flat arrays of numbers.
|
|
|
|
|
|
+ 类似于上面的 *slerp* 方法,但直接对平面数组进行操作。
|
|
</p>
|
|
</p>
|
|
|
|
|
|
<!-- Note: Do not add non-static methods to the bottom of this page. Put them above the <h2>Static Methods</h2> -->
|
|
<!-- Note: Do not add non-static methods to the bottom of this page. Put them above the <h2>Static Methods</h2> -->
|