// Copyright © 2019 - 2020 Oscar Campos <oscar.campos@thepimpam.com>
// Copyright © 2017 - William Edwards
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package gdnative

// ==================================================================
// This file was autogenerated by PimPam GDNative-Go binding tools
// Please do not modify this file, any change will be lost
// ==================================================================

/*
#include "gdnative.gen.h"
#include <gdnative/quat.h>
// Include all headers for now. TODO: Look up all the required
// headers we need to import based on the method arguments and return types.
#include <gdnative/aabb.h>
#include <gdnative/array.h>
#include <gdnative/basis.h>
#include <gdnative/color.h>
#include <gdnative/dictionary.h>
#include <gdnative/gdnative.h>
#include <gdnative/node_path.h>
#include <gdnative/plane.h>
#include <gdnative/pool_arrays.h>
#include <gdnative/quat.h>
#include <gdnative/rect2.h>
#include <gdnative/rid.h>
#include <gdnative/string.h>
#include <gdnative/string_name.h>
#include <gdnative/transform.h>
#include <gdnative/transform2d.h>
#include <gdnative/variant.h>
#include <gdnative/vector2.h>
#include <gdnative/vector3.h>
#include <gdnative_api_struct.gen.h>
*/
import "C"
import "unsafe"

// NewEmptyQuat will return a pointer to an empty
// initialized Quat. This is primarily used in
// conjunction with MethodBindPtrCall.
func NewEmptyQuat() Pointer {
	var obj C.godot_quat
	return Pointer{base: unsafe.Pointer(&obj)}
}

// NewPointerFromQuat will return an unsafe pointer to the given
// object. This is primarily used in conjunction with MethodBindPtrCall.
func NewPointerFromQuat(obj Quat) Pointer {
	return Pointer{base: unsafe.Pointer(obj.getBase())}
}

// NewQuatFromPointer will return a Quat from the
// given unsafe pointer. This is primarily used in conjunction with MethodBindPtrCall.
func NewQuatFromPointer(ptr Pointer) Quat {

	return Quat{base: (*C.godot_quat)(ptr.getBase())}
}

// Quat data structure wrapper
type Quat struct {
	base *C.godot_quat
}

// returns the wrapped C base data type for this type
func (gdt Quat) getBase() *C.godot_quat {
	return gdt.base
}

// NewQuat godot_quat_new [[godot_quat * r_dest] [const godot_real p_x] [const godot_real p_y] [const godot_real p_z] [const godot_real p_w]] void
func NewQuat(x Real, y Real, z Real, w Real) Quat {
	var dest C.godot_quat
	arg1 := x.getBase()
	arg2 := y.getBase()
	arg3 := z.getBase()
	arg4 := w.getBase()
	C.go_godot_quat_new(GDNative.api, &dest, arg1, arg2, arg3, arg4)
	return Quat{base: &dest}
}

// NewQuatWithAxisAngle godot_quat_new_with_axis_angle [[godot_quat * r_dest] [const godot_vector3 * p_axis] [const godot_real p_angle]] void
func NewQuatWithAxisAngle(axis Vector3, angle Real) Quat {
	var dest C.godot_quat
	arg1 := axis.getBase()
	arg2 := angle.getBase()
	C.go_godot_quat_new_with_axis_angle(GDNative.api, &dest, arg1, arg2)
	return Quat{base: &dest}
}

// GetX godot_quat_get_x [[const godot_quat * p_self]] godot_real
func (gdt *Quat) GetX() Real {
	arg0 := gdt.getBase()

	ret := C.go_godot_quat_get_x(GDNative.api, arg0)

	return Real(ret)
}

// SetX godot_quat_set_x [[godot_quat * p_self] [const godot_real val]] void
func (gdt *Quat) SetX(val Real) {
	arg0 := gdt.getBase()
	arg1 := val.getBase()

	C.go_godot_quat_set_x(GDNative.api, arg0, arg1)
}

// GetY godot_quat_get_y [[const godot_quat * p_self]] godot_real
func (gdt *Quat) GetY() Real {
	arg0 := gdt.getBase()

	ret := C.go_godot_quat_get_y(GDNative.api, arg0)

	return Real(ret)
}

