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
QQuickVector4DValueType Class Reference

#include <qquickvaluetypes_p.h>

Inheritance diagram for QQuickVector4DValueType:
Collaboration diagram for QQuickVector4DValueType:

Public Member Functions

Q_INVOKABLE QQuickVector4DValueType ()=default
Q_INVOKABLE QQuickVector4DValueType (const QVector4D &vector4d)
Q_INVOKABLE QString toString () const
qreal x () const
qreal y () const
qreal z () const
qreal w () const
void setX (qreal)
void setY (qreal)
void setZ (qreal)
void setW (qreal)
Q_INVOKABLE qreal dotProduct (const QVector4D &vec) const
Q_INVOKABLE QVector4D times (const QVector4D &vec) const
Q_INVOKABLE QVector4D times (const QMatrix4x4 &m) const
Q_INVOKABLE QVector4D times (qreal scalar) const
Q_INVOKABLE QVector4D plus (const QVector4D &vec) const
Q_INVOKABLE QVector4D minus (const QVector4D &vec) const
Q_INVOKABLE QVector4D normalized () const
Q_INVOKABLE qreal length () const
Q_INVOKABLE QVector2D toVector2d () const
Q_INVOKABLE QVector3D toVector3d () const
Q_INVOKABLE bool fuzzyEquals (const QVector4D &vec, qreal epsilon) const
Q_INVOKABLE bool fuzzyEquals (const QVector4D &vec) const
Public Member Functions inherited from QVector4D
constexpr QVector4D () noexcept
 Constructs a null vector, i.e.
 QVector4D (Qt::Initialization) noexcept
constexpr QVector4D (float xpos, float ypos, float zpos, float wpos) noexcept
 Constructs a vector with coordinates (xpos, ypos, zpos, wpos).
constexpr QVector4D (QPoint point) noexcept
 Constructs a vector with x and y coordinates from a 2D point, and z and w coordinates of 0.
constexpr QVector4D (QPointF point) noexcept
 Constructs a vector with x and y coordinates from a 2D point, and z and w coordinates of 0.
constexpr QVector4D (QVector2D vector) noexcept
 Constructs a 4D vector from the specified 2D vector.
constexpr QVector4D (QVector2D vector, float zpos, float wpos) noexcept
 Constructs a 4D vector from the specified 2D vector.
constexpr QVector4D (QVector3D vector) noexcept
 Constructs a 4D vector from the specified 3D vector.
constexpr QVector4D (QVector3D vector, float wpos) noexcept
 Constructs a 4D vector from the specified 3D vector.
constexpr bool isNull () const noexcept
 Returns true if the x, y, z, and w 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 float w () const noexcept
 Returns the w 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 void setW (float w) noexcept
 Sets the w coordinate of this point to the given finite w 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.
QVector4D normalized () const noexcept
 Returns the normalized unit vector form of this vector.
void normalize () noexcept
 Normalizes the current vector in place.
constexpr QVector4Doperator+= (QVector4D vector) noexcept
 Adds the given vector to this vector and returns a reference to this vector.
constexpr QVector4Doperator-= (QVector4D vector) noexcept
 Subtracts the given vector from this vector and returns a reference to this vector.
constexpr QVector4Doperator*= (float factor) noexcept
 Multiplies this vector's coordinates by the given finite factor, and returns a reference to this vector.
constexpr QVector4Doperator*= (QVector4D vector) noexcept
 Multiplies each component of this vector by the corresponding component of vector and returns a reference to this vector.
constexpr QVector4Doperator/= (float divisor)
 Divides this vector's coordinates by the given divisor, and returns a reference to this vector.
constexpr QVector4Doperator/= (QVector4D vector)
constexpr QVector2D toVector2D () const noexcept
 Returns the 2D vector form of this 4D vector, dropping the z and w coordinates.
constexpr QVector2D toVector2DAffine () const noexcept
 Returns the 2D vector form of this 4D vector, dividing the x and y coordinates by the w coordinate and dropping the z coordinate.
constexpr QVector3D toVector3D () const noexcept
 Returns the 3D vector form of this 4D vector, dropping the w coordinate.
constexpr QVector3D toVector3DAffine () const noexcept
 Returns the 3D vector form of this 4D vector, dividing the x, y, and z coordinates by the w coordinate.
constexpr QPoint toPoint () const noexcept
 Returns the QPoint form of this 4D vector.
constexpr QPointF toPointF () const noexcept
 Returns the QPointF form of this 4D vector.
Q_GUI_EXPORT operator QVariant () const
 Returns the 4D vector as a QVariant.

Static Public Member Functions

