QVector3D 类表示 3D 空间中的向量或顶点。 更多...
This class can be pickled.
The QVector3D class represents a vector or vertex in 3D space.
Vectors are one of the main building blocks of 3D representation and drawing. They consist of three coordinates, traditionally called x, y, and z.
The QVector3D class can also be used to represent vertices in 3D space. We therefore do not need to provide a separate vertex 类。
注意: By design values in the QVector3D instance are stored as float . This means that on platforms where the qreal arguments to QVector3D functions are represented by double values, it is possible to lose precision.
构造 null 向量,即:采用坐标 (0, 0, 0)。
构造向量采用坐标 ( xpos , ypos , zpos ).
Constructs a vector with x and y coordinates from a 2D point , and a z coordinate of 0.
Constructs a vector with x and y coordinates from a 2D point , and a z coordinate of 0.
构造 3D 向量从指定 2D vector 。 z coordinate is set to zero.
另请参阅 toVector2D ().
构造 3D 向量从指定 2D vector 。 z coordinate is set to zpos .
另请参阅 toVector2D ().
构造 3D 向量从指定 4D vector 。 w coordinate is dropped.
另请参阅 toVector4D ().
Returns the cross-product of vectors v1 and v2 , which corresponds to the normal vector of a plane defined by v1 and v2 .
另请参阅 normal ().
Returns the distance that this vertex is from a line defined by point and the unit vector direction .
若 direction is a null vector, then it does not define a line. In that case, the distance from point to this vertex 被返回。
另请参阅 distanceToPlane ().
Returns the distance from this vertex to a plane defined by the vertex plane 和 normal unit vector. The normal parameter is assumed to have been normalized to a unit vector.
The return value will be negative if the vertex is below the plane, or zero if it is on the plane.
另请参阅 normal () 和 distanceToLine ().
这是重载函数。
Returns the distance from this vertex a plane defined by the vertices plane1 , plane2 and plane3 .
The return value will be negative if the vertex is below the plane, or zero if it is on the plane.
The two vectors that define the plane are plane2 - plane1 and plane3 - plane1 .
另请参阅 normal () 和 distanceToLine ().
Returns the dot product of v1 and v2 .
Returns true if the x, y, and z coordinates are set to 0.0, otherwise returns false.
从原点返回向量长度。
另请参阅 lengthSquared () 和 normalized ().
Returns the squared length of the vector from the origin. This is equivalent to the dot product of the vector with itself.
另请参阅 length () 和 dotProduct ().
Returns the normal vector of a plane defined by vectors v1 and v2 , normalized to be a unit vector.
使用 crossProduct () 到 compute the cross-product of v1 and v2 if you do not need the result to be normalized to a unit vector.
另请参阅 crossProduct () 和 distanceToPlane ().
这是重载函数。
Returns the normal vector of a plane defined by vectors v2 - v1 and v3 - v1 , normalized to be a unit vector.
使用 crossProduct () 到 compute the cross-product of v2 - v1 and v3 - v1 if you do not need the result to be normalized to a unit vector.
另请参阅 crossProduct () 和 distanceToPlane ().
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.
另请参阅 length () 和 normalized ().
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.
另请参阅 length () 和 normalize ().
Sets the x coordinate of this point to the given x 坐标。
Sets the y coordinate of this point to the given y 坐标。
Sets the z coordinate of this point to the given z 坐标。
返回 QPoint form of this 3D vector. The z coordinate is dropped.
另请参阅 toPointF () and toVector2D ().
返回 QPointF form of this 3D vector. The z coordinate is dropped.
另请参阅 toPoint () and toVector2D ().
Returns the 2D vector form of this 3D vector, dropping the z 坐标。
另请参阅 toVector4D () 和 toPoint ().
Returns the 4D form of this 3D vector, with the w coordinate set to zero.
另请参阅 toVector2D () 和 toPoint ().
返回此点的 x 坐标。
返回此点的 y 坐标。
返回此点的 z 坐标。