C

matrix4x4 QML基本类型

一个4行4列的矩阵。更多信息...

方法

  • matrix4x4 plus(matrix4x4 other)
  • matrix4x4 times(real factor)
  • matrix4x4 times(matrix4x4 other)

matrix4x4类型包含十六个值,在QML中通过m11到m44属性(按行列顺序)访问。此类型值可以用Qt.matrix4x4()函数组合。matrix4x4中的每个属性都存储为实数(单精度)。

该基本类型由QtQuick导入提供。

方法文档

matrix4x4 plus(matrix4x4 other)

返回此matrix4x4与other matrix4x4相加得到的matrix4x4结果

var a = Qt.matrix4x4(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16);
var b = Qt.matrix4x4(5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20);
var c = a.plus(b);
console.log(c.toString());
// Matrix4x4(6, 8, 10, 12, 14, 16, 18, 20, 22,
// 24, 26, 28, 30, 32, 34, 36)

matrix4x4 times(real factor)

返回此matrix4x4与标量factor相乘得到的matrix4x4结果

var a = Qt.matrix4x4(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16);
var b = 4.48;
var c = a.times(b);
console.log(c.toString());
// Matrix4x4(4.48, 8.96, 13.44, 17.92, 22.4, 26.88, 31.36, 35.84,
// 40.32, 44.8, 49.28, 53.76, 58.24, 62.72, 67.2, 71.68)

matrix4x4 times(matrix4x4 other)

返回此matrix4x4与other matrix4x4相乘得到的matrix4x4结果

var a = Qt.matrix4x4(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16);
var b = Qt.matrix4x4(4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19);
var c = a.times(b);
console.log(c.toString());
// Matrix4x4(120, 130, 140, 150, 280, 306, 332, 358, 440, 482,
// 524, 566, 600, 658, 716, 774)

在某些Qt许可下提供。
了解更多信息。