vector2.gen.go 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462
  1. // Copyright © 2019 - 2020 Oscar Campos <oscar.campos@thepimpam.com>
  2. // Copyright © 2017 - William Edwards
  3. //
  4. // Licensed under the Apache License, Version 2.0 (the "License");
  5. // you may not use this file except in compliance with the License.
  6. // You may obtain a copy of the License at
  7. //
  8. // http://www.apache.org/licenses/LICENSE-2.0
  9. //
  10. // Unless required by applicable law or agreed to in writing, software
  11. // distributed under the License is distributed on an "AS IS" BASIS,
  12. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. // See the License for the specific language governing permissions and
  14. // limitations under the License.
  15. package gdnative
  16. // ==================================================================
  17. // This file was autogenerated by PimPam GDNative-Go binding tools
  18. // Please do not modify this file, any change will be lost
  19. // ==================================================================
  20. /*
  21. #include "gdnative.gen.h"
  22. #include <gdnative/vector2.h>
  23. // Include all headers for now. TODO: Look up all the required
  24. // headers we need to import based on the method arguments and return types.
  25. #include <gdnative/aabb.h>
  26. #include <gdnative/array.h>
  27. #include <gdnative/basis.h>
  28. #include <gdnative/color.h>
  29. #include <gdnative/dictionary.h>
  30. #include <gdnative/gdnative.h>
  31. #include <gdnative/node_path.h>
  32. #include <gdnative/plane.h>
  33. #include <gdnative/pool_arrays.h>
  34. #include <gdnative/quat.h>
  35. #include <gdnative/rect2.h>
  36. #include <gdnative/rid.h>
  37. #include <gdnative/string.h>
  38. #include <gdnative/string_name.h>
  39. #include <gdnative/transform.h>
  40. #include <gdnative/transform2d.h>
  41. #include <gdnative/variant.h>
  42. #include <gdnative/vector2.h>
  43. #include <gdnative/vector3.h>
  44. #include <gdnative_api_struct.gen.h>
  45. */
  46. import "C"
  47. import "unsafe"
  48. // NewEmptyVector2 will return a pointer to an empty
  49. // initialized Vector2. This is primarily used in
  50. // conjunction with MethodBindPtrCall.
  51. func NewEmptyVector2() Pointer {
  52. var obj C.godot_vector2
  53. return Pointer{base: unsafe.Pointer(&obj)}
  54. }
  55. // NewPointerFromVector2 will return an unsafe pointer to the given
  56. // object. This is primarily used in conjunction with MethodBindPtrCall.
  57. func NewPointerFromVector2(obj Vector2) Pointer {
  58. return Pointer{base: unsafe.Pointer(obj.getBase())}
  59. }
  60. // NewVector2FromPointer will return a Vector2 from the
  61. // given unsafe pointer. This is primarily used in conjunction with MethodBindPtrCall.
  62. func NewVector2FromPointer(ptr Pointer) Vector2 {
  63. return Vector2{base: (*C.godot_vector2)(ptr.getBase())}
  64. }
  65. // Vector2 data structure wrapper
  66. type Vector2 struct {
  67. base *C.godot_vector2
  68. }
  69. // returns the wrapped C base data type for this type
  70. func (gdt Vector2) getBase() *C.godot_vector2 {
  71. return gdt.base
  72. }
  73. // NewVector2 godot_vector2_new [[godot_vector2 * r_dest] [const godot_real p_x] [const godot_real p_y]] void
  74. func NewVector2(x Real, y Real) Vector2 {
  75. var dest C.godot_vector2
  76. arg1 := x.getBase()
  77. arg2 := y.getBase()
  78. C.go_godot_vector2_new(GDNative.api, &dest, arg1, arg2)
  79. return Vector2{base: &dest}
  80. }
  81. // AsString godot_vector2_as_string [[const godot_vector2 * p_self]] godot_string
  82. func (gdt *Vector2) AsString() String {
  83. arg0 := gdt.getBase()
  84. ret := C.go_godot_vector2_as_string(GDNative.api, arg0)
  85. utfStr := C.go_godot_string_utf8(GDNative.api, &ret)
  86. char := C.go_godot_char_string_get_data(GDNative.api, &utfStr)
  87. goStr := C.GoString(char)
  88. C.go_godot_char_string_destroy(GDNative.api, &utfStr)
  89. return String(goStr)
  90. }
  91. // Normalized godot_vector2_normalized [[const godot_vector2 * p_self]] godot_vector2
  92. func (gdt *Vector2) Normalized() Vector2 {
  93. arg0 := gdt.getBase()
  94. ret := C.go_godot_vector2_normalized(GDNative.api, arg0)
  95. return Vector2{base: &ret}
  96. }
  97. // Length godot_vector2_length [[const godot_vector2 * p_self]] godot_real
  98. func (gdt *Vector2) Length() Real {
  99. arg0 := gdt.getBase()
  100. ret := C.go_godot_vector2_length(GDNative.api, arg0)
  101. return Real(ret)
  102. }
  103. // Angle godot_vector2_angle [[const godot_vector2 * p_self]] godot_real
  104. func (gdt *Vector2) Angle() Real {
  105. arg0 := gdt.getBase()
  106. ret := C.go_godot_vector2_angle(GDNative.api, arg0)
  107. return Real(ret)
  108. }
  109. // LengthSquared godot_vector2_length_squared [[const godot_vector2 * p_self]] godot_real
  110. func (gdt *Vector2) LengthSquared() Real {
  111. arg0 := gdt.getBase()
  112. ret := C.go_godot_vector2_length_squared(GDNative.api, arg0)
  113. return Real(ret)
  114. }
  115. // IsNormalized godot_vector2_is_normalized [[const godot_vector2 * p_self]] godot_bool
  116. func (gdt *Vector2) IsNormalized() Bool {
  117. arg0 := gdt.getBase()
  118. ret := C.go_godot_vector2_is_normalized(GDNative.api, arg0)
  119. return Bool(ret)
  120. }
  121. // DistanceTo godot_vector2_distance_to [[const godot_vector2 * p_self] [const godot_vector2 * p_to]] godot_real
  122. func (gdt *Vector2) DistanceTo(to Vector2) Real {
  123. arg0 := gdt.getBase()
  124. arg1 := to.getBase()
  125. ret := C.go_godot_vector2_distance_to(GDNative.api, arg0, arg1)
  126. return Real(ret)
  127. }
  128. // DistanceSquaredTo godot_vector2_distance_squared_to [[const godot_vector2 * p_self] [const godot_vector2 * p_to]] godot_real
  129. func (gdt *Vector2) DistanceSquaredTo(to Vector2) Real {
  130. arg0 := gdt.getBase()
  131. arg1 := to.getBase()
  132. ret := C.go_godot_vector2_distance_squared_to(GDNative.api, arg0, arg1)
  133. return Real(ret)
  134. }
  135. // AngleTo godot_vector2_angle_to [[const godot_vector2 * p_self] [const godot_vector2 * p_to]] godot_real
  136. func (gdt *Vector2) AngleTo(to Vector2) Real {
  137. arg0 := gdt.getBase()
  138. arg1 := to.getBase()
  139. ret := C.go_godot_vector2_angle_to(GDNative.api, arg0, arg1)
  140. return Real(ret)
  141. }
  142. // AngleToPoint godot_vector2_angle_to_point [[const godot_vector2 * p_self] [const godot_vector2 * p_to]] godot_real
  143. func (gdt *Vector2) AngleToPoint(to Vector2) Real {
  144. arg0 := gdt.getBase()
  145. arg1 := to.getBase()
  146. ret := C.go_godot_vector2_angle_to_point(GDNative.api, arg0, arg1)
  147. return Real(ret)
  148. }
  149. // LinearInterpolate godot_vector2_linear_interpolate [[const godot_vector2 * p_self] [const godot_vector2 * p_b] [const godot_real p_t]] godot_vector2
  150. func (gdt *Vector2) LinearInterpolate(b Vector2, t Real) Vector2 {
  151. arg0 := gdt.getBase()
  152. arg1 := b.getBase()
  153. arg2 := t.getBase()
  154. ret := C.go_godot_vector2_linear_interpolate(GDNative.api, arg0, arg1, arg2)
  155. return Vector2{base: &ret}
  156. }
  157. // 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
  158. func (gdt *Vector2) CubicInterpolate(b Vector2, preA Vector2, postB Vector2, t Real) Vector2 {
  159. arg0 := gdt.getBase()
  160. arg1 := b.getBase()
  161. arg2 := preA.getBase()
  162. arg3 := postB.getBase()
  163. arg4 := t.getBase()
  164. ret := C.go_godot_vector2_cubic_interpolate(GDNative.api, arg0, arg1, arg2, arg3, arg4)
  165. return Vector2{base: &ret}
  166. }
  167. // Rotated godot_vector2_rotated [[const godot_vector2 * p_self] [const godot_real p_phi]] godot_vector2
  168. func (gdt *Vector2) Rotated(phi Real) Vector2 {
  169. arg0 := gdt.getBase()
  170. arg1 := phi.getBase()
  171. ret := C.go_godot_vector2_rotated(GDNative.api, arg0, arg1)
  172. return Vector2{base: &ret}
  173. }
  174. // Tangent godot_vector2_tangent [[const godot_vector2 * p_self]] godot_vector2
  175. func (gdt *Vector2) Tangent() Vector2 {
  176. arg0 := gdt.getBase()
  177. ret := C.go_godot_vector2_tangent(GDNative.api, arg0)
  178. return Vector2{base: &ret}
  179. }
  180. // Floor godot_vector2_floor [[const godot_vector2 * p_self]] godot_vector2
  181. func (gdt *Vector2) Floor() Vector2 {
  182. arg0 := gdt.getBase()
  183. ret := C.go_godot_vector2_floor(GDNative.api, arg0)
  184. return Vector2{base: &ret}
  185. }
  186. // Snapped godot_vector2_snapped [[const godot_vector2 * p_self] [const godot_vector2 * p_by]] godot_vector2
  187. func (gdt *Vector2) Snapped(by Vector2) Vector2 {
  188. arg0 := gdt.getBase()
  189. arg1 := by.getBase()
  190. ret := C.go_godot_vector2_snapped(GDNative.api, arg0, arg1)
  191. return Vector2{base: &ret}
  192. }
  193. // Aspect godot_vector2_aspect [[const godot_vector2 * p_self]] godot_real
  194. func (gdt *Vector2) Aspect() Real {
  195. arg0 := gdt.getBase()
  196. ret := C.go_godot_vector2_aspect(GDNative.api, arg0)
  197. return Real(ret)
  198. }
  199. // Dot godot_vector2_dot [[const godot_vector2 * p_self] [const godot_vector2 * p_with]] godot_real
  200. func (gdt *Vector2) Dot(with Vector2) Real {
  201. arg0 := gdt.getBase()
  202. arg1 := with.getBase()
  203. ret := C.go_godot_vector2_dot(GDNative.api, arg0, arg1)
  204. return Real(ret)
  205. }
  206. // Slide godot_vector2_slide [[const godot_vector2 * p_self] [const godot_vector2 * p_n]] godot_vector2
  207. func (gdt *Vector2) Slide(n Vector2) Vector2 {
  208. arg0 := gdt.getBase()
  209. arg1 := n.getBase()
  210. ret := C.go_godot_vector2_slide(GDNative.api, arg0, arg1)
  211. return Vector2{base: &ret}
  212. }
  213. // Bounce godot_vector2_bounce [[const godot_vector2 * p_self] [const godot_vector2 * p_n]] godot_vector2
  214. func (gdt *Vector2) Bounce(n Vector2) Vector2 {
  215. arg0 := gdt.getBase()
  216. arg1 := n.getBase()
  217. ret := C.go_godot_vector2_bounce(GDNative.api, arg0, arg1)
  218. return Vector2{base: &ret}
  219. }
  220. // Reflect godot_vector2_reflect [[const godot_vector2 * p_self] [const godot_vector2 * p_n]] godot_vector2
  221. func (gdt *Vector2) Reflect(n Vector2) Vector2 {
  222. arg0 := gdt.getBase()
  223. arg1 := n.getBase()
  224. ret := C.go_godot_vector2_reflect(GDNative.api, arg0, arg1)
  225. return Vector2{base: &ret}
  226. }
  227. // Abs godot_vector2_abs [[const godot_vector2 * p_self]] godot_vector2
  228. func (gdt *Vector2) Abs() Vector2 {
  229. arg0 := gdt.getBase()
  230. ret := C.go_godot_vector2_abs(GDNative.api, arg0)
  231. return Vector2{base: &ret}
  232. }
  233. // Clamped godot_vector2_clamped [[const godot_vector2 * p_self] [const godot_real p_length]] godot_vector2
  234. func (gdt *Vector2) Clamped(length Real) Vector2 {
  235. arg0 := gdt.getBase()
  236. arg1 := length.getBase()
  237. ret := C.go_godot_vector2_clamped(GDNative.api, arg0, arg1)
  238. return Vector2{base: &ret}
  239. }
  240. // OperatorAdd godot_vector2_operator_add [[const godot_vector2 * p_self] [const godot_vector2 * p_b]] godot_vector2
  241. func (gdt *Vector2) OperatorAdd(b Vector2) Vector2 {
  242. arg0 := gdt.getBase()
  243. arg1 := b.getBase()
  244. ret := C.go_godot_vector2_operator_add(GDNative.api, arg0, arg1)
  245. return Vector2{base: &ret}
  246. }
  247. // OperatorSubtract godot_vector2_operator_subtract [[const godot_vector2 * p_self] [const godot_vector2 * p_b]] godot_vector2
  248. func (gdt *Vector2) OperatorSubtract(b Vector2) Vector2 {
  249. arg0 := gdt.getBase()
  250. arg1 := b.getBase()
  251. ret := C.go_godot_vector2_operator_subtract(GDNative.api, arg0, arg1)
  252. return Vector2{base: &ret}
  253. }
  254. // OperatorMultiplyVector godot_vector2_operator_multiply_vector [[const godot_vector2 * p_self] [const godot_vector2 * p_b]] godot_vector2
  255. func (gdt *Vector2) OperatorMultiplyVector(b Vector2) Vector2 {
  256. arg0 := gdt.getBase()
  257. arg1 := b.getBase()
  258. ret := C.go_godot_vector2_operator_multiply_vector(GDNative.api, arg0, arg1)
  259. return Vector2{base: &ret}
  260. }
  261. // OperatorMultiplyScalar godot_vector2_operator_multiply_scalar [[const godot_vector2 * p_self] [const godot_real p_b]] godot_vector2
  262. func (gdt *Vector2) OperatorMultiplyScalar(b Real) Vector2 {
  263. arg0 := gdt.getBase()
  264. arg1 := b.getBase()
  265. ret := C.go_godot_vector2_operator_multiply_scalar(GDNative.api, arg0, arg1)
  266. return Vector2{base: &ret}
  267. }
  268. // OperatorDivideVector godot_vector2_operator_divide_vector [[const godot_vector2 * p_self] [const godot_vector2 * p_b]] godot_vector2
  269. func (gdt *Vector2) OperatorDivideVector(b Vector2) Vector2 {
  270. arg0 := gdt.getBase()
  271. arg1 := b.getBase()
  272. ret := C.go_godot_vector2_operator_divide_vector(GDNative.api, arg0, arg1)
  273. return Vector2{base: &ret}
  274. }
  275. // OperatorDivideScalar godot_vector2_operator_divide_scalar [[const godot_vector2 * p_self] [const godot_real p_b]] godot_vector2
  276. func (gdt *Vector2) OperatorDivideScalar(b Real) Vector2 {
  277. arg0 := gdt.getBase()
  278. arg1 := b.getBase()
  279. ret := C.go_godot_vector2_operator_divide_scalar(GDNative.api, arg0, arg1)
  280. return Vector2{base: &ret}
  281. }
  282. // OperatorEqual godot_vector2_operator_equal [[const godot_vector2 * p_self] [const godot_vector2 * p_b]] godot_bool
  283. func (gdt *Vector2) OperatorEqual(b Vector2) Bool {
  284. arg0 := gdt.getBase()
  285. arg1 := b.getBase()
  286. ret := C.go_godot_vector2_operator_equal(GDNative.api, arg0, arg1)
  287. return Bool(ret)
  288. }
  289. // OperatorLess godot_vector2_operator_less [[const godot_vector2 * p_self] [const godot_vector2 * p_b]] godot_bool
  290. func (gdt *Vector2) OperatorLess(b Vector2) Bool {
  291. arg0 := gdt.getBase()
  292. arg1 := b.getBase()
  293. ret := C.go_godot_vector2_operator_less(GDNative.api, arg0, arg1)
  294. return Bool(ret)
  295. }
  296. // OperatorNeg godot_vector2_operator_neg [[const godot_vector2 * p_self]] godot_vector2
  297. func (gdt *Vector2) OperatorNeg() Vector2 {
  298. arg0 := gdt.getBase()
  299. ret := C.go_godot_vector2_operator_neg(GDNative.api, arg0)
  300. return Vector2{base: &ret}
  301. }
  302. // SetX godot_vector2_set_x [[godot_vector2 * p_self] [const godot_real p_x]] void
  303. func (gdt *Vector2) SetX(x Real) {
  304. arg0 := gdt.getBase()
  305. arg1 := x.getBase()
  306. C.go_godot_vector2_set_x(GDNative.api, arg0, arg1)
  307. }
  308. // SetY godot_vector2_set_y [[godot_vector2 * p_self] [const godot_real p_y]] void
  309. func (gdt *Vector2) SetY(y Real) {
  310. arg0 := gdt.getBase()
  311. arg1 := y.getBase()
  312. C.go_godot_vector2_set_y(GDNative.api, arg0, arg1)
  313. }
  314. // GetX godot_vector2_get_x [[const godot_vector2 * p_self]] godot_real
  315. func (gdt *Vector2) GetX() Real {
  316. arg0 := gdt.getBase()
  317. ret := C.go_godot_vector2_get_x(GDNative.api, arg0)
  318. return Real(ret)
  319. }
  320. // GetY godot_vector2_get_y [[const godot_vector2 * p_self]] godot_real
  321. func (gdt *Vector2) GetY() Real {
  322. arg0 := gdt.getBase()
  323. ret := C.go_godot_vector2_get_y(GDNative.api, arg0)
  324. return Real(ret)
  325. }