注意
该类在 Qt4.6 引入
PySide.QtGui.QVector4D class represents a vector or vertex in 4D space.
PySide.QtGui.QVector4D class can also be used to represent vertices in 4D space. We therefore do not need to provide a separate vertex class.
注意
By design values in the PySide.QtGui.QVector4D instance are stored as float . This means that on platforms where the qreal arguments to PySide.QtGui.QVector4D functions are represented by double values, it is possible to lose precision.
| 参数: |
|
|---|
Constructs a null vector, i.e. with coordinates (0, 0, 0, 0).
Constructs a vector with x and y coordinates from a 2D point , and z and w coordinates of 0.
Constructs a vector with x and y coordinates from a 2D point , and z and w coordinates of 0.
构造 4D 向量从指定 2D vector . The z and w coordinates are set to zero.
构造 4D 向量从指定 2D vector . The z and w coordinates are set to zpos and wpos 分别。
构造 4D 向量从指定 3D vector . The w coordinate is set to zero.
构造 4D 向量从指定 3D vector . The w coordinate is set to wpos .
构造向量采用坐标 ( xpos , ypos , zpos , wpos ).
| 返回类型: | PyObject |
|---|
| 返回类型: | PyObject |
|---|
| 参数: |
|
|---|---|
| 返回类型: |
PySide.QtCore.qreal |
Returns the dot product of v1 and v2 .
| 返回类型: | PySide.QtCore.bool |
|---|
Returns true if the x, y, z, and w coordinates are set to 0.0, otherwise returns false.
| 返回类型: | PySide.QtCore.qreal |
|---|
从原点返回向量长度。
| 返回类型: | PySide.QtCore.qreal |
|---|
Returns the squared length of the vector from the origin. This is equivalent to the dot product of the vector with itself.
Normalizes the currect vector in place. Nothing happens if this vector is a null vector or the length of the vector is very close to 1.
| 返回类型: | PySide.QtGui.QVector4D |
|---|
Returns the normalized unit vector form of this vector.
If this vector is null, then a null vector is returned. If the length of the vector is very close to 1, then the vector will be returned as-is. Otherwise the normalized form of the vector of length 1 will be returned.
| 参数: | v2 – PySide.QtGui.QVector4D |
|---|---|
| 返回类型: | PySide.QtCore.bool |
| 参数: | factor – PySide.QtCore.qreal |
|---|---|
| 返回类型: | PySide.QtGui.QVector4D |
| 参数: | factor – PySide.QtCore.qreal |
|---|---|
| 返回类型: | PySide.QtGui.QVector4D |
| 参数: | matrix – PySide.QtGui.QMatrix4x4 |
|---|---|
| 返回类型: | PySide.QtGui.QVector4D |
| 参数: | matrix – PySide.QtGui.QMatrix4x4 |
|---|---|
| 返回类型: | PySide.QtGui.QVector4D |
| 参数: | v2 – PySide.QtGui.QVector4D |
|---|---|
| 返回类型: | PySide.QtGui.QVector4D |
| 参数: | factor – PySide.QtCore.qreal |
|---|---|
| 返回类型: | PySide.QtGui.QVector4D |
Multiplies this vector's coordinates by the given factor , and returns a reference to this vector.
另请参阅
PySide.QtGui.QVector4D.operator/=()
| 参数: | vector – PySide.QtGui.QVector4D |
|---|---|
| 返回类型: | PySide.QtGui.QVector4D |
Multiplies the components of this vector by the corresponding components in vector .
| 参数: | v2 – PySide.QtGui.QVector4D |
|---|---|
| 返回类型: | PySide.QtGui.QVector4D |
| 参数: | vector – PySide.QtGui.QVector4D |
|---|---|
| 返回类型: | PySide.QtGui.QVector4D |
添加给定 vector to this vector and returns a reference to this vector.
另请参阅
PySide.QtGui.QVector4D.operator-=()
| 参数: | v2 – PySide.QtGui.QVector4D |
|---|---|
| 返回类型: | PySide.QtGui.QVector4D |
| 返回类型: | PySide.QtGui.QVector4D |
|---|
| 参数: | vector – PySide.QtGui.QVector4D |
|---|---|
| 返回类型: | PySide.QtGui.QVector4D |
Subtracts the given vector from this vector and returns a reference to this vector.
另请参阅
PySide.QtGui.QVector4D.operator+=()
| 参数: | divisor – PySide.QtCore.qreal |
|---|---|
| 返回类型: | PySide.QtGui.QVector4D |
| 参数: | divisor – PySide.QtCore.qreal |
|---|---|
| 返回类型: | PySide.QtGui.QVector4D |
Divides this vector's coordinates by the given divisor , and returns a reference to this vector.
另请参阅
PySide.QtGui.QVector4D.operator*=()
| 参数: | v2 – PySide.QtGui.QVector4D |
|---|---|
| 返回类型: | PySide.QtCore.bool |
| 参数: | w – PySide.QtCore.qreal |
|---|
Sets the w coordinate of this point to the given w 坐标。
| 参数: | x – PySide.QtCore.qreal |
|---|
Sets the x coordinate of this point to the given x 坐标。
| 参数: | y – PySide.QtCore.qreal |
|---|
Sets the y coordinate of this point to the given y 坐标。
| 参数: | z – PySide.QtCore.qreal |
|---|
Sets the z coordinate of this point to the given z 坐标。
| 返回类型: | PySide.QtCore.QPoint |
|---|
返回 PySide.QtCore.QPoint form of this 4D vector. The z and w coordinates are dropped.
| 返回类型: | PySide.QtCore.QPointF |
|---|
返回 PySide.QtCore.QPointF form of this 4D vector. The z and w coordinates are dropped.
| 返回类型: | PyObject |
|---|
| 返回类型: | PySide.QtGui.QVector2D |
|---|
Returns the 2D vector form of this 4D vector, dropping the z and w coordinates.
| 返回类型: | PySide.QtGui.QVector2D |
|---|
Returns the 2D vector form of this 4D vector, dividing the x and y coordinates by the w coordinate and dropping the z coordinate. Returns a null vector if w is zero.
| 返回类型: | PySide.QtGui.QVector3D |
|---|
Returns the 3D vector form of this 4D vector, dropping the w coordinate.
| 返回类型: | PySide.QtGui.QVector3D |
|---|
Returns the 3D vector form of this 4D vector, dividing the x, y, and z coordinates by the w coordinate. Returns a null vector if w is zero.
| 返回类型: | PySide.QtCore.qreal |
|---|
返回此点的 w 坐标。
| 返回类型: | PySide.QtCore.qreal |
|---|
返回此点的 x 坐标。
| 返回类型: | PySide.QtCore.qreal |
|---|
返回此点的 y 坐标。
| 返回类型: | PySide.QtCore.qreal |
|---|
返回此点的 z 坐标。