Transform QML Type
用于对网格执行变换。更多
Import Statement: | import Qt3D.Core 2.9 |
In C++: | QTransform |
Inherits: | |
Status: | Deprecated |
属性
- matrix : matrix4x4
- rotation : quaternion
- rotationX : real
- rotationY : real
- rotationZ : real
- scale : real
- scale3D : vector3d
- translation : vector3d
方法
- quaternion fromAxesAndAngles(vector3d axis1, real angle1, vector3d axis2, real angle2)
- quaternion fromAxesAndAngles(vector3d axis1, real angle1, vector3d axis2, real angle2, vector3d axis3, real angle3)
- quaternion fromAxisAndAngle(vector3d axis, real angle)
- quaternion fromAxisAndAngle(real x, real y, real z, real angle)
- quaternion fromEulerAngles(vector3d eulerAngles)
- quaternion fromEulerAngles(real pitch, real yaw, real roll)
- matrix4x4 rotateAround(vector3d point, real angle, vector3d axis)
详细说明
变换组件不可在多个实体之间共享。变换以向量 3d 缩放、四元数旋转和向量 3d 平移组件的形式保存。这些变换按顺序应用于网格。当Transform::matrix 属性被设置时,它将被分解为这些变换分量,并发出相应的变换信号。
我们提供了多个辅助函数来设置变换:fromAxisAndAngle 和fromAxesAndAngles 可用于设置绕特定轴的旋转,fromEulerAngles 可用于设置基于欧拉角的旋转,rotateAround 可用于设置对象绕相对于本地原点的特定点的旋转。
属性文档
matrix : matrix4x4 |
保存变换的矩阵 4x4。
注: 设置矩阵属性后,矩阵将分解为平移、旋转和缩放三个分量。
rotation : quaternion |
以四元数形式保存变换的旋转。
rotationX : real |
以欧拉角形式保存变换的 x 轴旋转。
rotationY : real |
以欧拉角形式保存变换的 Y 轴旋转。
rotationZ : real |
以欧拉角形式保存变换的 z 旋转角度。
scale3D : vector3d |
以向量 3d 的形式保存变换的比例。
translation : vector3d |
以向量 3d 的形式保存变换的平移值。
方法文档
quaternion fromAxesAndAngles(vector3d axis1, real angle1, vector3d axis2, real angle2) |
从axis1,angle1,axis2, 和angle2 创建一个四元数。返回生成的四元数。
从axis1,angle1,axis2,angle2,axis3, 和angle3 创建一个四元数。返回生成的四元数。
quaternion fromAxisAndAngle(vector3d axis, real angle) |
从axis 和angle 创建一个四元数。返回得到的四元数。
quaternion fromAxisAndAngle(real x, real y, real z, real angle) |
从x,y,z, 和angle 创建一个四元数。返回生成的四元数。
quaternion fromEulerAngles(vector3d eulerAngles) |
从eulerAngles 创建一个四元数。返回得到的四元数。
quaternion fromEulerAngles(real pitch, real yaw, real roll) |
从pitch,yaw, 和roll 创建一个四元数。返回生成的四元数。
从axis 和angle 创建一个相对于本地原点围绕point 的旋转矩阵。返回生成的矩阵 4x4。
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.