quat.gen.go 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354
  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/quat.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. // NewEmptyQuat will return a pointer to an empty
  49. // initialized Quat. This is primarily used in
  50. // conjunction with MethodBindPtrCall.
  51. func NewEmptyQuat() Pointer {
  52. var obj C.godot_quat
  53. return Pointer{base: unsafe.Pointer(&obj)}
  54. }
  55. // NewPointerFromQuat will return an unsafe pointer to the given
  56. // object. This is primarily used in conjunction with MethodBindPtrCall.
  57. func NewPointerFromQuat(obj Quat) Pointer {
  58. return Pointer{base: unsafe.Pointer(obj.getBase())}
  59. }
  60. // NewQuatFromPointer will return a Quat from the
  61. // given unsafe pointer. This is primarily used in conjunction with MethodBindPtrCall.
  62. func NewQuatFromPointer(ptr Pointer) Quat {
  63. return Quat{base: (*C.godot_quat)(ptr.getBase())}
  64. }
  65. // Quat data structure wrapper
  66. type Quat struct {
  67. base *C.godot_quat
  68. }
  69. // returns the wrapped C base data type for this type
  70. func (gdt Quat) getBase() *C.godot_quat {
  71. return gdt.base
  72. }
  73. // 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
  74. func NewQuat(x Real, y Real, z Real, w Real) Quat {
  75. var dest C.godot_quat
  76. arg1 := x.getBase()
  77. arg2 := y.getBase()
  78. arg3 := z.getBase()
  79. arg4 := w.getBase()
  80. C.go_godot_quat_new(GDNative.api, &dest, arg1, arg2, arg3, arg4)
  81. return Quat{base: &dest}
  82. }
  83. // NewQuatWithAxisAngle godot_quat_new_with_axis_angle [[godot_quat * r_dest] [const godot_vector3 * p_axis] [const godot_real p_angle]] void
  84. func NewQuatWithAxisAngle(axis Vector3, angle Real) Quat {
  85. var dest C.godot_quat
  86. arg1 := axis.getBase()
  87. arg2 := angle.getBase()
  88. C.go_godot_quat_new_with_axis_angle(GDNative.api, &dest, arg1, arg2)
  89. return Quat{base: &dest}
  90. }
  91. // GetX godot_quat_get_x [[const godot_quat * p_self]] godot_real
  92. func (gdt *Quat) GetX() Real {
  93. arg0 := gdt.getBase()
  94. ret := C.go_godot_quat_get_x(GDNative.api, arg0)
  95. return Real(ret)
  96. }
  97. // SetX godot_quat_set_x [[godot_quat * p_self] [const godot_real val]] void
  98. func (gdt *Quat) SetX(val Real) {
  99. arg0 := gdt.getBase()
  100. arg1 := val.getBase()
  101. C.go_godot_quat_set_x(GDNative.api, arg0, arg1)
  102. }
  103. // GetY godot_quat_get_y [[const godot_quat * p_self]] godot_real
  104. func (gdt *Quat) GetY() Real {
  105. arg0 := gdt.getBase()
  106. ret := C.go_godot_quat_get_y(GDNative.api, arg0)
  107. return Real(ret)
  108. }
  109. // SetY godot_quat_set_y [[godot_quat * p_self] [const godot_real val]] void
  110. func (gdt *Quat) SetY(val Real) {
  111. arg0 := gdt.getBase()
  112. arg1 := val.getBase()
  113. C.go_godot_quat_set_y(GDNative.api, arg0, arg1)
  114. }
  115. // GetZ godot_quat_get_z [[const godot_quat * p_self]] godot_real
  116. func (gdt *Quat) GetZ() Real {
  117. arg0 := gdt.getBase()
  118. ret := C.go_godot_quat_get_z(GDNative.api, arg0)
  119. return Real(ret)
  120. }
  121. // SetZ godot_quat_set_z [[godot_quat * p_self] [const godot_real val]] void
  122. func (gdt *Quat) SetZ(val Real) {
  123. arg0 := gdt.getBase()
  124. arg1 := val.getBase()
  125. C.go_godot_quat_set_z(GDNative.api, arg0, arg1)
  126. }
  127. // GetW godot_quat_get_w [[const godot_quat * p_self]] godot_real
  128. func (gdt *Quat) GetW() Real {
  129. arg0 := gdt.getBase()
  130. ret := C.go_godot_quat_get_w(GDNative.api, arg0)
  131. return Real(ret)
  132. }
  133. // SetW godot_quat_set_w [[godot_quat * p_self] [const godot_real val]] void
  134. func (gdt *Quat) SetW(val Real) {
  135. arg0 := gdt.getBase()
  136. arg1 := val.getBase()
  137. C.go_godot_quat_set_w(GDNative.api, arg0, arg1)
  138. }
  139. // AsString godot_quat_as_string [[const godot_quat * p_self]] godot_string
  140. func (gdt *Quat) AsString() String {
  141. arg0 := gdt.getBase()
  142. ret := C.go_godot_quat_as_string(GDNative.api, arg0)
  143. utfStr := C.go_godot_string_utf8(GDNative.api, &ret)
  144. char := C.go_godot_char_string_get_data(GDNative.api, &utfStr)
  145. goStr := C.GoString(char)
  146. C.go_godot_char_string_destroy(GDNative.api, &utfStr)
  147. return String(goStr)
  148. }
  149. // Length godot_quat_length [[const godot_quat * p_self]] godot_real
  150. func (gdt *Quat) Length() Real {
  151. arg0 := gdt.getBase()
  152. ret := C.go_godot_quat_length(GDNative.api, arg0)
  153. return Real(ret)
  154. }
  155. // LengthSquared godot_quat_length_squared [[const godot_quat * p_self]] godot_real
  156. func (gdt *Quat) LengthSquared() Real {
  157. arg0 := gdt.getBase()
  158. ret := C.go_godot_quat_length_squared(GDNative.api, arg0)
  159. return Real(ret)
  160. }
  161. // Normalized godot_quat_normalized [[const godot_quat * p_self]] godot_quat
  162. func (gdt *Quat) Normalized() Quat {
  163. arg0 := gdt.getBase()
  164. ret := C.go_godot_quat_normalized(GDNative.api, arg0)
  165. return Quat{base: &ret}
  166. }
  167. // IsNormalized godot_quat_is_normalized [[const godot_quat * p_self]] godot_bool
  168. func (gdt *Quat) IsNormalized() Bool {
  169. arg0 := gdt.getBase()
  170. ret := C.go_godot_quat_is_normalized(GDNative.api, arg0)
  171. return Bool(ret)
  172. }
  173. // Inverse godot_quat_inverse [[const godot_quat * p_self]] godot_quat
  174. func (gdt *Quat) Inverse() Quat {
  175. arg0 := gdt.getBase()
  176. ret := C.go_godot_quat_inverse(GDNative.api, arg0)
  177. return Quat{base: &ret}
  178. }
  179. // Dot godot_quat_dot [[const godot_quat * p_self] [const godot_quat * p_b]] godot_real
  180. func (gdt *Quat) Dot(b Quat) Real {
  181. arg0 := gdt.getBase()
  182. arg1 := b.getBase()
  183. ret := C.go_godot_quat_dot(GDNative.api, arg0, arg1)
  184. return Real(ret)
  185. }
  186. // Xform godot_quat_xform [[const godot_quat * p_self] [const godot_vector3 * p_v]] godot_vector3
  187. func (gdt *Quat) Xform(v Vector3) Vector3 {
  188. arg0 := gdt.getBase()
  189. arg1 := v.getBase()
  190. ret := C.go_godot_quat_xform(GDNative.api, arg0, arg1)
  191. return Vector3{base: &ret}
  192. }
  193. // Slerp godot_quat_slerp [[const godot_quat * p_self] [const godot_quat * p_b] [const godot_real p_t]] godot_quat
  194. func (gdt *Quat) Slerp(b Quat, t Real) Quat {
  195. arg0 := gdt.getBase()
  196. arg1 := b.getBase()
  197. arg2 := t.getBase()
  198. ret := C.go_godot_quat_slerp(GDNative.api, arg0, arg1, arg2)
  199. return Quat{base: &ret}
  200. }
  201. // Slerpni godot_quat_slerpni [[const godot_quat * p_self] [const godot_quat * p_b] [const godot_real p_t]] godot_quat
  202. func (gdt *Quat) Slerpni(b Quat, t Real) Quat {
  203. arg0 := gdt.getBase()
  204. arg1 := b.getBase()
  205. arg2 := t.getBase()
  206. ret := C.go_godot_quat_slerpni(GDNative.api, arg0, arg1, arg2)
  207. return Quat{base: &ret}
  208. }
  209. // 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
  210. func (gdt *Quat) CubicSlerp(b Quat, preA Quat, postB Quat, t Real) Quat {
  211. arg0 := gdt.getBase()
  212. arg1 := b.getBase()
  213. arg2 := preA.getBase()
  214. arg3 := postB.getBase()
  215. arg4 := t.getBase()
  216. ret := C.go_godot_quat_cubic_slerp(GDNative.api, arg0, arg1, arg2, arg3, arg4)
  217. return Quat{base: &ret}
  218. }
  219. // OperatorMultiply godot_quat_operator_multiply [[const godot_quat * p_self] [const godot_real p_b]] godot_quat
  220. func (gdt *Quat) OperatorMultiply(b Real) Quat {
  221. arg0 := gdt.getBase()
  222. arg1 := b.getBase()
  223. ret := C.go_godot_quat_operator_multiply(GDNative.api, arg0, arg1)
  224. return Quat{base: &ret}
  225. }
  226. // OperatorAdd godot_quat_operator_add [[const godot_quat * p_self] [const godot_quat * p_b]] godot_quat
  227. func (gdt *Quat) OperatorAdd(b Quat) Quat {
  228. arg0 := gdt.getBase()
  229. arg1 := b.getBase()
  230. ret := C.go_godot_quat_operator_add(GDNative.api, arg0, arg1)
  231. return Quat{base: &ret}
  232. }
  233. // OperatorSubtract godot_quat_operator_subtract [[const godot_quat * p_self] [const godot_quat * p_b]] godot_quat
  234. func (gdt *Quat) OperatorSubtract(b Quat) Quat {
  235. arg0 := gdt.getBase()
  236. arg1 := b.getBase()
  237. ret := C.go_godot_quat_operator_subtract(GDNative.api, arg0, arg1)
  238. return Quat{base: &ret}
  239. }
  240. // OperatorDivide godot_quat_operator_divide [[const godot_quat * p_self] [const godot_real p_b]] godot_quat
  241. func (gdt *Quat) OperatorDivide(b Real) Quat {
  242. arg0 := gdt.getBase()
  243. arg1 := b.getBase()
  244. ret := C.go_godot_quat_operator_divide(GDNative.api, arg0, arg1)
  245. return Quat{base: &ret}
  246. }
  247. // OperatorEqual godot_quat_operator_equal [[const godot_quat * p_self] [const godot_quat * p_b]] godot_bool
  248. func (gdt *Quat) OperatorEqual(b Quat) Bool {
  249. arg0 := gdt.getBase()
  250. arg1 := b.getBase()
  251. ret := C.go_godot_quat_operator_equal(GDNative.api, arg0, arg1)
  252. return Bool(ret)
  253. }
  254. // OperatorNeg godot_quat_operator_neg [[const godot_quat * p_self]] godot_quat
  255. func (gdt *Quat) OperatorNeg() Quat {
  256. arg0 := gdt.getBase()
  257. ret := C.go_godot_quat_operator_neg(GDNative.api, arg0)
  258. return Quat{base: &ret}
  259. }