// SetY godot_quat_set_y [[godot_quat * p_self] [const godot_real val]] void
func (gdt *Quat) SetY(val Real) {
	arg0 := gdt.getBase()
	arg1 := val.getBase()

	C.go_godot_quat_set_y(GDNative.api, arg0, arg1)
}

// GetZ godot_quat_get_z [[const godot_quat * p_self]] godot_real
func (gdt *Quat) GetZ() Real {
	arg0 := gdt.getBase()

	ret := C.go_godot_quat_get_z(GDNative.api, arg0)

	return Real(ret)
}

// SetZ godot_quat_set_z [[godot_quat * p_self] [const godot_real val]] void
func (gdt *Quat) SetZ(val Real) {
	arg0 := gdt.getBase()
	arg1 := val.getBase()

	C.go_godot_quat_set_z(GDNative.api, arg0, arg1)
}

// GetW godot_quat_get_w [[const godot_quat * p_self]] godot_real
func (gdt *Quat) GetW() Real {
	arg0 := gdt.getBase()

	ret := C.go_godot_quat_get_w(GDNative.api, arg0)

	return Real(ret)
}

// SetW godot_quat_set_w [[godot_quat * p_self] [const godot_real val]] void
func (gdt *Quat) SetW(val Real) {
	arg0 := gdt.getBase()
	arg1 := val.getBase()

	C.go_godot_quat_set_w(GDNative.api, arg0, arg1)
}

// AsString godot_quat_as_string [[const godot_quat * p_self]] godot_string
func (gdt *Quat) AsString() String {
	arg0 := gdt.getBase()

	ret := C.go_godot_quat_as_string(GDNative.api, arg0)

	utfStr := C.go_godot_string_utf8(GDNative.api, &ret)
	char := C.go_godot_char_string_get_data(GDNative.api, &utfStr)
	goStr := C.GoString(char)
	C.go_godot_char_string_destroy(GDNative.api, &utfStr)

	return String(goStr)

}

// Length godot_quat_length [[const godot_quat * p_self]] godot_real
func (gdt *Quat) Length() Real {
	arg0 := gdt.getBase()

	ret := C.go_godot_quat_length(GDNative.api, arg0)

	return Real(ret)
}

// LengthSquared godot_quat_length_squared [[const godot_quat * p_self]] godot_real
func (gdt *Quat) LengthSquared() Real {
	arg0 := gdt.getBase()

	ret := C.go_godot_quat_length_squared(GDNative.api, arg0)

	return Real(ret)
}

// Normalized godot_quat_normalized [[const godot_quat * p_self]] godot_quat
func (gdt *Quat) Normalized() Quat {
	arg0 := gdt.getBase()

	ret := C.go_godot_quat_normalized(GDNative.api, arg0)

	return Quat{base: &ret}

}

// IsNormalized godot_quat_is_normalized [[const godot_quat * p_self]] godot_bool
func (gdt *Quat) IsNormalized() Bool {
	arg0 := gdt.getBase()

	ret := C.go_godot_quat_is_normalized(GDNative.api, arg0)

	return Bool(ret)
}

// Inverse godot_quat_inverse [[const godot_quat * p_self]] godot_quat
func (gdt *Quat) Inverse() Quat {
	arg0 := gdt.getBase()

	ret := C.go_godot_quat_inverse(GDNative.api, arg0)

	return Quat{base: &ret}

}

// Dot godot_quat_dot [[const godot_quat * p_self] [const godot_quat * p_b]] godot_real
func (gdt *Quat) Dot(b Quat) Real {
	arg0 := gdt.getBase()
	arg1 := b.getBase()

	ret := C.go_godot_quat_dot(GDNative.api, arg0, arg1)

	return Real(ret)
}

// Xform godot_quat_xform [[const godot_quat * p_self] [const godot_vector3 * p_v]] godot_vector3
func (gdt *Quat) Xform(v Vector3) Vector3 {
	arg0 := gdt.getBase()
	arg1 := v.getBase()

	ret := C.go_godot_quat_xform(GDNative.api, arg0, arg1)

	return Vector3{base: &ret}

}

// Slerp godot_quat_slerp [[const godot_quat * p_self] [const godot_quat * p_b] [const godot_real p_t]] godot_quat
func (gdt *Quat) Slerp(b Quat, t Real) Quat {
	arg0 := gdt.getBase()
	arg1 := b.getBase()
	arg2 := t.getBase()

	ret := C.go_godot_quat_slerp(GDNative.api, arg0, arg1, arg2)

	return Quat{base: &ret}

}

// Slerpni godot_quat_slerpni [[const godot_quat * p_self] [const godot_quat * p_b] [const godot_real p_t]] godot_quat
func (gdt *Quat) Slerpni(b Quat, t Real) Quat {
	arg0 := gdt.getBase()
	arg1 := b.getBase()
	arg2 := t.getBase()

	ret := C.go_godot_quat_slerpni(GDNative.api, arg0, arg1, arg2)

	return Quat{base: &ret}

}

// CubicSlerp godot_quat_cubic_slerp [[const godot_quat * p_self] [const godot_quat * p_b] [const godot_quat * p_pre_a] [const godot_quat * p_post_b] [const godot_real p_t]] godot_quat
func (gdt *Quat) CubicSlerp(b Quat, preA Quat, postB Quat, t Real) Quat {
	arg0 := gdt.getBase()
	arg1 := b.getBase()
	arg2 := preA.getBase()
	arg3 := postB.getBase()
	arg4 := t.getBase()

	ret := C.go_godot_quat_cubic_slerp(GDNative.api, arg0, arg1, arg2, arg3, arg4)

	return Quat{base: &ret}

}

// OperatorMultiply godot_quat_operator_multiply [[const godot_quat * p_self] [const godot_real p_b]] godot_quat
func (gdt *Quat) OperatorMultiply(b Real) Quat {
	arg0 := gdt.getBase()
	arg1 := b.getBase()

	ret := C.go_godot_quat_operator_multiply(GDNative.api, arg0, arg1)

	return Quat{base: &ret}

}

// OperatorAdd godot_quat_operator_add [[const godot_quat * p_self] [const godot_quat * p_b]] godot_quat
func (gdt *Quat) OperatorAdd(b Quat) Quat {
	arg0 := gdt.getBase()
	arg1 := b.getBase()

	ret := C.go_godot_quat_operator_add(GDNative.api, arg0, arg1)

	return Quat{base: &ret}

}

// OperatorSubtract godot_quat_operator_subtract [[const godot_quat * p_self] [const godot_quat * p_b]] godot_quat
func (gdt *Quat) OperatorSubtract(b Quat) Quat {
	arg0 := gdt.getBase()
	arg1 := b.getBase()

	ret := C.go_godot_quat_operator_subtract(GDNative.api, arg0, arg1)

	return Quat{base: &ret}

}

// OperatorDivide godot_quat_operator_divide [[const godot_quat * p_self] [const godot_real p_b]] godot_quat
func (gdt *Quat) OperatorDivide(b Real) Quat {
	arg0 := gdt.getBase()
	arg1 := b.getBase()

	ret := C.go_godot_quat_operator_divide(GDNative.api, arg0, arg1)

	return Quat{base: &ret}

}

// OperatorEqual godot_quat_operator_equal [[const godot_quat * p_self] [const godot_quat * p_b]] godot_bool
func (gdt *Quat) OperatorEqual(b Quat) Bool {
	arg0 := gdt.getBase()
	arg1 := b.getBase()

	ret := C.go_godot_quat_operator_equal(GDNative.api, arg0, arg1)

	return Bool(ret)
}

// OperatorNeg godot_quat_operator_neg [[const godot_quat * p_self]] godot_quat
func (gdt *Quat) OperatorNeg() Quat {
	arg0 := gdt.getBase()

	ret := C.go_godot_quat_operator_neg(GDNative.api, arg0)

	return Quat{base: &ret}

}
