Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QQuickVector3DValueType Class Reference

#include <qquickvaluetypes_p.h>

Inheritance diagram for QQuickVector3DValueType:
Collaboration diagram for QQuickVector3DValueType:

Public Member Functions

Q_INVOKABLE QQuickVector3DValueType ()=default
Q_INVOKABLE QQuickVector3DValueType (const QVector3D &vector3D)
Q_INVOKABLE QString toString () const
qreal x () const
qreal y () const
qreal z () const
void setX (qreal)
void setY (qreal)
void setZ (qreal)
Q_INVOKABLE QVector3D crossProduct (const QVector3D &vec) const
Q_INVOKABLE qreal dotProduct (const QVector3D &vec) const
Q_INVOKABLE QVector3D times (const QMatrix4x4 &m) const
Q_INVOKABLE QVector3D times (const QVector3D &vec) const
Q_INVOKABLE QVector3D times (qreal scalar) const
Q_INVOKABLE QVector3D plus (const QVector3D &vec) const
Q_INVOKABLE QVector3D minus (const QVector3D &vec) const
Q_INVOKABLE QVector3D normalized () const
Q_INVOKABLE qreal length () const
Q_INVOKABLE QVector2D toVector2d () const
Q_INVOKABLE QVector4D toVector4d () const
Q_INVOKABLE bool fuzzyEquals (const QVector3D &vec, qreal epsilon) const
Q_INVOKABLE bool fuzzyEquals (const QVector3D &vec) const
Public Member Functions inherited from QVector3D
constexpr QVector3D () noexcept
 Constructs a null vector, i.e.
 QVector3D (Qt::Initialization) noexcept
constexpr QVector3D (float xpos, float ypos, float zpos) noexcept
 Constructs a vector with coordinates (xpos, ypos, zpos).
constexpr QVector3D (QPoint point) noexcept
 Constructs a vector with x and y coordinates from a 2D point, and a z coordinate of 0.
constexpr QVector3D (QPointF point) noexcept
 Constructs a vector with x and y coordinates from a 2D point, and a z coordinate of 0.
constexpr QVector3D (QVector2D vector) noexcept
 Constructs a 3D vector from the specified 2D vector.
constexpr QVector3D (QVector2D vector, float zpos) noexcept
 Constructs a 3D vector from the specified 2D vector.
constexpr QVector3D (QVector4D vector) noexcept
 Constructs a 3D vector from the specified 4D vector.
constexpr bool isNull () const noexcept
 Returns true if the x, y, and z coordinates are set to 0.0, otherwise returns false.
constexpr float x () const noexcept
 Returns the x coordinate of this point.
constexpr float y () const noexcept
 Returns the y coordinate of this point.
constexpr float z () const noexcept
 Returns the z coordinate of this point.
constexpr void setX (float x) noexcept
 Sets the x coordinate of this point to the given finite x coordinate.
constexpr void setY (float y) noexcept
 Sets the y coordinate of this point to the given finite y coordinate.
constexpr void setZ (float z) noexcept
 Sets the z coordinate of this point to the given finite z coordinate.
constexpr float & operator[] (int i)
constexpr float operator[] (int i) const
float length () const noexcept
 Returns the length of the vector from the origin.
constexpr float lengthSquared () const noexcept
 Returns the squared length of the vector from the origin.
QVector3D normalized () const noexcept
 Returns the normalized unit vector form of this vector.
void normalize () noexcept
 Normalizes the current vector in place.
constexpr QVector3Doperator+= (QVector3D vector) noexcept
 Adds the given vector to this vector and returns a reference to this vector.
constexpr QVector3Doperator-= (QVector3D vector) noexcept
 Subtracts the given vector from this vector and returns a reference to this vector.
constexpr QVector3Doperator*= (float factor) noexcept
 Multiplies this vector's coordinates by the given finite factor and returns a reference to this vector.
constexpr QVector3Doperator*= (QVector3D vector) noexcept
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Multiplies each component of this vector by the corresponding component in vector and returns a reference to this vector.
constexpr QVector3Doperator/= (float divisor)
 Divides this vector's coordinates by the given divisor, and returns a reference to this vector.
constexpr QVector3Doperator/= (QVector3D vector)
Q_GUI_EXPORT QVector3D project (const QMatrix4x4 &modelView, const QMatrix4x4 &projection, const QRect &viewport) const
Q_GUI_EXPORT QVector3D unproject (const QMatrix4x4 &modelView, const QMatrix4x4 &projection, const QRect &viewport) const
QT_WARNING_POP float distanceToPoint (QVector3D point) const noexcept
constexpr float distanceToPlane (QVector3D plane, QVector3D normal) const noexcept
 Returns the distance from this vertex to a plane defined by the vertex plane and a normal unit vector.
float distanceToPlane (QVector3D plane1, QVector3D plane2, QVector3D plane3) const noexcept
 Returns the distance from this vertex to a plane defined by the vertices plane1, plane2 and plane3.
float distanceToLine (QVector3D point, QVector3D direction) const noexcept
 Returns the distance that this vertex is from a line defined by point and the unit vector direction.
constexpr QVector2D toVector2D () const noexcept
 Returns the 2D vector form of this 3D vector, dropping the z coordinate.
constexpr QVector4D toVector4D () const noexcept
 Returns the 4D form of this 3D vector, with the w coordinate set to zero.
constexpr QPoint toPoint () const noexcept
 Returns the QPoint form of this 3D vector.
