QtCraft API C++ classes QML types Handbook

QcVec3 Struct

Minimal double-precision vector for GUI-free code (QVector3D lives in QtGui). More...

Header: #include <common/core/QcVec3.h>

Public Functions

double dot(const QcVec3 &other) const
double length() const
QcVec3 normalized() const
QcVec3 operator*(double factor) const
QcVec3 operator+(const QcVec3 &other) const
QcVec3 &operator+=(const QcVec3 &other)
QcVec3 operator-(const QcVec3 &other) const

Public Variables

double x
double y
double z

Detailed Description

Member Function Documentation

[constexpr] double QcVec3::dot(const QcVec3 &other) const

Returns the dot product with other.

double QcVec3::length() const

Returns the length.

QcVec3 QcVec3::normalized() const

Returns the vector scaled to length 1; the zero vector stays zero.

[constexpr] QcVec3 QcVec3::operator*(double factor) const

Returns the vector scaled by factor.

[constexpr] QcVec3 QcVec3::operator+(const QcVec3 &other) const

Returns the sum with other.

[constexpr] QcVec3 &QcVec3::operator+=(const QcVec3 &other)

Adds other and returns this vector.

[constexpr] QcVec3 QcVec3::operator-(const QcVec3 &other) const

Returns the difference to other.