소스 검색

Merge pull request #18767 from sam6321/matrix4-extract-docs

Docs: Added section on extracting position, rotation and scale from a Matrix4.
Mr.doob 5 년 전
부모
커밋
790811db74
2개의 변경된 파일36개의 추가작업 그리고 0개의 파일을 삭제
  1. 18 0
      docs/api/en/math/Matrix4.html
  2. 18 0
      docs/api/zh/math/Matrix4.html

+ 18 - 0
docs/api/en/math/Matrix4.html

@@ -77,6 +77,24 @@ m.elements = [ 11, 21, 31, 41,
 		code, you'll have to take the [link:https://en.wikipedia.org/wiki/Transpose transpose] of any matrices outlined here to make sense of the calculations.
 		</p>
 
+		<h2>Extracting position, rotation and scale</h2>
+		<p>
+			There are several options available for extracting position, rotation and scale from a Matrix4.
+			<ul>
+				<li>
+					[page:Vector3.setFromMatrixPosition]: can be used to extract the translation component.
+				</li>
+				<li>
+					[page:Vector3.setFromMatrixScale]: can be used to extract the scale component.
+				</li>
+				<li>
+					[page:Quaternion.setFromRotationMatrix], [page:Euler.setFromRotationMatrix] or [page:.extractRotation extractRotation] can be used to extract the rotation component.
+				</li>
+				<li>
+					[page:.decompose decompose] can be used to extract position, rotation and scale all at once.
+				</li>
+			</ul>
+		</p>
 
 		<h2>Constructor</h2>
 

+ 18 - 0
docs/api/zh/math/Matrix4.html

@@ -71,6 +71,24 @@ m.elements = [ 11, 21, 31, 41,
 		请记住,如果您正在阅读源代码,您必须对这里列出的任何矩阵进行转置[link:https://en.wikipedia.org/wiki/Transpose transpose],以理解计算。
 		</p>
 
+		<h2>Extracting position, rotation and scale</h2>
+		<p>
+			There are several options available for extracting position, rotation and scale from a Matrix4.
+			<ul>
+				<li>
+					[page:Vector3.setFromMatrixPosition]: can be used to extract the translation component.
+				</li>
+				<li>
+					[page:Vector3.setFromMatrixScale]: can be used to extract the scale component.
+				</li>
+				<li>
+					[page:Quaternion.setFromRotationMatrix], [page:Euler.setFromRotationMatrix] or [page:.extractRotation extractRotation] can be used to extract the rotation component.
+				</li>
+				<li>
+					[page:.decompose decompose] can be used to extract position, rotation and scale all at once.
+				</li>
+			</ul>
+		</p>
 
 		<h2>构造器(Constructor)</h2>