static QVariant create (const QJSValue &params)
Static Public Member Functions inherited from QVector4D
static constexpr float dotProduct (QVector4D v1, QVector4D v2) noexcept
 Returns the dot product of v1 and v2.

Properties

qreal x
qreal y
qreal z
qreal w

Additional Inherited Members

Detailed Description

Definition at line 167 of file qquickvaluetypes_p.h.

Constructor & Destructor Documentation

◆ QQuickVector4DValueType() [1/2]

Q_INVOKABLE QQuickVector4DValueType::QQuickVector4DValueType ( )
default

◆ QQuickVector4DValueType() [2/2]

Q_INVOKABLE QQuickVector4DValueType::QQuickVector4DValueType ( const QVector4D & vector4d)
inline

Definition at line 184 of file qquickvaluetypes_p.h.

Member Function Documentation

◆ create()

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

Definition at line 400 of file qquickvaluetypes.cpp.

◆ dotProduct()

qreal QQuickVector4DValueType::dotProduct ( const QVector4D & vec) const

Definition at line 461 of file qquickvaluetypes.cpp.

◆ fuzzyEquals() [1/2]

bool QQuickVector4DValueType::fuzzyEquals ( const QVector4D & vec) const

Definition at line 525 of file qquickvaluetypes.cpp.

◆ fuzzyEquals() [2/2]

bool QQuickVector4DValueType::fuzzyEquals ( const QVector4D & vec,
qreal epsilon ) const

Definition at line 511 of file qquickvaluetypes.cpp.

◆ length()

qreal QQuickVector4DValueType::length ( ) const

Definition at line 496 of file qquickvaluetypes.cpp.

◆ minus()

QVector4D QQuickVector4DValueType::minus ( const QVector4D & vec) const

Definition at line 486 of file qquickvaluetypes.cpp.

◆ normalized()

QVector4D QQuickVector4DValueType::normalized ( ) const

Definition at line 491 of file qquickvaluetypes.cpp.

◆ plus()

QVector4D QQuickVector4DValueType::plus ( const QVector4D & vec) const

Definition at line 481 of file qquickvaluetypes.cpp.

◆ setW()

void QQuickVector4DValueType::setW ( qreal w)

Definition at line 456 of file qquickvaluetypes.cpp.

◆ setX()

void QQuickVector4DValueType::setX ( qreal x)

Definition at line 441 of file qquickvaluetypes.cpp.

◆ setY()

void QQuickVector4DValueType::setY ( qreal y)

Definition at line 446 of file qquickvaluetypes.cpp.

◆ setZ()

void QQuickVector4DValueType::setZ ( qreal z)

Definition at line 451 of file qquickvaluetypes.cpp.

◆ times() [1/3]

QVector4D QQuickVector4DValueType::times ( const QMatrix4x4 & m) const

Definition at line 471 of file qquickvaluetypes.cpp.

◆ times() [2/3]

QVector4D QQuickVector4DValueType::times ( const QVector4D & vec) const

Definition at line 466 of file qquickvaluetypes.cpp.

◆ times() [3/3]

QVector4D QQuickVector4DValueType::times ( qreal scalar) const

Definition at line 476 of file qquickvaluetypes.cpp.

◆ toString()

QString QQuickVector4DValueType::toString ( ) const

Definition at line 415 of file qquickvaluetypes.cpp.

◆ toVector2d()

QVector2D QQuickVector4DValueType::toVector2d ( ) const

Definition at line 501 of file qquickvaluetypes.cpp.

◆ toVector3d()

QVector3D QQuickVector4DValueType::toVector3d ( ) const

Definition at line 506 of file qquickvaluetypes.cpp.

◆ w()

qreal QQuickVector4DValueType::w ( ) const

Definition at line 436 of file qquickvaluetypes.cpp.

◆ x()

qreal QQuickVector4DValueType::x ( ) const

Definition at line 421 of file qquickvaluetypes.cpp.

◆ y()

qreal QQuickVector4DValueType::y ( ) const

Definition at line 426 of file qquickvaluetypes.cpp.

◆ z()

qreal QQuickVector4DValueType::z ( ) const

Definition at line 431 of file qquickvaluetypes.cpp.

Property Documentation

◆ w

qreal QQuickVector4DValueType::w
readwrite

Definition at line 172 of file qquickvaluetypes_p.h.

◆ x

qreal QQuickVector4DValueType::x
readwrite

Definition at line 169 of file qquickvaluetypes_p.h.

◆ y

qreal QQuickVector4DValueType::y
readwrite

Definition at line 170 of file qquickvaluetypes_p.h.

◆ z

qreal QQuickVector4DValueType::z
readwrite

Definition at line 171 of file qquickvaluetypes_p.h.


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