2024-08-25 04:08:24 +00:00
|
|
|
#include <QMatrix4x4>
|
|
|
|
#include <QPoint>
|
|
|
|
#include <QPointF>
|
|
|
|
#include <QRect>
|
|
|
|
#include <QVector2D>
|
|
|
|
#include <QVector3D>
|
|
|
|
#include <QVector4D>
|
2024-10-16 05:07:56 +00:00
|
|
|
#include <qvector3d.h>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include "gen_qvector3d.h"
|
2024-09-14 22:29:05 +00:00
|
|
|
#include "_cgo_export.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
QVector3D* QVector3D_new() {
|
|
|
|
return new QVector3D();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
QVector3D* QVector3D_new2(int param1) {
|
|
|
|
return new QVector3D(static_cast<Qt::Initialization>(param1));
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
QVector3D* QVector3D_new3(float xpos, float ypos, float zpos) {
|
|
|
|
return new QVector3D(static_cast<float>(xpos), static_cast<float>(ypos), static_cast<float>(zpos));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
QVector3D* QVector3D_new4(QPoint* point) {
|
|
|
|
return new QVector3D(*point);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
QVector3D* QVector3D_new5(QPointF* point) {
|
|
|
|
return new QVector3D(*point);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
QVector3D* QVector3D_new6(QVector2D* vector) {
|
|
|
|
return new QVector3D(*vector);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
QVector3D* QVector3D_new7(QVector2D* vector, float zpos) {
|
|
|
|
return new QVector3D(*vector, static_cast<float>(zpos));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
QVector3D* QVector3D_new8(QVector4D* vector) {
|
|
|
|
return new QVector3D(*vector);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
QVector3D* QVector3D_new9(QVector3D* param1) {
|
|
|
|
return new QVector3D(*param1);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QVector3D_IsNull(const QVector3D* self) {
|
|
|
|
return self->isNull();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
float QVector3D_X(const QVector3D* self) {
|
|
|
|
return self->x();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
float QVector3D_Y(const QVector3D* self) {
|
|
|
|
return self->y();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
float QVector3D_Z(const QVector3D* self) {
|
|
|
|
return self->z();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QVector3D_SetX(QVector3D* self, float x) {
|
|
|
|
self->setX(static_cast<float>(x));
|
|
|
|
}
|
|
|
|
|
|
|
|
void QVector3D_SetY(QVector3D* self, float y) {
|
|
|
|
self->setY(static_cast<float>(y));
|
|
|
|
}
|
|
|
|
|
|
|
|
void QVector3D_SetZ(QVector3D* self, float z) {
|
|
|
|
self->setZ(static_cast<float>(z));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
float QVector3D_OperatorSubscript(const QVector3D* self, int i) {
|
|
|
|
return self->operator[](static_cast<int>(i));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
float QVector3D_Length(const QVector3D* self) {
|
|
|
|
return self->length();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
float QVector3D_LengthSquared(const QVector3D* self) {
|
|
|
|
return self->lengthSquared();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QVector3D* QVector3D_Normalized(const QVector3D* self) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QVector3D(self->normalized());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QVector3D_Normalize(QVector3D* self) {
|
|
|
|
self->normalize();
|
|
|
|
}
|
|
|
|
|
|
|
|
QVector3D* QVector3D_OperatorPlusAssign(QVector3D* self, QVector3D* vector) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QVector3D& _ret = self->operator+=(*vector);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Cast returned reference into pointer
|
2024-09-14 22:29:05 +00:00
|
|
|
return &_ret;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QVector3D* QVector3D_OperatorMinusAssign(QVector3D* self, QVector3D* vector) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QVector3D& _ret = self->operator-=(*vector);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Cast returned reference into pointer
|
2024-09-14 22:29:05 +00:00
|
|
|
return &_ret;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QVector3D* QVector3D_OperatorMultiplyAssign(QVector3D* self, float factor) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QVector3D& _ret = self->operator*=(static_cast<float>(factor));
|
2024-08-25 04:08:24 +00:00
|
|
|
// Cast returned reference into pointer
|
2024-09-14 22:29:05 +00:00
|
|
|
return &_ret;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QVector3D* QVector3D_OperatorMultiplyAssignWithVector(QVector3D* self, QVector3D* vector) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QVector3D& _ret = self->operator*=(*vector);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Cast returned reference into pointer
|
2024-09-14 22:29:05 +00:00
|
|
|
return &_ret;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QVector3D* QVector3D_OperatorDivideAssign(QVector3D* self, float divisor) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QVector3D& _ret = self->operator/=(static_cast<float>(divisor));
|
2024-08-25 04:08:24 +00:00
|
|
|
// Cast returned reference into pointer
|
2024-09-14 22:29:05 +00:00
|
|
|
return &_ret;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QVector3D* QVector3D_OperatorDivideAssignWithVector(QVector3D* self, QVector3D* vector) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QVector3D& _ret = self->operator/=(*vector);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Cast returned reference into pointer
|
2024-09-14 22:29:05 +00:00
|
|
|
return &_ret;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
float QVector3D_DotProduct(QVector3D* v1, QVector3D* v2) {
|
|
|
|
return QVector3D::dotProduct(*v1, *v2);
|
|
|
|
}
|
|
|
|
|
|
|
|
QVector3D* QVector3D_CrossProduct(QVector3D* v1, QVector3D* v2) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QVector3D(QVector3D::crossProduct(*v1, *v2));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QVector3D* QVector3D_Normal(QVector3D* v1, QVector3D* v2) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QVector3D(QVector3D::normal(*v1, *v2));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QVector3D* QVector3D_Normal2(QVector3D* v1, QVector3D* v2, QVector3D* v3) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QVector3D(QVector3D::normal(*v1, *v2, *v3));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QVector3D* QVector3D_Project(const QVector3D* self, QMatrix4x4* modelView, QMatrix4x4* projection, QRect* viewport) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QVector3D(self->project(*modelView, *projection, *viewport));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QVector3D* QVector3D_Unproject(const QVector3D* self, QMatrix4x4* modelView, QMatrix4x4* projection, QRect* viewport) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QVector3D(self->unproject(*modelView, *projection, *viewport));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
float QVector3D_DistanceToPoint(const QVector3D* self, QVector3D* point) {
|
|
|
|
return self->distanceToPoint(*point);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
float QVector3D_DistanceToPlane(const QVector3D* self, QVector3D* plane, QVector3D* normal) {
|
|
|
|
return self->distanceToPlane(*plane, *normal);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
float QVector3D_DistanceToPlane2(const QVector3D* self, QVector3D* plane1, QVector3D* plane2, QVector3D* plane3) {
|
|
|
|
return self->distanceToPlane(*plane1, *plane2, *plane3);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
float QVector3D_DistanceToLine(const QVector3D* self, QVector3D* point, QVector3D* direction) {
|
|
|
|
return self->distanceToLine(*point, *direction);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QVector2D* QVector3D_ToVector2D(const QVector3D* self) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QVector2D(self->toVector2D());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QVector4D* QVector3D_ToVector4D(const QVector3D* self) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QVector4D(self->toVector4D());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QPoint* QVector3D_ToPoint(const QVector3D* self) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QPoint(self->toPoint());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QPointF* QVector3D_ToPointF(const QVector3D* self) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QPointF(self->toPointF());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QVector3D_Delete(QVector3D* self, bool isSubclass) {
|
|
|
|
if (isSubclass) {
|
|
|
|
delete dynamic_cast<QVector3D*>( self );
|
|
|
|
} else {
|
|
|
|
delete self;
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|