Quaternion QML Type
为四元数提供实用功能。更多
Import Statement: | import QtQuick3D |
方法
- 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 x, real y, real z)
- quaternion lookAt(vector3d sourcePosition, vector3d targetPosition, vector3d forwardDirection, vector3d upDirection)
详细说明
Quaternion
是一个具有实用功能的全局对象。
它不可实例化;要使用它,请直接调用Quaternion
全局对象的成员。例如
Node { rotation: Quaternion.fromAxisAndAngle(Qt.vector3d(1, 0, 0), 45) }
方法文档
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 x, real y, real z) |
从x,y, 和z 创建一个四元数。返回生成的四元数。
quaternion lookAt(vector3d sourcePosition, vector3d targetPosition, vector3d forwardDirection, vector3d upDirection) |
从sourcePosition,targetPosition,forwardDirection, 和upDirection 创建一个四元数。用于获取指向特定目标的旋转值,也可用于将摄像机指向场景中的某个位置。
forwardDirection 默认为 默认为Qt.vector3d(0, 0, -1)
upDirection Qt.vector3d(0, 1, 0)
返回得到的四元数。
© 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.