2024-08-25 04:08:24 +00:00
|
|
|
package qt
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
#include "gen_qvector3d.h"
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
*/
|
|
|
|
import "C"
|
|
|
|
|
|
|
|
import (
|
|
|
|
"runtime"
|
|
|
|
"unsafe"
|
|
|
|
)
|
|
|
|
|
|
|
|
type QVector3D struct {
|
|
|
|
h *C.QVector3D
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QVector3D) cPointer() *C.QVector3D {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
|
|
|
func newQVector3D(h *C.QVector3D) *QVector3D {
|
2024-09-01 02:23:55 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
return &QVector3D{h: h}
|
|
|
|
}
|
|
|
|
|
|
|
|
func newQVector3D_U(h unsafe.Pointer) *QVector3D {
|
|
|
|
return newQVector3D((*C.QVector3D)(h))
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQVector3D constructs a new QVector3D object.
|
|
|
|
func NewQVector3D() *QVector3D {
|
|
|
|
ret := C.QVector3D_new()
|
|
|
|
return newQVector3D(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQVector3D2 constructs a new QVector3D object.
|
2024-09-04 06:54:22 +00:00
|
|
|
func NewQVector3D2(param1 Initialization) *QVector3D {
|
2024-09-18 00:12:02 +00:00
|
|
|
ret := C.QVector3D_new2((C.int)(param1))
|
2024-08-25 04:08:24 +00:00
|
|
|
return newQVector3D(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQVector3D3 constructs a new QVector3D object.
|
2024-08-29 07:01:51 +00:00
|
|
|
func NewQVector3D3(xpos float32, ypos float32, zpos float32) *QVector3D {
|
|
|
|
ret := C.QVector3D_new3((C.float)(xpos), (C.float)(ypos), (C.float)(zpos))
|
2024-08-25 04:08:24 +00:00
|
|
|
return newQVector3D(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQVector3D4 constructs a new QVector3D object.
|
2024-08-29 07:01:51 +00:00
|
|
|
func NewQVector3D4(point *QPoint) *QVector3D {
|
2024-08-25 04:08:24 +00:00
|
|
|
ret := C.QVector3D_new4(point.cPointer())
|
|
|
|
return newQVector3D(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQVector3D5 constructs a new QVector3D object.
|
2024-08-29 07:01:51 +00:00
|
|
|
func NewQVector3D5(point *QPointF) *QVector3D {
|
|
|
|
ret := C.QVector3D_new5(point.cPointer())
|
2024-08-25 04:08:24 +00:00
|
|
|
return newQVector3D(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQVector3D6 constructs a new QVector3D object.
|
2024-08-29 07:01:51 +00:00
|
|
|
func NewQVector3D6(vector *QVector2D) *QVector3D {
|
|
|
|
ret := C.QVector3D_new6(vector.cPointer())
|
2024-08-25 04:08:24 +00:00
|
|
|
return newQVector3D(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQVector3D7 constructs a new QVector3D object.
|
2024-08-29 07:01:51 +00:00
|
|
|
func NewQVector3D7(vector *QVector2D, zpos float32) *QVector3D {
|
|
|
|
ret := C.QVector3D_new7(vector.cPointer(), (C.float)(zpos))
|
2024-08-25 04:08:24 +00:00
|
|
|
return newQVector3D(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQVector3D8 constructs a new QVector3D object.
|
2024-08-29 07:01:51 +00:00
|
|
|
func NewQVector3D8(vector *QVector4D) *QVector3D {
|
|
|
|
ret := C.QVector3D_new8(vector.cPointer())
|
|
|
|
return newQVector3D(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQVector3D9 constructs a new QVector3D object.
|
|
|
|
func NewQVector3D9(param1 *QVector3D) *QVector3D {
|
|
|
|
ret := C.QVector3D_new9(param1.cPointer())
|
2024-08-25 04:08:24 +00:00
|
|
|
return newQVector3D(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QVector3D) IsNull() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QVector3D_IsNull(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QVector3D) X() float32 {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (float32)(C.QVector3D_X(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QVector3D) Y() float32 {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (float32)(C.QVector3D_Y(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QVector3D) Z() float32 {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (float32)(C.QVector3D_Z(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QVector3D) SetX(x float32) {
|
|
|
|
C.QVector3D_SetX(this.h, (C.float)(x))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QVector3D) SetY(y float32) {
|
|
|
|
C.QVector3D_SetY(this.h, (C.float)(y))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QVector3D) SetZ(z float32) {
|
|
|
|
C.QVector3D_SetZ(this.h, (C.float)(z))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QVector3D) OperatorSubscript(i int) float32 {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (float32)(C.QVector3D_OperatorSubscript(this.h, (C.int)(i)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QVector3D) Length() float32 {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (float32)(C.QVector3D_Length(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QVector3D) LengthSquared() float32 {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (float32)(C.QVector3D_LengthSquared(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QVector3D) Normalized() *QVector3D {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QVector3D_Normalized(this.h)
|
|
|
|
_goptr := newQVector3D(_ret)
|
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QVector3D) Normalize() {
|
|
|
|
C.QVector3D_Normalize(this.h)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QVector3D) OperatorPlusAssign(vector *QVector3D) *QVector3D {
|
2024-09-17 07:30:27 +00:00
|
|
|
return newQVector3D_U(unsafe.Pointer(C.QVector3D_OperatorPlusAssign(this.h, vector.cPointer())))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QVector3D) OperatorMinusAssign(vector *QVector3D) *QVector3D {
|
2024-09-17 07:30:27 +00:00
|
|
|
return newQVector3D_U(unsafe.Pointer(C.QVector3D_OperatorMinusAssign(this.h, vector.cPointer())))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QVector3D) OperatorMultiplyAssign(factor float32) *QVector3D {
|
2024-09-17 07:30:27 +00:00
|
|
|
return newQVector3D_U(unsafe.Pointer(C.QVector3D_OperatorMultiplyAssign(this.h, (C.float)(factor))))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QVector3D) OperatorMultiplyAssignWithVector(vector *QVector3D) *QVector3D {
|
2024-09-17 07:30:27 +00:00
|
|
|
return newQVector3D_U(unsafe.Pointer(C.QVector3D_OperatorMultiplyAssignWithVector(this.h, vector.cPointer())))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QVector3D) OperatorDivideAssign(divisor float32) *QVector3D {
|
2024-09-17 07:30:27 +00:00
|
|
|
return newQVector3D_U(unsafe.Pointer(C.QVector3D_OperatorDivideAssign(this.h, (C.float)(divisor))))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QVector3D) OperatorDivideAssignWithVector(vector *QVector3D) *QVector3D {
|
2024-09-17 07:30:27 +00:00
|
|
|
return newQVector3D_U(unsafe.Pointer(C.QVector3D_OperatorDivideAssignWithVector(this.h, vector.cPointer())))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QVector3D_DotProduct(v1 *QVector3D, v2 *QVector3D) float32 {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (float32)(C.QVector3D_DotProduct(v1.cPointer(), v2.cPointer()))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QVector3D_CrossProduct(v1 *QVector3D, v2 *QVector3D) *QVector3D {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QVector3D_CrossProduct(v1.cPointer(), v2.cPointer())
|
|
|
|
_goptr := newQVector3D(_ret)
|
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QVector3D_Normal(v1 *QVector3D, v2 *QVector3D) *QVector3D {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QVector3D_Normal(v1.cPointer(), v2.cPointer())
|
|
|
|
_goptr := newQVector3D(_ret)
|
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QVector3D_Normal2(v1 *QVector3D, v2 *QVector3D, v3 *QVector3D) *QVector3D {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QVector3D_Normal2(v1.cPointer(), v2.cPointer(), v3.cPointer())
|
|
|
|
_goptr := newQVector3D(_ret)
|
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QVector3D) Project(modelView *QMatrix4x4, projection *QMatrix4x4, viewport *QRect) *QVector3D {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QVector3D_Project(this.h, modelView.cPointer(), projection.cPointer(), viewport.cPointer())
|
|
|
|
_goptr := newQVector3D(_ret)
|
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QVector3D) Unproject(modelView *QMatrix4x4, projection *QMatrix4x4, viewport *QRect) *QVector3D {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QVector3D_Unproject(this.h, modelView.cPointer(), projection.cPointer(), viewport.cPointer())
|
|
|
|
_goptr := newQVector3D(_ret)
|
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QVector3D) DistanceToPoint(point *QVector3D) float32 {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (float32)(C.QVector3D_DistanceToPoint(this.h, point.cPointer()))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QVector3D) DistanceToPlane(plane *QVector3D, normal *QVector3D) float32 {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (float32)(C.QVector3D_DistanceToPlane(this.h, plane.cPointer(), normal.cPointer()))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QVector3D) DistanceToPlane2(plane1 *QVector3D, plane2 *QVector3D, plane3 *QVector3D) float32 {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (float32)(C.QVector3D_DistanceToPlane2(this.h, plane1.cPointer(), plane2.cPointer(), plane3.cPointer()))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QVector3D) DistanceToLine(point *QVector3D, direction *QVector3D) float32 {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (float32)(C.QVector3D_DistanceToLine(this.h, point.cPointer(), direction.cPointer()))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QVector3D) ToVector2D() *QVector2D {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QVector3D_ToVector2D(this.h)
|
|
|
|
_goptr := newQVector2D(_ret)
|
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QVector3D) ToVector4D() *QVector4D {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QVector3D_ToVector4D(this.h)
|
|
|
|
_goptr := newQVector4D(_ret)
|
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QVector3D) ToPoint() *QPoint {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QVector3D_ToPoint(this.h)
|
|
|
|
_goptr := newQPoint(_ret)
|
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QVector3D) ToPointF() *QPointF {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QVector3D_ToPointF(this.h)
|
|
|
|
_goptr := newQPointF(_ret)
|
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
// Delete this object from C++ memory.
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QVector3D) Delete() {
|
|
|
|
C.QVector3D_Delete(this.h)
|
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
|
|
|
|
// GoGC adds a Go Finalizer to this pointer, so that it will be deleted
|
|
|
|
// from C++ memory once it is unreachable from Go memory.
|
|
|
|
func (this *QVector3D) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QVector3D) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|