new Cesium.Matrix4(column0Row0, column1Row0, column2Row0, column3Row0, column0Row1, column1Row1, column2Row1, column3Row1, column0Row2, column1Row2, column2Row2, column3Row2, column0Row3, column1Row3, column2Row3, column3Row3)
4x4 矩阵,可以作为列主序数组索引 .
构造参数按代码可读性的行主序排列.
| Name | Type | Default | Description |
|---|---|---|---|
column0Row0 |
number |
0.0
|
optional 第0栏,第0行的值. |
column1Row0 |
number |
0.0
|
optional 第1栏第0行的值. |
column2Row0 |
number |
0.0
|
optional 第2栏第0行的值. |
column3Row0 |
number |
0.0
|
optional 第3栏第0行的值. |
column0Row1 |
number |
0.0
|
optional 第0栏第1行的值. |
column1Row1 |
number |
0.0
|
optional 第1栏第1行的值. |
column2Row1 |
number |
0.0
|
optional 第2栏第1行的值. |
column3Row1 |
number |
0.0
|
optional 第3栏第1行的值. |
column0Row2 |
number |
0.0
|
optional 第0栏第2行的值. |
column1Row2 |
number |
0.0
|
optional 第1栏第2行的值. |
column2Row2 |
number |
0.0
|
optional 第2栏第2行的值. |
column3Row2 |
number |
0.0
|
optional 第3栏第2行的数值. |
column0Row3 |
number |
0.0
|
optional 第0栏第3行的值. |
column1Row3 |
number |
0.0
|
optional 第1栏第3行的值. |
column2Row3 |
number |
0.0
|
optional 第2栏第3行的值. |
column3Row3 |
number |
0.0
|
optional 第3栏第3行的值. |
- Matrix4.fromArray
- Matrix4.fromColumnMajorArray
- Matrix4.fromRowMajorArray
- Matrix4.fromRotationTranslation
- Matrix4.fromTranslationQuaternionRotationScale
- Matrix4.fromTranslationRotationScale
- Matrix4.fromTranslation
- Matrix4.fromScale
- Matrix4.fromUniformScale
- Matrix4.fromRotation
- Matrix4.fromCamera
- Matrix4.computePerspectiveFieldOfView
- Matrix4.computeOrthographicOffCenter
- Matrix4.computePerspectiveOffCenter
- Matrix4.computeInfinitePerspectiveOffCenter
- Matrix4.computeViewportTransformation
- Matrix4.computeView
- Matrix2
- Matrix3
- Packable
See:
Members
获取收藏中的项目数.
0栏,第0行的索引为 NT 0 .
0栏第1行的索引为 Matrix4 .
第0栏第2行的索引为 Matrix4 .
0栏第3行的索引为 Matrix4 .
第1栏第0行的索引为 Matrix4 .
第1栏第1行的索引为 Matrix4 .
第1栏第2行的索引为 Matrix4 .
第1栏第3行的索引为 Matrix4 .
第2栏第0行的索引为 Matrix4 .
第2栏第1行的索引为 Matrix4 .
第2栏第2行的索引为 Matrix4 .
第2栏第3行的索引为 Matrix4 .
第3栏第0行的索引为 Matrix4 .
第3栏第1行的索引为 Matrix4 .
第3栏第2行的索引为 Matrix4 .
第3栏第3行的索引为 Matrix4 .
static constant Cesium.Matrix4.IDENTITY : Matrix4
不可改变的 NT 0 实例初始化为身份矩阵.
用于将对象组合成数组的元素数量.
static constant Cesium.Matrix4.ZERO : Matrix4
不可改变的 NT 0 实例初始化为零矩阵.
Methods
clone(result) → Matrix4
Duplicates the provided Matrix4 instance.
| Name | Type | Description |
|---|---|---|
result |
Matrix4 | optional 存储结果的对象 . |
Returns:
未提供修改的结果参数或新的 NT% 0 实例 .
将这个矩阵与所提供的矩阵组件进行比较并返回
-NT+0+Treal NT+1+,如果两者是相等的, NT+2+false NT+3+否则.
| Name | Type | Description |
|---|---|---|
right |
Matrix4 | optional 右手侧矩阵. |
Returns:
-NT+0+Treal NT+1+,如果两者是相等的, NT+2+false NT+3+否则.
将这个矩阵与所提供的矩阵组件进行比较并返回
如果它们位于提供的epsilon范围内,
-NT+0+false NT+1+否则.
| Name | Type | Default | Description |
|---|---|---|---|
right |
Matrix4 | optional 右手侧矩阵. | |
epsilon |
number |
0
|
optional The epsilon to use for equality testing. |
Returns:
NT##############################################################################################################################################################################################################################################################.
计算代表这个矩阵的字符串,每行都是
单行并格式为“(栏0,栏1,栏2,栏3)”.
Returns:
代表所提供矩阵的字符串,每行在单独的行上,格式为“(栏0,栏1,栏2,栏3)”.
static Cesium.Matrix4.abs(matrix, result) → Matrix4
计算矩阵,其中包含所提供矩阵元素的绝对值(未签名).
| Name | Type | Description |
|---|---|---|
matrix |
Matrix4 | 带有签名元素的矩阵 . |
result |
Matrix4 | 存储结果的对象 . |
Returns:
修改的结果参数 .
static Cesium.Matrix4.add(left, right, result) → Matrix4
计算两个矩阵的总和.
| Name | Type | Description |
|---|---|---|
left |
Matrix4 | 第一个矩阵. |
right |
Matrix4 | 第二矩阵. |
result |
Matrix4 | 存储结果的对象 . |
Returns:
修改的结果参数 .
static Cesium.Matrix4.clone(matrix, result) → Matrix4
Duplicates a Matrix4 instance.
| Name | Type | Description |
|---|---|---|
matrix |
Matrix4 | 要复制的矩阵 . |
result |
Matrix4 | optional 存储结果的对象 . |
Returns:
The modified result parameter or a new Matrix4 instance if one was not provided. (Returns undefined if matrix is undefined)
static Cesium.Matrix4.computeInfinitePerspectiveOffCenter(left, right, bottom, top, near, result) → Matrix4
计算一个 NT% 0 实例,代表无限的中外视角转换.
| Name | Type | Description |
|---|---|---|
left |
number | 镜头左侧的米数将会被看到. |
right |
number | 镜头右侧的米数将会被看到. |
bottom |
number | 摄像头下方的米数将会被看到. |
top |
number | 将会看到的相机上方的米数. |
near |
number | 距离近机以米计. |
result |
Matrix4 | 结果存储的对象. |
Returns:
修改的结果参数 .
static Cesium.Matrix4.computeOrthographicOffCenter(left, right, bottom, top, near, far, result) → Matrix4
计算代表整形变换矩阵的 NT 0 实例.
| Name | Type | Description |
|---|---|---|
left |
number | 镜头左侧的米数将会被看到. |
right |
number | 镜头右侧的米数将会被看到. |
bottom |
number | 摄像头下方的米数将会被看到. |
top |
number | 将会看到的相机上方的米数. |
near |
number | 距离近机以米计. |
far |
number | 与远方飞机的距离以米计. |
result |
Matrix4 | 结果存储的对象. |
Returns:
修改的结果参数 .
static Cesium.Matrix4.computePerspectiveFieldOfView(fovY, aspectRatio, near, far, result) → Matrix4
计算代表视角变换矩阵的 NT 0 实例.
| Name | Type | Description |
|---|---|---|
fovY |
number | 沿Y轴的视野用弧度表示. |
aspectRatio |
number | 宽度比. |
near |
number | 距离近机以米计. |
far |
number | 与远方飞机的距离以米计. |
result |
Matrix4 | 结果存储的对象. |
Returns:
修改的结果参数 .
Throws:
-
DeveloperError : fovY must be in (0, PI].
-
DeveloperError : aspectRatio must be greater than zero.
-
DeveloperError : near must be greater than zero.
-
DeveloperError : far must be greater than zero.
static Cesium.Matrix4.computePerspectiveOffCenter(left, right, bottom, top, near, far, result) → Matrix4
计算代表离中心视角转换的 NT% 0 实例 .
| Name | Type | Description |
|---|---|---|
left |
number | 镜头左侧的米数将会被看到. |
right |
number | 镜头右侧的米数将会被看到. |
bottom |
number | 相机下方的米数将会被看到. |
top |
number | 将会看到的相机上方的米数. |
near |
number | 距离近机以米计. |
far |
number | 与远方飞机的距离以米计. |
result |
Matrix4 | 结果存储的对象. |
Returns:
修改的结果参数 .
static Cesium.Matrix4.computeView(position, direction, up, right, result) → Matrix4
计算从世界空间变换到查看空间的 NT 0 实例 .
| Name | Type | Description |
|---|---|---|
position |
Cartesian3 | 摄像头的位置. |
direction |
Cartesian3 | 前进方向. |
up |
Cartesian3 | 上升方向. |
right |
Cartesian3 | 正确的方向. |
result |
Matrix4 | 结果存储的对象. |
Returns:
修改的结果参数 .
static Cesium.Matrix4.computeViewportTransformation(viewport, nearDepthRange, farDepthRange, result) → Matrix4
计算一个 Matrix4 实例,该实例会从普通设备坐标转换为窗口坐标.
| Name | Type | Default | Description |
|---|---|---|---|
viewport |
object |
{ x : 0.0, y : 0.0, width : 0.0, height : 0.0 }
|
optional The viewport's corners as shown in Example 1. |
nearDepthRange |
number |
0.0
|
optional 窗口坐标中的近平面距离. |
farDepthRange |
number |
1.0
|
optional 窗口坐标中的远平面距离. |
result |
Matrix4 | optional 结果存储的对象. |
Returns:
修改的结果参数 .
Example:
// Create viewport transformation using an explicit viewport and depth range.
const m = Cesium.Matrix4.computeViewportTransformation({
x : 0.0,
y : 0.0,
width : 1024.0,
height : 768.0
}, 0.0, 1.0, new Cesium.Matrix4());
比较所提供的矩阵组件并返回
-NT+0+Treal NT+1+,如果两者是相等的, NT+2+false NT+3+否则.
| Name | Type | Description |
|---|---|---|
left |
Matrix4 | optional 第一个矩阵. |
right |
Matrix4 | optional 第二矩阵. |
Returns:
如果左右对等, 则使用 NT 0 true NT 1 , 否则使用 NT 2 false NT 3 .
Example:
//compares two Matrix4 instances
// a = [10.0, 14.0, 18.0, 22.0]
// [11.0, 15.0, 19.0, 23.0]
// [12.0, 16.0, 20.0, 24.0]
// [13.0, 17.0, 21.0, 25.0]
// b = [10.0, 14.0, 18.0, 22.0]
// [11.0, 15.0, 19.0, 23.0]
// [12.0, 16.0, 20.0, 24.0]
// [13.0, 17.0, 21.0, 25.0]
if(Cesium.Matrix4.equals(a,b)) {
console.log("Both matrices are equal");
} else {
console.log("They are not equal");
}
//Prints "Both matrices are equal" on the console
比较所提供的矩阵组件并返回
如果它们位于提供的epsilon范围内,
-NT+0+false NT+1+否则.
| Name | Type | Default | Description |
|---|---|---|---|
left |
Matrix4 | optional 第一个矩阵. | |
right |
Matrix4 | optional 第二矩阵. | |
epsilon |
number |
0
|
optional The epsilon to use for equality testing. |
Returns:
NT################################################################### ##########################################################################################################################################################################################.
Example:
//compares two Matrix4 instances
// a = [10.5, 14.5, 18.5, 22.5]
// [11.5, 15.5, 19.5, 23.5]
// [12.5, 16.5, 20.5, 24.5]
// [13.5, 17.5, 21.5, 25.5]
// b = [10.0, 14.0, 18.0, 22.0]
// [11.0, 15.0, 19.0, 23.0]
// [12.0, 16.0, 20.0, 24.0]
// [13.0, 17.0, 21.0, 25.0]
if(Cesium.Matrix4.equalsEpsilon(a,b,0.1)){
console.log("Difference between both the matrices is less than 0.1");
} else {
console.log("Difference between both the matrices is not less than 0.1");
}
//Prints "Difference between both the matrices is not less than 0.1" on the console
static Cesium.Matrix4.fromArray(array, startingIndex, result) → Matrix4
Creates a Matrix4 from 16 consecutive elements in an array.
| Name | Type | Default | Description |
|---|---|---|---|
array |
Array.<number> | 连续16个元素对应矩阵位置的阵列。 假设列主序. | |
startingIndex |
number |
0
|
optional The offset into the array of the first element, which corresponds to first column first row position in the matrix. |
result |
Matrix4 | optional 存储结果的对象 . |
Returns:
未提供修改的结果参数或新的 NT% 0 实例 .
Example:
// Create the Matrix4:
// [1.0, 2.0, 3.0, 4.0]
// [1.0, 2.0, 3.0, 4.0]
// [1.0, 2.0, 3.0, 4.0]
// [1.0, 2.0, 3.0, 4.0]
const v = [1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0, 3.0, 4.0, 4.0, 4.0, 4.0];
const m = Cesium.Matrix4.fromArray(v);
// Create same Matrix4 with using an offset into an array
const v2 = [0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0, 3.0, 4.0, 4.0, 4.0, 4.0];
const m2 = Cesium.Matrix4.fromArray(v2, 2);
static Cesium.Matrix4.fromCamera(camera, result) → Matrix4
Computes a Matrix4 instance from a Camera.
| Name | Type | Description |
|---|---|---|
camera |
Camera | 要使用的摄像机. |
result |
Matrix4 | optional 如果创建了未定义的新实例, 结果将存储的对象 . |
Returns:
已修改的结果参数, 或如果未提供新的 NT% 0 实例 .
static Cesium.Matrix4.fromColumnMajorArray(values, result) → Matrix4
Computes a Matrix4 instance from a column-major order array.
| Name | Type | Description |
|---|---|---|
values |
Array.<number> | 列主命令阵列 . |
result |
Matrix4 | optional 如果创建了未定义的新实例, 结果将存储的对象 . |
Returns:
已修改的结果参数, 或如果未提供新的 NT% 0 实例 .
static Cesium.Matrix4.fromRotation(rotation, result) → Matrix4
创建旋转矩阵.
| Name | Type | Description |
|---|---|---|
rotation |
Matrix3 | 旋转矩阵. |
result |
Matrix4 | optional 如果创建了未定义的新实例, 结果将存储的对象 . |
Returns:
已修改的结果参数, 或如果未提供新的 NT% 0 实例 .
static Cesium.Matrix4.fromRotationTranslation(rotation, translation, result) → Matrix4
Computes a Matrix4 instance from a Matrix3 representing the rotation
和代表译名的 NT 0 .
| Name | Type | Default | Description |
|---|---|---|---|
rotation |
Matrix3 | 代表旋转的矩阵左上部分. | |
translation |
Cartesian3 |
Cartesian3.ZERO
|
optional The upper right portion of the matrix representing the translation. |
result |
Matrix4 | optional 如果创建了未定义的新实例, 结果将存储的对象 . |
Returns:
已修改的结果参数, 或如果未提供新的 NT% 0 实例 .
static Cesium.Matrix4.fromRowMajorArray(values, result) → Matrix4
Computes a Matrix4 instance from a row-major order array.
所产生的矩阵将按列次排列.
| Name | Type | Description |
|---|---|---|
values |
Array.<number> | 行主命令阵列 . |
result |
Matrix4 | optional 如果创建了未定义的新实例, 结果将存储的对象 . |
Returns:
已修改的结果参数, 或如果未提供新的 NT% 0 实例 .
static Cesium.Matrix4.fromScale(scale, result) → Matrix4
计算代表非统一比例表的 Matrix4 例.
| Name | Type | Description |
|---|---|---|
scale |
Cartesian3 | X, y, 和 z 比例因子. |
result |
Matrix4 | optional 如果创建了未定义的新实例, 结果将存储的对象 . |
Returns:
已修改的结果参数, 或如果未提供新的 NT% 0 实例 .
Example:
// Creates
// [7.0, 0.0, 0.0, 0.0]
// [0.0, 8.0, 0.0, 0.0]
// [0.0, 0.0, 9.0, 0.0]
// [0.0, 0.0, 0.0, 1.0]
const m = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0));
static Cesium.Matrix4.fromTranslation(translation, result) → Matrix4
Creates a Matrix4 instance from a Cartesian3 representing the translation.
| Name | Type | Description |
|---|---|---|
translation |
Cartesian3 | 代表翻译的矩阵右上角部分. |
result |
Matrix4 | optional 如果创建了未定义的新实例, 结果将存储的对象 . |
Returns:
已修改的结果参数, 或如果未提供新的 NT% 0 实例 .
static Cesium.Matrix4.fromTranslationQuaternionRotationScale(translation, rotation, scale, result) → Matrix4
Computes a Matrix4 instance from a translation, rotation, and scale (TRS)
将代表名额改为四.
| Name | Type | Description |
|---|---|---|
translation |
Cartesian3 | 翻译的转变. |
rotation |
Quaternion | 轮回转变. |
scale |
Cartesian3 | 非统一规模转变. |
result |
Matrix4 | optional 如果创建了未定义的新实例, 结果将存储的对象 . |
Returns:
已修改的结果参数, 或如果未提供新的 NT% 0 实例 .
Example:
const result = Cesium.Matrix4.fromTranslationQuaternionRotationScale(
new Cesium.Cartesian3(1.0, 2.0, 3.0), // translation
Cesium.Quaternion.IDENTITY, // rotation
new Cesium.Cartesian3(7.0, 8.0, 9.0), // scale
result);
static Cesium.Matrix4.fromTranslationRotationScale(translationRotationScale, result) → Matrix4
Creates a Matrix4 instance from a
TranslationRotationScale instance.
| Name | Type | Description |
|---|---|---|
translationRotationScale |
TranslationRotationScale | The instance. |
result |
Matrix4 | optional 如果创建了未定义的新实例, 结果将存储的对象 . |
Returns:
已修改的结果参数, 或如果未提供新的 NT% 0 实例 .
static Cesium.Matrix4.fromUniformScale(scale, result) → Matrix4
计算代表统一比例尺的 Matrix4 实例.
| Name | Type | Description |
|---|---|---|
scale |
number | 统一比例系数. |
result |
Matrix4 | optional 如果创建了未定义的新实例, 结果将存储的对象 . |
Returns:
已修改的结果参数, 或如果未提供新的 NT% 0 实例 .
Example:
// Creates
// [2.0, 0.0, 0.0, 0.0]
// [0.0, 2.0, 0.0, 0.0]
// [0.0, 0.0, 2.0, 0.0]
// [0.0, 0.0, 0.0, 1.0]
const m = Cesium.Matrix4.fromUniformScale(2.0);
static Cesium.Matrix4.getColumn(matrix, index, result) → Cartesian4
Retrieves a copy of the matrix column at the provided index as a Cartesian4 instance.
| Name | Type | Description |
|---|---|---|
matrix |
Matrix4 | 要使用的矩阵 . |
index |
number | 要检索的列的零基索引 . |
result |
Cartesian4 | 存储结果的对象 . |
Returns:
修改的结果参数 .
Throws:
-
DeveloperError : index must be 0, 1, 2, or 3.
Examples:
//returns a Cartesian4 instance with values from the specified column
// m = [10.0, 11.0, 12.0, 13.0]
// [14.0, 15.0, 16.0, 17.0]
// [18.0, 19.0, 20.0, 21.0]
// [22.0, 23.0, 24.0, 25.0]
//Example 1: Creates an instance of Cartesian
const a = Cesium.Matrix4.getColumn(m, 2, new Cesium.Cartesian4());
//Example 2: Sets values for Cartesian instance
const a = new Cesium.Cartesian4();
Cesium.Matrix4.getColumn(m, 2, a);
// a.x = 12.0; a.y = 16.0; a.z = 20.0; a.w = 24.0;
在提供的行和列上计算元素的数组索引.
| Name | Type | Description |
|---|---|---|
row |
number | 行零基指数. |
column |
number | 列的零基索引. |
Returns:
提供的行和列的元素索引 .
Throws:
-
DeveloperError : row must be 0, 1, 2, or 3.
-
DeveloperError : column must be 0, 1, 2, or 3.
Example:
const myMatrix = new Cesium.Matrix4();
const column1Row0Index = Cesium.Matrix4.getElementIndex(1, 0);
const column1Row0 = myMatrix[column1Row0Index];
myMatrix[column1Row0Index] = 10.0;
static Cesium.Matrix4.getMatrix3(matrix, result) → Matrix3
获取所提供矩阵的左上方 3x3 矩阵.
| Name | Type | Description |
|---|---|---|
matrix |
Matrix4 | 要使用的矩阵 . |
result |
Matrix3 | 存储结果的对象 . |
Returns:
修改的结果参数 .
Example:
// returns a Matrix3 instance from a Matrix4 instance
// m = [10.0, 14.0, 18.0, 22.0]
// [11.0, 15.0, 19.0, 23.0]
// [12.0, 16.0, 20.0, 24.0]
// [13.0, 17.0, 21.0, 25.0]
const b = new Cesium.Matrix3();
Cesium.Matrix4.getMatrix3(m,b);
// b = [10.0, 14.0, 18.0]
// [11.0, 15.0, 19.0]
// [12.0, 16.0, 20.0]
计算最大尺度,假设矩阵是affine转换.
最大尺度是左上角的列向量的最大长度
3x3 matrix.
| Name | Type | Description |
|---|---|---|
matrix |
Matrix4 | The matrix. |
Returns:
最大范围.
static Cesium.Matrix4.getRotation(matrix, result) → Matrix3
提取旋转矩阵,假设矩阵是近缘变换.
| Name | Type | Description |
|---|---|---|
matrix |
Matrix4 | The matrix. |
result |
Matrix3 | 存储结果的对象 . |
Returns:
修改的结果参数 .
static Cesium.Matrix4.getRow(matrix, index, result) → Cartesian4
Retrieves a copy of the matrix row at the provided index as a Cartesian4 instance.
| Name | Type | Description |
|---|---|---|
matrix |
Matrix4 | 要使用的矩阵 . |
index |
number | 要检索的行零基索引 . |
result |
Cartesian4 | 存储结果的对象 . |
Returns:
修改的结果参数 .
Throws:
-
DeveloperError : index must be 0, 1, 2, or 3.
Examples:
//returns a Cartesian4 instance with values from the specified column
// m = [10.0, 11.0, 12.0, 13.0]
// [14.0, 15.0, 16.0, 17.0]
// [18.0, 19.0, 20.0, 21.0]
// [22.0, 23.0, 24.0, 25.0]
//Example 1: Returns an instance of Cartesian
const a = Cesium.Matrix4.getRow(m, 2, new Cesium.Cartesian4());
//Example 2: Sets values for a Cartesian instance
const a = new Cesium.Cartesian4();
Cesium.Matrix4.getRow(m, 2, a);
// a.x = 18.0; a.y = 19.0; a.z = 20.0; a.w = 21.0;
static Cesium.Matrix4.getScale(matrix, result) → Cartesian3
提取非统一比例表,假设矩阵是亲和转换.
| Name | Type | Description |
|---|---|---|
matrix |
Matrix4 | The matrix. |
result |
Cartesian3 | 存储结果的对象 . |
Returns:
修改的结果参数
static Cesium.Matrix4.getTranslation(matrix, result) → Cartesian3
获得所提供矩阵的翻译部分,假设矩阵是一个亲和变换矩阵.
| Name | Type | Description |
|---|---|---|
matrix |
Matrix4 | 要使用的矩阵 . |
result |
Cartesian3 | 存储结果的对象 . |
Returns:
修改的结果参数 .
static Cesium.Matrix4.inverse(matrix, result) → Matrix4
使用 Cramers 规则计算提供的矩阵的反向.
如果决定因素为零,则矩阵不能倒置,并抛出例外.
如果矩阵是适当的刚性转换,则效率更高
to invert it with
Matrix4.inverseTransformation.
| Name | Type | Description |
|---|---|---|
matrix |
Matrix4 | 矩阵为反转. |
result |
Matrix4 | 存储结果的对象 . |
Returns:
修改的结果参数 .
Throws:
-
RuntimeError : matrix is not invertible because its determinate is zero.
static Cesium.Matrix4.inverseTransformation(matrix, result) → Matrix4
计算所提供矩阵的反向,假设它是适当的僵硬矩阵,
其中左上方的3x3元素是一个旋转矩阵,
而第四列中的上三元素是译本.
下行假定为[0,0,0,1].
矩阵未经核实为正确形式.
这种方法比计算一个普通的4x4的反向更快
matrix using
Matrix4.inverse.
| Name | Type | Description |
|---|---|---|
matrix |
Matrix4 | 矩阵为反转. |
result |
Matrix4 | 存储结果的对象 . |
Returns:
修改的结果参数 .
static Cesium.Matrix4.inverseTranspose(matrix, result) → Matrix4
计算矩阵的反转式.
| Name | Type | Description |
|---|---|---|
matrix |
Matrix4 | 要转换和反转的矩阵 . |
result |
Matrix4 | 存储结果的对象 . |
Returns:
修改的结果参数 .
static Cesium.Matrix4.multiply(left, right, result) → Matrix4
计算两个矩阵的产物.
| Name | Type | Description |
|---|---|---|
left |
Matrix4 | 第一个矩阵. |
right |
Matrix4 | 第二矩阵. |
result |
Matrix4 | 存储结果的对象 . |
Returns:
修改的结果参数 .
static Cesium.Matrix4.multiplyByMatrix3(matrix, rotation, result) → Matrix4
Multiplies a transformation matrix (with a bottom row of
[0.0, 0.0, 0.0, 1.0])
3x3旋转矩阵。 这是一个优化
for Matrix4.multiply(m, Matrix4.fromRotationTranslation(rotation), m); with less allocations and arithmetic operations.
| Name | Type | Description |
|---|---|---|
matrix |
Matrix4 | 左侧的矩阵. |
rotation |
Matrix3 | 右侧的3x3旋转矩阵. |
result |
Matrix4 | 存储结果的对象 . |
Returns:
修改的结果参数 .
Example:
// Instead of Cesium.Matrix4.multiply(m, Cesium.Matrix4.fromRotationTranslation(rotation), m);
Cesium.Matrix4.multiplyByMatrix3(m, rotation, m);
static Cesium.Matrix4.multiplyByPoint(matrix, cartesian, result) → Cartesian3
Computes the product of a matrix and a
Cartesian3. This is equivalent to calling Matrix4.multiplyByVector
with a Cartesian4 with a w component of 1, but returns a Cartesian3 instead of a Cartesian4.
| Name | Type | Description |
|---|---|---|
matrix |
Matrix4 | The matrix. |
cartesian |
Cartesian3 | The point. |
result |
Cartesian3 | 存储结果的对象 . |
Returns:
修改的结果参数 .
Example:
const p = new Cesium.Cartesian3(1.0, 2.0, 3.0);
const result = Cesium.Matrix4.multiplyByPoint(matrix, p, new Cesium.Cartesian3());
static Cesium.Matrix4.multiplyByPointAsVector(matrix, cartesian, result) → Cartesian3
Computes the product of a matrix and a
Cartesian3. This is equivalent to calling Matrix4.multiplyByVector
with a Cartesian4 with a w component of zero.
| Name | Type | Description |
|---|---|---|
matrix |
Matrix4 | The matrix. |
cartesian |
Cartesian3 | The point. |
result |
Cartesian3 | 存储结果的对象 . |
Returns:
修改的结果参数 .
Example:
const p = new Cesium.Cartesian3(1.0, 2.0, 3.0);
const result = Cesium.Matrix4.multiplyByPointAsVector(matrix, p, new Cesium.Cartesian3());
// A shortcut for
// Cartesian3 p = ...
// Cesium.Matrix4.multiplyByVector(matrix, new Cesium.Cartesian4(p.x, p.y, p.z, 0.0), result);
static Cesium.Matrix4.multiplyByScalar(matrix, scalar, result) → Matrix4
计算矩阵和标尺的产物.
| Name | Type | Description |
|---|---|---|
matrix |
Matrix4 | The matrix. |
scalar |
number | 要乘之数. |
result |
Matrix4 | 存储结果的对象 . |
Returns:
修改的结果参数 .
Example:
//create a Matrix4 instance which is a scaled version of the supplied Matrix4
// m = [10.0, 11.0, 12.0, 13.0]
// [14.0, 15.0, 16.0, 17.0]
// [18.0, 19.0, 20.0, 21.0]
// [22.0, 23.0, 24.0, 25.0]
const a = Cesium.Matrix4.multiplyByScalar(m, -2, new Cesium.Matrix4());
// m remains the same
// a = [-20.0, -22.0, -24.0, -26.0]
// [-28.0, -30.0, -32.0, -34.0]
// [-36.0, -38.0, -40.0, -42.0]
// [-44.0, -46.0, -48.0, -50.0]
static Cesium.Matrix4.multiplyByScale(matrix, scale, result) → Matrix4
Multiplies an affine transformation matrix (with a bottom row of
[0.0, 0.0, 0.0, 1.0])
以隐含的非统一比额表矩阵。 这是一个优化
for Matrix4.multiply(m, Matrix4.fromUniformScale(scale), m);, where
m 必须是一个亲和矩阵.
此功能执行的配置和算术操作较少.
| Name | Type | Description |
|---|---|---|
matrix |
Matrix4 | 左侧的芳香基质. |
scale |
Cartesian3 | 右侧非统一尺度. |
result |
Matrix4 | 存储结果的对象 . |
Returns:
修改的结果参数 .
Example:
// Instead of Cesium.Matrix4.multiply(m, Cesium.Matrix4.fromScale(scale), m);
Cesium.Matrix4.multiplyByScale(m, scale, m);
See:
static Cesium.Matrix4.multiplyByTranslation(matrix, translation, result) → Matrix4
Multiplies a transformation matrix (with a bottom row of
[0.0, 0.0, 0.0, 1.0])
by an implicit translation matrix defined by a Cartesian3. This is an optimization
for Matrix4.multiply(m, Matrix4.fromTranslation(position), m); with less allocations and arithmetic operations.
| Name | Type | Description |
|---|---|---|
matrix |
Matrix4 | 左侧的矩阵. |
translation |
Cartesian3 | 右侧翻译. |
result |
Matrix4 | 存储结果的对象 . |
Returns:
修改的结果参数 .
Example:
// Instead of Cesium.Matrix4.multiply(m, Cesium.Matrix4.fromTranslation(position), m);
Cesium.Matrix4.multiplyByTranslation(m, position, m);
static Cesium.Matrix4.multiplyByUniformScale(matrix, scale, result) → Matrix4
计算矩阵乘以统一尺度的产物,仿佛尺度是尺度矩阵.
| Name | Type | Description |
|---|---|---|
matrix |
Matrix4 | 左侧的矩阵. |
scale |
number | 右侧的统一尺尺. |
result |
Matrix4 | 存储结果的对象 . |
Returns:
修改的结果参数 .
Example:
// Instead of Cesium.Matrix4.multiply(m, Cesium.Matrix4.fromUniformScale(scale), m);
Cesium.Matrix4.multiplyByUniformScale(m, scale, m);
See:
static Cesium.Matrix4.multiplyByVector(matrix, cartesian, result) → Cartesian4
计算矩阵和柱向量的产物.
| Name | Type | Description |
|---|---|---|
matrix |
Matrix4 | The matrix. |
cartesian |
Cartesian4 | The vector. |
result |
Cartesian4 | 存储结果的对象 . |
Returns:
修改的结果参数 .
static Cesium.Matrix4.multiplyTransformation(left, right, result) → Matrix4
计算两个矩阵的产物 假设矩阵是亲缘变换矩阵,
其中左上方的3x3元素是任何矩阵,以及
第四栏的上三元素是翻译.
下行假定为[0,0,0,1].
矩阵未经核实为正确形式.
这种方法比计算一般4x4产品更快
matrices using
Matrix4.multiply.
| Name | Type | Description |
|---|---|---|
left |
Matrix4 | 第一个矩阵. |
right |
Matrix4 | 第二矩阵. |
result |
Matrix4 | 存储结果的对象 . |
Returns:
修改的结果参数 .
Example:
const m1 = new Cesium.Matrix4(1.0, 6.0, 7.0, 0.0, 2.0, 5.0, 8.0, 0.0, 3.0, 4.0, 9.0, 0.0, 0.0, 0.0, 0.0, 1.0);
const m2 = Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3(1.0, 1.0, 1.0));
const m3 = Cesium.Matrix4.multiplyTransformation(m1, m2, new Cesium.Matrix4());
static Cesium.Matrix4.negate(matrix, result) → Matrix4
计算所提供矩阵的否定副本.
| Name | Type | Description |
|---|---|---|
matrix |
Matrix4 | 否定的矩阵. |
result |
Matrix4 | 存储结果的对象 . |
Returns:
修改的结果参数 .
Example:
//create a new Matrix4 instance which is a negation of a Matrix4
// m = [10.0, 11.0, 12.0, 13.0]
// [14.0, 15.0, 16.0, 17.0]
// [18.0, 19.0, 20.0, 21.0]
// [22.0, 23.0, 24.0, 25.0]
const a = Cesium.Matrix4.negate(m, new Cesium.Matrix4());
// m remains the same
// a = [-10.0, -11.0, -12.0, -13.0]
// [-14.0, -15.0, -16.0, -17.0]
// [-18.0, -19.0, -20.0, -21.0]
// [-22.0, -23.0, -24.0, -25.0]
将所提供的实例存储到所提供的数组中.
| Name | Type | Default | Description |
|---|---|---|---|
value |
Matrix4 | 包装的价值. | |
array |
Array.<number> | 装入的阵列. | |
startingIndex |
number |
0
|
optional The index into the array at which to start packing the elements. |
Returns:
装入的阵列
将矩阵4的阵列平整成组件阵列。 构成部分
以列主要顺序存储.
| Name | Type | Description |
|---|---|---|
array |
Array.<Matrix4> | 要打包的矩阵阵列 . |
result |
Array.<number> |
optional
The array onto which to store the result. If this is a typed array, it must have array.length * 16 components, else a DeveloperError will be thrown. If it is a regular array, it will be resized to have (array.length * 16) elements. |
Returns:
装填的阵列.
static Cesium.Matrix4.setColumn(matrix, index, cartesian, result) → Matrix4
计算一个新的矩阵,用所提供的 NT 0 例取代所提供的矩阵中指定的列.
| Name | Type | Description |
|---|---|---|
matrix |
Matrix4 | 要使用的矩阵 . |
index |
number | 要设置的列的零基索引 . |
cartesian |
Cartesian4 | 指定的列将指定其值的笛卡尔 . |
result |
Matrix4 | 存储结果的对象 . |
Returns:
修改的结果参数 .
Throws:
-
DeveloperError : index must be 0, 1, 2, or 3.
Example:
//creates a new Matrix4 instance with new column values from the Cartesian4 instance
// m = [10.0, 11.0, 12.0, 13.0]
// [14.0, 15.0, 16.0, 17.0]
// [18.0, 19.0, 20.0, 21.0]
// [22.0, 23.0, 24.0, 25.0]
const a = Cesium.Matrix4.setColumn(m, 2, new Cesium.Cartesian4(99.0, 98.0, 97.0, 96.0), new Cesium.Matrix4());
// m remains the same
// a = [10.0, 11.0, 99.0, 13.0]
// [14.0, 15.0, 98.0, 17.0]
// [18.0, 19.0, 97.0, 21.0]
// [22.0, 23.0, 96.0, 25.0]
static Cesium.Matrix4.setRotation(matrix, rotation, result) → Matrix4
设定旋转假设矩阵是affine 转换.
| Name | Type | Description |
|---|---|---|
matrix |
Matrix4 | The matrix. |
rotation |
Matrix3 | 旋转矩阵. |
result |
Matrix4 | 存储结果的对象 . |
Returns:
修改的结果参数 .
static Cesium.Matrix4.setRow(matrix, index, cartesian, result) → Matrix4
Computes a new matrix that replaces the specified row in the provided matrix with the provided Cartesian4 instance.
| Name | Type | Description |
|---|---|---|
matrix |
Matrix4 | 要使用的矩阵 . |
index |
number | 要设置的行零基索引 . |
cartesian |
Cartesian4 | 指定行将分配其值的笛卡尔 . |
result |
Matrix4 | 存储结果的对象 . |
Returns:
修改的结果参数 .
Throws:
-
DeveloperError : index must be 0, 1, 2, or 3.
Example:
//create a new Matrix4 instance with new row values from the Cartesian4 instance
// m = [10.0, 11.0, 12.0, 13.0]
// [14.0, 15.0, 16.0, 17.0]
// [18.0, 19.0, 20.0, 21.0]
// [22.0, 23.0, 24.0, 25.0]
const a = Cesium.Matrix4.setRow(m, 2, new Cesium.Cartesian4(99.0, 98.0, 97.0, 96.0), new Cesium.Matrix4());
// m remains the same
// a = [10.0, 11.0, 12.0, 13.0]
// [14.0, 15.0, 16.0, 17.0]
// [99.0, 98.0, 97.0, 96.0]
// [22.0, 23.0, 24.0, 25.0]
static Cesium.Matrix4.setScale(matrix, scale, result) → Matrix4
计算新的矩阵,用提供的尺度取代比例表.
这假设矩阵是一种亲缘转变.
| Name | Type | Description |
|---|---|---|
matrix |
Matrix4 | 要使用的矩阵 . |
scale |
Cartesian3 | 替换所提供矩阵的尺度. |
result |
Matrix4 | 存储结果的对象 . |
Returns:
修改的结果参数 .
static Cesium.Matrix4.setTranslation(matrix, translation, result) → Matrix4
计算新矩阵, 替换所提供文本中最右栏的翻译
提供翻译的矩阵。 这假设矩阵是一种亲缘转变.
| Name | Type | Description |
|---|---|---|
matrix |
Matrix4 | 要使用的矩阵 . |
translation |
Cartesian3 | 替换所提供矩阵的翻译. |
result |
Matrix4 | 存储结果的对象 . |
Returns:
修改的结果参数 .
static Cesium.Matrix4.setUniformScale(matrix, scale, result) → Matrix4
计算新的矩阵,用所提供的统一尺度来取代比例表.
这假设矩阵是一种亲缘转变.
| Name | Type | Description |
|---|---|---|
matrix |
Matrix4 | 要使用的矩阵 . |
scale |
number | 用来取代所提供矩阵比例的统一比例表. |
result |
Matrix4 | 存储结果的对象 . |
Returns:
修改的结果参数 .
static Cesium.Matrix4.subtract(left, right, result) → Matrix4
计算两个矩阵的差异.
| Name | Type | Description |
|---|---|---|
left |
Matrix4 | 第一个矩阵. |
right |
Matrix4 | 第二矩阵. |
result |
Matrix4 | 存储结果的对象 . |
Returns:
修改的结果参数 .
Computes an Array from the provided Matrix4 instance.
阵列将按列主序排列.
| Name | Type | Description |
|---|---|---|
matrix |
Matrix4 | 要使用的矩阵... |
result |
Array.<number> | optional 存储结果的矩阵 . |
Returns:
未提供修改的矩阵参数或新的矩阵实例 .
Example:
//create an array from an instance of Matrix4
// m = [10.0, 14.0, 18.0, 22.0]
// [11.0, 15.0, 19.0, 23.0]
// [12.0, 16.0, 20.0, 24.0]
// [13.0, 17.0, 21.0, 25.0]
const a = Cesium.Matrix4.toArray(m);
// m remains the same
//creates a = [10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0]
static Cesium.Matrix4.transpose(matrix, result) → Matrix4
计算所提供矩阵的转写.
| Name | Type | Description |
|---|---|---|
matrix |
Matrix4 | 变换矩阵 . |
result |
Matrix4 | 存储结果的对象 . |
Returns:
修改的结果参数 .
Example:
//returns transpose of a Matrix4
// m = [10.0, 11.0, 12.0, 13.0]
// [14.0, 15.0, 16.0, 17.0]
// [18.0, 19.0, 20.0, 21.0]
// [22.0, 23.0, 24.0, 25.0]
const a = Cesium.Matrix4.transpose(m, new Cesium.Matrix4());
// m remains the same
// a = [10.0, 14.0, 18.0, 22.0]
// [11.0, 15.0, 19.0, 23.0]
// [12.0, 16.0, 20.0, 24.0]
// [13.0, 17.0, 21.0, 25.0]
static Cesium.Matrix4.unpack(array, startingIndex, result) → Matrix4
从组合的数组中获取实例 .
| Name | Type | Default | Description |
|---|---|---|---|
array |
Array.<number> | 装填的阵列. | |
startingIndex |
number |
0
|
optional The starting index of the element to be unpacked. |
result |
Matrix4 | optional 存储结果的对象. |
Returns:
未提供修改的结果参数或新的 NT% 0 实例 .
static Cesium.Matrix4.unpackArray(array, result) → Array.<Matrix4>
将一组列主要矩阵组件解析成一组矩阵4.
| Name | Type | Description |
|---|---|---|
array |
Array.<number> | 要解开的组件阵列 . |
result |
Array.<Matrix4> | optional 存储结果的数组 . |
Returns:
无包装的阵列.