vector3.gen.go 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490
  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/vector3.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. // NewEmptyVector3 will return a pointer to an empty
  49. // initialized Vector3. This is primarily used in
  50. // conjunction with MethodBindPtrCall.
  51. func NewEmptyVector3() Pointer {
  52. var obj C.godot_vector3
  53. return Pointer{base: unsafe.Pointer(&obj)}
  54. }
  55. // NewPointerFromVector3 will return an unsafe pointer to the given
  56. // object. This is primarily used in conjunction with MethodBindPtrCall.
  57. func NewPointerFromVector3(obj Vector3) Pointer {
  58. return Pointer{base: unsafe.Pointer(obj.getBase())}
  59. }
  60. // NewVector3FromPointer will return a Vector3 from the
  61. // given unsafe pointer. This is primarily used in conjunction with MethodBindPtrCall.
  62. func NewVector3FromPointer(ptr Pointer) Vector3 {
  63. return Vector3{base: (*C.godot_vector3)(ptr.getBase())}
  64. }
  65. // Vector3 data structure wrapper
  66. type Vector3 struct {
  67. base *C.godot_vector3
  68. }
  69. // returns the wrapped C base data type for this type
  70. func (gdt Vector3) getBase() *C.godot_vector3 {
  71. return gdt.base
  72. }
  73. // NewVector3 godot_vector3_new [[godot_vector3 * r_dest] [const godot_real p_x] [const godot_real p_y] [const godot_real p_z]] void
  74. func NewVector3(x Real, y Real, z Real) Vector3 {
  75. var dest C.godot_vector3
  76. arg1 := x.getBase()
  77. arg2 := y.getBase()
  78. arg3 := z.getBase()
  79. C.go_godot_vector3_new(GDNative.api, &dest, arg1, arg2, arg3)
  80. return Vector3{base: &dest}
  81. }
  82. // AsString godot_vector3_as_string [[const godot_vector3 * p_self]] godot_string
  83. func (gdt *Vector3) AsString() String {
  84. arg0 := gdt.getBase()
  85. ret := C.go_godot_vector3_as_string(GDNative.api, arg0)
  86. utfStr := C.go_godot_string_utf8(GDNative.api, &ret)
  87. char := C.go_godot_char_string_get_data(GDNative.api, &utfStr)
  88. goStr := C.GoString(char)
  89. C.go_godot_char_string_destroy(GDNative.api, &utfStr)
  90. return String(goStr)
  91. }
  92. // MinAxis godot_vector3_min_axis [[const godot_vector3 * p_self]] godot_int
  93. func (gdt *Vector3) MinAxis() Int {
  94. arg0 := gdt.getBase()
  95. ret := C.go_godot_vector3_min_axis(GDNative.api, arg0)
  96. return Int(ret)
  97. }
  98. // MaxAxis godot_vector3_max_axis [[const godot_vector3 * p_self]] godot_int
  99. func (gdt *Vector3) MaxAxis() Int {
  100. arg0 := gdt.getBase()
  101. ret := C.go_godot_vector3_max_axis(GDNative.api, arg0)
  102. return Int(ret)
  103. }
  104. // Length godot_vector3_length [[const godot_vector3 * p_self]] godot_real
  105. func (gdt *Vector3) Length() Real {
  106. arg0 := gdt.getBase()
  107. ret := C.go_godot_vector3_length(GDNative.api, arg0)
  108. return Real(ret)
  109. }
  110. // LengthSquared godot_vector3_length_squared [[const godot_vector3 * p_self]] godot_real
  111. func (gdt *Vector3) LengthSquared() Real {
  112. arg0 := gdt.getBase()
  113. ret := C.go_godot_vector3_length_squared(GDNative.api, arg0)
  114. return Real(ret)
  115. }
  116. // IsNormalized godot_vector3_is_normalized [[const godot_vector3 * p_self]] godot_bool
  117. func (gdt *Vector3) IsNormalized() Bool {
  118. arg0 := gdt.getBase()
  119. ret := C.go_godot_vector3_is_normalized(GDNative.api, arg0)
  120. return Bool(ret)
  121. }
  122. // Normalized godot_vector3_normalized [[const godot_vector3 * p_self]] godot_vector3
  123. func (gdt *Vector3) Normalized() Vector3 {
  124. arg0 := gdt.getBase()
  125. ret := C.go_godot_vector3_normalized(GDNative.api, arg0)
  126. return Vector3{base: &ret}
  127. }
  128. // Inverse godot_vector3_inverse [[const godot_vector3 * p_self]] godot_vector3
  129. func (gdt *Vector3) Inverse() Vector3 {
  130. arg0 := gdt.getBase()
  131. ret := C.go_godot_vector3_inverse(GDNative.api, arg0)
  132. return Vector3{base: &ret}
  133. }
  134. // Snapped godot_vector3_snapped [[const godot_vector3 * p_self] [const godot_vector3 * p_by]] godot_vector3
  135. func (gdt *Vector3) Snapped(by Vector3) Vector3 {
  136. arg0 := gdt.getBase()
  137. arg1 := by.getBase()
  138. ret := C.go_godot_vector3_snapped(GDNative.api, arg0, arg1)
  139. return Vector3{base: &ret}
  140. }
  141. // Rotated godot_vector3_rotated [[const godot_vector3 * p_self] [const godot_vector3 * p_axis] [const godot_real p_phi]] godot_vector3
  142. func (gdt *Vector3) Rotated(axis Vector3, phi Real) Vector3 {
  143. arg0 := gdt.getBase()
  144. arg1 := axis.getBase()
  145. arg2 := phi.getBase()
  146. ret := C.go_godot_vector3_rotated(GDNative.api, arg0, arg1, arg2)
  147. return Vector3{base: &ret}
  148. }
  149. // LinearInterpolate godot_vector3_linear_interpolate [[const godot_vector3 * p_self] [const godot_vector3 * p_b] [const godot_real p_t]] godot_vector3
  150. func (gdt *Vector3) LinearInterpolate(b Vector3, t Real) Vector3 {
  151. arg0 := gdt.getBase()
  152. arg1 := b.getBase()
  153. arg2 := t.getBase()
  154. ret := C.go_godot_vector3_linear_interpolate(GDNative.api, arg0, arg1, arg2)
  155. return Vector3{base: &ret}
  156. }
  157. // CubicInterpolate godot_vector3_cubic_interpolate [[const godot_vector3 * p_self] [const godot_vector3 * p_b] [const godot_vector3 * p_pre_a] [const godot_vector3 * p_post_b] [const godot_real p_t]] godot_vector3
  158. func (gdt *Vector3) CubicInterpolate(b Vector3, preA Vector3, postB Vector3, t Real) Vector3 {
  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_vector3_cubic_interpolate(GDNative.api, arg0, arg1, arg2, arg3, arg4)
  165. return Vector3{base: &ret}
  166. }
  167. // Dot godot_vector3_dot [[const godot_vector3 * p_self] [const godot_vector3 * p_b]] godot_real
  168. func (gdt *Vector3) Dot(b Vector3) Real {
  169. arg0 := gdt.getBase()
  170. arg1 := b.getBase()
  171. ret := C.go_godot_vector3_dot(GDNative.api, arg0, arg1)
  172. return Real(ret)
  173. }
  174. // Cross godot_vector3_cross [[const godot_vector3 * p_self] [const godot_vector3 * p_b]] godot_vector3
  175. func (gdt *Vector3) Cross(b Vector3) Vector3 {
  176. arg0 := gdt.getBase()
  177. arg1 := b.getBase()
  178. ret := C.go_godot_vector3_cross(GDNative.api, arg0, arg1)
  179. return Vector3{base: &ret}
  180. }
  181. // Outer godot_vector3_outer [[const godot_vector3 * p_self] [const godot_vector3 * p_b]] godot_basis
  182. func (gdt *Vector3) Outer(b Vector3) Basis {
  183. arg0 := gdt.getBase()
  184. arg1 := b.getBase()
  185. ret := C.go_godot_vector3_outer(GDNative.api, arg0, arg1)
  186. return Basis{base: &ret}
  187. }
  188. // ToDiagonalMatrix godot_vector3_to_diagonal_matrix [[const godot_vector3 * p_self]] godot_basis
  189. func (gdt *Vector3) ToDiagonalMatrix() Basis {
  190. arg0 := gdt.getBase()
  191. ret := C.go_godot_vector3_to_diagonal_matrix(GDNative.api, arg0)
  192. return Basis{base: &ret}
  193. }
  194. // Abs godot_vector3_abs [[const godot_vector3 * p_self]] godot_vector3
  195. func (gdt *Vector3) Abs() Vector3 {
  196. arg0 := gdt.getBase()
  197. ret := C.go_godot_vector3_abs(GDNative.api, arg0)
  198. return Vector3{base: &ret}
  199. }
  200. // Floor godot_vector3_floor [[const godot_vector3 * p_self]] godot_vector3
  201. func (gdt *Vector3) Floor() Vector3 {
  202. arg0 := gdt.getBase()
  203. ret := C.go_godot_vector3_floor(GDNative.api, arg0)
  204. return Vector3{base: &ret}
  205. }
  206. // Ceil godot_vector3_ceil [[const godot_vector3 * p_self]] godot_vector3
  207. func (gdt *Vector3) Ceil() Vector3 {
  208. arg0 := gdt.getBase()
  209. ret := C.go_godot_vector3_ceil(GDNative.api, arg0)
  210. return Vector3{base: &ret}
  211. }
  212. // DistanceTo godot_vector3_distance_to [[const godot_vector3 * p_self] [const godot_vector3 * p_b]] godot_real
  213. func (gdt *Vector3) DistanceTo(b Vector3) Real {
  214. arg0 := gdt.getBase()
  215. arg1 := b.getBase()
  216. ret := C.go_godot_vector3_distance_to(GDNative.api, arg0, arg1)
  217. return Real(ret)
  218. }
  219. // DistanceSquaredTo godot_vector3_distance_squared_to [[const godot_vector3 * p_self] [const godot_vector3 * p_b]] godot_real
  220. func (gdt *Vector3) DistanceSquaredTo(b Vector3) Real {
  221. arg0 := gdt.getBase()
  222. arg1 := b.getBase()
  223. ret := C.go_godot_vector3_distance_squared_to(GDNative.api, arg0, arg1)
  224. return Real(ret)
  225. }
  226. // AngleTo godot_vector3_angle_to [[const godot_vector3 * p_self] [const godot_vector3 * p_to]] godot_real
  227. func (gdt *Vector3) AngleTo(to Vector3) Real {
  228. arg0 := gdt.getBase()
  229. arg1 := to.getBase()
  230. ret := C.go_godot_vector3_angle_to(GDNative.api, arg0, arg1)
  231. return Real(ret)
  232. }
  233. // Slide godot_vector3_slide [[const godot_vector3 * p_self] [const godot_vector3 * p_n]] godot_vector3
  234. func (gdt *Vector3) Slide(n Vector3) Vector3 {
  235. arg0 := gdt.getBase()
  236. arg1 := n.getBase()
  237. ret := C.go_godot_vector3_slide(GDNative.api, arg0, arg1)
  238. return Vector3{base: &ret}
  239. }
  240. // Bounce godot_vector3_bounce [[const godot_vector3 * p_self] [const godot_vector3 * p_n]] godot_vector3
  241. func (gdt *Vector3) Bounce(n Vector3) Vector3 {
  242. arg0 := gdt.getBase()
  243. arg1 := n.getBase()
  244. ret := C.go_godot_vector3_bounce(GDNative.api, arg0, arg1)
  245. return Vector3{base: &ret}
  246. }
  247. // Reflect godot_vector3_reflect [[const godot_vector3 * p_self] [const godot_vector3 * p_n]] godot_vector3
  248. func (gdt *Vector3) Reflect(n Vector3) Vector3 {
  249. arg0 := gdt.getBase()
  250. arg1 := n.getBase()
  251. ret := C.go_godot_vector3_reflect(GDNative.api, arg0, arg1)
  252. return Vector3{base: &ret}
  253. }
  254. // OperatorAdd godot_vector3_operator_add [[const godot_vector3 * p_self] [const godot_vector3 * p_b]] godot_vector3
  255. func (gdt *Vector3) OperatorAdd(b Vector3) Vector3 {
  256. arg0 := gdt.getBase()
  257. arg1 := b.getBase()
  258. ret := C.go_godot_vector3_operator_add(GDNative.api, arg0, arg1)
  259. return Vector3{base: &ret}
  260. }
  261. // OperatorSubtract godot_vector3_operator_subtract [[const godot_vector3 * p_self] [const godot_vector3 * p_b]] godot_vector3
  262. func (gdt *Vector3) OperatorSubtract(b Vector3) Vector3 {
  263. arg0 := gdt.getBase()
  264. arg1 := b.getBase()
  265. ret := C.go_godot_vector3_operator_subtract(GDNative.api, arg0, arg1)
  266. return Vector3{base: &ret}
  267. }
  268. // OperatorMultiplyVector godot_vector3_operator_multiply_vector [[const godot_vector3 * p_self] [const godot_vector3 * p_b]] godot_vector3
  269. func (gdt *Vector3) OperatorMultiplyVector(b Vector3) Vector3 {
  270. arg0 := gdt.getBase()
  271. arg1 := b.getBase()
  272. ret := C.go_godot_vector3_operator_multiply_vector(GDNative.api, arg0, arg1)
  273. return Vector3{base: &ret}
  274. }
  275. // OperatorMultiplyScalar godot_vector3_operator_multiply_scalar [[const godot_vector3 * p_self] [const godot_real p_b]] godot_vector3
  276. func (gdt *Vector3) OperatorMultiplyScalar(b Real) Vector3 {
  277. arg0 := gdt.getBase()
  278. arg1 := b.getBase()
  279. ret := C.go_godot_vector3_operator_multiply_scalar(GDNative.api, arg0, arg1)
  280. return Vector3{base: &ret}
  281. }
  282. // OperatorDivideVector godot_vector3_operator_divide_vector [[const godot_vector3 * p_self] [const godot_vector3 * p_b]] godot_vector3
  283. func (gdt *Vector3) OperatorDivideVector(b Vector3) Vector3 {
  284. arg0 := gdt.getBase()
  285. arg1 := b.getBase()
  286. ret := C.go_godot_vector3_operator_divide_vector(GDNative.api, arg0, arg1)
  287. return Vector3{base: &ret}
  288. }
  289. // OperatorDivideScalar godot_vector3_operator_divide_scalar [[const godot_vector3 * p_self] [const godot_real p_b]] godot_vector3
  290. func (gdt *Vector3) OperatorDivideScalar(b Real) Vector3 {
  291. arg0 := gdt.getBase()
  292. arg1 := b.getBase()
  293. ret := C.go_godot_vector3_operator_divide_scalar(GDNative.api, arg0, arg1)
  294. return Vector3{base: &ret}
  295. }
  296. // OperatorEqual godot_vector3_operator_equal [[const godot_vector3 * p_self] [const godot_vector3 * p_b]] godot_bool
  297. func (gdt *Vector3) OperatorEqual(b Vector3) Bool {
  298. arg0 := gdt.getBase()
  299. arg1 := b.getBase()
  300. ret := C.go_godot_vector3_operator_equal(GDNative.api, arg0, arg1)
  301. return Bool(ret)
  302. }
  303. // OperatorLess godot_vector3_operator_less [[const godot_vector3 * p_self] [const godot_vector3 * p_b]] godot_bool
  304. func (gdt *Vector3) OperatorLess(b Vector3) Bool {
  305. arg0 := gdt.getBase()
  306. arg1 := b.getBase()
  307. ret := C.go_godot_vector3_operator_less(GDNative.api, arg0, arg1)
  308. return Bool(ret)
  309. }
  310. // OperatorNeg godot_vector3_operator_neg [[const godot_vector3 * p_self]] godot_vector3
  311. func (gdt *Vector3) OperatorNeg() Vector3 {
  312. arg0 := gdt.getBase()
  313. ret := C.go_godot_vector3_operator_neg(GDNative.api, arg0)
  314. return Vector3{base: &ret}
  315. }
  316. // SetAxis godot_vector3_set_axis [[godot_vector3 * p_self] [const godot_vector3_axis p_axis] [const godot_real p_val]] void
  317. func (gdt *Vector3) SetAxis(axis Vector3Axis, val Real) {
  318. arg0 := gdt.getBase()
  319. arg1 := axis.getBase()
  320. arg2 := val.getBase()
  321. C.go_godot_vector3_set_axis(GDNative.api, arg0, arg1, arg2)
  322. }
  323. // GetAxis godot_vector3_get_axis [[const godot_vector3 * p_self] [const godot_vector3_axis p_axis]] godot_real
  324. func (gdt *Vector3) GetAxis(axis Vector3Axis) Real {
  325. arg0 := gdt.getBase()
  326. arg1 := axis.getBase()
  327. ret := C.go_godot_vector3_get_axis(GDNative.api, arg0, arg1)
  328. return Real(ret)
  329. }
  330. // Vector3Axis is a Go wrapper for the C.godot_vector3_axis enum type.
  331. type Vector3Axis int
  332. func (e Vector3Axis) getBase() C.godot_vector3_axis {
  333. return C.godot_vector3_axis(e)
  334. }
  335. const (
  336. Vector3AxisX Vector3Axis = 0
  337. Vector3AxisY Vector3Axis = 1
  338. Vector3AxisZ Vector3Axis = 2
  339. )
  340. // Vector3AxisLookupMap is a string-based lookup table of constants for Vector3Axis.
  341. var Vector3AxisLookupMap = map[string]Vector3Axis{
  342. "Vector3AxisX": Vector3AxisX,
  343. "Vector3AxisY": Vector3AxisY,
  344. "Vector3AxisZ": Vector3AxisZ,
  345. }