constexpr QPointF toPointF () const noexcept
 Returns the QPointF form of this 3D vector.
Q_GUI_EXPORT operator QVariant () const
 Returns the 3D vector as a QVariant.

Static Public Member Functions

static QVariant create (const QJSValue &params)
Static Public Member Functions inherited from QVector3D
static constexpr float dotProduct (QVector3D v1, QVector3D v2) noexcept
 Returns the dot product of v1 and v2.
static constexpr QVector3D crossProduct (QVector3D v1, QVector3D v2) noexcept
 Returns the cross-product of vectors v1 and v2, which is normal to the plane spanned by v1 and v2.
static QVector3D normal (QVector3D v1, QVector3D v2) noexcept
 Returns the unit normal vector of a plane spanned by vectors v1 and v2, which must not be parallel to one another.
static QVector3D normal (QVector3D v1, QVector3D v2, QVector3D v3) noexcept
 Returns the unit normal vector of a plane spanned by vectors v2 - v1 and v3 - v1, which must not be parallel to one another.

Properties

qreal x
qreal y
qreal z

Additional Inherited Members

Detailed Description

Definition at line 126 of file qquickvaluetypes_p.h.

Constructor & Destructor Documentation

◆ QQuickVector3DValueType() [1/2]

Q_INVOKABLE QQuickVector3DValueType::QQuickVector3DValueType ( )
default

◆ QQuickVector3DValueType() [2/2]

Q_INVOKABLE QQuickVector3DValueType::QQuickVector3DValueType ( const QVector3D & vector3D)
inline

Definition at line 142 of file qquickvaluetypes_p.h.

Member Function Documentation

◆ create()

QVariant QQuickVector3DValueType::create ( const QJSValue & params)
static

Definition at line 278 of file qquickvaluetypes.cpp.

◆ crossProduct()

QVector3D QQuickVector3DValueType::crossProduct ( const QVector3D & vec) const

Definition at line 328 of file qquickvaluetypes.cpp.

◆ dotProduct()

qreal QQuickVector3DValueType::dotProduct ( const QVector3D & vec) const

Definition at line 333 of file qquickvaluetypes.cpp.

◆ fuzzyEquals() [1/2]

bool QQuickVector3DValueType::fuzzyEquals ( const QVector3D & vec) const

Definition at line 395 of file qquickvaluetypes.cpp.

◆ fuzzyEquals() [2/2]

bool QQuickVector3DValueType::fuzzyEquals ( const QVector3D & vec,
qreal epsilon ) const

Definition at line 383 of file qquickvaluetypes.cpp.

◆ length()

qreal QQuickVector3DValueType::length ( ) const

Definition at line 368 of file qquickvaluetypes.cpp.

◆ minus()

QVector3D QQuickVector3DValueType::minus ( const QVector3D & vec) const

Definition at line 358 of file qquickvaluetypes.cpp.

◆ normalized()

QVector3D QQuickVector3DValueType::normalized ( ) const

Definition at line 363 of file qquickvaluetypes.cpp.

◆ plus()

QVector3D QQuickVector3DValueType::plus ( const QVector3D & vec) const

Definition at line 353 of file qquickvaluetypes.cpp.

◆ setX()

void QQuickVector3DValueType::setX ( qreal x)

Definition at line 313 of file qquickvaluetypes.cpp.

◆ setY()

void QQuickVector3DValueType::setY ( qreal y)

Definition at line 318 of file qquickvaluetypes.cpp.

◆ setZ()

void QQuickVector3DValueType::setZ ( qreal z)

Definition at line 323 of file qquickvaluetypes.cpp.

◆ times() [1/3]

QVector3D QQuickVector3DValueType::times ( const QMatrix4x4 & m) const

Definition at line 338 of file qquickvaluetypes.cpp.

◆ times() [2/3]

QVector3D QQuickVector3DValueType::times ( const QVector3D & vec) const

Definition at line 343 of file qquickvaluetypes.cpp.

◆ times() [3/3]

QVector3D QQuickVector3DValueType::times ( qreal scalar) const

Definition at line 348 of file qquickvaluetypes.cpp.

◆ toString()

QString QQuickVector3DValueType::toString ( ) const

Definition at line 292 of file qquickvaluetypes.cpp.

◆ toVector2d()

QVector2D QQuickVector3DValueType::toVector2d ( ) const

Definition at line 373 of file qquickvaluetypes.cpp.

◆ toVector4d()

QVector4D QQuickVector3DValueType::toVector4d ( ) const

Definition at line 378 of file qquickvaluetypes.cpp.

◆ x()

qreal QQuickVector3DValueType::x ( ) const

Definition at line 298 of file qquickvaluetypes.cpp.

◆ y()

qreal QQuickVector3DValueType::y ( ) const

Definition at line 303 of file qquickvaluetypes.cpp.

◆ z()

qreal QQuickVector3DValueType::z ( ) const

Definition at line 308 of file qquickvaluetypes.cpp.

Property Documentation

◆ x

qreal QQuickVector3DValueType::x
readwrite

Definition at line 128 of file qquickvaluetypes_p.h.

◆ y

qreal QQuickVector3DValueType::y
readwrite

Definition at line 129 of file qquickvaluetypes_p.h.

◆ z

qreal QQuickVector3DValueType::z
readwrite

Definition at line 130 of file qquickvaluetypes_p.h.


The documentation for this class was generated from the following files: