123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462 |
- // 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/vector2.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"
- // NewEmptyVector2 will return a pointer to an empty
- // initialized Vector2. This is primarily used in
- // conjunction with MethodBindPtrCall.
- func NewEmptyVector2() Pointer {
- var obj C.godot_vector2
- return Pointer{base: unsafe.Pointer(&obj)}
- }
- // NewPointerFromVector2 will return an unsafe pointer to the given
- // object. This is primarily used in conjunction with MethodBindPtrCall.
- func NewPointerFromVector2(obj Vector2) Pointer {
- return Pointer{base: unsafe.Pointer(obj.getBase())}
- }
- // NewVector2FromPointer will return a Vector2 from the
- // given unsafe pointer. This is primarily used in conjunction with MethodBindPtrCall.
- func NewVector2FromPointer(ptr Pointer) Vector2 {
- return Vector2{base: (*C.godot_vector2)(ptr.getBase())}
- }
- // Vector2 data structure wrapper
- type Vector2 struct {
- base *C.godot_vector2
- }
- // returns the wrapped C base data type for this type
- func (gdt Vector2) getBase() *C.godot_vector2 {
- return gdt.base
- }
- // NewVector2 godot_vector2_new [[godot_vector2 * r_dest] [const godot_real p_x] [const godot_real p_y]] void
- func NewVector2(x Real, y Real) Vector2 {
- var dest C.godot_vector2
- arg1 := x.getBase()
- arg2 := y.getBase()
- C.go_godot_vector2_new(GDNative.api, &dest, arg1, arg2)
- return Vector2{base: &dest}
- }
- // AsString godot_vector2_as_string [[const godot_vector2 * p_self]] godot_string
- func (gdt *Vector2) AsString() String {
- arg0 := gdt.getBase()
- ret := C.go_godot_vector2_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)
- }
- // Normalized godot_vector2_normalized [[const godot_vector2 * p_self]] godot_vector2
- func (gdt *Vector2) Normalized() Vector2 {
- arg0 := gdt.getBase()
- ret := C.go_godot_vector2_normalized(GDNative.api, arg0)
- return Vector2{base: &ret}
- }
- // Length godot_vector2_length [[const godot_vector2 * p_self]] godot_real
- func (gdt *Vector2) Length() Real {
- arg0 := gdt.getBase()
- ret := C.go_godot_vector2_length(GDNative.api, arg0)
- return Real(ret)
- }
- // Angle godot_vector2_angle [[const godot_vector2 * p_self]] godot_real
- func (gdt *Vector2) Angle() Real {
- arg0 := gdt.getBase()
- ret := C.go_godot_vector2_angle(GDNative.api, arg0)
- return Real(ret)
- }
- // LengthSquared godot_vector2_length_squared [[const godot_vector2 * p_self]] godot_real
- func (gdt *Vector2) LengthSquared() Real {
- arg0 := gdt.getBase()
- ret := C.go_godot_vector2_length_squared(GDNative.api, arg0)
- return Real(ret)
- }
- // IsNormalized godot_vector2_is_normalized [[const godot_vector2 * p_self]] godot_bool
- func (gdt *Vector2) IsNormalized() Bool {
- arg0 := gdt.getBase()
- ret := C.go_godot_vector2_is_normalized(GDNative.api, arg0)
- return Bool(ret)
- }
- // DistanceTo godot_vector2_distance_to [[const godot_vector2 * p_self] [const godot_vector2 * p_to]] godot_real
- func (gdt *Vector2) DistanceTo(to Vector2) Real {
- arg0 := gdt.getBase()
- arg1 := to.getBase()
- ret := C.go_godot_vector2_distance_to(GDNative.api, arg0, arg1)
- return Real(ret)
- }
- // DistanceSquaredTo godot_vector2_distance_squared_to [[const godot_vector2 * p_self] [const godot_vector2 * p_to]] godot_real
- func (gdt *Vector2) DistanceSquaredTo(to Vector2) Real {
- arg0 := gdt.getBase()
- arg1 := to.getBase()
- ret := C.go_godot_vector2_distance_squared_to(GDNative.api, arg0, arg1)
- return Real(ret)
- }
- // AngleTo godot_vector2_angle_to [[const godot_vector2 * p_self] [const godot_vector2 * p_to]] godot_real
- func (gdt *Vector2) AngleTo(to Vector2) Real {
- arg0 := gdt.getBase()
- arg1 := to.getBase()
- ret := C.go_godot_vector2_angle_to(GDNative.api, arg0, arg1)
- return Real(ret)
- }
- // AngleToPoint godot_vector2_angle_to_point [[const godot_vector2 * p_self] [const godot_vector2 * p_to]] godot_real
- func (gdt *Vector2) AngleToPoint(to Vector2) Real {
- arg0 := gdt.getBase()
- arg1 := to.getBase()
- ret := C.go_godot_vector2_angle_to_point(GDNative.api, arg0, arg1)
- return Real(ret)
- }
- // LinearInterpolate godot_vector2_linear_interpolate [[const godot_vector2 * p_self] [const godot_vector2 * p_b] [const godot_real p_t]] godot_vector2
- func (gdt *Vector2) LinearInterpolate(b Vector2, t Real) Vector2 {
- arg0 := gdt.getBase()
- arg1 := b.getBase()
- arg2 := t.getBase()
- ret := C.go_godot_vector2_linear_interpolate(GDNative.api, arg0, arg1, arg2)
- return Vector2{base: &ret}
- }
- // CubicInterpolate godot_vector2_cubic_interpolate [[const godot_vector2 * p_self] [const godot_vector2 * p_b] [const godot_vector2 * p_pre_a] [const godot_vector2 * p_post_b] [const godot_real p_t]] godot_vector2
- func (gdt *Vector2) CubicInterpolate(b Vector2, preA Vector2, postB Vector2, t Real) Vector2 {
- arg0 := gdt.getBase()
- arg1 := b.getBase()
- arg2 := preA.getBase()
- arg3 := postB.getBase()
- arg4 := t.getBase()
- ret := C.go_godot_vector2_cubic_interpolate(GDNative.api, arg0, arg1, arg2, arg3, arg4)
- return Vector2{base: &ret}
- }
- // Rotated godot_vector2_rotated [[const godot_vector2 * p_self] [const godot_real p_phi]] godot_vector2
- func (gdt *Vector2) Rotated(phi Real) Vector2 {
- arg0 := gdt.getBase()
- arg1 := phi.getBase()
- ret := C.go_godot_vector2_rotated(GDNative.api, arg0, arg1)
- return Vector2{base: &ret}
- }
- // Tangent godot_vector2_tangent [[const godot_vector2 * p_self]] godot_vector2
- func (gdt *Vector2) Tangent() Vector2 {
- arg0 := gdt.getBase()
- ret := C.go_godot_vector2_tangent(GDNative.api, arg0)
- return Vector2{base: &ret}
- }
- // Floor godot_vector2_floor [[const godot_vector2 * p_self]] godot_vector2
- func (gdt *Vector2) Floor() Vector2 {
- arg0 := gdt.getBase()
- ret := C.go_godot_vector2_floor(GDNative.api, arg0)
- return Vector2{base: &ret}
- }
- // Snapped godot_vector2_snapped [[const godot_vector2 * p_self] [const godot_vector2 * p_by]] godot_vector2
- func (gdt *Vector2) Snapped(by Vector2) Vector2 {
- arg0 := gdt.getBase()
- arg1 := by.getBase()
- ret := C.go_godot_vector2_snapped(GDNative.api, arg0, arg1)
- return Vector2{base: &ret}
- }
- // Aspect godot_vector2_aspect [[const godot_vector2 * p_self]] godot_real
- func (gdt *Vector2) Aspect() Real {
- arg0 := gdt.getBase()
- ret := C.go_godot_vector2_aspect(GDNative.api, arg0)
- return Real(ret)
- }
- // Dot godot_vector2_dot [[const godot_vector2 * p_self] [const godot_vector2 * p_with]] godot_real
- func (gdt *Vector2) Dot(with Vector2) Real {
- arg0 := gdt.getBase()
- arg1 := with.getBase()
- ret := C.go_godot_vector2_dot(GDNative.api, arg0, arg1)
- return Real(ret)
- }
- // Slide godot_vector2_slide [[const godot_vector2 * p_self] [const godot_vector2 * p_n]] godot_vector2
- func (gdt *Vector2) Slide(n Vector2) Vector2 {
- arg0 := gdt.getBase()
- arg1 := n.getBase()
- ret := C.go_godot_vector2_slide(GDNative.api, arg0, arg1)
- return Vector2{base: &ret}
- }
- // Bounce godot_vector2_bounce [[const godot_vector2 * p_self] [const godot_vector2 * p_n]] godot_vector2
- func (gdt *Vector2) Bounce(n Vector2) Vector2 {
- arg0 := gdt.getBase()
- arg1 := n.getBase()
- ret := C.go_godot_vector2_bounce(GDNative.api, arg0, arg1)
- return Vector2{base: &ret}
- }
- // Reflect godot_vector2_reflect [[const godot_vector2 * p_self] [const godot_vector2 * p_n]] godot_vector2
- func (gdt *Vector2) Reflect(n Vector2) Vector2 {
- arg0 := gdt.getBase()
- arg1 := n.getBase()
- ret := C.go_godot_vector2_reflect(GDNative.api, arg0, arg1)
- return Vector2{base: &ret}
- }
- // Abs godot_vector2_abs [[const godot_vector2 * p_self]] godot_vector2
- func (gdt *Vector2) Abs() Vector2 {
- arg0 := gdt.getBase()
- ret := C.go_godot_vector2_abs(GDNative.api, arg0)
- return Vector2{base: &ret}
- }
- // Clamped godot_vector2_clamped [[const godot_vector2 * p_self] [const godot_real p_length]] godot_vector2
- func (gdt *Vector2) Clamped(length Real) Vector2 {
- arg0 := gdt.getBase()
- arg1 := length.getBase()
- ret := C.go_godot_vector2_clamped(GDNative.api, arg0, arg1)
- return Vector2{base: &ret}
- }
- // OperatorAdd godot_vector2_operator_add [[const godot_vector2 * p_self] [const godot_vector2 * p_b]] godot_vector2
- func (gdt *Vector2) OperatorAdd(b Vector2) Vector2 {
- arg0 := gdt.getBase()
- arg1 := b.getBase()
- ret := C.go_godot_vector2_operator_add(GDNative.api, arg0, arg1)
- return Vector2{base: &ret}
- }
- // OperatorSubtract godot_vector2_operator_subtract [[const godot_vector2 * p_self] [const godot_vector2 * p_b]] godot_vector2
- func (gdt *Vector2) OperatorSubtract(b Vector2) Vector2 {
- arg0 := gdt.getBase()
- arg1 := b.getBase()
- ret := C.go_godot_vector2_operator_subtract(GDNative.api, arg0, arg1)
- return Vector2{base: &ret}
- }
- // OperatorMultiplyVector godot_vector2_operator_multiply_vector [[const godot_vector2 * p_self] [const godot_vector2 * p_b]] godot_vector2
- func (gdt *Vector2) OperatorMultiplyVector(b Vector2) Vector2 {
- arg0 := gdt.getBase()
- arg1 := b.getBase()
- ret := C.go_godot_vector2_operator_multiply_vector(GDNative.api, arg0, arg1)
- return Vector2{base: &ret}
- }
- // OperatorMultiplyScalar godot_vector2_operator_multiply_scalar [[const godot_vector2 * p_self] [const godot_real p_b]] godot_vector2
- func (gdt *Vector2) OperatorMultiplyScalar(b Real) Vector2 {
- arg0 := gdt.getBase()
- arg1 := b.getBase()
- ret := C.go_godot_vector2_operator_multiply_scalar(GDNative.api, arg0, arg1)
- return Vector2{base: &ret}
- }
- // OperatorDivideVector godot_vector2_operator_divide_vector [[const godot_vector2 * p_self] [const godot_vector2 * p_b]] godot_vector2
- func (gdt *Vector2) OperatorDivideVector(b Vector2) Vector2 {
- arg0 := gdt.getBase()
- arg1 := b.getBase()
- ret := C.go_godot_vector2_operator_divide_vector(GDNative.api, arg0, arg1)
- return Vector2{base: &ret}
- }
- // OperatorDivideScalar godot_vector2_operator_divide_scalar [[const godot_vector2 * p_self] [const godot_real p_b]] godot_vector2
- func (gdt *Vector2) OperatorDivideScalar(b Real) Vector2 {
- arg0 := gdt.getBase()
- arg1 := b.getBase()
- ret := C.go_godot_vector2_operator_divide_scalar(GDNative.api, arg0, arg1)
- return Vector2{base: &ret}
- }
- // OperatorEqual godot_vector2_operator_equal [[const godot_vector2 * p_self] [const godot_vector2 * p_b]] godot_bool
- func (gdt *Vector2) OperatorEqual(b Vector2) Bool {
- arg0 := gdt.getBase()
- arg1 := b.getBase()
- ret := C.go_godot_vector2_operator_equal(GDNative.api, arg0, arg1)
- return Bool(ret)
- }
- // OperatorLess godot_vector2_operator_less [[const godot_vector2 * p_self] [const godot_vector2 * p_b]] godot_bool
- func (gdt *Vector2) OperatorLess(b Vector2) Bool {
- arg0 := gdt.getBase()
- arg1 := b.getBase()
- ret := C.go_godot_vector2_operator_less(GDNative.api, arg0, arg1)
- return Bool(ret)
- }
- // OperatorNeg godot_vector2_operator_neg [[const godot_vector2 * p_self]] godot_vector2
- func (gdt *Vector2) OperatorNeg() Vector2 {
- arg0 := gdt.getBase()
- ret := C.go_godot_vector2_operator_neg(GDNative.api, arg0)
- return Vector2{base: &ret}
- }
- // SetX godot_vector2_set_x [[godot_vector2 * p_self] [const godot_real p_x]] void
- func (gdt *Vector2) SetX(x Real) {
- arg0 := gdt.getBase()
- arg1 := x.getBase()
- C.go_godot_vector2_set_x(GDNative.api, arg0, arg1)
- }
- // SetY godot_vector2_set_y [[godot_vector2 * p_self] [const godot_real p_y]] void
- func (gdt *Vector2) SetY(y Real) {
- arg0 := gdt.getBase()
- arg1 := y.getBase()
- C.go_godot_vector2_set_y(GDNative.api, arg0, arg1)
- }
- // GetX godot_vector2_get_x [[const godot_vector2 * p_self]] godot_real
- func (gdt *Vector2) GetX() Real {
- arg0 := gdt.getBase()
- ret := C.go_godot_vector2_get_x(GDNative.api, arg0)
- return Real(ret)
- }
- // GetY godot_vector2_get_y [[const godot_vector2 * p_self]] godot_real
- func (gdt *Vector2) GetY() Real {
- arg0 := gdt.getBase()
- ret := C.go_godot_vector2_get_y(GDNative.api, arg0)
- return Real(ret)
- }
|