Let's code

This commit is contained in:
Amaury
2020-03-25 11:00:23 +01:00
parent a4f2128fc1
commit d0d7d7da7e
125 changed files with 208076 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
# Properly detect languages on Github
*.h linguist-language=c
*.inc linguist-language=c
drivers/* linguist-vendored
*.c eol=lf
*.cpp eol=lf
*.mm eol=lf
*.h eol=lf
*.py eol=lf
*.hpp eol=lf
*.xml eol=lf
*.json eol=lf

View File

@@ -0,0 +1,21 @@
# MIT License
Copyright (c) 2017-2020 GodotNativeTools
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -0,0 +1,234 @@
# godot_headers
#### `GDNative / NativeScript`
> `GDNative` enables the use of dynamically linked libraries inside of [**Godot**](https://github.com/godotengine/godot).
> `NativeScript` uses GDNative to implement scripts backed by native code.
- [**Getting Started**](#getting-started)
- [**FAQ**](#faq)
## Getting Started
| **Build latest version of Godot** | [**GitHub**](https://github.com/godotengine/godot) | [**Docs**](https://godot.readthedocs.io/en/latest/development/compiling/index.html) |
| --- | --- | --- |
### Clone godot_headers into Library
Clone `godot_headers` under `SimpleLibrary/`
```bash
cd SimpleLibrary
git clone https://github.com/GodotNativeTools/godot_headers
```
> Note that the master branch of this repository contains the header for the latest Godot master. If you want to build GDNative modules for older versions of Godot add `-b <version>` to the git clone command above. i.e. `git clone https://github.com/GodotNativeTools/godot_headers -b 3.0` will retrieve headers compatible with Godot 3.0.
> With the exception of a breaking change in the ARVR module between 3.0 and 3.1, GDNative plugins written for an older version of Godot will work in newer versions.
```bash
[SimpleLibrary]
├── lib/
└── src/
```
### Create Script
Create `test.c` under `SimpleLibrary/src/`
<details>
```c
#include <gdnative/gdnative.h>
#include <nativescript/godot_nativescript.h>
#include <stdio.h>
void *test_constructor(godot_object *obj, void *method_data) {
printf("test.constructor()\n");
return 0;
}
void test_destructor(godot_object *obj, void *method_data, void *user_data) {
printf("test.destructor()\n");
}
/** func _ready() **/
godot_variant test_ready(godot_object *obj, void *method_data, void *user_data, int num_args, godot_variant **args) {
godot_variant ret;
godot_variant_new_nil(&ret);
printf("_ready()\n");
return ret;
}
/** Library entry point **/
void GDN_EXPORT godot_gdnative_init(godot_gdnative_init_options *o) {
}
/** Library de-initialization **/
void GDN_EXPORT godot_gdnative_terminate(godot_gdnative_terminate_options *o) {
}
/** Script entry (Registering all the classes and stuff) **/
void GDN_EXPORT godot_nativescript_init(void *desc) {
printf("nativescript init\n");
godot_instance_create_func create_func = {
.create_func = &test_constructor,
.method_data = 0,
.free_func = 0
};
godot_instance_destroy_func destroy_func = {
.destroy_func = &test_destructor,
.method_data = 0,
.free_func = 0
};
godot_nativescript_register_class(desc, "SimpleClass", "Node", create_func, destroy_func);
{
godot_instance_method method = {
.method = &test_ready,
.method_data = 0,
.free_func = 0
};
godot_method_attributes attr = {
.rpc_type = GODOT_METHOD_RPC_MODE_DISABLED
};
godot_nativescript_register_method(desc, "SimpleClass", "_ready", attr, method);
}
}
godot_variant GDN_EXPORT some_test_procedure(void *data, godot_array *args) {
godot_variant ret;
godot_variant_new_int(&ret, 42);
godot_string s;
godot_string_new_unicode_data(&s, L"Hello World", 11);
godot_print(&s);
godot_string_destroy(&s);
return ret;
}
```
</details>
`Expand details for example code.`
### Compile Library
On Linux:
```bash
clang -g -fPIC -std=c99 -c src/test.c -I/path/to/godot/headers/ -o src/test.os
clang -g -shared src/test.os -o lib/test.so
```
On MacOS:
```bash
clang -g -fPIC -std=c99 -c src/test.c -I/path/to/godot/headers/ -o src/test.os
clang -g -shared -framework Cocoa -Wl,-undefined,dynamic_lookup src/test.os -o lib/test.dylib
```
- `-g` is for debugging information.
- Use `godot_nativescript_*` methods only in the `nativescript_init()` function.
### Create GDNativeLibrary Resource
The GDNativeLibrary resource contains links to the libraries for each platform.
1. Create a new resource in memory and edit it.
1. Select `Resource > GDNativeLibrary`.
1. Set the library file for your platform inside the inspector.
1. Save the edited resource as a `.tres`
<details>
![](images/faq/dllibrary_create_new_resource.png?raw=true)
![](images/faq/dllibrary_create_new_dllibrary.png?raw=true)
![](images/faq/dllibrary_save_as_resource.png?raw=true)
*Note*: Remember to save `GDNativeLibrary` as `.gdnlib`
</details>
`Expand details for screenshots.`
### Using GDNativeLibrary in GDScript
```gdscript
extends Node
func _ready():
var gdn = GDNative.new()
gdn.library = load("res://lib/libtest.tres")
gdn.initialize()
var res = gdn.call_native("standard_varcall", "some_test_procedure", [])
print("result: ", res)
gdn.terminate()
```
### Attaching GDNativeLibrary to a Node
1. Attach a new script to a node.
1. In the pop-up dialog, choose NativeScript in the `Language` menu.
1. Enable built-in script, or create a `.gdn` file, which only contains a name.
1. Specify the `Class Name`.
1. Press `Create`.
The GDNativeLibrary field in a NativeScript is empty by default.
<details>
![](images/faq/create_dlscript.png?raw=true)
![](images/faq/set_script_dllibrary.png?raw=true)
</details>
`Expand details for screenshots.`
## FAQ
**What is the difference between `GDNative` and `NativeScript`?**
`GDNative` is a new class that can call native functions in libraries.
GDScript / VisualScript / C#, etc, are able to use this class.
Godot treats `NativeScript` as a scripting language, enabling the
use of GDNative to implement scripts backed by native code.
**Which languages are binding as a NativeScript?**
[**C++**](https://github.com/GodotNativeTools/cpp_bindings),
[**D**](https://github.com/GodotNativeTools/d_bindings),
[**Nim**](https://github.com/pragmagic/godot-nim)
**Can you debug NativeScripts?**
You must compile the library with debug
symbols, and then you can use your debugger as usual.
**Can you use one GDNativeLibrary for all NativeScripts?**
You can! ✨
**What is the reason behind the name "GDNative"?**
GDNative was originally named "cscript" because it exposes a C API, but people
mistook a relation to C#, which is sometimes abbreviated as "cs". Then named "DLScript", but that brought up some confusion, so we settled with
GDNative. 📖

View File

@@ -0,0 +1,56 @@
/*************************************************************************/
/* godot_android.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef GODOT_ANDROID_GDN_H
#define GODOT_ANDROID_GDN_H
#include <gdnative/gdnative.h>
#ifdef __ANDROID__
#include <jni.h>
#else
#define JNIEnv void
#define jobject void *
#endif
#ifdef __cplusplus
extern "C" {
#endif
JNIEnv *GDAPI godot_android_get_env();
jobject GDAPI godot_android_get_activity();
jobject GDAPI godot_android_get_surface();
bool GDAPI godot_android_is_activity_resumed();
#ifdef __cplusplus
}
#endif
#endif /* !GODOT_ANDROID_GDN_H */

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,92 @@
/*************************************************************************/
/* godot_arvr.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef GODOT_NATIVEARVR_H
#define GODOT_NATIVEARVR_H
#include <gdnative/gdnative.h>
#ifdef __cplusplus
extern "C" {
#endif
// For future versions of the API we should only add new functions at the end of the structure and use the
// version info to detect whether a call is available
// Use these to populate version in your plugin
#define GODOTVR_API_MAJOR 1
#define GODOTVR_API_MINOR 1
typedef struct {
godot_gdnative_api_version version; /* version of our API */
void *(*constructor)(godot_object *);
void (*destructor)(void *);
godot_string (*get_name)(const void *);
godot_int (*get_capabilities)(const void *);
godot_bool (*get_anchor_detection_is_enabled)(const void *);
void (*set_anchor_detection_is_enabled)(void *, godot_bool);
godot_bool (*is_stereo)(const void *);
godot_bool (*is_initialized)(const void *);
godot_bool (*initialize)(void *);
void (*uninitialize)(void *);
godot_vector2 (*get_render_targetsize)(const void *);
godot_transform (*get_transform_for_eye)(void *, godot_int, godot_transform *);
void (*fill_projection_for_eye)(void *, godot_real *, godot_int, godot_real, godot_real, godot_real);
void (*commit_for_eye)(void *, godot_int, godot_rid *, godot_rect2 *);
void (*process)(void *);
// only in 1.1 onwards
godot_int (*get_external_texture_for_eye)(void *, godot_int);
void (*notification)(void *, godot_int);
godot_int (*get_camera_feed_id)(void *);
} godot_arvr_interface_gdnative;
void GDAPI godot_arvr_register_interface(const godot_arvr_interface_gdnative *p_interface);
// helper functions to access ARVRServer data
godot_real GDAPI godot_arvr_get_worldscale();
godot_transform GDAPI godot_arvr_get_reference_frame();
// helper functions for rendering
void GDAPI godot_arvr_blit(godot_int p_eye, godot_rid *p_render_target, godot_rect2 *p_rect);
godot_int GDAPI godot_arvr_get_texid(godot_rid *p_render_target);
// helper functions for updating ARVR controllers
godot_int GDAPI godot_arvr_add_controller(char *p_device_name, godot_int p_hand, godot_bool p_tracks_orientation, godot_bool p_tracks_position);
void GDAPI godot_arvr_remove_controller(godot_int p_controller_id);
void GDAPI godot_arvr_set_controller_transform(godot_int p_controller_id, godot_transform *p_transform, godot_bool p_tracks_orientation, godot_bool p_tracks_position);
void GDAPI godot_arvr_set_controller_button(godot_int p_controller_id, godot_int p_button, godot_bool p_is_pressed);
void GDAPI godot_arvr_set_controller_axis(godot_int p_controller_id, godot_int p_axis, godot_real p_value, godot_bool p_can_be_negative);
godot_real GDAPI godot_arvr_get_controller_rumble(godot_int p_controller_id);
#ifdef __cplusplus
}
#endif
#endif /* !GODOT_NATIVEARVR_H */

View File

@@ -0,0 +1,118 @@
/*************************************************************************/
/* aabb.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef GODOT_AABB_H
#define GODOT_AABB_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#define GODOT_AABB_SIZE 24
#ifndef GODOT_CORE_API_GODOT_AABB_TYPE_DEFINED
#define GODOT_CORE_API_GODOT_AABB_TYPE_DEFINED
typedef struct {
uint8_t _dont_touch_that[GODOT_AABB_SIZE];
} godot_aabb;
#endif
// reduce extern "C" nesting for VS2013
#ifdef __cplusplus
}
#endif
#include <gdnative/gdnative.h>
#include <gdnative/plane.h>
#include <gdnative/vector3.h>
#ifdef __cplusplus
extern "C" {
#endif
void GDAPI godot_aabb_new(godot_aabb *r_dest, const godot_vector3 *p_pos, const godot_vector3 *p_size);
godot_vector3 GDAPI godot_aabb_get_position(const godot_aabb *p_self);
void GDAPI godot_aabb_set_position(const godot_aabb *p_self, const godot_vector3 *p_v);
godot_vector3 GDAPI godot_aabb_get_size(const godot_aabb *p_self);
void GDAPI godot_aabb_set_size(const godot_aabb *p_self, const godot_vector3 *p_v);
godot_string GDAPI godot_aabb_as_string(const godot_aabb *p_self);
godot_real GDAPI godot_aabb_get_area(const godot_aabb *p_self);
godot_bool GDAPI godot_aabb_has_no_area(const godot_aabb *p_self);
godot_bool GDAPI godot_aabb_has_no_surface(const godot_aabb *p_self);
godot_bool GDAPI godot_aabb_intersects(const godot_aabb *p_self, const godot_aabb *p_with);
godot_bool GDAPI godot_aabb_encloses(const godot_aabb *p_self, const godot_aabb *p_with);
godot_aabb GDAPI godot_aabb_merge(const godot_aabb *p_self, const godot_aabb *p_with);
godot_aabb GDAPI godot_aabb_intersection(const godot_aabb *p_self, const godot_aabb *p_with);
godot_bool GDAPI godot_aabb_intersects_plane(const godot_aabb *p_self, const godot_plane *p_plane);
godot_bool GDAPI godot_aabb_intersects_segment(const godot_aabb *p_self, const godot_vector3 *p_from, const godot_vector3 *p_to);
godot_bool GDAPI godot_aabb_has_point(const godot_aabb *p_self, const godot_vector3 *p_point);
godot_vector3 GDAPI godot_aabb_get_support(const godot_aabb *p_self, const godot_vector3 *p_dir);
godot_vector3 GDAPI godot_aabb_get_longest_axis(const godot_aabb *p_self);
godot_int GDAPI godot_aabb_get_longest_axis_index(const godot_aabb *p_self);
godot_real GDAPI godot_aabb_get_longest_axis_size(const godot_aabb *p_self);
godot_vector3 GDAPI godot_aabb_get_shortest_axis(const godot_aabb *p_self);
godot_int GDAPI godot_aabb_get_shortest_axis_index(const godot_aabb *p_self);
godot_real GDAPI godot_aabb_get_shortest_axis_size(const godot_aabb *p_self);
godot_aabb GDAPI godot_aabb_expand(const godot_aabb *p_self, const godot_vector3 *p_to_point);
godot_aabb GDAPI godot_aabb_grow(const godot_aabb *p_self, const godot_real p_by);
godot_vector3 GDAPI godot_aabb_get_endpoint(const godot_aabb *p_self, const godot_int p_idx);
godot_bool GDAPI godot_aabb_operator_equal(const godot_aabb *p_self, const godot_aabb *p_b);
#ifdef __cplusplus
}
#endif
#endif // GODOT_AABB_H

View File

@@ -0,0 +1,147 @@
/*************************************************************************/
/* array.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef GODOT_ARRAY_H
#define GODOT_ARRAY_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#define GODOT_ARRAY_SIZE sizeof(void *)
#ifndef GODOT_CORE_API_GODOT_ARRAY_TYPE_DEFINED
#define GODOT_CORE_API_GODOT_ARRAY_TYPE_DEFINED
typedef struct {
uint8_t _dont_touch_that[GODOT_ARRAY_SIZE];
} godot_array;
#endif
// reduce extern "C" nesting for VS2013
#ifdef __cplusplus
}
#endif
#include <gdnative/pool_arrays.h>
#include <gdnative/variant.h>
#include <gdnative/gdnative.h>
#ifdef __cplusplus
extern "C" {
#endif
void GDAPI godot_array_new(godot_array *r_dest);
void GDAPI godot_array_new_copy(godot_array *r_dest, const godot_array *p_src);
void GDAPI godot_array_new_pool_color_array(godot_array *r_dest, const godot_pool_color_array *p_pca);
void GDAPI godot_array_new_pool_vector3_array(godot_array *r_dest, const godot_pool_vector3_array *p_pv3a);
void GDAPI godot_array_new_pool_vector2_array(godot_array *r_dest, const godot_pool_vector2_array *p_pv2a);
void GDAPI godot_array_new_pool_string_array(godot_array *r_dest, const godot_pool_string_array *p_psa);
void GDAPI godot_array_new_pool_real_array(godot_array *r_dest, const godot_pool_real_array *p_pra);
void GDAPI godot_array_new_pool_int_array(godot_array *r_dest, const godot_pool_int_array *p_pia);
void GDAPI godot_array_new_pool_byte_array(godot_array *r_dest, const godot_pool_byte_array *p_pba);
void GDAPI godot_array_set(godot_array *p_self, const godot_int p_idx, const godot_variant *p_value);
godot_variant GDAPI godot_array_get(const godot_array *p_self, const godot_int p_idx);
godot_variant GDAPI *godot_array_operator_index(godot_array *p_self, const godot_int p_idx);
const godot_variant GDAPI *godot_array_operator_index_const(const godot_array *p_self, const godot_int p_idx);
void GDAPI godot_array_append(godot_array *p_self, const godot_variant *p_value);
void GDAPI godot_array_clear(godot_array *p_self);
godot_int GDAPI godot_array_count(const godot_array *p_self, const godot_variant *p_value);
godot_bool GDAPI godot_array_empty(const godot_array *p_self);
void GDAPI godot_array_erase(godot_array *p_self, const godot_variant *p_value);
godot_variant GDAPI godot_array_front(const godot_array *p_self);
godot_variant GDAPI godot_array_back(const godot_array *p_self);
godot_int GDAPI godot_array_find(const godot_array *p_self, const godot_variant *p_what, const godot_int p_from);
godot_int GDAPI godot_array_find_last(const godot_array *p_self, const godot_variant *p_what);
godot_bool GDAPI godot_array_has(const godot_array *p_self, const godot_variant *p_value);
godot_int GDAPI godot_array_hash(const godot_array *p_self);
void GDAPI godot_array_insert(godot_array *p_self, const godot_int p_pos, const godot_variant *p_value);
void GDAPI godot_array_invert(godot_array *p_self);
godot_variant GDAPI godot_array_pop_back(godot_array *p_self);
godot_variant GDAPI godot_array_pop_front(godot_array *p_self);
void GDAPI godot_array_push_back(godot_array *p_self, const godot_variant *p_value);
void GDAPI godot_array_push_front(godot_array *p_self, const godot_variant *p_value);
void GDAPI godot_array_remove(godot_array *p_self, const godot_int p_idx);
void GDAPI godot_array_resize(godot_array *p_self, const godot_int p_size);
godot_int GDAPI godot_array_rfind(const godot_array *p_self, const godot_variant *p_what, const godot_int p_from);
godot_int GDAPI godot_array_size(const godot_array *p_self);
void GDAPI godot_array_sort(godot_array *p_self);
void GDAPI godot_array_sort_custom(godot_array *p_self, godot_object *p_obj, const godot_string *p_func);
godot_int GDAPI godot_array_bsearch(godot_array *p_self, const godot_variant *p_value, const godot_bool p_before);
godot_int GDAPI godot_array_bsearch_custom(godot_array *p_self, const godot_variant *p_value, godot_object *p_obj, const godot_string *p_func, const godot_bool p_before);
void GDAPI godot_array_destroy(godot_array *p_self);
godot_array GDAPI godot_array_duplicate(const godot_array *p_self, const godot_bool p_deep);
godot_array GDAPI godot_array_slice(const godot_array *p_self, const godot_int p_begin, const godot_int p_end, const godot_int p_step, const godot_bool p_deep);
godot_variant GDAPI godot_array_max(const godot_array *p_self);
godot_variant GDAPI godot_array_min(const godot_array *p_self);
void GDAPI godot_array_shuffle(godot_array *p_self);
#ifdef __cplusplus
}
#endif
#endif // GODOT_ARRAY_H

View File

@@ -0,0 +1,136 @@
/*************************************************************************/
/* basis.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef GODOT_BASIS_H
#define GODOT_BASIS_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#define GODOT_BASIS_SIZE 36
#ifndef GODOT_CORE_API_GODOT_BASIS_TYPE_DEFINED
#define GODOT_CORE_API_GODOT_BASIS_TYPE_DEFINED
typedef struct {
uint8_t _dont_touch_that[GODOT_BASIS_SIZE];
} godot_basis;
#endif
// reduce extern "C" nesting for VS2013
#ifdef __cplusplus
}
#endif
#include <gdnative/gdnative.h>
#include <gdnative/quat.h>
#include <gdnative/vector3.h>
#ifdef __cplusplus
extern "C" {
#endif
void GDAPI godot_basis_new_with_rows(godot_basis *r_dest, const godot_vector3 *p_x_axis, const godot_vector3 *p_y_axis, const godot_vector3 *p_z_axis);
void GDAPI godot_basis_new_with_axis_and_angle(godot_basis *r_dest, const godot_vector3 *p_axis, const godot_real p_phi);
void GDAPI godot_basis_new_with_euler(godot_basis *r_dest, const godot_vector3 *p_euler);
void GDAPI godot_basis_new_with_euler_quat(godot_basis *r_dest, const godot_quat *p_euler);
godot_string GDAPI godot_basis_as_string(const godot_basis *p_self);
godot_basis GDAPI godot_basis_inverse(const godot_basis *p_self);
godot_basis GDAPI godot_basis_transposed(const godot_basis *p_self);
godot_basis GDAPI godot_basis_orthonormalized(const godot_basis *p_self);
godot_real GDAPI godot_basis_determinant(const godot_basis *p_self);
godot_basis GDAPI godot_basis_rotated(const godot_basis *p_self, const godot_vector3 *p_axis, const godot_real p_phi);
godot_basis GDAPI godot_basis_scaled(const godot_basis *p_self, const godot_vector3 *p_scale);
godot_vector3 GDAPI godot_basis_get_scale(const godot_basis *p_self);
godot_vector3 GDAPI godot_basis_get_euler(const godot_basis *p_self);
godot_quat GDAPI godot_basis_get_quat(const godot_basis *p_self);
void GDAPI godot_basis_set_quat(godot_basis *p_self, const godot_quat *p_quat);
void GDAPI godot_basis_set_axis_angle_scale(godot_basis *p_self, const godot_vector3 *p_axis, godot_real p_phi, const godot_vector3 *p_scale);
void GDAPI godot_basis_set_euler_scale(godot_basis *p_self, const godot_vector3 *p_euler, const godot_vector3 *p_scale);
void GDAPI godot_basis_set_quat_scale(godot_basis *p_self, const godot_quat *p_quat, const godot_vector3 *p_scale);
godot_real GDAPI godot_basis_tdotx(const godot_basis *p_self, const godot_vector3 *p_with);
godot_real GDAPI godot_basis_tdoty(const godot_basis *p_self, const godot_vector3 *p_with);
godot_real GDAPI godot_basis_tdotz(const godot_basis *p_self, const godot_vector3 *p_with);
godot_vector3 GDAPI godot_basis_xform(const godot_basis *p_self, const godot_vector3 *p_v);
godot_vector3 GDAPI godot_basis_xform_inv(const godot_basis *p_self, const godot_vector3 *p_v);
godot_int GDAPI godot_basis_get_orthogonal_index(const godot_basis *p_self);
void GDAPI godot_basis_new(godot_basis *r_dest);
// p_elements is a pointer to an array of 3 (!!) vector3
void GDAPI godot_basis_get_elements(const godot_basis *p_self, godot_vector3 *p_elements);
godot_vector3 GDAPI godot_basis_get_axis(const godot_basis *p_self, const godot_int p_axis);
void GDAPI godot_basis_set_axis(godot_basis *p_self, const godot_int p_axis, const godot_vector3 *p_value);
godot_vector3 GDAPI godot_basis_get_row(const godot_basis *p_self, const godot_int p_row);
void GDAPI godot_basis_set_row(godot_basis *p_self, const godot_int p_row, const godot_vector3 *p_value);
godot_bool GDAPI godot_basis_operator_equal(const godot_basis *p_self, const godot_basis *p_b);
godot_basis GDAPI godot_basis_operator_add(const godot_basis *p_self, const godot_basis *p_b);
godot_basis GDAPI godot_basis_operator_subtract(const godot_basis *p_self, const godot_basis *p_b);
godot_basis GDAPI godot_basis_operator_multiply_vector(const godot_basis *p_self, const godot_basis *p_b);
godot_basis GDAPI godot_basis_operator_multiply_scalar(const godot_basis *p_self, const godot_real p_b);
godot_basis GDAPI godot_basis_slerp(const godot_basis *p_self, const godot_basis *p_b, const godot_real p_t);
#ifdef __cplusplus
}
#endif
#endif // GODOT_BASIS_H

View File

@@ -0,0 +1,120 @@
/*************************************************************************/
/* color.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef GODOT_COLOR_H
#define GODOT_COLOR_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#define GODOT_COLOR_SIZE 16
#ifndef GODOT_CORE_API_GODOT_COLOR_TYPE_DEFINED
#define GODOT_CORE_API_GODOT_COLOR_TYPE_DEFINED
typedef struct {
uint8_t _dont_touch_that[GODOT_COLOR_SIZE];
} godot_color;
#endif
// reduce extern "C" nesting for VS2013
#ifdef __cplusplus
}
#endif
#include <gdnative/gdnative.h>
#include <gdnative/string.h>
#ifdef __cplusplus
extern "C" {
#endif
void GDAPI godot_color_new_rgba(godot_color *r_dest, const godot_real p_r, const godot_real p_g, const godot_real p_b, const godot_real p_a);
void GDAPI godot_color_new_rgb(godot_color *r_dest, const godot_real p_r, const godot_real p_g, const godot_real p_b);
godot_real godot_color_get_r(const godot_color *p_self);
void godot_color_set_r(godot_color *p_self, const godot_real r);
godot_real godot_color_get_g(const godot_color *p_self);
void godot_color_set_g(godot_color *p_self, const godot_real g);
godot_real godot_color_get_b(const godot_color *p_self);
void godot_color_set_b(godot_color *p_self, const godot_real b);
godot_real godot_color_get_a(const godot_color *p_self);
void godot_color_set_a(godot_color *p_self, const godot_real a);
godot_real godot_color_get_h(const godot_color *p_self);
godot_real godot_color_get_s(const godot_color *p_self);
godot_real godot_color_get_v(const godot_color *p_self);
godot_string GDAPI godot_color_as_string(const godot_color *p_self);
godot_int GDAPI godot_color_to_rgba32(const godot_color *p_self);
godot_int GDAPI godot_color_to_abgr32(const godot_color *p_self);
godot_int GDAPI godot_color_to_abgr64(const godot_color *p_self);
godot_int GDAPI godot_color_to_argb64(const godot_color *p_self);
godot_int GDAPI godot_color_to_rgba64(const godot_color *p_self);
godot_int GDAPI godot_color_to_argb32(const godot_color *p_self);
godot_real GDAPI godot_color_gray(const godot_color *p_self);
godot_color GDAPI godot_color_inverted(const godot_color *p_self);
godot_color GDAPI godot_color_contrasted(const godot_color *p_self);
godot_color GDAPI godot_color_linear_interpolate(const godot_color *p_self, const godot_color *p_b, const godot_real p_t);
godot_color GDAPI godot_color_blend(const godot_color *p_self, const godot_color *p_over);
godot_color GDAPI godot_color_darkened(const godot_color *p_self, const godot_real p_amount);
godot_color GDAPI godot_color_from_hsv(const godot_color *p_self, const godot_real p_h, const godot_real p_s, const godot_real p_v, const godot_real p_a);
godot_color GDAPI godot_color_lightened(const godot_color *p_self, const godot_real p_amount);
godot_string GDAPI godot_color_to_html(const godot_color *p_self, const godot_bool p_with_alpha);
godot_bool GDAPI godot_color_operator_equal(const godot_color *p_self, const godot_color *p_b);
godot_bool GDAPI godot_color_operator_less(const godot_color *p_self, const godot_color *p_b);
#ifdef __cplusplus
}
#endif
#endif // GODOT_COLOR_H

View File

@@ -0,0 +1,109 @@
/*************************************************************************/
/* dictionary.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef GODOT_DICTIONARY_H
#define GODOT_DICTIONARY_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#define GODOT_DICTIONARY_SIZE sizeof(void *)
#ifndef GODOT_CORE_API_GODOT_DICTIONARY_TYPE_DEFINED
#define GODOT_CORE_API_GODOT_DICTIONARY_TYPE_DEFINED
typedef struct {
uint8_t _dont_touch_that[GODOT_DICTIONARY_SIZE];
} godot_dictionary;
#endif
// reduce extern "C" nesting for VS2013
#ifdef __cplusplus
}
#endif
#include <gdnative/array.h>
#include <gdnative/gdnative.h>
#include <gdnative/variant.h>
#ifdef __cplusplus
extern "C" {
#endif
void GDAPI godot_dictionary_new(godot_dictionary *r_dest);
void GDAPI godot_dictionary_new_copy(godot_dictionary *r_dest, const godot_dictionary *p_src);
void GDAPI godot_dictionary_destroy(godot_dictionary *p_self);
godot_dictionary GDAPI godot_dictionary_duplicate(const godot_dictionary *p_self, const godot_bool p_deep);
godot_int GDAPI godot_dictionary_size(const godot_dictionary *p_self);
godot_bool GDAPI godot_dictionary_empty(const godot_dictionary *p_self);
void GDAPI godot_dictionary_clear(godot_dictionary *p_self);
godot_bool GDAPI godot_dictionary_has(const godot_dictionary *p_self, const godot_variant *p_key);
godot_bool GDAPI godot_dictionary_has_all(const godot_dictionary *p_self, const godot_array *p_keys);
void GDAPI godot_dictionary_erase(godot_dictionary *p_self, const godot_variant *p_key);
godot_int GDAPI godot_dictionary_hash(const godot_dictionary *p_self);
godot_array GDAPI godot_dictionary_keys(const godot_dictionary *p_self);
godot_array GDAPI godot_dictionary_values(const godot_dictionary *p_self);
godot_variant GDAPI godot_dictionary_get(const godot_dictionary *p_self, const godot_variant *p_key);
void GDAPI godot_dictionary_set(godot_dictionary *p_self, const godot_variant *p_key, const godot_variant *p_value);
godot_variant GDAPI *godot_dictionary_operator_index(godot_dictionary *p_self, const godot_variant *p_key);
const godot_variant GDAPI *godot_dictionary_operator_index_const(const godot_dictionary *p_self, const godot_variant *p_key);
godot_variant GDAPI *godot_dictionary_next(const godot_dictionary *p_self, const godot_variant *p_key);
godot_bool GDAPI godot_dictionary_operator_equal(const godot_dictionary *p_self, const godot_dictionary *p_b);
godot_string GDAPI godot_dictionary_to_json(const godot_dictionary *p_self);
// GDNative core 1.1
godot_bool GDAPI godot_dictionary_erase_with_return(godot_dictionary *p_self, const godot_variant *p_key);
godot_variant GDAPI godot_dictionary_get_with_default(const godot_dictionary *p_self, const godot_variant *p_key, const godot_variant *p_default);
#ifdef __cplusplus
}
#endif
#endif // GODOT_DICTIONARY_H

View File

@@ -0,0 +1,300 @@
/*************************************************************************/
/* gdnative.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef GODOT_GDNATIVE_H
#define GODOT_GDNATIVE_H
#ifdef __cplusplus
extern "C" {
#endif
#if defined(_WIN32) || defined(__ANDROID__)
#define GDCALLINGCONV
#define GDAPI GDCALLINGCONV
#elif defined(__APPLE__)
#include "TargetConditionals.h"
#if TARGET_OS_IPHONE
#define GDCALLINGCONV __attribute__((visibility("default")))
#define GDAPI GDCALLINGCONV
#elif TARGET_OS_MAC
#define GDCALLINGCONV __attribute__((sysv_abi))
#define GDAPI GDCALLINGCONV
#endif
#else // !_WIN32 && !__APPLE__
#define GDCALLINGCONV __attribute__((sysv_abi))
#define GDAPI GDCALLINGCONV
#endif
// This is for libraries *using* the header, NOT GODOT EXPOSING STUFF!!
#ifdef _WIN32
#define GDN_EXPORT __declspec(dllexport)
#else
#define GDN_EXPORT
#endif
#include <stdbool.h>
#include <stdint.h>
#define GODOT_API_VERSION 1
////// Error
typedef enum {
GODOT_OK, // (0)
GODOT_FAILED, ///< Generic fail error
GODOT_ERR_UNAVAILABLE, ///< What is requested is unsupported/unavailable
GODOT_ERR_UNCONFIGURED, ///< The object being used hasn't been properly set up yet
GODOT_ERR_UNAUTHORIZED, ///< Missing credentials for requested resource
GODOT_ERR_PARAMETER_RANGE_ERROR, ///< Parameter given out of range (5)
GODOT_ERR_OUT_OF_MEMORY, ///< Out of memory
GODOT_ERR_FILE_NOT_FOUND,
GODOT_ERR_FILE_BAD_DRIVE,
GODOT_ERR_FILE_BAD_PATH,
GODOT_ERR_FILE_NO_PERMISSION, // (10)
GODOT_ERR_FILE_ALREADY_IN_USE,
GODOT_ERR_FILE_CANT_OPEN,
GODOT_ERR_FILE_CANT_WRITE,
GODOT_ERR_FILE_CANT_READ,
GODOT_ERR_FILE_UNRECOGNIZED, // (15)
GODOT_ERR_FILE_CORRUPT,
GODOT_ERR_FILE_MISSING_DEPENDENCIES,
GODOT_ERR_FILE_EOF,
GODOT_ERR_CANT_OPEN, ///< Can't open a resource/socket/file
GODOT_ERR_CANT_CREATE, // (20)
GODOT_ERR_QUERY_FAILED,
GODOT_ERR_ALREADY_IN_USE,
GODOT_ERR_LOCKED, ///< resource is locked
GODOT_ERR_TIMEOUT,
GODOT_ERR_CANT_CONNECT, // (25)
GODOT_ERR_CANT_RESOLVE,
GODOT_ERR_CONNECTION_ERROR,
GODOT_ERR_CANT_ACQUIRE_RESOURCE,
GODOT_ERR_CANT_FORK,
GODOT_ERR_INVALID_DATA, ///< Data passed is invalid (30)
GODOT_ERR_INVALID_PARAMETER, ///< Parameter passed is invalid
GODOT_ERR_ALREADY_EXISTS, ///< When adding, item already exists
GODOT_ERR_DOES_NOT_EXIST, ///< When retrieving/erasing, it item does not exist
GODOT_ERR_DATABASE_CANT_READ, ///< database is full
GODOT_ERR_DATABASE_CANT_WRITE, ///< database is full (35)
GODOT_ERR_COMPILATION_FAILED,
GODOT_ERR_METHOD_NOT_FOUND,
GODOT_ERR_LINK_FAILED,
GODOT_ERR_SCRIPT_FAILED,
GODOT_ERR_CYCLIC_LINK, // (40)
GODOT_ERR_INVALID_DECLARATION,
GODOT_ERR_DUPLICATE_SYMBOL,
GODOT_ERR_PARSE_ERROR,
GODOT_ERR_BUSY,
GODOT_ERR_SKIP, // (45)
GODOT_ERR_HELP, ///< user requested help!!
GODOT_ERR_BUG, ///< a bug in the software certainly happened, due to a double check failing or unexpected behavior.
GODOT_ERR_PRINTER_ON_FIRE, /// the parallel port printer is engulfed in flames
} godot_error;
////// bool
typedef bool godot_bool;
#define GODOT_TRUE 1
#define GODOT_FALSE 0
/////// int
typedef int godot_int;
/////// real
typedef float godot_real;
/////// Object (forward declared)
typedef void godot_object;
/////// String
#include <gdnative/string.h>
/////// String name
#include <gdnative/string_name.h>
////// Vector2
#include <gdnative/vector2.h>
////// Rect2
#include <gdnative/rect2.h>
////// Vector3
#include <gdnative/vector3.h>
////// Transform2D
#include <gdnative/transform2d.h>
/////// Plane
#include <gdnative/plane.h>
/////// Quat
#include <gdnative/quat.h>
/////// AABB
#include <gdnative/aabb.h>
/////// Basis
#include <gdnative/basis.h>
/////// Transform
#include <gdnative/transform.h>
/////// Color
#include <gdnative/color.h>
/////// NodePath
#include <gdnative/node_path.h>
/////// RID
#include <gdnative/rid.h>
/////// Dictionary
#include <gdnative/dictionary.h>
/////// Array
#include <gdnative/array.h>
// single API file for Pool*Array
#include <gdnative/pool_arrays.h>
void GDAPI godot_object_destroy(godot_object *p_o);
////// Variant
#include <gdnative/variant.h>
////// Singleton API
godot_object GDAPI *godot_global_get_singleton(char *p_name); // result shouldn't be freed
////// MethodBind API
typedef struct {
uint8_t _dont_touch_that[1]; // TODO
} godot_method_bind;
godot_method_bind GDAPI *godot_method_bind_get_method(const char *p_classname, const char *p_methodname);
void GDAPI godot_method_bind_ptrcall(godot_method_bind *p_method_bind, godot_object *p_instance, const void **p_args, void *p_ret);
godot_variant GDAPI godot_method_bind_call(godot_method_bind *p_method_bind, godot_object *p_instance, const godot_variant **p_args, const int p_arg_count, godot_variant_call_error *p_call_error);
////// Script API
typedef struct godot_gdnative_api_version {
unsigned int major;
unsigned int minor;
} godot_gdnative_api_version;
typedef struct godot_gdnative_api_struct godot_gdnative_api_struct;
struct godot_gdnative_api_struct {
unsigned int type;
godot_gdnative_api_version version;
const godot_gdnative_api_struct *next;
};
#define GDNATIVE_VERSION_COMPATIBLE(want, have) (want.major == have.major && want.minor <= have.minor)
typedef struct {
godot_bool in_editor;
uint64_t core_api_hash;
uint64_t editor_api_hash;
uint64_t no_api_hash;
void (*report_version_mismatch)(const godot_object *p_library, const char *p_what, godot_gdnative_api_version p_want, godot_gdnative_api_version p_have);
void (*report_loading_error)(const godot_object *p_library, const char *p_what);
godot_object *gd_native_library; // pointer to GDNativeLibrary that is being initialized
const struct godot_gdnative_core_api_struct *api_struct;
const godot_string *active_library_path;
} godot_gdnative_init_options;
typedef struct {
godot_bool in_editor;
} godot_gdnative_terminate_options;
// Calling convention?
typedef godot_object *(*godot_class_constructor)();
godot_class_constructor GDAPI godot_get_class_constructor(const char *p_classname);
godot_dictionary GDAPI godot_get_global_constants();
////// GDNative procedure types
typedef void (*godot_gdnative_init_fn)(godot_gdnative_init_options *);
typedef void (*godot_gdnative_terminate_fn)(godot_gdnative_terminate_options *);
typedef godot_variant (*godot_gdnative_procedure_fn)(godot_array *);
////// System Functions
typedef godot_variant (*native_call_cb)(void *, godot_array *);
void GDAPI godot_register_native_call_type(const char *p_call_type, native_call_cb p_callback);
//using these will help Godot track how much memory is in use in debug mode
void GDAPI *godot_alloc(int p_bytes);
void GDAPI *godot_realloc(void *p_ptr, int p_bytes);
void GDAPI godot_free(void *p_ptr);
//print using Godot's error handler list
void GDAPI godot_print_error(const char *p_description, const char *p_function, const char *p_file, int p_line);
void GDAPI godot_print_warning(const char *p_description, const char *p_function, const char *p_file, int p_line);
void GDAPI godot_print(const godot_string *p_message);
// GDNATIVE CORE 1.0.1
bool GDAPI godot_is_instance_valid(const godot_object *p_object);
//tags used for safe dynamic casting
void GDAPI *godot_get_class_tag(const godot_string_name *p_class);
godot_object GDAPI *godot_object_cast_to(const godot_object *p_object, void *p_class_tag);
// equivalent of GDScript's instance_from_id
godot_object GDAPI *godot_instance_from_id(godot_int p_instance_id);
#ifdef __cplusplus
}
#endif
#endif // GODOT_C_H

View File

@@ -0,0 +1,89 @@
/*************************************************************************/
/* node_path.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef GODOT_NODE_PATH_H
#define GODOT_NODE_PATH_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#define GODOT_NODE_PATH_SIZE sizeof(void *)
#ifndef GODOT_CORE_API_GODOT_NODE_PATH_TYPE_DEFINED
#define GODOT_CORE_API_GODOT_NODE_PATH_TYPE_DEFINED
typedef struct {
uint8_t _dont_touch_that[GODOT_NODE_PATH_SIZE];
} godot_node_path;
#endif
// reduce extern "C" nesting for VS2013
#ifdef __cplusplus
}
#endif
#include <gdnative/gdnative.h>
#include <gdnative/string.h>
#ifdef __cplusplus
extern "C" {
#endif
void GDAPI godot_node_path_new(godot_node_path *r_dest, const godot_string *p_from);
void GDAPI godot_node_path_new_copy(godot_node_path *r_dest, const godot_node_path *p_src);
void GDAPI godot_node_path_destroy(godot_node_path *p_self);
godot_string GDAPI godot_node_path_as_string(const godot_node_path *p_self);
godot_bool GDAPI godot_node_path_is_absolute(const godot_node_path *p_self);
godot_int GDAPI godot_node_path_get_name_count(const godot_node_path *p_self);
godot_string GDAPI godot_node_path_get_name(const godot_node_path *p_self, const godot_int p_idx);
godot_int GDAPI godot_node_path_get_subname_count(const godot_node_path *p_self);
godot_string GDAPI godot_node_path_get_subname(const godot_node_path *p_self, const godot_int p_idx);
godot_string GDAPI godot_node_path_get_concatenated_subnames(const godot_node_path *p_self);
godot_bool GDAPI godot_node_path_is_empty(const godot_node_path *p_self);
godot_bool GDAPI godot_node_path_operator_equal(const godot_node_path *p_self, const godot_node_path *p_b);
godot_node_path godot_node_path_get_as_property_path(const godot_node_path *p_self);
#ifdef __cplusplus
}
#endif
#endif // GODOT_NODE_PATH_H

View File

@@ -0,0 +1,103 @@
/*************************************************************************/
/* plane.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef GODOT_PLANE_H
#define GODOT_PLANE_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#define GODOT_PLANE_SIZE 16
#ifndef GODOT_CORE_API_GODOT_PLANE_TYPE_DEFINED
#define GODOT_CORE_API_GODOT_PLANE_TYPE_DEFINED
typedef struct {
uint8_t _dont_touch_that[GODOT_PLANE_SIZE];
} godot_plane;
#endif
// reduce extern "C" nesting for VS2013
#ifdef __cplusplus
}
#endif
#include <gdnative/gdnative.h>
#include <gdnative/vector3.h>
#ifdef __cplusplus
extern "C" {
#endif
void GDAPI godot_plane_new_with_reals(godot_plane *r_dest, const godot_real p_a, const godot_real p_b, const godot_real p_c, const godot_real p_d);
void GDAPI godot_plane_new_with_vectors(godot_plane *r_dest, const godot_vector3 *p_v1, const godot_vector3 *p_v2, const godot_vector3 *p_v3);
void GDAPI godot_plane_new_with_normal(godot_plane *r_dest, const godot_vector3 *p_normal, const godot_real p_d);
godot_string GDAPI godot_plane_as_string(const godot_plane *p_self);
godot_plane GDAPI godot_plane_normalized(const godot_plane *p_self);
godot_vector3 GDAPI godot_plane_center(const godot_plane *p_self);
godot_vector3 GDAPI godot_plane_get_any_point(const godot_plane *p_self);
godot_bool GDAPI godot_plane_is_point_over(const godot_plane *p_self, const godot_vector3 *p_point);
godot_real GDAPI godot_plane_distance_to(const godot_plane *p_self, const godot_vector3 *p_point);
godot_bool GDAPI godot_plane_has_point(const godot_plane *p_self, const godot_vector3 *p_point, const godot_real p_epsilon);
godot_vector3 GDAPI godot_plane_project(const godot_plane *p_self, const godot_vector3 *p_point);
godot_bool GDAPI godot_plane_intersect_3(const godot_plane *p_self, godot_vector3 *r_dest, const godot_plane *p_b, const godot_plane *p_c);
godot_bool GDAPI godot_plane_intersects_ray(const godot_plane *p_self, godot_vector3 *r_dest, const godot_vector3 *p_from, const godot_vector3 *p_dir);
godot_bool GDAPI godot_plane_intersects_segment(const godot_plane *p_self, godot_vector3 *r_dest, const godot_vector3 *p_begin, const godot_vector3 *p_end);
godot_plane GDAPI godot_plane_operator_neg(const godot_plane *p_self);
godot_bool GDAPI godot_plane_operator_equal(const godot_plane *p_self, const godot_plane *p_b);
void GDAPI godot_plane_set_normal(godot_plane *p_self, const godot_vector3 *p_normal);
godot_vector3 GDAPI godot_plane_get_normal(const godot_plane *p_self);
godot_real GDAPI godot_plane_get_d(const godot_plane *p_self);
void GDAPI godot_plane_set_d(godot_plane *p_self, const godot_real p_d);
#ifdef __cplusplus
}
#endif
#endif // GODOT_PLANE_H

View File

@@ -0,0 +1,478 @@
/*************************************************************************/
/* pool_arrays.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef GODOT_POOL_ARRAYS_H
#define GODOT_POOL_ARRAYS_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
/////// Read Access
#define GODOT_POOL_ARRAY_READ_ACCESS_SIZE 1
typedef struct {
uint8_t _dont_touch_that[GODOT_POOL_ARRAY_READ_ACCESS_SIZE];
} godot_pool_array_read_access;
typedef godot_pool_array_read_access godot_pool_byte_array_read_access;
typedef godot_pool_array_read_access godot_pool_int_array_read_access;
typedef godot_pool_array_read_access godot_pool_real_array_read_access;
typedef godot_pool_array_read_access godot_pool_string_array_read_access;
typedef godot_pool_array_read_access godot_pool_vector2_array_read_access;
typedef godot_pool_array_read_access godot_pool_vector3_array_read_access;
typedef godot_pool_array_read_access godot_pool_color_array_read_access;
/////// Write Access
#define GODOT_POOL_ARRAY_WRITE_ACCESS_SIZE 1
typedef struct {
uint8_t _dont_touch_that[GODOT_POOL_ARRAY_WRITE_ACCESS_SIZE];
} godot_pool_array_write_access;
typedef godot_pool_array_write_access godot_pool_byte_array_write_access;
typedef godot_pool_array_write_access godot_pool_int_array_write_access;
typedef godot_pool_array_write_access godot_pool_real_array_write_access;
typedef godot_pool_array_write_access godot_pool_string_array_write_access;
typedef godot_pool_array_write_access godot_pool_vector2_array_write_access;
typedef godot_pool_array_write_access godot_pool_vector3_array_write_access;
typedef godot_pool_array_write_access godot_pool_color_array_write_access;
/////// PoolByteArray
#define GODOT_POOL_BYTE_ARRAY_SIZE sizeof(void *)
#ifndef GODOT_CORE_API_GODOT_POOL_BYTE_ARRAY_TYPE_DEFINED
#define GODOT_CORE_API_GODOT_POOL_BYTE_ARRAY_TYPE_DEFINED
typedef struct {
uint8_t _dont_touch_that[GODOT_POOL_BYTE_ARRAY_SIZE];
} godot_pool_byte_array;
#endif
/////// PoolIntArray
#define GODOT_POOL_INT_ARRAY_SIZE sizeof(void *)
#ifndef GODOT_CORE_API_GODOT_POOL_INT_ARRAY_TYPE_DEFINED
#define GODOT_CORE_API_GODOT_POOL_INT_ARRAY_TYPE_DEFINED
typedef struct {
uint8_t _dont_touch_that[GODOT_POOL_INT_ARRAY_SIZE];
} godot_pool_int_array;
#endif
/////// PoolRealArray
#define GODOT_POOL_REAL_ARRAY_SIZE sizeof(void *)
#ifndef GODOT_CORE_API_GODOT_POOL_REAL_ARRAY_TYPE_DEFINED
#define GODOT_CORE_API_GODOT_POOL_REAL_ARRAY_TYPE_DEFINED
typedef struct {
uint8_t _dont_touch_that[GODOT_POOL_REAL_ARRAY_SIZE];
} godot_pool_real_array;
#endif
/////// PoolStringArray
#define GODOT_POOL_STRING_ARRAY_SIZE sizeof(void *)
#ifndef GODOT_CORE_API_GODOT_POOL_STRING_ARRAY_TYPE_DEFINED
#define GODOT_CORE_API_GODOT_POOL_STRING_ARRAY_TYPE_DEFINED
typedef struct {
uint8_t _dont_touch_that[GODOT_POOL_STRING_ARRAY_SIZE];
} godot_pool_string_array;
#endif
/////// PoolVector2Array
#define GODOT_POOL_VECTOR2_ARRAY_SIZE sizeof(void *)
#ifndef GODOT_CORE_API_GODOT_POOL_VECTOR2_ARRAY_TYPE_DEFINED
#define GODOT_CORE_API_GODOT_POOL_VECTOR2_ARRAY_TYPE_DEFINED
typedef struct {
uint8_t _dont_touch_that[GODOT_POOL_VECTOR2_ARRAY_SIZE];
} godot_pool_vector2_array;
#endif
/////// PoolVector3Array
#define GODOT_POOL_VECTOR3_ARRAY_SIZE sizeof(void *)
#ifndef GODOT_CORE_API_GODOT_POOL_VECTOR3_ARRAY_TYPE_DEFINED
#define GODOT_CORE_API_GODOT_POOL_VECTOR3_ARRAY_TYPE_DEFINED
typedef struct {
uint8_t _dont_touch_that[GODOT_POOL_VECTOR3_ARRAY_SIZE];
} godot_pool_vector3_array;
#endif
/////// PoolColorArray
#define GODOT_POOL_COLOR_ARRAY_SIZE sizeof(void *)
#ifndef GODOT_CORE_API_GODOT_POOL_COLOR_ARRAY_TYPE_DEFINED
#define GODOT_CORE_API_GODOT_POOL_COLOR_ARRAY_TYPE_DEFINED
typedef struct {
uint8_t _dont_touch_that[GODOT_POOL_COLOR_ARRAY_SIZE];
} godot_pool_color_array;
#endif
// reduce extern "C" nesting for VS2013
#ifdef __cplusplus
}
#endif
#include <gdnative/array.h>
#include <gdnative/color.h>
#include <gdnative/vector2.h>
#include <gdnative/vector3.h>
#include <gdnative/gdnative.h>
#ifdef __cplusplus
extern "C" {
#endif
// byte
void GDAPI godot_pool_byte_array_new(godot_pool_byte_array *r_dest);
void GDAPI godot_pool_byte_array_new_copy(godot_pool_byte_array *r_dest, const godot_pool_byte_array *p_src);
void GDAPI godot_pool_byte_array_new_with_array(godot_pool_byte_array *r_dest, const godot_array *p_a);
void GDAPI godot_pool_byte_array_append(godot_pool_byte_array *p_self, const uint8_t p_data);
void GDAPI godot_pool_byte_array_append_array(godot_pool_byte_array *p_self, const godot_pool_byte_array *p_array);
godot_error GDAPI godot_pool_byte_array_insert(godot_pool_byte_array *p_self, const godot_int p_idx, const uint8_t p_data);
void GDAPI godot_pool_byte_array_invert(godot_pool_byte_array *p_self);
void GDAPI godot_pool_byte_array_push_back(godot_pool_byte_array *p_self, const uint8_t p_data);
void GDAPI godot_pool_byte_array_remove(godot_pool_byte_array *p_self, const godot_int p_idx);
void GDAPI godot_pool_byte_array_resize(godot_pool_byte_array *p_self, const godot_int p_size);
godot_pool_byte_array_read_access GDAPI *godot_pool_byte_array_read(const godot_pool_byte_array *p_self);
godot_pool_byte_array_write_access GDAPI *godot_pool_byte_array_write(godot_pool_byte_array *p_self);
void GDAPI godot_pool_byte_array_set(godot_pool_byte_array *p_self, const godot_int p_idx, const uint8_t p_data);
uint8_t GDAPI godot_pool_byte_array_get(const godot_pool_byte_array *p_self, const godot_int p_idx);
godot_int GDAPI godot_pool_byte_array_size(const godot_pool_byte_array *p_self);
godot_bool GDAPI godot_pool_byte_array_empty(const godot_pool_byte_array *p_self);
void GDAPI godot_pool_byte_array_destroy(godot_pool_byte_array *p_self);
// int
void GDAPI godot_pool_int_array_new(godot_pool_int_array *r_dest);
void GDAPI godot_pool_int_array_new_copy(godot_pool_int_array *r_dest, const godot_pool_int_array *p_src);
void GDAPI godot_pool_int_array_new_with_array(godot_pool_int_array *r_dest, const godot_array *p_a);
void GDAPI godot_pool_int_array_append(godot_pool_int_array *p_self, const godot_int p_data);
void GDAPI godot_pool_int_array_append_array(godot_pool_int_array *p_self, const godot_pool_int_array *p_array);
godot_error GDAPI godot_pool_int_array_insert(godot_pool_int_array *p_self, const godot_int p_idx, const godot_int p_data);
void GDAPI godot_pool_int_array_invert(godot_pool_int_array *p_self);
void GDAPI godot_pool_int_array_push_back(godot_pool_int_array *p_self, const godot_int p_data);
void GDAPI godot_pool_int_array_remove(godot_pool_int_array *p_self, const godot_int p_idx);
void GDAPI godot_pool_int_array_resize(godot_pool_int_array *p_self, const godot_int p_size);
godot_pool_int_array_read_access GDAPI *godot_pool_int_array_read(const godot_pool_int_array *p_self);
godot_pool_int_array_write_access GDAPI *godot_pool_int_array_write(godot_pool_int_array *p_self);
void GDAPI godot_pool_int_array_set(godot_pool_int_array *p_self, const godot_int p_idx, const godot_int p_data);
godot_int GDAPI godot_pool_int_array_get(const godot_pool_int_array *p_self, const godot_int p_idx);
godot_int GDAPI godot_pool_int_array_size(const godot_pool_int_array *p_self);
godot_bool GDAPI godot_pool_int_array_empty(const godot_pool_int_array *p_self);
void GDAPI godot_pool_int_array_destroy(godot_pool_int_array *p_self);
// real
void GDAPI godot_pool_real_array_new(godot_pool_real_array *r_dest);
void GDAPI godot_pool_real_array_new_copy(godot_pool_real_array *r_dest, const godot_pool_real_array *p_src);
void GDAPI godot_pool_real_array_new_with_array(godot_pool_real_array *r_dest, const godot_array *p_a);
void GDAPI godot_pool_real_array_append(godot_pool_real_array *p_self, const godot_real p_data);
void GDAPI godot_pool_real_array_append_array(godot_pool_real_array *p_self, const godot_pool_real_array *p_array);
godot_error GDAPI godot_pool_real_array_insert(godot_pool_real_array *p_self, const godot_int p_idx, const godot_real p_data);
void GDAPI godot_pool_real_array_invert(godot_pool_real_array *p_self);
void GDAPI godot_pool_real_array_push_back(godot_pool_real_array *p_self, const godot_real p_data);
void GDAPI godot_pool_real_array_remove(godot_pool_real_array *p_self, const godot_int p_idx);
void GDAPI godot_pool_real_array_resize(godot_pool_real_array *p_self, const godot_int p_size);
godot_pool_real_array_read_access GDAPI *godot_pool_real_array_read(const godot_pool_real_array *p_self);
godot_pool_real_array_write_access GDAPI *godot_pool_real_array_write(godot_pool_real_array *p_self);
void GDAPI godot_pool_real_array_set(godot_pool_real_array *p_self, const godot_int p_idx, const godot_real p_data);
godot_real GDAPI godot_pool_real_array_get(const godot_pool_real_array *p_self, const godot_int p_idx);
godot_int GDAPI godot_pool_real_array_size(const godot_pool_real_array *p_self);
godot_bool GDAPI godot_pool_real_array_empty(const godot_pool_real_array *p_self);
void GDAPI godot_pool_real_array_destroy(godot_pool_real_array *p_self);
// string
void GDAPI godot_pool_string_array_new(godot_pool_string_array *r_dest);
void GDAPI godot_pool_string_array_new_copy(godot_pool_string_array *r_dest, const godot_pool_string_array *p_src);
void GDAPI godot_pool_string_array_new_with_array(godot_pool_string_array *r_dest, const godot_array *p_a);
void GDAPI godot_pool_string_array_append(godot_pool_string_array *p_self, const godot_string *p_data);
void GDAPI godot_pool_string_array_append_array(godot_pool_string_array *p_self, const godot_pool_string_array *p_array);
godot_error GDAPI godot_pool_string_array_insert(godot_pool_string_array *p_self, const godot_int p_idx, const godot_string *p_data);
void GDAPI godot_pool_string_array_invert(godot_pool_string_array *p_self);
void GDAPI godot_pool_string_array_push_back(godot_pool_string_array *p_self, const godot_string *p_data);
void GDAPI godot_pool_string_array_remove(godot_pool_string_array *p_self, const godot_int p_idx);
void GDAPI godot_pool_string_array_resize(godot_pool_string_array *p_self, const godot_int p_size);
godot_pool_string_array_read_access GDAPI *godot_pool_string_array_read(const godot_pool_string_array *p_self);
godot_pool_string_array_write_access GDAPI *godot_pool_string_array_write(godot_pool_string_array *p_self);
void GDAPI godot_pool_string_array_set(godot_pool_string_array *p_self, const godot_int p_idx, const godot_string *p_data);
godot_string GDAPI godot_pool_string_array_get(const godot_pool_string_array *p_self, const godot_int p_idx);
godot_int GDAPI godot_pool_string_array_size(const godot_pool_string_array *p_self);
godot_bool GDAPI godot_pool_string_array_empty(const godot_pool_string_array *p_self);
void GDAPI godot_pool_string_array_destroy(godot_pool_string_array *p_self);
// vector2
void GDAPI godot_pool_vector2_array_new(godot_pool_vector2_array *r_dest);
void GDAPI godot_pool_vector2_array_new_copy(godot_pool_vector2_array *r_dest, const godot_pool_vector2_array *p_src);
void GDAPI godot_pool_vector2_array_new_with_array(godot_pool_vector2_array *r_dest, const godot_array *p_a);
void GDAPI godot_pool_vector2_array_append(godot_pool_vector2_array *p_self, const godot_vector2 *p_data);
void GDAPI godot_pool_vector2_array_append_array(godot_pool_vector2_array *p_self, const godot_pool_vector2_array *p_array);
godot_error GDAPI godot_pool_vector2_array_insert(godot_pool_vector2_array *p_self, const godot_int p_idx, const godot_vector2 *p_data);
void GDAPI godot_pool_vector2_array_invert(godot_pool_vector2_array *p_self);
void GDAPI godot_pool_vector2_array_push_back(godot_pool_vector2_array *p_self, const godot_vector2 *p_data);
void GDAPI godot_pool_vector2_array_remove(godot_pool_vector2_array *p_self, const godot_int p_idx);
void GDAPI godot_pool_vector2_array_resize(godot_pool_vector2_array *p_self, const godot_int p_size);
godot_pool_vector2_array_read_access GDAPI *godot_pool_vector2_array_read(const godot_pool_vector2_array *p_self);
godot_pool_vector2_array_write_access GDAPI *godot_pool_vector2_array_write(godot_pool_vector2_array *p_self);
void GDAPI godot_pool_vector2_array_set(godot_pool_vector2_array *p_self, const godot_int p_idx, const godot_vector2 *p_data);
godot_vector2 GDAPI godot_pool_vector2_array_get(const godot_pool_vector2_array *p_self, const godot_int p_idx);
godot_int GDAPI godot_pool_vector2_array_size(const godot_pool_vector2_array *p_self);
godot_bool GDAPI godot_pool_vector2_array_empty(const godot_pool_vector2_array *p_self);
void GDAPI godot_pool_vector2_array_destroy(godot_pool_vector2_array *p_self);
// vector3
void GDAPI godot_pool_vector3_array_new(godot_pool_vector3_array *r_dest);
void GDAPI godot_pool_vector3_array_new_copy(godot_pool_vector3_array *r_dest, const godot_pool_vector3_array *p_src);
void GDAPI godot_pool_vector3_array_new_with_array(godot_pool_vector3_array *r_dest, const godot_array *p_a);
void GDAPI godot_pool_vector3_array_append(godot_pool_vector3_array *p_self, const godot_vector3 *p_data);
void GDAPI godot_pool_vector3_array_append_array(godot_pool_vector3_array *p_self, const godot_pool_vector3_array *p_array);
godot_error GDAPI godot_pool_vector3_array_insert(godot_pool_vector3_array *p_self, const godot_int p_idx, const godot_vector3 *p_data);
void GDAPI godot_pool_vector3_array_invert(godot_pool_vector3_array *p_self);
void GDAPI godot_pool_vector3_array_push_back(godot_pool_vector3_array *p_self, const godot_vector3 *p_data);
void GDAPI godot_pool_vector3_array_remove(godot_pool_vector3_array *p_self, const godot_int p_idx);
void GDAPI godot_pool_vector3_array_resize(godot_pool_vector3_array *p_self, const godot_int p_size);
godot_pool_vector3_array_read_access GDAPI *godot_pool_vector3_array_read(const godot_pool_vector3_array *p_self);
godot_pool_vector3_array_write_access GDAPI *godot_pool_vector3_array_write(godot_pool_vector3_array *p_self);
void GDAPI godot_pool_vector3_array_set(godot_pool_vector3_array *p_self, const godot_int p_idx, const godot_vector3 *p_data);
godot_vector3 GDAPI godot_pool_vector3_array_get(const godot_pool_vector3_array *p_self, const godot_int p_idx);
godot_int GDAPI godot_pool_vector3_array_size(const godot_pool_vector3_array *p_self);
godot_bool GDAPI godot_pool_vector3_array_empty(const godot_pool_vector3_array *p_self);
void GDAPI godot_pool_vector3_array_destroy(godot_pool_vector3_array *p_self);
// color
void GDAPI godot_pool_color_array_new(godot_pool_color_array *r_dest);
void GDAPI godot_pool_color_array_new_copy(godot_pool_color_array *r_dest, const godot_pool_color_array *p_src);
void GDAPI godot_pool_color_array_new_with_array(godot_pool_color_array *r_dest, const godot_array *p_a);
void GDAPI godot_pool_color_array_append(godot_pool_color_array *p_self, const godot_color *p_data);
void GDAPI godot_pool_color_array_append_array(godot_pool_color_array *p_self, const godot_pool_color_array *p_array);
godot_error GDAPI godot_pool_color_array_insert(godot_pool_color_array *p_self, const godot_int p_idx, const godot_color *p_data);
void GDAPI godot_pool_color_array_invert(godot_pool_color_array *p_self);
void GDAPI godot_pool_color_array_push_back(godot_pool_color_array *p_self, const godot_color *p_data);
void GDAPI godot_pool_color_array_remove(godot_pool_color_array *p_self, const godot_int p_idx);
void GDAPI godot_pool_color_array_resize(godot_pool_color_array *p_self, const godot_int p_size);
godot_pool_color_array_read_access GDAPI *godot_pool_color_array_read(const godot_pool_color_array *p_self);
godot_pool_color_array_write_access GDAPI *godot_pool_color_array_write(godot_pool_color_array *p_self);
void GDAPI godot_pool_color_array_set(godot_pool_color_array *p_self, const godot_int p_idx, const godot_color *p_data);
godot_color GDAPI godot_pool_color_array_get(const godot_pool_color_array *p_self, const godot_int p_idx);
godot_int GDAPI godot_pool_color_array_size(const godot_pool_color_array *p_self);
godot_bool GDAPI godot_pool_color_array_empty(const godot_pool_color_array *p_self);
void GDAPI godot_pool_color_array_destroy(godot_pool_color_array *p_self);
//
// read accessor functions
//
godot_pool_byte_array_read_access GDAPI *godot_pool_byte_array_read_access_copy(const godot_pool_byte_array_read_access *p_other);
const uint8_t GDAPI *godot_pool_byte_array_read_access_ptr(const godot_pool_byte_array_read_access *p_read);
void GDAPI godot_pool_byte_array_read_access_operator_assign(godot_pool_byte_array_read_access *p_read, godot_pool_byte_array_read_access *p_other);
void GDAPI godot_pool_byte_array_read_access_destroy(godot_pool_byte_array_read_access *p_read);
godot_pool_int_array_read_access GDAPI *godot_pool_int_array_read_access_copy(const godot_pool_int_array_read_access *p_other);
const godot_int GDAPI *godot_pool_int_array_read_access_ptr(const godot_pool_int_array_read_access *p_read);
void GDAPI godot_pool_int_array_read_access_operator_assign(godot_pool_int_array_read_access *p_read, godot_pool_int_array_read_access *p_other);
void GDAPI godot_pool_int_array_read_access_destroy(godot_pool_int_array_read_access *p_read);
godot_pool_real_array_read_access GDAPI *godot_pool_real_array_read_access_copy(const godot_pool_real_array_read_access *p_other);
const godot_real GDAPI *godot_pool_real_array_read_access_ptr(const godot_pool_real_array_read_access *p_read);
void GDAPI godot_pool_real_array_read_access_operator_assign(godot_pool_real_array_read_access *p_read, godot_pool_real_array_read_access *p_other);
void GDAPI godot_pool_real_array_read_access_destroy(godot_pool_real_array_read_access *p_read);
godot_pool_string_array_read_access GDAPI *godot_pool_string_array_read_access_copy(const godot_pool_string_array_read_access *p_other);
const godot_string GDAPI *godot_pool_string_array_read_access_ptr(const godot_pool_string_array_read_access *p_read);
void GDAPI godot_pool_string_array_read_access_operator_assign(godot_pool_string_array_read_access *p_read, godot_pool_string_array_read_access *p_other);
void GDAPI godot_pool_string_array_read_access_destroy(godot_pool_string_array_read_access *p_read);
godot_pool_vector2_array_read_access GDAPI *godot_pool_vector2_array_read_access_copy(const godot_pool_vector2_array_read_access *p_other);
const godot_vector2 GDAPI *godot_pool_vector2_array_read_access_ptr(const godot_pool_vector2_array_read_access *p_read);
void GDAPI godot_pool_vector2_array_read_access_operator_assign(godot_pool_vector2_array_read_access *p_read, godot_pool_vector2_array_read_access *p_other);
void GDAPI godot_pool_vector2_array_read_access_destroy(godot_pool_vector2_array_read_access *p_read);
godot_pool_vector3_array_read_access GDAPI *godot_pool_vector3_array_read_access_copy(const godot_pool_vector3_array_read_access *p_other);
const godot_vector3 GDAPI *godot_pool_vector3_array_read_access_ptr(const godot_pool_vector3_array_read_access *p_read);
void GDAPI godot_pool_vector3_array_read_access_operator_assign(godot_pool_vector3_array_read_access *p_read, godot_pool_vector3_array_read_access *p_other);
void GDAPI godot_pool_vector3_array_read_access_destroy(godot_pool_vector3_array_read_access *p_read);
godot_pool_color_array_read_access GDAPI *godot_pool_color_array_read_access_copy(const godot_pool_color_array_read_access *p_other);
const godot_color GDAPI *godot_pool_color_array_read_access_ptr(const godot_pool_color_array_read_access *p_read);
void GDAPI godot_pool_color_array_read_access_operator_assign(godot_pool_color_array_read_access *p_read, godot_pool_color_array_read_access *p_other);
void GDAPI godot_pool_color_array_read_access_destroy(godot_pool_color_array_read_access *p_read);
//
// write accessor functions
//
godot_pool_byte_array_write_access GDAPI *godot_pool_byte_array_write_access_copy(const godot_pool_byte_array_write_access *p_other);
uint8_t GDAPI *godot_pool_byte_array_write_access_ptr(const godot_pool_byte_array_write_access *p_write);
void GDAPI godot_pool_byte_array_write_access_operator_assign(godot_pool_byte_array_write_access *p_write, godot_pool_byte_array_write_access *p_other);
void GDAPI godot_pool_byte_array_write_access_destroy(godot_pool_byte_array_write_access *p_write);
godot_pool_int_array_write_access GDAPI *godot_pool_int_array_write_access_copy(const godot_pool_int_array_write_access *p_other);
godot_int GDAPI *godot_pool_int_array_write_access_ptr(const godot_pool_int_array_write_access *p_write);
void GDAPI godot_pool_int_array_write_access_operator_assign(godot_pool_int_array_write_access *p_write, godot_pool_int_array_write_access *p_other);
void GDAPI godot_pool_int_array_write_access_destroy(godot_pool_int_array_write_access *p_write);
godot_pool_real_array_write_access GDAPI *godot_pool_real_array_write_access_copy(const godot_pool_real_array_write_access *p_other);
godot_real GDAPI *godot_pool_real_array_write_access_ptr(const godot_pool_real_array_write_access *p_write);
void GDAPI godot_pool_real_array_write_access_operator_assign(godot_pool_real_array_write_access *p_write, godot_pool_real_array_write_access *p_other);
void GDAPI godot_pool_real_array_write_access_destroy(godot_pool_real_array_write_access *p_write);
godot_pool_string_array_write_access GDAPI *godot_pool_string_array_write_access_copy(const godot_pool_string_array_write_access *p_other);
godot_string GDAPI *godot_pool_string_array_write_access_ptr(const godot_pool_string_array_write_access *p_write);
void GDAPI godot_pool_string_array_write_access_operator_assign(godot_pool_string_array_write_access *p_write, godot_pool_string_array_write_access *p_other);
void GDAPI godot_pool_string_array_write_access_destroy(godot_pool_string_array_write_access *p_write);
godot_pool_vector2_array_write_access GDAPI *godot_pool_vector2_array_write_access_copy(const godot_pool_vector2_array_write_access *p_other);
godot_vector2 GDAPI *godot_pool_vector2_array_write_access_ptr(const godot_pool_vector2_array_write_access *p_write);
void GDAPI godot_pool_vector2_array_write_access_operator_assign(godot_pool_vector2_array_write_access *p_write, godot_pool_vector2_array_write_access *p_other);
void GDAPI godot_pool_vector2_array_write_access_destroy(godot_pool_vector2_array_write_access *p_write);
godot_pool_vector3_array_write_access GDAPI *godot_pool_vector3_array_write_access_copy(const godot_pool_vector3_array_write_access *p_other);
godot_vector3 GDAPI *godot_pool_vector3_array_write_access_ptr(const godot_pool_vector3_array_write_access *p_write);
void GDAPI godot_pool_vector3_array_write_access_operator_assign(godot_pool_vector3_array_write_access *p_write, godot_pool_vector3_array_write_access *p_other);
void GDAPI godot_pool_vector3_array_write_access_destroy(godot_pool_vector3_array_write_access *p_write);
godot_pool_color_array_write_access GDAPI *godot_pool_color_array_write_access_copy(const godot_pool_color_array_write_access *p_other);
godot_color GDAPI *godot_pool_color_array_write_access_ptr(const godot_pool_color_array_write_access *p_write);
void GDAPI godot_pool_color_array_write_access_operator_assign(godot_pool_color_array_write_access *p_write, godot_pool_color_array_write_access *p_other);
void GDAPI godot_pool_color_array_write_access_destroy(godot_pool_color_array_write_access *p_write);
#ifdef __cplusplus
}
#endif
#endif // GODOT_POOL_ARRAYS_H

View File

@@ -0,0 +1,118 @@
/*************************************************************************/
/* quat.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef GODOT_QUAT_H
#define GODOT_QUAT_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#define GODOT_QUAT_SIZE 16
#ifndef GODOT_CORE_API_GODOT_QUAT_TYPE_DEFINED
#define GODOT_CORE_API_GODOT_QUAT_TYPE_DEFINED
typedef struct {
uint8_t _dont_touch_that[GODOT_QUAT_SIZE];
} godot_quat;
#endif
// reduce extern "C" nesting for VS2013
#ifdef __cplusplus
}
#endif
#include <gdnative/gdnative.h>
#include <gdnative/vector3.h>
#ifdef __cplusplus
extern "C" {
#endif
void GDAPI 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 GDAPI godot_quat_new_with_axis_angle(godot_quat *r_dest, const godot_vector3 *p_axis, const godot_real p_angle);
void GDAPI godot_quat_new_with_basis(godot_quat *r_dest, const godot_basis *p_basis);
void GDAPI godot_quat_new_with_euler(godot_quat *r_dest, const godot_vector3 *p_euler);
godot_real GDAPI godot_quat_get_x(const godot_quat *p_self);
void GDAPI godot_quat_set_x(godot_quat *p_self, const godot_real val);
godot_real GDAPI godot_quat_get_y(const godot_quat *p_self);
void GDAPI godot_quat_set_y(godot_quat *p_self, const godot_real val);
godot_real GDAPI godot_quat_get_z(const godot_quat *p_self);
void GDAPI godot_quat_set_z(godot_quat *p_self, const godot_real val);
godot_real GDAPI godot_quat_get_w(const godot_quat *p_self);
void GDAPI godot_quat_set_w(godot_quat *p_self, const godot_real val);
godot_string GDAPI godot_quat_as_string(const godot_quat *p_self);
godot_real GDAPI godot_quat_length(const godot_quat *p_self);
godot_real GDAPI godot_quat_length_squared(const godot_quat *p_self);
godot_quat GDAPI godot_quat_normalized(const godot_quat *p_self);
godot_bool GDAPI godot_quat_is_normalized(const godot_quat *p_self);
godot_quat GDAPI godot_quat_inverse(const godot_quat *p_self);
godot_real GDAPI godot_quat_dot(const godot_quat *p_self, const godot_quat *p_b);
godot_vector3 GDAPI godot_quat_xform(const godot_quat *p_self, const godot_vector3 *p_v);
godot_quat GDAPI godot_quat_slerp(const godot_quat *p_self, const godot_quat *p_b, const godot_real p_t);
godot_quat GDAPI godot_quat_slerpni(const godot_quat *p_self, const godot_quat *p_b, const godot_real p_t);
godot_quat GDAPI 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 GDAPI godot_quat_operator_multiply(const godot_quat *p_self, const godot_real p_b);
godot_quat GDAPI godot_quat_operator_add(const godot_quat *p_self, const godot_quat *p_b);
godot_quat GDAPI godot_quat_operator_subtract(const godot_quat *p_self, const godot_quat *p_b);
godot_quat GDAPI godot_quat_operator_divide(const godot_quat *p_self, const godot_real p_b);
godot_bool GDAPI godot_quat_operator_equal(const godot_quat *p_self, const godot_quat *p_b);
godot_quat GDAPI godot_quat_operator_neg(const godot_quat *p_self);
void GDAPI godot_quat_set_axis_angle(godot_quat *p_self, const godot_vector3 *p_axis, const godot_real p_angle);
#ifdef __cplusplus
}
#endif
#endif // GODOT_QUAT_H

View File

@@ -0,0 +1,102 @@
/*************************************************************************/
/* rect2.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef GODOT_RECT2_H
#define GODOT_RECT2_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#ifndef GODOT_CORE_API_GODOT_RECT2_TYPE_DEFINED
#define GODOT_CORE_API_GODOT_RECT2_TYPE_DEFINED
typedef struct godot_rect2 {
uint8_t _dont_touch_that[16];
} godot_rect2;
#endif
// reduce extern "C" nesting for VS2013
#ifdef __cplusplus
}
#endif
#include <gdnative/gdnative.h>
#include <gdnative/vector2.h>
#ifdef __cplusplus
extern "C" {
#endif
void GDAPI godot_rect2_new_with_position_and_size(godot_rect2 *r_dest, const godot_vector2 *p_pos, const godot_vector2 *p_size);
void GDAPI godot_rect2_new(godot_rect2 *r_dest, const godot_real p_x, const godot_real p_y, const godot_real p_width, const godot_real p_height);
godot_string GDAPI godot_rect2_as_string(const godot_rect2 *p_self);
godot_real GDAPI godot_rect2_get_area(const godot_rect2 *p_self);
godot_bool GDAPI godot_rect2_intersects(const godot_rect2 *p_self, const godot_rect2 *p_b);
godot_bool GDAPI godot_rect2_encloses(const godot_rect2 *p_self, const godot_rect2 *p_b);
godot_bool GDAPI godot_rect2_has_no_area(const godot_rect2 *p_self);
godot_rect2 GDAPI godot_rect2_clip(const godot_rect2 *p_self, const godot_rect2 *p_b);
godot_rect2 GDAPI godot_rect2_merge(const godot_rect2 *p_self, const godot_rect2 *p_b);
godot_bool GDAPI godot_rect2_has_point(const godot_rect2 *p_self, const godot_vector2 *p_point);
godot_rect2 GDAPI godot_rect2_grow(const godot_rect2 *p_self, const godot_real p_by);
godot_rect2 GDAPI godot_rect2_grow_individual(const godot_rect2 *p_self, const godot_real p_left, const godot_real p_top, const godot_real p_right, const godot_real p_bottom);
godot_rect2 GDAPI godot_rect2_grow_margin(const godot_rect2 *p_self, const godot_int p_margin, const godot_real p_by);
godot_rect2 GDAPI godot_rect2_abs(const godot_rect2 *p_self);
godot_rect2 GDAPI godot_rect2_expand(const godot_rect2 *p_self, const godot_vector2 *p_to);
godot_bool GDAPI godot_rect2_operator_equal(const godot_rect2 *p_self, const godot_rect2 *p_b);
godot_vector2 GDAPI godot_rect2_get_position(const godot_rect2 *p_self);
godot_vector2 GDAPI godot_rect2_get_size(const godot_rect2 *p_self);
void GDAPI godot_rect2_set_position(godot_rect2 *p_self, const godot_vector2 *p_pos);
void GDAPI godot_rect2_set_size(godot_rect2 *p_self, const godot_vector2 *p_size);
#ifdef __cplusplus
}
#endif
#endif // GODOT_RECT2_H

View File

@@ -0,0 +1,74 @@
/*************************************************************************/
/* rid.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef GODOT_RID_H
#define GODOT_RID_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#define GODOT_RID_SIZE sizeof(void *)
#ifndef GODOT_CORE_API_GODOT_RID_TYPE_DEFINED
#define GODOT_CORE_API_GODOT_RID_TYPE_DEFINED
typedef struct {
uint8_t _dont_touch_that[GODOT_RID_SIZE];
} godot_rid;
#endif
// reduce extern "C" nesting for VS2013
#ifdef __cplusplus
}
#endif
#include <gdnative/gdnative.h>
#ifdef __cplusplus
extern "C" {
#endif
void GDAPI godot_rid_new(godot_rid *r_dest);
godot_int GDAPI godot_rid_get_id(const godot_rid *p_self);
void GDAPI godot_rid_new_with_resource(godot_rid *r_dest, const godot_object *p_from);
godot_bool GDAPI godot_rid_operator_equal(const godot_rid *p_self, const godot_rid *p_b);
godot_bool GDAPI godot_rid_operator_less(const godot_rid *p_self, const godot_rid *p_b);
#ifdef __cplusplus
}
#endif
#endif // GODOT_RID_H

View File

@@ -0,0 +1,263 @@
/*************************************************************************/
/* string.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef GODOT_STRING_H
#define GODOT_STRING_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <wchar.h>
typedef wchar_t godot_char_type;
#define GODOT_STRING_SIZE sizeof(void *)
#define GODOT_CHAR_STRING_SIZE sizeof(void *)
#ifndef GODOT_CORE_API_GODOT_STRING_TYPE_DEFINED
#define GODOT_CORE_API_GODOT_STRING_TYPE_DEFINED
typedef struct {
uint8_t _dont_touch_that[GODOT_STRING_SIZE];
} godot_string;
#endif
#ifndef GODOT_CORE_API_GODOT_CHAR_STRING_TYPE_DEFINED
#define GODOT_CORE_API_GODOT_CHAR_STRING_TYPE_DEFINED
typedef struct {
uint8_t _dont_touch_that[GODOT_CHAR_STRING_SIZE];
} godot_char_string;
#endif
// reduce extern "C" nesting for VS2013
#ifdef __cplusplus
}
#endif
#include <gdnative/array.h>
#include <gdnative/gdnative.h>
#include <gdnative/variant.h>
#ifdef __cplusplus
extern "C" {
#endif
godot_int GDAPI godot_char_string_length(const godot_char_string *p_cs);
const char GDAPI *godot_char_string_get_data(const godot_char_string *p_cs);
void GDAPI godot_char_string_destroy(godot_char_string *p_cs);
void GDAPI godot_string_new(godot_string *r_dest);
void GDAPI godot_string_new_copy(godot_string *r_dest, const godot_string *p_src);
void GDAPI godot_string_new_with_wide_string(godot_string *r_dest, const wchar_t *p_contents, const int p_size);
const wchar_t GDAPI *godot_string_operator_index(godot_string *p_self, const godot_int p_idx);
wchar_t GDAPI godot_string_operator_index_const(const godot_string *p_self, const godot_int p_idx);
const wchar_t GDAPI *godot_string_wide_str(const godot_string *p_self);
godot_bool GDAPI godot_string_operator_equal(const godot_string *p_self, const godot_string *p_b);
godot_bool GDAPI godot_string_operator_less(const godot_string *p_self, const godot_string *p_b);
godot_string GDAPI godot_string_operator_plus(const godot_string *p_self, const godot_string *p_b);
/* Standard size stuff */
godot_int GDAPI godot_string_length(const godot_string *p_self);
/* Helpers */
signed char GDAPI godot_string_casecmp_to(const godot_string *p_self, const godot_string *p_str);
signed char GDAPI godot_string_nocasecmp_to(const godot_string *p_self, const godot_string *p_str);
signed char GDAPI godot_string_naturalnocasecmp_to(const godot_string *p_self, const godot_string *p_str);
godot_bool GDAPI godot_string_begins_with(const godot_string *p_self, const godot_string *p_string);
godot_bool GDAPI godot_string_begins_with_char_array(const godot_string *p_self, const char *p_char_array);
godot_array GDAPI godot_string_bigrams(const godot_string *p_self);
godot_string GDAPI godot_string_chr(wchar_t p_character);
godot_bool GDAPI godot_string_ends_with(const godot_string *p_self, const godot_string *p_string);
godot_int GDAPI godot_string_count(const godot_string *p_self, godot_string p_what, godot_int p_from, godot_int p_to);
godot_int GDAPI godot_string_countn(const godot_string *p_self, godot_string p_what, godot_int p_from, godot_int p_to);
godot_int GDAPI godot_string_find(const godot_string *p_self, godot_string p_what);
godot_int GDAPI godot_string_find_from(const godot_string *p_self, godot_string p_what, godot_int p_from);
godot_int GDAPI godot_string_findmk(const godot_string *p_self, const godot_array *p_keys);
godot_int GDAPI godot_string_findmk_from(const godot_string *p_self, const godot_array *p_keys, godot_int p_from);
godot_int GDAPI godot_string_findmk_from_in_place(const godot_string *p_self, const godot_array *p_keys, godot_int p_from, godot_int *r_key);
godot_int GDAPI godot_string_findn(const godot_string *p_self, godot_string p_what);
godot_int GDAPI godot_string_findn_from(const godot_string *p_self, godot_string p_what, godot_int p_from);
godot_int GDAPI godot_string_find_last(const godot_string *p_self, godot_string p_what);
godot_string GDAPI godot_string_format(const godot_string *p_self, const godot_variant *p_values);
godot_string GDAPI godot_string_format_with_custom_placeholder(const godot_string *p_self, const godot_variant *p_values, const char *p_placeholder);
godot_string GDAPI godot_string_hex_encode_buffer(const uint8_t *p_buffer, godot_int p_len);
godot_int GDAPI godot_string_hex_to_int(const godot_string *p_self);
godot_int GDAPI godot_string_hex_to_int_without_prefix(const godot_string *p_self);
godot_string GDAPI godot_string_insert(const godot_string *p_self, godot_int p_at_pos, godot_string p_string);
godot_bool GDAPI godot_string_is_numeric(const godot_string *p_self);
godot_bool GDAPI godot_string_is_subsequence_of(const godot_string *p_self, const godot_string *p_string);
godot_bool GDAPI godot_string_is_subsequence_ofi(const godot_string *p_self, const godot_string *p_string);
godot_string GDAPI godot_string_lpad(const godot_string *p_self, godot_int p_min_length);
godot_string GDAPI godot_string_lpad_with_custom_character(const godot_string *p_self, godot_int p_min_length, const godot_string *p_character);
godot_bool GDAPI godot_string_match(const godot_string *p_self, const godot_string *p_wildcard);
godot_bool GDAPI godot_string_matchn(const godot_string *p_self, const godot_string *p_wildcard);
godot_string GDAPI godot_string_md5(const uint8_t *p_md5);
godot_string GDAPI godot_string_num(double p_num);
godot_string GDAPI godot_string_num_int64(int64_t p_num, godot_int p_base);
godot_string GDAPI godot_string_num_int64_capitalized(int64_t p_num, godot_int p_base, godot_bool p_capitalize_hex);
godot_string GDAPI godot_string_num_real(double p_num);
godot_string GDAPI godot_string_num_scientific(double p_num);
godot_string GDAPI godot_string_num_with_decimals(double p_num, godot_int p_decimals);
godot_string GDAPI godot_string_pad_decimals(const godot_string *p_self, godot_int p_digits);
godot_string GDAPI godot_string_pad_zeros(const godot_string *p_self, godot_int p_digits);
godot_string GDAPI godot_string_replace_first(const godot_string *p_self, godot_string p_key, godot_string p_with);
godot_string GDAPI godot_string_replace(const godot_string *p_self, godot_string p_key, godot_string p_with);
godot_string GDAPI godot_string_replacen(const godot_string *p_self, godot_string p_key, godot_string p_with);
godot_int GDAPI godot_string_rfind(const godot_string *p_self, godot_string p_what);
godot_int GDAPI godot_string_rfindn(const godot_string *p_self, godot_string p_what);
godot_int GDAPI godot_string_rfind_from(const godot_string *p_self, godot_string p_what, godot_int p_from);
godot_int GDAPI godot_string_rfindn_from(const godot_string *p_self, godot_string p_what, godot_int p_from);
godot_string GDAPI godot_string_rpad(const godot_string *p_self, godot_int p_min_length);
godot_string GDAPI godot_string_rpad_with_custom_character(const godot_string *p_self, godot_int p_min_length, const godot_string *p_character);
godot_real GDAPI godot_string_similarity(const godot_string *p_self, const godot_string *p_string);
godot_string GDAPI godot_string_sprintf(const godot_string *p_self, const godot_array *p_values, godot_bool *p_error);
godot_string GDAPI godot_string_substr(const godot_string *p_self, godot_int p_from, godot_int p_chars);
double GDAPI godot_string_to_double(const godot_string *p_self);
godot_real GDAPI godot_string_to_float(const godot_string *p_self);
godot_int GDAPI godot_string_to_int(const godot_string *p_self);
godot_string GDAPI godot_string_camelcase_to_underscore(const godot_string *p_self);
godot_string GDAPI godot_string_camelcase_to_underscore_lowercased(const godot_string *p_self);
godot_string GDAPI godot_string_capitalize(const godot_string *p_self);
double GDAPI godot_string_char_to_double(const char *p_what);
godot_int GDAPI godot_string_char_to_int(const char *p_what);
int64_t GDAPI godot_string_wchar_to_int(const wchar_t *p_str);
godot_int GDAPI godot_string_char_to_int_with_len(const char *p_what, godot_int p_len);
int64_t GDAPI godot_string_char_to_int64_with_len(const wchar_t *p_str, int p_len);
int64_t GDAPI godot_string_hex_to_int64(const godot_string *p_self);
int64_t GDAPI godot_string_hex_to_int64_with_prefix(const godot_string *p_self);
int64_t GDAPI godot_string_to_int64(const godot_string *p_self);
double GDAPI godot_string_unicode_char_to_double(const wchar_t *p_str, const wchar_t **r_end);
godot_int GDAPI godot_string_get_slice_count(const godot_string *p_self, godot_string p_splitter);
godot_string GDAPI godot_string_get_slice(const godot_string *p_self, godot_string p_splitter, godot_int p_slice);
godot_string GDAPI godot_string_get_slicec(const godot_string *p_self, wchar_t p_splitter, godot_int p_slice);
godot_array GDAPI godot_string_split(const godot_string *p_self, const godot_string *p_splitter);
godot_array GDAPI godot_string_split_allow_empty(const godot_string *p_self, const godot_string *p_splitter);
godot_array GDAPI godot_string_split_floats(const godot_string *p_self, const godot_string *p_splitter);
godot_array GDAPI godot_string_split_floats_allows_empty(const godot_string *p_self, const godot_string *p_splitter);
godot_array GDAPI godot_string_split_floats_mk(const godot_string *p_self, const godot_array *p_splitters);
godot_array GDAPI godot_string_split_floats_mk_allows_empty(const godot_string *p_self, const godot_array *p_splitters);
godot_array GDAPI godot_string_split_ints(const godot_string *p_self, const godot_string *p_splitter);
godot_array GDAPI godot_string_split_ints_allows_empty(const godot_string *p_self, const godot_string *p_splitter);
godot_array GDAPI godot_string_split_ints_mk(const godot_string *p_self, const godot_array *p_splitters);
godot_array GDAPI godot_string_split_ints_mk_allows_empty(const godot_string *p_self, const godot_array *p_splitters);
godot_array GDAPI godot_string_split_spaces(const godot_string *p_self);
wchar_t GDAPI godot_string_char_lowercase(wchar_t p_char);
wchar_t GDAPI godot_string_char_uppercase(wchar_t p_char);
godot_string GDAPI godot_string_to_lower(const godot_string *p_self);
godot_string GDAPI godot_string_to_upper(const godot_string *p_self);
godot_string GDAPI godot_string_get_basename(const godot_string *p_self);
godot_string GDAPI godot_string_get_extension(const godot_string *p_self);
godot_string GDAPI godot_string_left(const godot_string *p_self, godot_int p_pos);
wchar_t GDAPI godot_string_ord_at(const godot_string *p_self, godot_int p_idx);
godot_string GDAPI godot_string_plus_file(const godot_string *p_self, const godot_string *p_file);
godot_string GDAPI godot_string_right(const godot_string *p_self, godot_int p_pos);
godot_string GDAPI godot_string_strip_edges(const godot_string *p_self, godot_bool p_left, godot_bool p_right);
godot_string GDAPI godot_string_strip_escapes(const godot_string *p_self);
void GDAPI godot_string_erase(godot_string *p_self, godot_int p_pos, godot_int p_chars);
godot_char_string GDAPI godot_string_ascii(const godot_string *p_self);
godot_char_string GDAPI godot_string_ascii_extended(const godot_string *p_self);
godot_char_string GDAPI godot_string_utf8(const godot_string *p_self);
godot_bool GDAPI godot_string_parse_utf8(godot_string *p_self, const char *p_utf8);
godot_bool GDAPI godot_string_parse_utf8_with_len(godot_string *p_self, const char *p_utf8, godot_int p_len);
godot_string GDAPI godot_string_chars_to_utf8(const char *p_utf8);
godot_string GDAPI godot_string_chars_to_utf8_with_len(const char *p_utf8, godot_int p_len);
uint32_t GDAPI godot_string_hash(const godot_string *p_self);
uint64_t GDAPI godot_string_hash64(const godot_string *p_self);
uint32_t GDAPI godot_string_hash_chars(const char *p_cstr);
uint32_t GDAPI godot_string_hash_chars_with_len(const char *p_cstr, godot_int p_len);
uint32_t GDAPI godot_string_hash_utf8_chars(const wchar_t *p_str);
uint32_t GDAPI godot_string_hash_utf8_chars_with_len(const wchar_t *p_str, godot_int p_len);
godot_pool_byte_array GDAPI godot_string_md5_buffer(const godot_string *p_self);
godot_string GDAPI godot_string_md5_text(const godot_string *p_self);
godot_pool_byte_array GDAPI godot_string_sha256_buffer(const godot_string *p_self);
godot_string GDAPI godot_string_sha256_text(const godot_string *p_self);
godot_bool godot_string_empty(const godot_string *p_self);
// path functions
godot_string GDAPI godot_string_get_base_dir(const godot_string *p_self);
godot_string GDAPI godot_string_get_file(const godot_string *p_self);
godot_string GDAPI godot_string_humanize_size(size_t p_size);
godot_bool GDAPI godot_string_is_abs_path(const godot_string *p_self);
godot_bool GDAPI godot_string_is_rel_path(const godot_string *p_self);
godot_bool GDAPI godot_string_is_resource_file(const godot_string *p_self);
godot_string GDAPI godot_string_path_to(const godot_string *p_self, const godot_string *p_path);
godot_string GDAPI godot_string_path_to_file(const godot_string *p_self, const godot_string *p_path);
godot_string GDAPI godot_string_simplify_path(const godot_string *p_self);
godot_string GDAPI godot_string_c_escape(const godot_string *p_self);
godot_string GDAPI godot_string_c_escape_multiline(const godot_string *p_self);
godot_string GDAPI godot_string_c_unescape(const godot_string *p_self);
godot_string GDAPI godot_string_http_escape(const godot_string *p_self);
godot_string GDAPI godot_string_http_unescape(const godot_string *p_self);
godot_string GDAPI godot_string_json_escape(const godot_string *p_self);
godot_string GDAPI godot_string_word_wrap(const godot_string *p_self, godot_int p_chars_per_line);
godot_string GDAPI godot_string_xml_escape(const godot_string *p_self);
godot_string GDAPI godot_string_xml_escape_with_quotes(const godot_string *p_self);
godot_string GDAPI godot_string_xml_unescape(const godot_string *p_self);
godot_string GDAPI godot_string_percent_decode(const godot_string *p_self);
godot_string GDAPI godot_string_percent_encode(const godot_string *p_self);
godot_bool GDAPI godot_string_is_valid_float(const godot_string *p_self);
godot_bool GDAPI godot_string_is_valid_hex_number(const godot_string *p_self, godot_bool p_with_prefix);
godot_bool GDAPI godot_string_is_valid_html_color(const godot_string *p_self);
godot_bool GDAPI godot_string_is_valid_identifier(const godot_string *p_self);
godot_bool GDAPI godot_string_is_valid_integer(const godot_string *p_self);
godot_bool GDAPI godot_string_is_valid_ip_address(const godot_string *p_self);
godot_string GDAPI godot_string_dedent(const godot_string *p_self);
godot_string GDAPI godot_string_trim_prefix(const godot_string *p_self, const godot_string *p_prefix);
godot_string GDAPI godot_string_trim_suffix(const godot_string *p_self, const godot_string *p_suffix);
godot_string GDAPI godot_string_rstrip(const godot_string *p_self, const godot_string *p_chars);
godot_pool_string_array GDAPI godot_string_rsplit(const godot_string *p_self, const godot_string *p_divisor, const godot_bool p_allow_empty, const godot_int p_maxsplit);
void GDAPI godot_string_destroy(godot_string *p_self);
#ifdef __cplusplus
}
#endif
#endif // GODOT_STRING_H

View File

@@ -0,0 +1,78 @@
/*************************************************************************/
/* string_name.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef GODOT_STRING_NAME_H
#define GODOT_STRING_NAME_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <wchar.h>
#define GODOT_STRING_NAME_SIZE sizeof(void *)
#ifndef GODOT_CORE_API_GODOT_STRING_NAME_TYPE_DEFINED
#define GODOT_CORE_API_GODOT_STRING_NAME_TYPE_DEFINED
typedef struct {
uint8_t _dont_touch_that[GODOT_STRING_NAME_SIZE];
} godot_string_name;
#endif
// reduce extern "C" nesting for VS2013
#ifdef __cplusplus
}
#endif
#include <gdnative/gdnative.h>
#ifdef __cplusplus
extern "C" {
#endif
void GDAPI godot_string_name_new(godot_string_name *r_dest, const godot_string *p_name);
void GDAPI godot_string_name_new_data(godot_string_name *r_dest, const char *p_name);
godot_string GDAPI godot_string_name_get_name(const godot_string_name *p_self);
uint32_t GDAPI godot_string_name_get_hash(const godot_string_name *p_self);
const void GDAPI *godot_string_name_get_data_unique_pointer(const godot_string_name *p_self);
godot_bool GDAPI godot_string_name_operator_equal(const godot_string_name *p_self, const godot_string_name *p_other);
godot_bool GDAPI godot_string_name_operator_less(const godot_string_name *p_self, const godot_string_name *p_other);
void GDAPI godot_string_name_destroy(godot_string_name *p_self);
#ifdef __cplusplus
}
#endif
#endif // GODOT_STRING_NAME_H

View File

@@ -0,0 +1,111 @@
/*************************************************************************/
/* transform.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef GODOT_TRANSFORM_H
#define GODOT_TRANSFORM_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#define GODOT_TRANSFORM_SIZE 48
#ifndef GODOT_CORE_API_GODOT_TRANSFORM_TYPE_DEFINED
#define GODOT_CORE_API_GODOT_TRANSFORM_TYPE_DEFINED
typedef struct {
uint8_t _dont_touch_that[GODOT_TRANSFORM_SIZE];
} godot_transform;
#endif
// reduce extern "C" nesting for VS2013
#ifdef __cplusplus
}
#endif
#include <gdnative/basis.h>
#include <gdnative/gdnative.h>
#include <gdnative/variant.h>
#include <gdnative/vector3.h>
#ifdef __cplusplus
extern "C" {
#endif
void GDAPI godot_transform_new_with_axis_origin(godot_transform *r_dest, const godot_vector3 *p_x_axis, const godot_vector3 *p_y_axis, const godot_vector3 *p_z_axis, const godot_vector3 *p_origin);
void GDAPI godot_transform_new(godot_transform *r_dest, const godot_basis *p_basis, const godot_vector3 *p_origin);
void GDAPI godot_transform_new_with_quat(godot_transform *r_dest, const godot_quat *p_quat);
godot_basis GDAPI godot_transform_get_basis(const godot_transform *p_self);
void GDAPI godot_transform_set_basis(godot_transform *p_self, const godot_basis *p_v);
godot_vector3 GDAPI godot_transform_get_origin(const godot_transform *p_self);
void GDAPI godot_transform_set_origin(godot_transform *p_self, const godot_vector3 *p_v);
godot_string GDAPI godot_transform_as_string(const godot_transform *p_self);
godot_transform GDAPI godot_transform_inverse(const godot_transform *p_self);
godot_transform GDAPI godot_transform_affine_inverse(const godot_transform *p_self);
godot_transform GDAPI godot_transform_orthonormalized(const godot_transform *p_self);
godot_transform GDAPI godot_transform_rotated(const godot_transform *p_self, const godot_vector3 *p_axis, const godot_real p_phi);
godot_transform GDAPI godot_transform_scaled(const godot_transform *p_self, const godot_vector3 *p_scale);
godot_transform GDAPI godot_transform_translated(const godot_transform *p_self, const godot_vector3 *p_ofs);
godot_transform GDAPI godot_transform_looking_at(const godot_transform *p_self, const godot_vector3 *p_target, const godot_vector3 *p_up);
godot_plane GDAPI godot_transform_xform_plane(const godot_transform *p_self, const godot_plane *p_v);
godot_plane GDAPI godot_transform_xform_inv_plane(const godot_transform *p_self, const godot_plane *p_v);
void GDAPI godot_transform_new_identity(godot_transform *r_dest);
godot_bool GDAPI godot_transform_operator_equal(const godot_transform *p_self, const godot_transform *p_b);
godot_transform GDAPI godot_transform_operator_multiply(const godot_transform *p_self, const godot_transform *p_b);
godot_vector3 GDAPI godot_transform_xform_vector3(const godot_transform *p_self, const godot_vector3 *p_v);
godot_vector3 GDAPI godot_transform_xform_inv_vector3(const godot_transform *p_self, const godot_vector3 *p_v);
godot_aabb GDAPI godot_transform_xform_aabb(const godot_transform *p_self, const godot_aabb *p_v);
godot_aabb GDAPI godot_transform_xform_inv_aabb(const godot_transform *p_self, const godot_aabb *p_v);
#ifdef __cplusplus
}
#endif
#endif // GODOT_TRANSFORM_H

View File

@@ -0,0 +1,109 @@
/*************************************************************************/
/* transform2d.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef GODOT_TRANSFORM2D_H
#define GODOT_TRANSFORM2D_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#define GODOT_TRANSFORM2D_SIZE 24
#ifndef GODOT_CORE_API_GODOT_TRANSFORM2D_TYPE_DEFINED
#define GODOT_CORE_API_GODOT_TRANSFORM2D_TYPE_DEFINED
typedef struct {
uint8_t _dont_touch_that[GODOT_TRANSFORM2D_SIZE];
} godot_transform2d;
#endif
// reduce extern "C" nesting for VS2013
#ifdef __cplusplus
}
#endif
#include <gdnative/gdnative.h>
#include <gdnative/variant.h>
#include <gdnative/vector2.h>
#ifdef __cplusplus
extern "C" {
#endif
void GDAPI godot_transform2d_new(godot_transform2d *r_dest, const godot_real p_rot, const godot_vector2 *p_pos);
void GDAPI godot_transform2d_new_axis_origin(godot_transform2d *r_dest, const godot_vector2 *p_x_axis, const godot_vector2 *p_y_axis, const godot_vector2 *p_origin);
godot_string GDAPI godot_transform2d_as_string(const godot_transform2d *p_self);
godot_transform2d GDAPI godot_transform2d_inverse(const godot_transform2d *p_self);
godot_transform2d GDAPI godot_transform2d_affine_inverse(const godot_transform2d *p_self);
godot_real GDAPI godot_transform2d_get_rotation(const godot_transform2d *p_self);
godot_vector2 GDAPI godot_transform2d_get_origin(const godot_transform2d *p_self);
godot_vector2 GDAPI godot_transform2d_get_scale(const godot_transform2d *p_self);
godot_transform2d GDAPI godot_transform2d_orthonormalized(const godot_transform2d *p_self);
godot_transform2d GDAPI godot_transform2d_rotated(const godot_transform2d *p_self, const godot_real p_phi);
godot_transform2d GDAPI godot_transform2d_scaled(const godot_transform2d *p_self, const godot_vector2 *p_scale);
godot_transform2d GDAPI godot_transform2d_translated(const godot_transform2d *p_self, const godot_vector2 *p_offset);
godot_vector2 GDAPI godot_transform2d_xform_vector2(const godot_transform2d *p_self, const godot_vector2 *p_v);
godot_vector2 GDAPI godot_transform2d_xform_inv_vector2(const godot_transform2d *p_self, const godot_vector2 *p_v);
godot_vector2 GDAPI godot_transform2d_basis_xform_vector2(const godot_transform2d *p_self, const godot_vector2 *p_v);
godot_vector2 GDAPI godot_transform2d_basis_xform_inv_vector2(const godot_transform2d *p_self, const godot_vector2 *p_v);
godot_transform2d GDAPI godot_transform2d_interpolate_with(const godot_transform2d *p_self, const godot_transform2d *p_m, const godot_real p_c);
godot_bool GDAPI godot_transform2d_operator_equal(const godot_transform2d *p_self, const godot_transform2d *p_b);
godot_transform2d GDAPI godot_transform2d_operator_multiply(const godot_transform2d *p_self, const godot_transform2d *p_b);
void GDAPI godot_transform2d_new_identity(godot_transform2d *r_dest);
godot_rect2 GDAPI godot_transform2d_xform_rect2(const godot_transform2d *p_self, const godot_rect2 *p_v);
godot_rect2 GDAPI godot_transform2d_xform_inv_rect2(const godot_transform2d *p_self, const godot_rect2 *p_v);
#ifdef __cplusplus
}
#endif
#endif // GODOT_TRANSFORM2D_H

View File

@@ -0,0 +1,255 @@
/*************************************************************************/
/* variant.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef GODOT_VARIANT_H
#define GODOT_VARIANT_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#define GODOT_VARIANT_SIZE (16 + sizeof(void *))
#ifndef GODOT_CORE_API_GODOT_VARIANT_TYPE_DEFINED
#define GODOT_CORE_API_GODOT_VARIANT_TYPE_DEFINED
typedef struct {
uint8_t _dont_touch_that[GODOT_VARIANT_SIZE];
} godot_variant;
#endif
typedef enum godot_variant_type {
GODOT_VARIANT_TYPE_NIL,
// atomic types
GODOT_VARIANT_TYPE_BOOL,
GODOT_VARIANT_TYPE_INT,
GODOT_VARIANT_TYPE_REAL,
GODOT_VARIANT_TYPE_STRING,
// math types
GODOT_VARIANT_TYPE_VECTOR2, // 5
GODOT_VARIANT_TYPE_RECT2,
GODOT_VARIANT_TYPE_VECTOR3,
GODOT_VARIANT_TYPE_TRANSFORM2D,
GODOT_VARIANT_TYPE_PLANE,
GODOT_VARIANT_TYPE_QUAT, // 10
GODOT_VARIANT_TYPE_AABB,
GODOT_VARIANT_TYPE_BASIS,
GODOT_VARIANT_TYPE_TRANSFORM,
// misc types
GODOT_VARIANT_TYPE_COLOR,
GODOT_VARIANT_TYPE_NODE_PATH, // 15
GODOT_VARIANT_TYPE_RID,
GODOT_VARIANT_TYPE_OBJECT,
GODOT_VARIANT_TYPE_DICTIONARY,
GODOT_VARIANT_TYPE_ARRAY, // 20
// arrays
GODOT_VARIANT_TYPE_POOL_BYTE_ARRAY,
GODOT_VARIANT_TYPE_POOL_INT_ARRAY,
GODOT_VARIANT_TYPE_POOL_REAL_ARRAY,
GODOT_VARIANT_TYPE_POOL_STRING_ARRAY,
GODOT_VARIANT_TYPE_POOL_VECTOR2_ARRAY, // 25
GODOT_VARIANT_TYPE_POOL_VECTOR3_ARRAY,
GODOT_VARIANT_TYPE_POOL_COLOR_ARRAY,
} godot_variant_type;
typedef enum godot_variant_call_error_error {
GODOT_CALL_ERROR_CALL_OK,
GODOT_CALL_ERROR_CALL_ERROR_INVALID_METHOD,
GODOT_CALL_ERROR_CALL_ERROR_INVALID_ARGUMENT,
GODOT_CALL_ERROR_CALL_ERROR_TOO_MANY_ARGUMENTS,
GODOT_CALL_ERROR_CALL_ERROR_TOO_FEW_ARGUMENTS,
GODOT_CALL_ERROR_CALL_ERROR_INSTANCE_IS_NULL,
} godot_variant_call_error_error;
typedef struct godot_variant_call_error {
godot_variant_call_error_error error;
int argument;
godot_variant_type expected;
} godot_variant_call_error;
typedef enum godot_variant_operator {
// comparison
GODOT_VARIANT_OP_EQUAL,
GODOT_VARIANT_OP_NOT_EQUAL,
GODOT_VARIANT_OP_LESS,
GODOT_VARIANT_OP_LESS_EQUAL,
GODOT_VARIANT_OP_GREATER,
GODOT_VARIANT_OP_GREATER_EQUAL,
// mathematic
GODOT_VARIANT_OP_ADD,
GODOT_VARIANT_OP_SUBTRACT,
GODOT_VARIANT_OP_MULTIPLY,
GODOT_VARIANT_OP_DIVIDE,
GODOT_VARIANT_OP_NEGATE,
GODOT_VARIANT_OP_POSITIVE,
GODOT_VARIANT_OP_MODULE,
GODOT_VARIANT_OP_STRING_CONCAT,
// bitwise
GODOT_VARIANT_OP_SHIFT_LEFT,
GODOT_VARIANT_OP_SHIFT_RIGHT,
GODOT_VARIANT_OP_BIT_AND,
GODOT_VARIANT_OP_BIT_OR,
GODOT_VARIANT_OP_BIT_XOR,
GODOT_VARIANT_OP_BIT_NEGATE,
// logic
GODOT_VARIANT_OP_AND,
GODOT_VARIANT_OP_OR,
GODOT_VARIANT_OP_XOR,
GODOT_VARIANT_OP_NOT,
// containment
GODOT_VARIANT_OP_IN,
GODOT_VARIANT_OP_MAX,
} godot_variant_operator;
// reduce extern "C" nesting for VS2013
#ifdef __cplusplus
}
#endif
#include <gdnative/aabb.h>
#include <gdnative/array.h>
#include <gdnative/basis.h>
#include <gdnative/color.h>
#include <gdnative/dictionary.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/transform.h>
#include <gdnative/transform2d.h>
#include <gdnative/variant.h>
#include <gdnative/vector2.h>
#include <gdnative/vector3.h>
#include <gdnative/gdnative.h>
#ifdef __cplusplus
extern "C" {
#endif
godot_variant_type GDAPI godot_variant_get_type(const godot_variant *p_v);
void GDAPI godot_variant_new_copy(godot_variant *r_dest, const godot_variant *p_src);
void GDAPI godot_variant_new_nil(godot_variant *r_dest);
void GDAPI godot_variant_new_bool(godot_variant *r_dest, const godot_bool p_b);
void GDAPI godot_variant_new_uint(godot_variant *r_dest, const uint64_t p_i);
void GDAPI godot_variant_new_int(godot_variant *r_dest, const int64_t p_i);
void GDAPI godot_variant_new_real(godot_variant *r_dest, const double p_r);
void GDAPI godot_variant_new_string(godot_variant *r_dest, const godot_string *p_s);
void GDAPI godot_variant_new_vector2(godot_variant *r_dest, const godot_vector2 *p_v2);
void GDAPI godot_variant_new_rect2(godot_variant *r_dest, const godot_rect2 *p_rect2);
void GDAPI godot_variant_new_vector3(godot_variant *r_dest, const godot_vector3 *p_v3);
void GDAPI godot_variant_new_transform2d(godot_variant *r_dest, const godot_transform2d *p_t2d);
void GDAPI godot_variant_new_plane(godot_variant *r_dest, const godot_plane *p_plane);
void GDAPI godot_variant_new_quat(godot_variant *r_dest, const godot_quat *p_quat);
void GDAPI godot_variant_new_aabb(godot_variant *r_dest, const godot_aabb *p_aabb);
void GDAPI godot_variant_new_basis(godot_variant *r_dest, const godot_basis *p_basis);
void GDAPI godot_variant_new_transform(godot_variant *r_dest, const godot_transform *p_trans);
void GDAPI godot_variant_new_color(godot_variant *r_dest, const godot_color *p_color);
void GDAPI godot_variant_new_node_path(godot_variant *r_dest, const godot_node_path *p_np);
void GDAPI godot_variant_new_rid(godot_variant *r_dest, const godot_rid *p_rid);
void GDAPI godot_variant_new_object(godot_variant *r_dest, const godot_object *p_obj);
void GDAPI godot_variant_new_dictionary(godot_variant *r_dest, const godot_dictionary *p_dict);
void GDAPI godot_variant_new_array(godot_variant *r_dest, const godot_array *p_arr);
void GDAPI godot_variant_new_pool_byte_array(godot_variant *r_dest, const godot_pool_byte_array *p_pba);
void GDAPI godot_variant_new_pool_int_array(godot_variant *r_dest, const godot_pool_int_array *p_pia);
void GDAPI godot_variant_new_pool_real_array(godot_variant *r_dest, const godot_pool_real_array *p_pra);
void GDAPI godot_variant_new_pool_string_array(godot_variant *r_dest, const godot_pool_string_array *p_psa);
void GDAPI godot_variant_new_pool_vector2_array(godot_variant *r_dest, const godot_pool_vector2_array *p_pv2a);
void GDAPI godot_variant_new_pool_vector3_array(godot_variant *r_dest, const godot_pool_vector3_array *p_pv3a);
void GDAPI godot_variant_new_pool_color_array(godot_variant *r_dest, const godot_pool_color_array *p_pca);
godot_bool GDAPI godot_variant_as_bool(const godot_variant *p_self);
uint64_t GDAPI godot_variant_as_uint(const godot_variant *p_self);
int64_t GDAPI godot_variant_as_int(const godot_variant *p_self);
double GDAPI godot_variant_as_real(const godot_variant *p_self);
godot_string GDAPI godot_variant_as_string(const godot_variant *p_self);
godot_vector2 GDAPI godot_variant_as_vector2(const godot_variant *p_self);
godot_rect2 GDAPI godot_variant_as_rect2(const godot_variant *p_self);
godot_vector3 GDAPI godot_variant_as_vector3(const godot_variant *p_self);
godot_transform2d GDAPI godot_variant_as_transform2d(const godot_variant *p_self);
godot_plane GDAPI godot_variant_as_plane(const godot_variant *p_self);
godot_quat GDAPI godot_variant_as_quat(const godot_variant *p_self);
godot_aabb GDAPI godot_variant_as_aabb(const godot_variant *p_self);
godot_basis GDAPI godot_variant_as_basis(const godot_variant *p_self);
godot_transform GDAPI godot_variant_as_transform(const godot_variant *p_self);
godot_color GDAPI godot_variant_as_color(const godot_variant *p_self);
godot_node_path GDAPI godot_variant_as_node_path(const godot_variant *p_self);
godot_rid GDAPI godot_variant_as_rid(const godot_variant *p_self);
godot_object GDAPI *godot_variant_as_object(const godot_variant *p_self);
godot_dictionary GDAPI godot_variant_as_dictionary(const godot_variant *p_self);
godot_array GDAPI godot_variant_as_array(const godot_variant *p_self);
godot_pool_byte_array GDAPI godot_variant_as_pool_byte_array(const godot_variant *p_self);
godot_pool_int_array GDAPI godot_variant_as_pool_int_array(const godot_variant *p_self);
godot_pool_real_array GDAPI godot_variant_as_pool_real_array(const godot_variant *p_self);
godot_pool_string_array GDAPI godot_variant_as_pool_string_array(const godot_variant *p_self);
godot_pool_vector2_array GDAPI godot_variant_as_pool_vector2_array(const godot_variant *p_self);
godot_pool_vector3_array GDAPI godot_variant_as_pool_vector3_array(const godot_variant *p_self);
godot_pool_color_array GDAPI godot_variant_as_pool_color_array(const godot_variant *p_self);
godot_variant GDAPI godot_variant_call(godot_variant *p_self, const godot_string *p_method, const godot_variant **p_args, const godot_int p_argcount, godot_variant_call_error *r_error);
godot_bool GDAPI godot_variant_has_method(const godot_variant *p_self, const godot_string *p_method);
godot_bool GDAPI godot_variant_operator_equal(const godot_variant *p_self, const godot_variant *p_other);
godot_bool GDAPI godot_variant_operator_less(const godot_variant *p_self, const godot_variant *p_other);
godot_bool GDAPI godot_variant_hash_compare(const godot_variant *p_self, const godot_variant *p_other);
godot_bool GDAPI godot_variant_booleanize(const godot_variant *p_self);
void GDAPI godot_variant_destroy(godot_variant *p_self);
// GDNative core 1.1
godot_string GDAPI godot_variant_get_operator_name(godot_variant_operator p_op);
void GDAPI godot_variant_evaluate(godot_variant_operator p_op, const godot_variant *p_a, const godot_variant *p_b, godot_variant *r_ret, godot_bool *r_valid);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,142 @@
/*************************************************************************/
/* vector2.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef GODOT_VECTOR2_H
#define GODOT_VECTOR2_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#define GODOT_VECTOR2_SIZE 8
#ifndef GODOT_CORE_API_GODOT_VECTOR2_TYPE_DEFINED
#define GODOT_CORE_API_GODOT_VECTOR2_TYPE_DEFINED
typedef struct {
uint8_t _dont_touch_that[GODOT_VECTOR2_SIZE];
} godot_vector2;
#endif
// reduce extern "C" nesting for VS2013
#ifdef __cplusplus
}
#endif
#include <gdnative/gdnative.h>
#ifdef __cplusplus
extern "C" {
#endif
void GDAPI godot_vector2_new(godot_vector2 *r_dest, const godot_real p_x, const godot_real p_y);
godot_string GDAPI godot_vector2_as_string(const godot_vector2 *p_self);
godot_vector2 GDAPI godot_vector2_normalized(const godot_vector2 *p_self);
godot_real GDAPI godot_vector2_length(const godot_vector2 *p_self);
godot_real GDAPI godot_vector2_angle(const godot_vector2 *p_self);
godot_real GDAPI godot_vector2_length_squared(const godot_vector2 *p_self);
godot_bool GDAPI godot_vector2_is_normalized(const godot_vector2 *p_self);
godot_vector2 GDAPI godot_vector2_direction_to(const godot_vector2 *p_self, const godot_vector2 *p_b);
godot_real GDAPI godot_vector2_distance_to(const godot_vector2 *p_self, const godot_vector2 *p_to);
godot_real GDAPI godot_vector2_distance_squared_to(const godot_vector2 *p_self, const godot_vector2 *p_to);
godot_real GDAPI godot_vector2_angle_to(const godot_vector2 *p_self, const godot_vector2 *p_to);
godot_real GDAPI godot_vector2_angle_to_point(const godot_vector2 *p_self, const godot_vector2 *p_to);
godot_vector2 GDAPI godot_vector2_linear_interpolate(const godot_vector2 *p_self, const godot_vector2 *p_b, const godot_real p_t);
godot_vector2 GDAPI 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 GDAPI godot_vector2_move_toward(const godot_vector2 *p_self, const godot_vector2 *p_to, const godot_real p_delta);
godot_vector2 GDAPI godot_vector2_rotated(const godot_vector2 *p_self, const godot_real p_phi);
godot_vector2 GDAPI godot_vector2_tangent(const godot_vector2 *p_self);
godot_vector2 GDAPI godot_vector2_floor(const godot_vector2 *p_self);
godot_vector2 GDAPI godot_vector2_snapped(const godot_vector2 *p_self, const godot_vector2 *p_by);
godot_real GDAPI godot_vector2_aspect(const godot_vector2 *p_self);
godot_real GDAPI godot_vector2_dot(const godot_vector2 *p_self, const godot_vector2 *p_with);
godot_vector2 GDAPI godot_vector2_slide(const godot_vector2 *p_self, const godot_vector2 *p_n);
godot_vector2 GDAPI godot_vector2_bounce(const godot_vector2 *p_self, const godot_vector2 *p_n);
godot_vector2 GDAPI godot_vector2_reflect(const godot_vector2 *p_self, const godot_vector2 *p_n);
godot_vector2 GDAPI godot_vector2_abs(const godot_vector2 *p_self);
godot_vector2 GDAPI godot_vector2_clamped(const godot_vector2 *p_self, const godot_real p_length);
godot_vector2 GDAPI godot_vector2_operator_add(const godot_vector2 *p_self, const godot_vector2 *p_b);
godot_vector2 GDAPI godot_vector2_operator_subtract(const godot_vector2 *p_self, const godot_vector2 *p_b);
godot_vector2 GDAPI godot_vector2_operator_multiply_vector(const godot_vector2 *p_self, const godot_vector2 *p_b);
godot_vector2 GDAPI godot_vector2_operator_multiply_scalar(const godot_vector2 *p_self, const godot_real p_b);
godot_vector2 GDAPI godot_vector2_operator_divide_vector(const godot_vector2 *p_self, const godot_vector2 *p_b);
godot_vector2 GDAPI godot_vector2_operator_divide_scalar(const godot_vector2 *p_self, const godot_real p_b);
godot_bool GDAPI godot_vector2_operator_equal(const godot_vector2 *p_self, const godot_vector2 *p_b);
godot_bool GDAPI godot_vector2_operator_less(const godot_vector2 *p_self, const godot_vector2 *p_b);
godot_vector2 GDAPI godot_vector2_operator_neg(const godot_vector2 *p_self);
void GDAPI godot_vector2_set_x(godot_vector2 *p_self, const godot_real p_x);
void GDAPI godot_vector2_set_y(godot_vector2 *p_self, const godot_real p_y);
godot_real GDAPI godot_vector2_get_x(const godot_vector2 *p_self);
godot_real GDAPI godot_vector2_get_y(const godot_vector2 *p_self);
#ifdef __cplusplus
}
#endif
#endif // GODOT_VECTOR2_H

View File

@@ -0,0 +1,149 @@
/*************************************************************************/
/* vector3.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef GODOT_VECTOR3_H
#define GODOT_VECTOR3_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#define GODOT_VECTOR3_SIZE 12
#ifndef GODOT_CORE_API_GODOT_VECTOR3_TYPE_DEFINED
#define GODOT_CORE_API_GODOT_VECTOR3_TYPE_DEFINED
typedef struct {
uint8_t _dont_touch_that[GODOT_VECTOR3_SIZE];
} godot_vector3;
#endif
// reduce extern "C" nesting for VS2013
#ifdef __cplusplus
}
#endif
#include <gdnative/basis.h>
#include <gdnative/gdnative.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef enum {
GODOT_VECTOR3_AXIS_X,
GODOT_VECTOR3_AXIS_Y,
GODOT_VECTOR3_AXIS_Z,
} godot_vector3_axis;
void GDAPI godot_vector3_new(godot_vector3 *r_dest, const godot_real p_x, const godot_real p_y, const godot_real p_z);
godot_string GDAPI godot_vector3_as_string(const godot_vector3 *p_self);
godot_int GDAPI godot_vector3_min_axis(const godot_vector3 *p_self);
godot_int GDAPI godot_vector3_max_axis(const godot_vector3 *p_self);
godot_real GDAPI godot_vector3_length(const godot_vector3 *p_self);
godot_real GDAPI godot_vector3_length_squared(const godot_vector3 *p_self);
godot_bool GDAPI godot_vector3_is_normalized(const godot_vector3 *p_self);
godot_vector3 GDAPI godot_vector3_normalized(const godot_vector3 *p_self);
godot_vector3 GDAPI godot_vector3_inverse(const godot_vector3 *p_self);
godot_vector3 GDAPI godot_vector3_snapped(const godot_vector3 *p_self, const godot_vector3 *p_by);
godot_vector3 GDAPI godot_vector3_rotated(const godot_vector3 *p_self, const godot_vector3 *p_axis, const godot_real p_phi);
godot_vector3 GDAPI godot_vector3_linear_interpolate(const godot_vector3 *p_self, const godot_vector3 *p_b, const godot_real p_t);
godot_vector3 GDAPI 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 GDAPI godot_vector3_move_toward(const godot_vector3 *p_self, const godot_vector3 *p_to, const godot_real p_delta);
godot_real GDAPI godot_vector3_dot(const godot_vector3 *p_self, const godot_vector3 *p_b);
godot_vector3 GDAPI godot_vector3_cross(const godot_vector3 *p_self, const godot_vector3 *p_b);
godot_basis GDAPI godot_vector3_outer(const godot_vector3 *p_self, const godot_vector3 *p_b);
godot_basis GDAPI godot_vector3_to_diagonal_matrix(const godot_vector3 *p_self);
godot_vector3 GDAPI godot_vector3_abs(const godot_vector3 *p_self);
godot_vector3 GDAPI godot_vector3_floor(const godot_vector3 *p_self);
godot_vector3 GDAPI godot_vector3_ceil(const godot_vector3 *p_self);
godot_vector3 GDAPI godot_vector3_direction_to(const godot_vector3 *p_self, const godot_vector3 *p_b);
godot_real GDAPI godot_vector3_distance_to(const godot_vector3 *p_self, const godot_vector3 *p_b);
godot_real GDAPI godot_vector3_distance_squared_to(const godot_vector3 *p_self, const godot_vector3 *p_b);
godot_real GDAPI godot_vector3_angle_to(const godot_vector3 *p_self, const godot_vector3 *p_to);
godot_vector3 GDAPI godot_vector3_slide(const godot_vector3 *p_self, const godot_vector3 *p_n);
godot_vector3 GDAPI godot_vector3_bounce(const godot_vector3 *p_self, const godot_vector3 *p_n);
godot_vector3 GDAPI godot_vector3_reflect(const godot_vector3 *p_self, const godot_vector3 *p_n);
godot_vector3 GDAPI godot_vector3_operator_add(const godot_vector3 *p_self, const godot_vector3 *p_b);
godot_vector3 GDAPI godot_vector3_operator_subtract(const godot_vector3 *p_self, const godot_vector3 *p_b);
godot_vector3 GDAPI godot_vector3_operator_multiply_vector(const godot_vector3 *p_self, const godot_vector3 *p_b);
godot_vector3 GDAPI godot_vector3_operator_multiply_scalar(const godot_vector3 *p_self, const godot_real p_b);
godot_vector3 GDAPI godot_vector3_operator_divide_vector(const godot_vector3 *p_self, const godot_vector3 *p_b);
godot_vector3 GDAPI godot_vector3_operator_divide_scalar(const godot_vector3 *p_self, const godot_real p_b);
godot_bool GDAPI godot_vector3_operator_equal(const godot_vector3 *p_self, const godot_vector3 *p_b);
godot_bool GDAPI godot_vector3_operator_less(const godot_vector3 *p_self, const godot_vector3 *p_b);
godot_vector3 GDAPI godot_vector3_operator_neg(const godot_vector3 *p_self);
void GDAPI godot_vector3_set_axis(godot_vector3 *p_self, const godot_vector3_axis p_axis, const godot_real p_val);
godot_real GDAPI godot_vector3_get_axis(const godot_vector3 *p_self, const godot_vector3_axis p_axis);
#ifdef __cplusplus
}
#endif
#endif // GODOT_VECTOR3_H

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,973 @@
/* THIS FILE IS GENERATED DO NOT EDIT */
#ifndef GODOT_GDNATIVE_API_STRUCT_H
#define GODOT_GDNATIVE_API_STRUCT_H
#include <gdnative/gdnative.h>
#include <android/godot_android.h>
#include <arvr/godot_arvr.h>
#include <nativescript/godot_nativescript.h>
#include <net/godot_net.h>
#include <pluginscript/godot_pluginscript.h>
#include <videodecoder/godot_videodecoder.h>
#define GDNATIVE_API_INIT(options) do { \
extern const godot_gdnative_core_api_struct *_gdnative_wrapper_api_struct; \
extern const godot_gdnative_ext_nativescript_api_struct *_gdnative_wrapper_nativescript_api_struct; \
extern const godot_gdnative_ext_pluginscript_api_struct *_gdnative_wrapper_pluginscript_api_struct; \
extern const godot_gdnative_ext_android_api_struct *_gdnative_wrapper_android_api_struct; \
extern const godot_gdnative_ext_arvr_api_struct *_gdnative_wrapper_arvr_api_struct; \
extern const godot_gdnative_ext_videodecoder_api_struct *_gdnative_wrapper_videodecoder_api_struct; \
extern const godot_gdnative_ext_net_api_struct *_gdnative_wrapper_net_api_struct; \
_gdnative_wrapper_api_struct = options->api_struct; \
for (unsigned int i = 0; i < _gdnative_wrapper_api_struct->num_extensions; i++) { \
switch (_gdnative_wrapper_api_struct->extensions[i]->type) { \
case GDNATIVE_EXT_NATIVESCRIPT: \
_gdnative_wrapper_nativescript_api_struct = (godot_gdnative_ext_nativescript_api_struct *) _gdnative_wrapper_api_struct->extensions[i]; \
break; \
case GDNATIVE_EXT_PLUGINSCRIPT: \
_gdnative_wrapper_pluginscript_api_struct = (godot_gdnative_ext_pluginscript_api_struct *) _gdnative_wrapper_api_struct->extensions[i]; \
break; \
case GDNATIVE_EXT_ANDROID: \
_gdnative_wrapper_android_api_struct = (godot_gdnative_ext_android_api_struct *) _gdnative_wrapper_api_struct->extensions[i]; \
break; \
case GDNATIVE_EXT_ARVR: \
_gdnative_wrapper_arvr_api_struct = (godot_gdnative_ext_arvr_api_struct *) _gdnative_wrapper_api_struct->extensions[i]; \
break; \
case GDNATIVE_EXT_VIDEODECODER: \
_gdnative_wrapper_videodecoder_api_struct = (godot_gdnative_ext_videodecoder_api_struct *) _gdnative_wrapper_api_struct->extensions[i]; \
break; \
case GDNATIVE_EXT_NET: \
_gdnative_wrapper_net_api_struct = (godot_gdnative_ext_net_api_struct *) _gdnative_wrapper_api_struct->extensions[i]; \
break; \
} \
} \
} while (0)
#ifdef __cplusplus
extern "C" {
#endif
enum GDNATIVE_API_TYPES {
GDNATIVE_CORE,
GDNATIVE_EXT_NATIVESCRIPT,
GDNATIVE_EXT_PLUGINSCRIPT,
GDNATIVE_EXT_ANDROID,
GDNATIVE_EXT_ARVR,
GDNATIVE_EXT_VIDEODECODER,
GDNATIVE_EXT_NET,
};
typedef struct godot_gdnative_ext_nativescript_1_1_api_struct {
unsigned int type;
godot_gdnative_api_version version;
const godot_gdnative_api_struct *next;
void (*godot_nativescript_set_method_argument_information)(void *p_gdnative_handle, const char *p_name, const char *p_function_name, int p_num_args, const godot_method_arg *p_args);
void (*godot_nativescript_set_class_documentation)(void *p_gdnative_handle, const char *p_name, godot_string p_documentation);
void (*godot_nativescript_set_method_documentation)(void *p_gdnative_handle, const char *p_name, const char *p_function_name, godot_string p_documentation);
void (*godot_nativescript_set_property_documentation)(void *p_gdnative_handle, const char *p_name, const char *p_path, godot_string p_documentation);
void (*godot_nativescript_set_signal_documentation)(void *p_gdnative_handle, const char *p_name, const char *p_signal_name, godot_string p_documentation);
void (*godot_nativescript_set_global_type_tag)(int p_idx, const char *p_name, const void *p_type_tag);
const void *(*godot_nativescript_get_global_type_tag)(int p_idx, const char *p_name);
void (*godot_nativescript_set_type_tag)(void *p_gdnative_handle, const char *p_name, const void *p_type_tag);
const void *(*godot_nativescript_get_type_tag)(const godot_object *p_object);
int (*godot_nativescript_register_instance_binding_data_functions)(godot_instance_binding_functions p_binding_functions);
void (*godot_nativescript_unregister_instance_binding_data_functions)(int p_idx);
void *(*godot_nativescript_get_instance_binding_data)(int p_idx, godot_object *p_object);
void (*godot_nativescript_profiling_add_data)(const char *p_signature, uint64_t p_line);
} godot_gdnative_ext_nativescript_1_1_api_struct;
typedef struct godot_gdnative_ext_nativescript_api_struct {
unsigned int type;
godot_gdnative_api_version version;
const godot_gdnative_api_struct *next;
void (*godot_nativescript_register_class)(void *p_gdnative_handle, const char *p_name, const char *p_base, godot_instance_create_func p_create_func, godot_instance_destroy_func p_destroy_func);
void (*godot_nativescript_register_tool_class)(void *p_gdnative_handle, const char *p_name, const char *p_base, godot_instance_create_func p_create_func, godot_instance_destroy_func p_destroy_func);
void (*godot_nativescript_register_method)(void *p_gdnative_handle, const char *p_name, const char *p_function_name, godot_method_attributes p_attr, godot_instance_method p_method);
void (*godot_nativescript_register_property)(void *p_gdnative_handle, const char *p_name, const char *p_path, godot_property_attributes *p_attr, godot_property_set_func p_set_func, godot_property_get_func p_get_func);
void (*godot_nativescript_register_signal)(void *p_gdnative_handle, const char *p_name, const godot_signal *p_signal);
void *(*godot_nativescript_get_userdata)(godot_object *p_instance);
} godot_gdnative_ext_nativescript_api_struct;
typedef struct godot_gdnative_ext_pluginscript_api_struct {
unsigned int type;
godot_gdnative_api_version version;
const godot_gdnative_api_struct *next;
void (*godot_pluginscript_register_language)(const godot_pluginscript_language_desc *language_desc);
} godot_gdnative_ext_pluginscript_api_struct;
typedef struct godot_gdnative_ext_android_api_struct {
unsigned int type;
godot_gdnative_api_version version;
const godot_gdnative_api_struct *next;
JNIEnv*(*godot_android_get_env)();
jobject (*godot_android_get_activity)();
jobject (*godot_android_get_surface)();
bool (*godot_android_is_activity_resumed)();
} godot_gdnative_ext_android_api_struct;
typedef struct godot_gdnative_ext_arvr_api_struct {
unsigned int type;
godot_gdnative_api_version version;
const godot_gdnative_api_struct *next;
void (*godot_arvr_register_interface)(const godot_arvr_interface_gdnative *p_interface);
godot_real (*godot_arvr_get_worldscale)();
godot_transform (*godot_arvr_get_reference_frame)();
void (*godot_arvr_blit)(int p_eye, godot_rid *p_render_target, godot_rect2 *p_screen_rect);
godot_int (*godot_arvr_get_texid)(godot_rid *p_render_target);
godot_int (*godot_arvr_add_controller)(char *p_device_name, godot_int p_hand, godot_bool p_tracks_orientation, godot_bool p_tracks_position);
void (*godot_arvr_remove_controller)(godot_int p_controller_id);
void (*godot_arvr_set_controller_transform)(godot_int p_controller_id, godot_transform *p_transform, godot_bool p_tracks_orientation, godot_bool p_tracks_position);
void (*godot_arvr_set_controller_button)(godot_int p_controller_id, godot_int p_button, godot_bool p_is_pressed);
void (*godot_arvr_set_controller_axis)(godot_int p_controller_id, godot_int p_exis, godot_real p_value, godot_bool p_can_be_negative);
godot_real (*godot_arvr_get_controller_rumble)(godot_int p_controller_id);
} godot_gdnative_ext_arvr_api_struct;
typedef struct godot_gdnative_ext_videodecoder_api_struct {
unsigned int type;
godot_gdnative_api_version version;
const godot_gdnative_api_struct *next;
godot_int (*godot_videodecoder_file_read)(void *file_ptr, uint8_t *buf, int buf_size);
int64_t (*godot_videodecoder_file_seek)(void *file_ptr, int64_t pos, int whence);
void (*godot_videodecoder_register_decoder)(const godot_videodecoder_interface_gdnative *p_interface);
} godot_gdnative_ext_videodecoder_api_struct;
typedef struct godot_gdnative_ext_net_3_2_api_struct {
unsigned int type;
godot_gdnative_api_version version;
const godot_gdnative_api_struct *next;
godot_error (*godot_net_set_webrtc_library)(const godot_net_webrtc_library *p_library);
void (*godot_net_bind_webrtc_peer_connection)(godot_object *p_obj, const godot_net_webrtc_peer_connection *p_interface);
void (*godot_net_bind_webrtc_data_channel)(godot_object *p_obj, const godot_net_webrtc_data_channel *p_interface);
} godot_gdnative_ext_net_3_2_api_struct;
typedef struct godot_gdnative_ext_net_api_struct {
unsigned int type;
godot_gdnative_api_version version;
const godot_gdnative_api_struct *next;
void (*godot_net_bind_stream_peer)(godot_object *p_obj, const godot_net_stream_peer *p_interface);
void (*godot_net_bind_packet_peer)(godot_object *p_obj, const godot_net_packet_peer *p_interface);
void (*godot_net_bind_multiplayer_peer)(godot_object *p_obj, const godot_net_multiplayer_peer *p_interface);
} godot_gdnative_ext_net_api_struct;
typedef struct godot_gdnative_core_1_2_api_struct {
unsigned int type;
godot_gdnative_api_version version;
const godot_gdnative_api_struct *next;
godot_dictionary (*godot_dictionary_duplicate)(const godot_dictionary *p_self, const godot_bool p_deep);
godot_vector3 (*godot_vector3_move_toward)(const godot_vector3 *p_self, const godot_vector3 *p_to, const godot_real p_delta);
godot_vector2 (*godot_vector2_move_toward)(const godot_vector2 *p_self, const godot_vector2 *p_to, const godot_real p_delta);
godot_int (*godot_string_count)(const godot_string *p_self, godot_string p_what, godot_int p_from, godot_int p_to);
godot_int (*godot_string_countn)(const godot_string *p_self, godot_string p_what, godot_int p_from, godot_int p_to);
godot_vector3 (*godot_vector3_direction_to)(const godot_vector3 *p_self, const godot_vector3 *p_to);
godot_vector2 (*godot_vector2_direction_to)(const godot_vector2 *p_self, const godot_vector2 *p_to);
godot_array (*godot_array_slice)(const godot_array *p_self, const godot_int p_begin, const godot_int p_end, const godot_int p_step, const godot_bool p_deep);
godot_bool (*godot_pool_byte_array_empty)(const godot_pool_byte_array *p_self);
godot_bool (*godot_pool_int_array_empty)(const godot_pool_int_array *p_self);
godot_bool (*godot_pool_real_array_empty)(const godot_pool_real_array *p_self);
godot_bool (*godot_pool_string_array_empty)(const godot_pool_string_array *p_self);
godot_bool (*godot_pool_vector2_array_empty)(const godot_pool_vector2_array *p_self);
godot_bool (*godot_pool_vector3_array_empty)(const godot_pool_vector3_array *p_self);
godot_bool (*godot_pool_color_array_empty)(const godot_pool_color_array *p_self);
void *(*godot_get_class_tag)(const godot_string_name *p_class);
godot_object *(*godot_object_cast_to)(const godot_object *p_object, void *p_class_tag);
godot_object *(*godot_instance_from_id)(godot_int p_instance_id);
} godot_gdnative_core_1_2_api_struct;
typedef struct godot_gdnative_core_1_1_api_struct {
unsigned int type;
godot_gdnative_api_version version;
const godot_gdnative_api_struct *next;
godot_int (*godot_color_to_abgr32)(const godot_color *p_self);
godot_int (*godot_color_to_abgr64)(const godot_color *p_self);
godot_int (*godot_color_to_argb64)(const godot_color *p_self);
godot_int (*godot_color_to_rgba64)(const godot_color *p_self);
godot_color (*godot_color_darkened)(const godot_color *p_self, const godot_real p_amount);
godot_color (*godot_color_from_hsv)(const godot_color *p_self, const godot_real p_h, const godot_real p_s, const godot_real p_v, const godot_real p_a);
godot_color (*godot_color_lightened)(const godot_color *p_self, const godot_real p_amount);
godot_array (*godot_array_duplicate)(const godot_array *p_self, const godot_bool p_deep);
godot_variant (*godot_array_max)(const godot_array *p_self);
godot_variant (*godot_array_min)(const godot_array *p_self);
void (*godot_array_shuffle)(godot_array *p_self);
godot_basis (*godot_basis_slerp)(const godot_basis *p_self, const godot_basis *p_b, const godot_real p_t);
godot_variant (*godot_dictionary_get_with_default)(const godot_dictionary *p_self, const godot_variant *p_key, const godot_variant *p_default);
bool (*godot_dictionary_erase_with_return)(godot_dictionary *p_self, const godot_variant *p_key);
godot_node_path (*godot_node_path_get_as_property_path)(const godot_node_path *p_self);
void (*godot_quat_set_axis_angle)(godot_quat *p_self, const godot_vector3 *p_axis, const godot_real p_angle);
godot_rect2 (*godot_rect2_grow_individual)(const godot_rect2 *p_self, const godot_real p_left, const godot_real p_top, const godot_real p_right, const godot_real p_bottom);
godot_rect2 (*godot_rect2_grow_margin)(const godot_rect2 *p_self, const godot_int p_margin, const godot_real p_by);
godot_rect2 (*godot_rect2_abs)(const godot_rect2 *p_self);
godot_string (*godot_string_dedent)(const godot_string *p_self);
godot_string (*godot_string_trim_prefix)(const godot_string *p_self, const godot_string *p_prefix);
godot_string (*godot_string_trim_suffix)(const godot_string *p_self, const godot_string *p_suffix);
godot_string (*godot_string_rstrip)(const godot_string *p_self, const godot_string *p_chars);
godot_pool_string_array (*godot_string_rsplit)(const godot_string *p_self, const godot_string *p_divisor, const godot_bool p_allow_empty, const godot_int p_maxsplit);
godot_quat (*godot_basis_get_quat)(const godot_basis *p_self);
void (*godot_basis_set_quat)(godot_basis *p_self, const godot_quat *p_quat);
void (*godot_basis_set_axis_angle_scale)(godot_basis *p_self, const godot_vector3 *p_axis, godot_real p_phi, const godot_vector3 *p_scale);
void (*godot_basis_set_euler_scale)(godot_basis *p_self, const godot_vector3 *p_euler, const godot_vector3 *p_scale);
void (*godot_basis_set_quat_scale)(godot_basis *p_self, const godot_quat *p_quat, const godot_vector3 *p_scale);
bool (*godot_is_instance_valid)(const godot_object *p_object);
void (*godot_quat_new_with_basis)(godot_quat *r_dest, const godot_basis *p_basis);
void (*godot_quat_new_with_euler)(godot_quat *r_dest, const godot_vector3 *p_euler);
void (*godot_transform_new_with_quat)(godot_transform *r_dest, const godot_quat *p_quat);
godot_string (*godot_variant_get_operator_name)(godot_variant_operator p_op);
void (*godot_variant_evaluate)(godot_variant_operator p_op, const godot_variant *p_a, const godot_variant *p_b, godot_variant *r_ret, godot_bool *r_valid);
} godot_gdnative_core_1_1_api_struct;
typedef struct godot_gdnative_core_api_struct {
unsigned int type;
godot_gdnative_api_version version;
const godot_gdnative_api_struct *next;
unsigned int num_extensions;
const godot_gdnative_api_struct **extensions;
void (*godot_color_new_rgba)(godot_color *r_dest, const godot_real p_r, const godot_real p_g, const godot_real p_b, const godot_real p_a);
void (*godot_color_new_rgb)(godot_color *r_dest, const godot_real p_r, const godot_real p_g, const godot_real p_b);
godot_real (*godot_color_get_r)(const godot_color *p_self);
void (*godot_color_set_r)(godot_color *p_self, const godot_real r);
godot_real (*godot_color_get_g)(const godot_color *p_self);
void (*godot_color_set_g)(godot_color *p_self, const godot_real g);
godot_real (*godot_color_get_b)(const godot_color *p_self);
void (*godot_color_set_b)(godot_color *p_self, const godot_real b);
godot_real (*godot_color_get_a)(const godot_color *p_self);
void (*godot_color_set_a)(godot_color *p_self, const godot_real a);
godot_real (*godot_color_get_h)(const godot_color *p_self);
godot_real (*godot_color_get_s)(const godot_color *p_self);
godot_real (*godot_color_get_v)(const godot_color *p_self);
godot_string (*godot_color_as_string)(const godot_color *p_self);
godot_int (*godot_color_to_rgba32)(const godot_color *p_self);
godot_int (*godot_color_to_argb32)(const godot_color *p_self);
godot_real (*godot_color_gray)(const godot_color *p_self);
godot_color (*godot_color_inverted)(const godot_color *p_self);
godot_color (*godot_color_contrasted)(const godot_color *p_self);
godot_color (*godot_color_linear_interpolate)(const godot_color *p_self, const godot_color *p_b, const godot_real p_t);
godot_color (*godot_color_blend)(const godot_color *p_self, const godot_color *p_over);
godot_string (*godot_color_to_html)(const godot_color *p_self, const godot_bool p_with_alpha);
godot_bool (*godot_color_operator_equal)(const godot_color *p_self, const godot_color *p_b);
godot_bool (*godot_color_operator_less)(const godot_color *p_self, const godot_color *p_b);
void (*godot_vector2_new)(godot_vector2 *r_dest, const godot_real p_x, const godot_real p_y);
godot_string (*godot_vector2_as_string)(const godot_vector2 *p_self);
godot_vector2 (*godot_vector2_normalized)(const godot_vector2 *p_self);
godot_real (*godot_vector2_length)(const godot_vector2 *p_self);
godot_real (*godot_vector2_angle)(const godot_vector2 *p_self);
godot_real (*godot_vector2_length_squared)(const godot_vector2 *p_self);
godot_bool (*godot_vector2_is_normalized)(const godot_vector2 *p_self);
godot_real (*godot_vector2_distance_to)(const godot_vector2 *p_self, const godot_vector2 *p_to);
godot_real (*godot_vector2_distance_squared_to)(const godot_vector2 *p_self, const godot_vector2 *p_to);
godot_real (*godot_vector2_angle_to)(const godot_vector2 *p_self, const godot_vector2 *p_to);
godot_real (*godot_vector2_angle_to_point)(const godot_vector2 *p_self, const godot_vector2 *p_to);
godot_vector2 (*godot_vector2_linear_interpolate)(const godot_vector2 *p_self, const godot_vector2 *p_b, const godot_real p_t);
godot_vector2 (*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 (*godot_vector2_rotated)(const godot_vector2 *p_self, const godot_real p_phi);
godot_vector2 (*godot_vector2_tangent)(const godot_vector2 *p_self);
godot_vector2 (*godot_vector2_floor)(const godot_vector2 *p_self);
godot_vector2 (*godot_vector2_snapped)(const godot_vector2 *p_self, const godot_vector2 *p_by);
godot_real (*godot_vector2_aspect)(const godot_vector2 *p_self);
godot_real (*godot_vector2_dot)(const godot_vector2 *p_self, const godot_vector2 *p_with);
godot_vector2 (*godot_vector2_slide)(const godot_vector2 *p_self, const godot_vector2 *p_n);
godot_vector2 (*godot_vector2_bounce)(const godot_vector2 *p_self, const godot_vector2 *p_n);
godot_vector2 (*godot_vector2_reflect)(const godot_vector2 *p_self, const godot_vector2 *p_n);
godot_vector2 (*godot_vector2_abs)(const godot_vector2 *p_self);
godot_vector2 (*godot_vector2_clamped)(const godot_vector2 *p_self, const godot_real p_length);
godot_vector2 (*godot_vector2_operator_add)(const godot_vector2 *p_self, const godot_vector2 *p_b);
godot_vector2 (*godot_vector2_operator_subtract)(const godot_vector2 *p_self, const godot_vector2 *p_b);
godot_vector2 (*godot_vector2_operator_multiply_vector)(const godot_vector2 *p_self, const godot_vector2 *p_b);
godot_vector2 (*godot_vector2_operator_multiply_scalar)(const godot_vector2 *p_self, const godot_real p_b);
godot_vector2 (*godot_vector2_operator_divide_vector)(const godot_vector2 *p_self, const godot_vector2 *p_b);
godot_vector2 (*godot_vector2_operator_divide_scalar)(const godot_vector2 *p_self, const godot_real p_b);
godot_bool (*godot_vector2_operator_equal)(const godot_vector2 *p_self, const godot_vector2 *p_b);
godot_bool (*godot_vector2_operator_less)(const godot_vector2 *p_self, const godot_vector2 *p_b);
godot_vector2 (*godot_vector2_operator_neg)(const godot_vector2 *p_self);
void (*godot_vector2_set_x)(godot_vector2 *p_self, const godot_real p_x);
void (*godot_vector2_set_y)(godot_vector2 *p_self, const godot_real p_y);
godot_real (*godot_vector2_get_x)(const godot_vector2 *p_self);
godot_real (*godot_vector2_get_y)(const godot_vector2 *p_self);
void (*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 (*godot_quat_new_with_axis_angle)(godot_quat *r_dest, const godot_vector3 *p_axis, const godot_real p_angle);
godot_real (*godot_quat_get_x)(const godot_quat *p_self);
void (*godot_quat_set_x)(godot_quat *p_self, const godot_real val);
godot_real (*godot_quat_get_y)(const godot_quat *p_self);
void (*godot_quat_set_y)(godot_quat *p_self, const godot_real val);
godot_real (*godot_quat_get_z)(const godot_quat *p_self);
void (*godot_quat_set_z)(godot_quat *p_self, const godot_real val);
godot_real (*godot_quat_get_w)(const godot_quat *p_self);
void (*godot_quat_set_w)(godot_quat *p_self, const godot_real val);
godot_string (*godot_quat_as_string)(const godot_quat *p_self);
godot_real (*godot_quat_length)(const godot_quat *p_self);
godot_real (*godot_quat_length_squared)(const godot_quat *p_self);
godot_quat (*godot_quat_normalized)(const godot_quat *p_self);
godot_bool (*godot_quat_is_normalized)(const godot_quat *p_self);
godot_quat (*godot_quat_inverse)(const godot_quat *p_self);
godot_real (*godot_quat_dot)(const godot_quat *p_self, const godot_quat *p_b);
godot_vector3 (*godot_quat_xform)(const godot_quat *p_self, const godot_vector3 *p_v);
godot_quat (*godot_quat_slerp)(const godot_quat *p_self, const godot_quat *p_b, const godot_real p_t);
godot_quat (*godot_quat_slerpni)(const godot_quat *p_self, const godot_quat *p_b, const godot_real p_t);
godot_quat (*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 (*godot_quat_operator_multiply)(const godot_quat *p_self, const godot_real p_b);
godot_quat (*godot_quat_operator_add)(const godot_quat *p_self, const godot_quat *p_b);
godot_quat (*godot_quat_operator_subtract)(const godot_quat *p_self, const godot_quat *p_b);
godot_quat (*godot_quat_operator_divide)(const godot_quat *p_self, const godot_real p_b);
godot_bool (*godot_quat_operator_equal)(const godot_quat *p_self, const godot_quat *p_b);
godot_quat (*godot_quat_operator_neg)(const godot_quat *p_self);
void (*godot_basis_new_with_rows)(godot_basis *r_dest, const godot_vector3 *p_x_axis, const godot_vector3 *p_y_axis, const godot_vector3 *p_z_axis);
void (*godot_basis_new_with_axis_and_angle)(godot_basis *r_dest, const godot_vector3 *p_axis, const godot_real p_phi);
void (*godot_basis_new_with_euler)(godot_basis *r_dest, const godot_vector3 *p_euler);
godot_string (*godot_basis_as_string)(const godot_basis *p_self);
godot_basis (*godot_basis_inverse)(const godot_basis *p_self);
godot_basis (*godot_basis_transposed)(const godot_basis *p_self);
godot_basis (*godot_basis_orthonormalized)(const godot_basis *p_self);
godot_real (*godot_basis_determinant)(const godot_basis *p_self);
godot_basis (*godot_basis_rotated)(const godot_basis *p_self, const godot_vector3 *p_axis, const godot_real p_phi);
godot_basis (*godot_basis_scaled)(const godot_basis *p_self, const godot_vector3 *p_scale);
godot_vector3 (*godot_basis_get_scale)(const godot_basis *p_self);
godot_vector3 (*godot_basis_get_euler)(const godot_basis *p_self);
godot_real (*godot_basis_tdotx)(const godot_basis *p_self, const godot_vector3 *p_with);
godot_real (*godot_basis_tdoty)(const godot_basis *p_self, const godot_vector3 *p_with);
godot_real (*godot_basis_tdotz)(const godot_basis *p_self, const godot_vector3 *p_with);
godot_vector3 (*godot_basis_xform)(const godot_basis *p_self, const godot_vector3 *p_v);
godot_vector3 (*godot_basis_xform_inv)(const godot_basis *p_self, const godot_vector3 *p_v);
godot_int (*godot_basis_get_orthogonal_index)(const godot_basis *p_self);
void (*godot_basis_new)(godot_basis *r_dest);
void (*godot_basis_new_with_euler_quat)(godot_basis *r_dest, const godot_quat *p_euler);
void (*godot_basis_get_elements)(const godot_basis *p_self, godot_vector3 *p_elements);
godot_vector3 (*godot_basis_get_axis)(const godot_basis *p_self, const godot_int p_axis);
void (*godot_basis_set_axis)(godot_basis *p_self, const godot_int p_axis, const godot_vector3 *p_value);
godot_vector3 (*godot_basis_get_row)(const godot_basis *p_self, const godot_int p_row);
void (*godot_basis_set_row)(godot_basis *p_self, const godot_int p_row, const godot_vector3 *p_value);
godot_bool (*godot_basis_operator_equal)(const godot_basis *p_self, const godot_basis *p_b);
godot_basis (*godot_basis_operator_add)(const godot_basis *p_self, const godot_basis *p_b);
godot_basis (*godot_basis_operator_subtract)(const godot_basis *p_self, const godot_basis *p_b);
godot_basis (*godot_basis_operator_multiply_vector)(const godot_basis *p_self, const godot_basis *p_b);
godot_basis (*godot_basis_operator_multiply_scalar)(const godot_basis *p_self, const godot_real p_b);
void (*godot_vector3_new)(godot_vector3 *r_dest, const godot_real p_x, const godot_real p_y, const godot_real p_z);
godot_string (*godot_vector3_as_string)(const godot_vector3 *p_self);
godot_int (*godot_vector3_min_axis)(const godot_vector3 *p_self);
godot_int (*godot_vector3_max_axis)(const godot_vector3 *p_self);
godot_real (*godot_vector3_length)(const godot_vector3 *p_self);
godot_real (*godot_vector3_length_squared)(const godot_vector3 *p_self);
godot_bool (*godot_vector3_is_normalized)(const godot_vector3 *p_self);
godot_vector3 (*godot_vector3_normalized)(const godot_vector3 *p_self);
godot_vector3 (*godot_vector3_inverse)(const godot_vector3 *p_self);
godot_vector3 (*godot_vector3_snapped)(const godot_vector3 *p_self, const godot_vector3 *p_by);
godot_vector3 (*godot_vector3_rotated)(const godot_vector3 *p_self, const godot_vector3 *p_axis, const godot_real p_phi);
godot_vector3 (*godot_vector3_linear_interpolate)(const godot_vector3 *p_self, const godot_vector3 *p_b, const godot_real p_t);
godot_vector3 (*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_real (*godot_vector3_dot)(const godot_vector3 *p_self, const godot_vector3 *p_b);
godot_vector3 (*godot_vector3_cross)(const godot_vector3 *p_self, const godot_vector3 *p_b);
godot_basis (*godot_vector3_outer)(const godot_vector3 *p_self, const godot_vector3 *p_b);
godot_basis (*godot_vector3_to_diagonal_matrix)(const godot_vector3 *p_self);
godot_vector3 (*godot_vector3_abs)(const godot_vector3 *p_self);
godot_vector3 (*godot_vector3_floor)(const godot_vector3 *p_self);
godot_vector3 (*godot_vector3_ceil)(const godot_vector3 *p_self);
godot_real (*godot_vector3_distance_to)(const godot_vector3 *p_self, const godot_vector3 *p_b);
godot_real (*godot_vector3_distance_squared_to)(const godot_vector3 *p_self, const godot_vector3 *p_b);
godot_real (*godot_vector3_angle_to)(const godot_vector3 *p_self, const godot_vector3 *p_to);
godot_vector3 (*godot_vector3_slide)(const godot_vector3 *p_self, const godot_vector3 *p_n);
godot_vector3 (*godot_vector3_bounce)(const godot_vector3 *p_self, const godot_vector3 *p_n);
godot_vector3 (*godot_vector3_reflect)(const godot_vector3 *p_self, const godot_vector3 *p_n);
godot_vector3 (*godot_vector3_operator_add)(const godot_vector3 *p_self, const godot_vector3 *p_b);
godot_vector3 (*godot_vector3_operator_subtract)(const godot_vector3 *p_self, const godot_vector3 *p_b);
godot_vector3 (*godot_vector3_operator_multiply_vector)(const godot_vector3 *p_self, const godot_vector3 *p_b);
godot_vector3 (*godot_vector3_operator_multiply_scalar)(const godot_vector3 *p_self, const godot_real p_b);
godot_vector3 (*godot_vector3_operator_divide_vector)(const godot_vector3 *p_self, const godot_vector3 *p_b);
godot_vector3 (*godot_vector3_operator_divide_scalar)(const godot_vector3 *p_self, const godot_real p_b);
godot_bool (*godot_vector3_operator_equal)(const godot_vector3 *p_self, const godot_vector3 *p_b);
godot_bool (*godot_vector3_operator_less)(const godot_vector3 *p_self, const godot_vector3 *p_b);
godot_vector3 (*godot_vector3_operator_neg)(const godot_vector3 *p_self);
void (*godot_vector3_set_axis)(godot_vector3 *p_self, const godot_vector3_axis p_axis, const godot_real p_val);
godot_real (*godot_vector3_get_axis)(const godot_vector3 *p_self, const godot_vector3_axis p_axis);
void (*godot_pool_byte_array_new)(godot_pool_byte_array *r_dest);
void (*godot_pool_byte_array_new_copy)(godot_pool_byte_array *r_dest, const godot_pool_byte_array *p_src);
void (*godot_pool_byte_array_new_with_array)(godot_pool_byte_array *r_dest, const godot_array *p_a);
void (*godot_pool_byte_array_append)(godot_pool_byte_array *p_self, const uint8_t p_data);
void (*godot_pool_byte_array_append_array)(godot_pool_byte_array *p_self, const godot_pool_byte_array *p_array);
godot_error (*godot_pool_byte_array_insert)(godot_pool_byte_array *p_self, const godot_int p_idx, const uint8_t p_data);
void (*godot_pool_byte_array_invert)(godot_pool_byte_array *p_self);
void (*godot_pool_byte_array_push_back)(godot_pool_byte_array *p_self, const uint8_t p_data);
void (*godot_pool_byte_array_remove)(godot_pool_byte_array *p_self, const godot_int p_idx);
void (*godot_pool_byte_array_resize)(godot_pool_byte_array *p_self, const godot_int p_size);
godot_pool_byte_array_read_access *(*godot_pool_byte_array_read)(const godot_pool_byte_array *p_self);
godot_pool_byte_array_write_access *(*godot_pool_byte_array_write)(godot_pool_byte_array *p_self);
void (*godot_pool_byte_array_set)(godot_pool_byte_array *p_self, const godot_int p_idx, const uint8_t p_data);
uint8_t (*godot_pool_byte_array_get)(const godot_pool_byte_array *p_self, const godot_int p_idx);
godot_int (*godot_pool_byte_array_size)(const godot_pool_byte_array *p_self);
void (*godot_pool_byte_array_destroy)(godot_pool_byte_array *p_self);
void (*godot_pool_int_array_new)(godot_pool_int_array *r_dest);
void (*godot_pool_int_array_new_copy)(godot_pool_int_array *r_dest, const godot_pool_int_array *p_src);
void (*godot_pool_int_array_new_with_array)(godot_pool_int_array *r_dest, const godot_array *p_a);
void (*godot_pool_int_array_append)(godot_pool_int_array *p_self, const godot_int p_data);
void (*godot_pool_int_array_append_array)(godot_pool_int_array *p_self, const godot_pool_int_array *p_array);
godot_error (*godot_pool_int_array_insert)(godot_pool_int_array *p_self, const godot_int p_idx, const godot_int p_data);
void (*godot_pool_int_array_invert)(godot_pool_int_array *p_self);
void (*godot_pool_int_array_push_back)(godot_pool_int_array *p_self, const godot_int p_data);
void (*godot_pool_int_array_remove)(godot_pool_int_array *p_self, const godot_int p_idx);
void (*godot_pool_int_array_resize)(godot_pool_int_array *p_self, const godot_int p_size);
godot_pool_int_array_read_access *(*godot_pool_int_array_read)(const godot_pool_int_array *p_self);
godot_pool_int_array_write_access *(*godot_pool_int_array_write)(godot_pool_int_array *p_self);
void (*godot_pool_int_array_set)(godot_pool_int_array *p_self, const godot_int p_idx, const godot_int p_data);
godot_int (*godot_pool_int_array_get)(const godot_pool_int_array *p_self, const godot_int p_idx);
godot_int (*godot_pool_int_array_size)(const godot_pool_int_array *p_self);
void (*godot_pool_int_array_destroy)(godot_pool_int_array *p_self);
void (*godot_pool_real_array_new)(godot_pool_real_array *r_dest);
void (*godot_pool_real_array_new_copy)(godot_pool_real_array *r_dest, const godot_pool_real_array *p_src);
void (*godot_pool_real_array_new_with_array)(godot_pool_real_array *r_dest, const godot_array *p_a);
void (*godot_pool_real_array_append)(godot_pool_real_array *p_self, const godot_real p_data);
void (*godot_pool_real_array_append_array)(godot_pool_real_array *p_self, const godot_pool_real_array *p_array);
godot_error (*godot_pool_real_array_insert)(godot_pool_real_array *p_self, const godot_int p_idx, const godot_real p_data);
void (*godot_pool_real_array_invert)(godot_pool_real_array *p_self);
void (*godot_pool_real_array_push_back)(godot_pool_real_array *p_self, const godot_real p_data);
void (*godot_pool_real_array_remove)(godot_pool_real_array *p_self, const godot_int p_idx);
void (*godot_pool_real_array_resize)(godot_pool_real_array *p_self, const godot_int p_size);
godot_pool_real_array_read_access *(*godot_pool_real_array_read)(const godot_pool_real_array *p_self);
godot_pool_real_array_write_access *(*godot_pool_real_array_write)(godot_pool_real_array *p_self);
void (*godot_pool_real_array_set)(godot_pool_real_array *p_self, const godot_int p_idx, const godot_real p_data);
godot_real (*godot_pool_real_array_get)(const godot_pool_real_array *p_self, const godot_int p_idx);
godot_int (*godot_pool_real_array_size)(const godot_pool_real_array *p_self);
void (*godot_pool_real_array_destroy)(godot_pool_real_array *p_self);
void (*godot_pool_string_array_new)(godot_pool_string_array *r_dest);
void (*godot_pool_string_array_new_copy)(godot_pool_string_array *r_dest, const godot_pool_string_array *p_src);
void (*godot_pool_string_array_new_with_array)(godot_pool_string_array *r_dest, const godot_array *p_a);
void (*godot_pool_string_array_append)(godot_pool_string_array *p_self, const godot_string *p_data);
void (*godot_pool_string_array_append_array)(godot_pool_string_array *p_self, const godot_pool_string_array *p_array);
godot_error (*godot_pool_string_array_insert)(godot_pool_string_array *p_self, const godot_int p_idx, const godot_string *p_data);
void (*godot_pool_string_array_invert)(godot_pool_string_array *p_self);
void (*godot_pool_string_array_push_back)(godot_pool_string_array *p_self, const godot_string *p_data);
void (*godot_pool_string_array_remove)(godot_pool_string_array *p_self, const godot_int p_idx);
void (*godot_pool_string_array_resize)(godot_pool_string_array *p_self, const godot_int p_size);
godot_pool_string_array_read_access *(*godot_pool_string_array_read)(const godot_pool_string_array *p_self);
godot_pool_string_array_write_access *(*godot_pool_string_array_write)(godot_pool_string_array *p_self);
void (*godot_pool_string_array_set)(godot_pool_string_array *p_self, const godot_int p_idx, const godot_string *p_data);
godot_string (*godot_pool_string_array_get)(const godot_pool_string_array *p_self, const godot_int p_idx);
godot_int (*godot_pool_string_array_size)(const godot_pool_string_array *p_self);
void (*godot_pool_string_array_destroy)(godot_pool_string_array *p_self);
void (*godot_pool_vector2_array_new)(godot_pool_vector2_array *r_dest);
void (*godot_pool_vector2_array_new_copy)(godot_pool_vector2_array *r_dest, const godot_pool_vector2_array *p_src);
void (*godot_pool_vector2_array_new_with_array)(godot_pool_vector2_array *r_dest, const godot_array *p_a);
void (*godot_pool_vector2_array_append)(godot_pool_vector2_array *p_self, const godot_vector2 *p_data);
void (*godot_pool_vector2_array_append_array)(godot_pool_vector2_array *p_self, const godot_pool_vector2_array *p_array);
godot_error (*godot_pool_vector2_array_insert)(godot_pool_vector2_array *p_self, const godot_int p_idx, const godot_vector2 *p_data);
void (*godot_pool_vector2_array_invert)(godot_pool_vector2_array *p_self);
void (*godot_pool_vector2_array_push_back)(godot_pool_vector2_array *p_self, const godot_vector2 *p_data);
void (*godot_pool_vector2_array_remove)(godot_pool_vector2_array *p_self, const godot_int p_idx);
void (*godot_pool_vector2_array_resize)(godot_pool_vector2_array *p_self, const godot_int p_size);
godot_pool_vector2_array_read_access *(*godot_pool_vector2_array_read)(const godot_pool_vector2_array *p_self);
godot_pool_vector2_array_write_access *(*godot_pool_vector2_array_write)(godot_pool_vector2_array *p_self);
void (*godot_pool_vector2_array_set)(godot_pool_vector2_array *p_self, const godot_int p_idx, const godot_vector2 *p_data);
godot_vector2 (*godot_pool_vector2_array_get)(const godot_pool_vector2_array *p_self, const godot_int p_idx);
godot_int (*godot_pool_vector2_array_size)(const godot_pool_vector2_array *p_self);
void (*godot_pool_vector2_array_destroy)(godot_pool_vector2_array *p_self);
void (*godot_pool_vector3_array_new)(godot_pool_vector3_array *r_dest);
void (*godot_pool_vector3_array_new_copy)(godot_pool_vector3_array *r_dest, const godot_pool_vector3_array *p_src);
void (*godot_pool_vector3_array_new_with_array)(godot_pool_vector3_array *r_dest, const godot_array *p_a);
void (*godot_pool_vector3_array_append)(godot_pool_vector3_array *p_self, const godot_vector3 *p_data);
void (*godot_pool_vector3_array_append_array)(godot_pool_vector3_array *p_self, const godot_pool_vector3_array *p_array);
godot_error (*godot_pool_vector3_array_insert)(godot_pool_vector3_array *p_self, const godot_int p_idx, const godot_vector3 *p_data);
void (*godot_pool_vector3_array_invert)(godot_pool_vector3_array *p_self);
void (*godot_pool_vector3_array_push_back)(godot_pool_vector3_array *p_self, const godot_vector3 *p_data);
void (*godot_pool_vector3_array_remove)(godot_pool_vector3_array *p_self, const godot_int p_idx);
void (*godot_pool_vector3_array_resize)(godot_pool_vector3_array *p_self, const godot_int p_size);
godot_pool_vector3_array_read_access *(*godot_pool_vector3_array_read)(const godot_pool_vector3_array *p_self);
godot_pool_vector3_array_write_access *(*godot_pool_vector3_array_write)(godot_pool_vector3_array *p_self);
void (*godot_pool_vector3_array_set)(godot_pool_vector3_array *p_self, const godot_int p_idx, const godot_vector3 *p_data);
godot_vector3 (*godot_pool_vector3_array_get)(const godot_pool_vector3_array *p_self, const godot_int p_idx);
godot_int (*godot_pool_vector3_array_size)(const godot_pool_vector3_array *p_self);
void (*godot_pool_vector3_array_destroy)(godot_pool_vector3_array *p_self);
void (*godot_pool_color_array_new)(godot_pool_color_array *r_dest);
void (*godot_pool_color_array_new_copy)(godot_pool_color_array *r_dest, const godot_pool_color_array *p_src);
void (*godot_pool_color_array_new_with_array)(godot_pool_color_array *r_dest, const godot_array *p_a);
void (*godot_pool_color_array_append)(godot_pool_color_array *p_self, const godot_color *p_data);
void (*godot_pool_color_array_append_array)(godot_pool_color_array *p_self, const godot_pool_color_array *p_array);
godot_error (*godot_pool_color_array_insert)(godot_pool_color_array *p_self, const godot_int p_idx, const godot_color *p_data);
void (*godot_pool_color_array_invert)(godot_pool_color_array *p_self);
void (*godot_pool_color_array_push_back)(godot_pool_color_array *p_self, const godot_color *p_data);
void (*godot_pool_color_array_remove)(godot_pool_color_array *p_self, const godot_int p_idx);
void (*godot_pool_color_array_resize)(godot_pool_color_array *p_self, const godot_int p_size);
godot_pool_color_array_read_access *(*godot_pool_color_array_read)(const godot_pool_color_array *p_self);
godot_pool_color_array_write_access *(*godot_pool_color_array_write)(godot_pool_color_array *p_self);
void (*godot_pool_color_array_set)(godot_pool_color_array *p_self, const godot_int p_idx, const godot_color *p_data);
godot_color (*godot_pool_color_array_get)(const godot_pool_color_array *p_self, const godot_int p_idx);
godot_int (*godot_pool_color_array_size)(const godot_pool_color_array *p_self);
void (*godot_pool_color_array_destroy)(godot_pool_color_array *p_self);
godot_pool_byte_array_read_access *(*godot_pool_byte_array_read_access_copy)(const godot_pool_byte_array_read_access *p_read);
const uint8_t *(*godot_pool_byte_array_read_access_ptr)(const godot_pool_byte_array_read_access *p_read);
void (*godot_pool_byte_array_read_access_operator_assign)(godot_pool_byte_array_read_access *p_read, godot_pool_byte_array_read_access *p_other);
void (*godot_pool_byte_array_read_access_destroy)(godot_pool_byte_array_read_access *p_read);
godot_pool_int_array_read_access *(*godot_pool_int_array_read_access_copy)(const godot_pool_int_array_read_access *p_read);
const godot_int *(*godot_pool_int_array_read_access_ptr)(const godot_pool_int_array_read_access *p_read);
void (*godot_pool_int_array_read_access_operator_assign)(godot_pool_int_array_read_access *p_read, godot_pool_int_array_read_access *p_other);
void (*godot_pool_int_array_read_access_destroy)(godot_pool_int_array_read_access *p_read);
godot_pool_real_array_read_access *(*godot_pool_real_array_read_access_copy)(const godot_pool_real_array_read_access *p_read);
const godot_real *(*godot_pool_real_array_read_access_ptr)(const godot_pool_real_array_read_access *p_read);
void (*godot_pool_real_array_read_access_operator_assign)(godot_pool_real_array_read_access *p_read, godot_pool_real_array_read_access *p_other);
void (*godot_pool_real_array_read_access_destroy)(godot_pool_real_array_read_access *p_read);
godot_pool_string_array_read_access *(*godot_pool_string_array_read_access_copy)(const godot_pool_string_array_read_access *p_read);
const godot_string *(*godot_pool_string_array_read_access_ptr)(const godot_pool_string_array_read_access *p_read);
void (*godot_pool_string_array_read_access_operator_assign)(godot_pool_string_array_read_access *p_read, godot_pool_string_array_read_access *p_other);
void (*godot_pool_string_array_read_access_destroy)(godot_pool_string_array_read_access *p_read);
godot_pool_vector2_array_read_access *(*godot_pool_vector2_array_read_access_copy)(const godot_pool_vector2_array_read_access *p_read);
const godot_vector2 *(*godot_pool_vector2_array_read_access_ptr)(const godot_pool_vector2_array_read_access *p_read);
void (*godot_pool_vector2_array_read_access_operator_assign)(godot_pool_vector2_array_read_access *p_read, godot_pool_vector2_array_read_access *p_other);
void (*godot_pool_vector2_array_read_access_destroy)(godot_pool_vector2_array_read_access *p_read);
godot_pool_vector3_array_read_access *(*godot_pool_vector3_array_read_access_copy)(const godot_pool_vector3_array_read_access *p_read);
const godot_vector3 *(*godot_pool_vector3_array_read_access_ptr)(const godot_pool_vector3_array_read_access *p_read);
void (*godot_pool_vector3_array_read_access_operator_assign)(godot_pool_vector3_array_read_access *p_read, godot_pool_vector3_array_read_access *p_other);
void (*godot_pool_vector3_array_read_access_destroy)(godot_pool_vector3_array_read_access *p_read);
godot_pool_color_array_read_access *(*godot_pool_color_array_read_access_copy)(const godot_pool_color_array_read_access *p_read);
const godot_color *(*godot_pool_color_array_read_access_ptr)(const godot_pool_color_array_read_access *p_read);
void (*godot_pool_color_array_read_access_operator_assign)(godot_pool_color_array_read_access *p_read, godot_pool_color_array_read_access *p_other);
void (*godot_pool_color_array_read_access_destroy)(godot_pool_color_array_read_access *p_read);
godot_pool_byte_array_write_access *(*godot_pool_byte_array_write_access_copy)(const godot_pool_byte_array_write_access *p_write);
uint8_t *(*godot_pool_byte_array_write_access_ptr)(const godot_pool_byte_array_write_access *p_write);
void (*godot_pool_byte_array_write_access_operator_assign)(godot_pool_byte_array_write_access *p_write, godot_pool_byte_array_write_access *p_other);
void (*godot_pool_byte_array_write_access_destroy)(godot_pool_byte_array_write_access *p_write);
godot_pool_int_array_write_access *(*godot_pool_int_array_write_access_copy)(const godot_pool_int_array_write_access *p_write);
godot_int *(*godot_pool_int_array_write_access_ptr)(const godot_pool_int_array_write_access *p_write);
void (*godot_pool_int_array_write_access_operator_assign)(godot_pool_int_array_write_access *p_write, godot_pool_int_array_write_access *p_other);
void (*godot_pool_int_array_write_access_destroy)(godot_pool_int_array_write_access *p_write);
godot_pool_real_array_write_access *(*godot_pool_real_array_write_access_copy)(const godot_pool_real_array_write_access *p_write);
godot_real *(*godot_pool_real_array_write_access_ptr)(const godot_pool_real_array_write_access *p_write);
void (*godot_pool_real_array_write_access_operator_assign)(godot_pool_real_array_write_access *p_write, godot_pool_real_array_write_access *p_other);
void (*godot_pool_real_array_write_access_destroy)(godot_pool_real_array_write_access *p_write);
godot_pool_string_array_write_access *(*godot_pool_string_array_write_access_copy)(const godot_pool_string_array_write_access *p_write);
godot_string *(*godot_pool_string_array_write_access_ptr)(const godot_pool_string_array_write_access *p_write);
void (*godot_pool_string_array_write_access_operator_assign)(godot_pool_string_array_write_access *p_write, godot_pool_string_array_write_access *p_other);
void (*godot_pool_string_array_write_access_destroy)(godot_pool_string_array_write_access *p_write);
godot_pool_vector2_array_write_access *(*godot_pool_vector2_array_write_access_copy)(const godot_pool_vector2_array_write_access *p_write);
godot_vector2 *(*godot_pool_vector2_array_write_access_ptr)(const godot_pool_vector2_array_write_access *p_write);
void (*godot_pool_vector2_array_write_access_operator_assign)(godot_pool_vector2_array_write_access *p_write, godot_pool_vector2_array_write_access *p_other);
void (*godot_pool_vector2_array_write_access_destroy)(godot_pool_vector2_array_write_access *p_write);
godot_pool_vector3_array_write_access *(*godot_pool_vector3_array_write_access_copy)(const godot_pool_vector3_array_write_access *p_write);
godot_vector3 *(*godot_pool_vector3_array_write_access_ptr)(const godot_pool_vector3_array_write_access *p_write);
void (*godot_pool_vector3_array_write_access_operator_assign)(godot_pool_vector3_array_write_access *p_write, godot_pool_vector3_array_write_access *p_other);
void (*godot_pool_vector3_array_write_access_destroy)(godot_pool_vector3_array_write_access *p_write);
godot_pool_color_array_write_access *(*godot_pool_color_array_write_access_copy)(const godot_pool_color_array_write_access *p_write);
godot_color *(*godot_pool_color_array_write_access_ptr)(const godot_pool_color_array_write_access *p_write);
void (*godot_pool_color_array_write_access_operator_assign)(godot_pool_color_array_write_access *p_write, godot_pool_color_array_write_access *p_other);
void (*godot_pool_color_array_write_access_destroy)(godot_pool_color_array_write_access *p_write);
void (*godot_array_new)(godot_array *r_dest);
void (*godot_array_new_copy)(godot_array *r_dest, const godot_array *p_src);
void (*godot_array_new_pool_color_array)(godot_array *r_dest, const godot_pool_color_array *p_pca);
void (*godot_array_new_pool_vector3_array)(godot_array *r_dest, const godot_pool_vector3_array *p_pv3a);
void (*godot_array_new_pool_vector2_array)(godot_array *r_dest, const godot_pool_vector2_array *p_pv2a);
void (*godot_array_new_pool_string_array)(godot_array *r_dest, const godot_pool_string_array *p_psa);
void (*godot_array_new_pool_real_array)(godot_array *r_dest, const godot_pool_real_array *p_pra);
void (*godot_array_new_pool_int_array)(godot_array *r_dest, const godot_pool_int_array *p_pia);
void (*godot_array_new_pool_byte_array)(godot_array *r_dest, const godot_pool_byte_array *p_pba);
void (*godot_array_set)(godot_array *p_self, const godot_int p_idx, const godot_variant *p_value);
godot_variant (*godot_array_get)(const godot_array *p_self, const godot_int p_idx);
godot_variant *(*godot_array_operator_index)(godot_array *p_self, const godot_int p_idx);
const godot_variant *(*godot_array_operator_index_const)(const godot_array *p_self, const godot_int p_idx);
void (*godot_array_append)(godot_array *p_self, const godot_variant *p_value);
void (*godot_array_clear)(godot_array *p_self);
godot_int (*godot_array_count)(const godot_array *p_self, const godot_variant *p_value);
godot_bool (*godot_array_empty)(const godot_array *p_self);
void (*godot_array_erase)(godot_array *p_self, const godot_variant *p_value);
godot_variant (*godot_array_front)(const godot_array *p_self);
godot_variant (*godot_array_back)(const godot_array *p_self);
godot_int (*godot_array_find)(const godot_array *p_self, const godot_variant *p_what, const godot_int p_from);
godot_int (*godot_array_find_last)(const godot_array *p_self, const godot_variant *p_what);
godot_bool (*godot_array_has)(const godot_array *p_self, const godot_variant *p_value);
godot_int (*godot_array_hash)(const godot_array *p_self);
void (*godot_array_insert)(godot_array *p_self, const godot_int p_pos, const godot_variant *p_value);
void (*godot_array_invert)(godot_array *p_self);
godot_variant (*godot_array_pop_back)(godot_array *p_self);
godot_variant (*godot_array_pop_front)(godot_array *p_self);
void (*godot_array_push_back)(godot_array *p_self, const godot_variant *p_value);
void (*godot_array_push_front)(godot_array *p_self, const godot_variant *p_value);
void (*godot_array_remove)(godot_array *p_self, const godot_int p_idx);
void (*godot_array_resize)(godot_array *p_self, const godot_int p_size);
godot_int (*godot_array_rfind)(const godot_array *p_self, const godot_variant *p_what, const godot_int p_from);
godot_int (*godot_array_size)(const godot_array *p_self);
void (*godot_array_sort)(godot_array *p_self);
void (*godot_array_sort_custom)(godot_array *p_self, godot_object *p_obj, const godot_string *p_func);
godot_int (*godot_array_bsearch)(godot_array *p_self, const godot_variant *p_value, const godot_bool p_before);
godot_int (*godot_array_bsearch_custom)(godot_array *p_self, const godot_variant *p_value, godot_object *p_obj, const godot_string *p_func, const godot_bool p_before);
void (*godot_array_destroy)(godot_array *p_self);
void (*godot_dictionary_new)(godot_dictionary *r_dest);
void (*godot_dictionary_new_copy)(godot_dictionary *r_dest, const godot_dictionary *p_src);
void (*godot_dictionary_destroy)(godot_dictionary *p_self);
godot_int (*godot_dictionary_size)(const godot_dictionary *p_self);
godot_bool (*godot_dictionary_empty)(const godot_dictionary *p_self);
void (*godot_dictionary_clear)(godot_dictionary *p_self);
godot_bool (*godot_dictionary_has)(const godot_dictionary *p_self, const godot_variant *p_key);
godot_bool (*godot_dictionary_has_all)(const godot_dictionary *p_self, const godot_array *p_keys);
void (*godot_dictionary_erase)(godot_dictionary *p_self, const godot_variant *p_key);
godot_int (*godot_dictionary_hash)(const godot_dictionary *p_self);
godot_array (*godot_dictionary_keys)(const godot_dictionary *p_self);
godot_array (*godot_dictionary_values)(const godot_dictionary *p_self);
godot_variant (*godot_dictionary_get)(const godot_dictionary *p_self, const godot_variant *p_key);
void (*godot_dictionary_set)(godot_dictionary *p_self, const godot_variant *p_key, const godot_variant *p_value);
godot_variant *(*godot_dictionary_operator_index)(godot_dictionary *p_self, const godot_variant *p_key);
const godot_variant *(*godot_dictionary_operator_index_const)(const godot_dictionary *p_self, const godot_variant *p_key);
godot_variant *(*godot_dictionary_next)(const godot_dictionary *p_self, const godot_variant *p_key);
godot_bool (*godot_dictionary_operator_equal)(const godot_dictionary *p_self, const godot_dictionary *p_b);
godot_string (*godot_dictionary_to_json)(const godot_dictionary *p_self);
void (*godot_node_path_new)(godot_node_path *r_dest, const godot_string *p_from);
void (*godot_node_path_new_copy)(godot_node_path *r_dest, const godot_node_path *p_src);
void (*godot_node_path_destroy)(godot_node_path *p_self);
godot_string (*godot_node_path_as_string)(const godot_node_path *p_self);
godot_bool (*godot_node_path_is_absolute)(const godot_node_path *p_self);
godot_int (*godot_node_path_get_name_count)(const godot_node_path *p_self);
godot_string (*godot_node_path_get_name)(const godot_node_path *p_self, const godot_int p_idx);
godot_int (*godot_node_path_get_subname_count)(const godot_node_path *p_self);
godot_string (*godot_node_path_get_subname)(const godot_node_path *p_self, const godot_int p_idx);
godot_string (*godot_node_path_get_concatenated_subnames)(const godot_node_path *p_self);
godot_bool (*godot_node_path_is_empty)(const godot_node_path *p_self);
godot_bool (*godot_node_path_operator_equal)(const godot_node_path *p_self, const godot_node_path *p_b);
void (*godot_plane_new_with_reals)(godot_plane *r_dest, const godot_real p_a, const godot_real p_b, const godot_real p_c, const godot_real p_d);
void (*godot_plane_new_with_vectors)(godot_plane *r_dest, const godot_vector3 *p_v1, const godot_vector3 *p_v2, const godot_vector3 *p_v3);
void (*godot_plane_new_with_normal)(godot_plane *r_dest, const godot_vector3 *p_normal, const godot_real p_d);
godot_string (*godot_plane_as_string)(const godot_plane *p_self);
godot_plane (*godot_plane_normalized)(const godot_plane *p_self);
godot_vector3 (*godot_plane_center)(const godot_plane *p_self);
godot_vector3 (*godot_plane_get_any_point)(const godot_plane *p_self);
godot_bool (*godot_plane_is_point_over)(const godot_plane *p_self, const godot_vector3 *p_point);
godot_real (*godot_plane_distance_to)(const godot_plane *p_self, const godot_vector3 *p_point);
godot_bool (*godot_plane_has_point)(const godot_plane *p_self, const godot_vector3 *p_point, const godot_real p_epsilon);
godot_vector3 (*godot_plane_project)(const godot_plane *p_self, const godot_vector3 *p_point);
godot_bool (*godot_plane_intersect_3)(const godot_plane *p_self, godot_vector3 *r_dest, const godot_plane *p_b, const godot_plane *p_c);
godot_bool (*godot_plane_intersects_ray)(const godot_plane *p_self, godot_vector3 *r_dest, const godot_vector3 *p_from, const godot_vector3 *p_dir);
godot_bool (*godot_plane_intersects_segment)(const godot_plane *p_self, godot_vector3 *r_dest, const godot_vector3 *p_begin, const godot_vector3 *p_end);
godot_plane (*godot_plane_operator_neg)(const godot_plane *p_self);
godot_bool (*godot_plane_operator_equal)(const godot_plane *p_self, const godot_plane *p_b);
void (*godot_plane_set_normal)(godot_plane *p_self, const godot_vector3 *p_normal);
godot_vector3 (*godot_plane_get_normal)(const godot_plane *p_self);
godot_real (*godot_plane_get_d)(const godot_plane *p_self);
void (*godot_plane_set_d)(godot_plane *p_self, const godot_real p_d);
void (*godot_rect2_new_with_position_and_size)(godot_rect2 *r_dest, const godot_vector2 *p_pos, const godot_vector2 *p_size);
void (*godot_rect2_new)(godot_rect2 *r_dest, const godot_real p_x, const godot_real p_y, const godot_real p_width, const godot_real p_height);
godot_string (*godot_rect2_as_string)(const godot_rect2 *p_self);
godot_real (*godot_rect2_get_area)(const godot_rect2 *p_self);
godot_bool (*godot_rect2_intersects)(const godot_rect2 *p_self, const godot_rect2 *p_b);
godot_bool (*godot_rect2_encloses)(const godot_rect2 *p_self, const godot_rect2 *p_b);
godot_bool (*godot_rect2_has_no_area)(const godot_rect2 *p_self);
godot_rect2 (*godot_rect2_clip)(const godot_rect2 *p_self, const godot_rect2 *p_b);
godot_rect2 (*godot_rect2_merge)(const godot_rect2 *p_self, const godot_rect2 *p_b);
godot_bool (*godot_rect2_has_point)(const godot_rect2 *p_self, const godot_vector2 *p_point);
godot_rect2 (*godot_rect2_grow)(const godot_rect2 *p_self, const godot_real p_by);
godot_rect2 (*godot_rect2_expand)(const godot_rect2 *p_self, const godot_vector2 *p_to);
godot_bool (*godot_rect2_operator_equal)(const godot_rect2 *p_self, const godot_rect2 *p_b);
godot_vector2 (*godot_rect2_get_position)(const godot_rect2 *p_self);
godot_vector2 (*godot_rect2_get_size)(const godot_rect2 *p_self);
void (*godot_rect2_set_position)(godot_rect2 *p_self, const godot_vector2 *p_pos);
void (*godot_rect2_set_size)(godot_rect2 *p_self, const godot_vector2 *p_size);
void (*godot_aabb_new)(godot_aabb *r_dest, const godot_vector3 *p_pos, const godot_vector3 *p_size);
godot_vector3 (*godot_aabb_get_position)(const godot_aabb *p_self);
void (*godot_aabb_set_position)(const godot_aabb *p_self, const godot_vector3 *p_v);
godot_vector3 (*godot_aabb_get_size)(const godot_aabb *p_self);
void (*godot_aabb_set_size)(const godot_aabb *p_self, const godot_vector3 *p_v);
godot_string (*godot_aabb_as_string)(const godot_aabb *p_self);
godot_real (*godot_aabb_get_area)(const godot_aabb *p_self);
godot_bool (*godot_aabb_has_no_area)(const godot_aabb *p_self);
godot_bool (*godot_aabb_has_no_surface)(const godot_aabb *p_self);
godot_bool (*godot_aabb_intersects)(const godot_aabb *p_self, const godot_aabb *p_with);
godot_bool (*godot_aabb_encloses)(const godot_aabb *p_self, const godot_aabb *p_with);
godot_aabb (*godot_aabb_merge)(const godot_aabb *p_self, const godot_aabb *p_with);
godot_aabb (*godot_aabb_intersection)(const godot_aabb *p_self, const godot_aabb *p_with);
godot_bool (*godot_aabb_intersects_plane)(const godot_aabb *p_self, const godot_plane *p_plane);
godot_bool (*godot_aabb_intersects_segment)(const godot_aabb *p_self, const godot_vector3 *p_from, const godot_vector3 *p_to);
godot_bool (*godot_aabb_has_point)(const godot_aabb *p_self, const godot_vector3 *p_point);
godot_vector3 (*godot_aabb_get_support)(const godot_aabb *p_self, const godot_vector3 *p_dir);
godot_vector3 (*godot_aabb_get_longest_axis)(const godot_aabb *p_self);
godot_int (*godot_aabb_get_longest_axis_index)(const godot_aabb *p_self);
godot_real (*godot_aabb_get_longest_axis_size)(const godot_aabb *p_self);
godot_vector3 (*godot_aabb_get_shortest_axis)(const godot_aabb *p_self);
godot_int (*godot_aabb_get_shortest_axis_index)(const godot_aabb *p_self);
godot_real (*godot_aabb_get_shortest_axis_size)(const godot_aabb *p_self);
godot_aabb (*godot_aabb_expand)(const godot_aabb *p_self, const godot_vector3 *p_to_point);
godot_aabb (*godot_aabb_grow)(const godot_aabb *p_self, const godot_real p_by);
godot_vector3 (*godot_aabb_get_endpoint)(const godot_aabb *p_self, const godot_int p_idx);
godot_bool (*godot_aabb_operator_equal)(const godot_aabb *p_self, const godot_aabb *p_b);
void (*godot_rid_new)(godot_rid *r_dest);
godot_int (*godot_rid_get_id)(const godot_rid *p_self);
void (*godot_rid_new_with_resource)(godot_rid *r_dest, const godot_object *p_from);
godot_bool (*godot_rid_operator_equal)(const godot_rid *p_self, const godot_rid *p_b);
godot_bool (*godot_rid_operator_less)(const godot_rid *p_self, const godot_rid *p_b);
void (*godot_transform_new_with_axis_origin)(godot_transform *r_dest, const godot_vector3 *p_x_axis, const godot_vector3 *p_y_axis, const godot_vector3 *p_z_axis, const godot_vector3 *p_origin);
void (*godot_transform_new)(godot_transform *r_dest, const godot_basis *p_basis, const godot_vector3 *p_origin);
godot_basis (*godot_transform_get_basis)(const godot_transform *p_self);
void (*godot_transform_set_basis)(godot_transform *p_self, const godot_basis *p_v);
godot_vector3 (*godot_transform_get_origin)(const godot_transform *p_self);
void (*godot_transform_set_origin)(godot_transform *p_self, const godot_vector3 *p_v);
godot_string (*godot_transform_as_string)(const godot_transform *p_self);
godot_transform (*godot_transform_inverse)(const godot_transform *p_self);
godot_transform (*godot_transform_affine_inverse)(const godot_transform *p_self);
godot_transform (*godot_transform_orthonormalized)(const godot_transform *p_self);
godot_transform (*godot_transform_rotated)(const godot_transform *p_self, const godot_vector3 *p_axis, const godot_real p_phi);
godot_transform (*godot_transform_scaled)(const godot_transform *p_self, const godot_vector3 *p_scale);
godot_transform (*godot_transform_translated)(const godot_transform *p_self, const godot_vector3 *p_ofs);
godot_transform (*godot_transform_looking_at)(const godot_transform *p_self, const godot_vector3 *p_target, const godot_vector3 *p_up);
godot_plane (*godot_transform_xform_plane)(const godot_transform *p_self, const godot_plane *p_v);
godot_plane (*godot_transform_xform_inv_plane)(const godot_transform *p_self, const godot_plane *p_v);
void (*godot_transform_new_identity)(godot_transform *r_dest);
godot_bool (*godot_transform_operator_equal)(const godot_transform *p_self, const godot_transform *p_b);
godot_transform (*godot_transform_operator_multiply)(const godot_transform *p_self, const godot_transform *p_b);
godot_vector3 (*godot_transform_xform_vector3)(const godot_transform *p_self, const godot_vector3 *p_v);
godot_vector3 (*godot_transform_xform_inv_vector3)(const godot_transform *p_self, const godot_vector3 *p_v);
godot_aabb (*godot_transform_xform_aabb)(const godot_transform *p_self, const godot_aabb *p_v);
godot_aabb (*godot_transform_xform_inv_aabb)(const godot_transform *p_self, const godot_aabb *p_v);
void (*godot_transform2d_new)(godot_transform2d *r_dest, const godot_real p_rot, const godot_vector2 *p_pos);
void (*godot_transform2d_new_axis_origin)(godot_transform2d *r_dest, const godot_vector2 *p_x_axis, const godot_vector2 *p_y_axis, const godot_vector2 *p_origin);
godot_string (*godot_transform2d_as_string)(const godot_transform2d *p_self);
godot_transform2d (*godot_transform2d_inverse)(const godot_transform2d *p_self);
godot_transform2d (*godot_transform2d_affine_inverse)(const godot_transform2d *p_self);
godot_real (*godot_transform2d_get_rotation)(const godot_transform2d *p_self);
godot_vector2 (*godot_transform2d_get_origin)(const godot_transform2d *p_self);
godot_vector2 (*godot_transform2d_get_scale)(const godot_transform2d *p_self);
godot_transform2d (*godot_transform2d_orthonormalized)(const godot_transform2d *p_self);
godot_transform2d (*godot_transform2d_rotated)(const godot_transform2d *p_self, const godot_real p_phi);
godot_transform2d (*godot_transform2d_scaled)(const godot_transform2d *p_self, const godot_vector2 *p_scale);
godot_transform2d (*godot_transform2d_translated)(const godot_transform2d *p_self, const godot_vector2 *p_offset);
godot_vector2 (*godot_transform2d_xform_vector2)(const godot_transform2d *p_self, const godot_vector2 *p_v);
godot_vector2 (*godot_transform2d_xform_inv_vector2)(const godot_transform2d *p_self, const godot_vector2 *p_v);
godot_vector2 (*godot_transform2d_basis_xform_vector2)(const godot_transform2d *p_self, const godot_vector2 *p_v);
godot_vector2 (*godot_transform2d_basis_xform_inv_vector2)(const godot_transform2d *p_self, const godot_vector2 *p_v);
godot_transform2d (*godot_transform2d_interpolate_with)(const godot_transform2d *p_self, const godot_transform2d *p_m, const godot_real p_c);
godot_bool (*godot_transform2d_operator_equal)(const godot_transform2d *p_self, const godot_transform2d *p_b);
godot_transform2d (*godot_transform2d_operator_multiply)(const godot_transform2d *p_self, const godot_transform2d *p_b);
void (*godot_transform2d_new_identity)(godot_transform2d *r_dest);
godot_rect2 (*godot_transform2d_xform_rect2)(const godot_transform2d *p_self, const godot_rect2 *p_v);
godot_rect2 (*godot_transform2d_xform_inv_rect2)(const godot_transform2d *p_self, const godot_rect2 *p_v);
godot_variant_type (*godot_variant_get_type)(const godot_variant *p_v);
void (*godot_variant_new_copy)(godot_variant *r_dest, const godot_variant *p_src);
void (*godot_variant_new_nil)(godot_variant *r_dest);
void (*godot_variant_new_bool)(godot_variant *r_dest, const godot_bool p_b);
void (*godot_variant_new_uint)(godot_variant *r_dest, const uint64_t p_i);
void (*godot_variant_new_int)(godot_variant *r_dest, const int64_t p_i);
void (*godot_variant_new_real)(godot_variant *r_dest, const double p_r);
void (*godot_variant_new_string)(godot_variant *r_dest, const godot_string *p_s);
void (*godot_variant_new_vector2)(godot_variant *r_dest, const godot_vector2 *p_v2);
void (*godot_variant_new_rect2)(godot_variant *r_dest, const godot_rect2 *p_rect2);
void (*godot_variant_new_vector3)(godot_variant *r_dest, const godot_vector3 *p_v3);
void (*godot_variant_new_transform2d)(godot_variant *r_dest, const godot_transform2d *p_t2d);
void (*godot_variant_new_plane)(godot_variant *r_dest, const godot_plane *p_plane);
void (*godot_variant_new_quat)(godot_variant *r_dest, const godot_quat *p_quat);
void (*godot_variant_new_aabb)(godot_variant *r_dest, const godot_aabb *p_aabb);
void (*godot_variant_new_basis)(godot_variant *r_dest, const godot_basis *p_basis);
void (*godot_variant_new_transform)(godot_variant *r_dest, const godot_transform *p_trans);
void (*godot_variant_new_color)(godot_variant *r_dest, const godot_color *p_color);
void (*godot_variant_new_node_path)(godot_variant *r_dest, const godot_node_path *p_np);
void (*godot_variant_new_rid)(godot_variant *r_dest, const godot_rid *p_rid);
void (*godot_variant_new_object)(godot_variant *r_dest, const godot_object *p_obj);
void (*godot_variant_new_dictionary)(godot_variant *r_dest, const godot_dictionary *p_dict);
void (*godot_variant_new_array)(godot_variant *r_dest, const godot_array *p_arr);
void (*godot_variant_new_pool_byte_array)(godot_variant *r_dest, const godot_pool_byte_array *p_pba);
void (*godot_variant_new_pool_int_array)(godot_variant *r_dest, const godot_pool_int_array *p_pia);
void (*godot_variant_new_pool_real_array)(godot_variant *r_dest, const godot_pool_real_array *p_pra);
void (*godot_variant_new_pool_string_array)(godot_variant *r_dest, const godot_pool_string_array *p_psa);
void (*godot_variant_new_pool_vector2_array)(godot_variant *r_dest, const godot_pool_vector2_array *p_pv2a);
void (*godot_variant_new_pool_vector3_array)(godot_variant *r_dest, const godot_pool_vector3_array *p_pv3a);
void (*godot_variant_new_pool_color_array)(godot_variant *r_dest, const godot_pool_color_array *p_pca);
godot_bool (*godot_variant_as_bool)(const godot_variant *p_self);
uint64_t (*godot_variant_as_uint)(const godot_variant *p_self);
int64_t (*godot_variant_as_int)(const godot_variant *p_self);
double (*godot_variant_as_real)(const godot_variant *p_self);
godot_string (*godot_variant_as_string)(const godot_variant *p_self);
godot_vector2 (*godot_variant_as_vector2)(const godot_variant *p_self);
godot_rect2 (*godot_variant_as_rect2)(const godot_variant *p_self);
godot_vector3 (*godot_variant_as_vector3)(const godot_variant *p_self);
godot_transform2d (*godot_variant_as_transform2d)(const godot_variant *p_self);
godot_plane (*godot_variant_as_plane)(const godot_variant *p_self);
godot_quat (*godot_variant_as_quat)(const godot_variant *p_self);
godot_aabb (*godot_variant_as_aabb)(const godot_variant *p_self);
godot_basis (*godot_variant_as_basis)(const godot_variant *p_self);
godot_transform (*godot_variant_as_transform)(const godot_variant *p_self);
godot_color (*godot_variant_as_color)(const godot_variant *p_self);
godot_node_path (*godot_variant_as_node_path)(const godot_variant *p_self);
godot_rid (*godot_variant_as_rid)(const godot_variant *p_self);
godot_object *(*godot_variant_as_object)(const godot_variant *p_self);
godot_dictionary (*godot_variant_as_dictionary)(const godot_variant *p_self);
godot_array (*godot_variant_as_array)(const godot_variant *p_self);
godot_pool_byte_array (*godot_variant_as_pool_byte_array)(const godot_variant *p_self);
godot_pool_int_array (*godot_variant_as_pool_int_array)(const godot_variant *p_self);
godot_pool_real_array (*godot_variant_as_pool_real_array)(const godot_variant *p_self);
godot_pool_string_array (*godot_variant_as_pool_string_array)(const godot_variant *p_self);
godot_pool_vector2_array (*godot_variant_as_pool_vector2_array)(const godot_variant *p_self);
godot_pool_vector3_array (*godot_variant_as_pool_vector3_array)(const godot_variant *p_self);
godot_pool_color_array (*godot_variant_as_pool_color_array)(const godot_variant *p_self);
godot_variant (*godot_variant_call)(godot_variant *p_self, const godot_string *p_method, const godot_variant **p_args, const godot_int p_argcount, godot_variant_call_error *r_error);
godot_bool (*godot_variant_has_method)(const godot_variant *p_self, const godot_string *p_method);
godot_bool (*godot_variant_operator_equal)(const godot_variant *p_self, const godot_variant *p_other);
godot_bool (*godot_variant_operator_less)(const godot_variant *p_self, const godot_variant *p_other);
godot_bool (*godot_variant_hash_compare)(const godot_variant *p_self, const godot_variant *p_other);
godot_bool (*godot_variant_booleanize)(const godot_variant *p_self);
void (*godot_variant_destroy)(godot_variant *p_self);
godot_int (*godot_char_string_length)(const godot_char_string *p_cs);
const char *(*godot_char_string_get_data)(const godot_char_string *p_cs);
void (*godot_char_string_destroy)(godot_char_string *p_cs);
void (*godot_string_new)(godot_string *r_dest);
void (*godot_string_new_copy)(godot_string *r_dest, const godot_string *p_src);
void (*godot_string_new_with_wide_string)(godot_string *r_dest, const wchar_t *p_contents, const int p_size);
const wchar_t *(*godot_string_operator_index)(godot_string *p_self, const godot_int p_idx);
wchar_t (*godot_string_operator_index_const)(const godot_string *p_self, const godot_int p_idx);
const wchar_t *(*godot_string_wide_str)(const godot_string *p_self);
godot_bool (*godot_string_operator_equal)(const godot_string *p_self, const godot_string *p_b);
godot_bool (*godot_string_operator_less)(const godot_string *p_self, const godot_string *p_b);
godot_string (*godot_string_operator_plus)(const godot_string *p_self, const godot_string *p_b);
godot_int (*godot_string_length)(const godot_string *p_self);
signed char (*godot_string_casecmp_to)(const godot_string *p_self, const godot_string *p_str);
signed char (*godot_string_nocasecmp_to)(const godot_string *p_self, const godot_string *p_str);
signed char (*godot_string_naturalnocasecmp_to)(const godot_string *p_self, const godot_string *p_str);
godot_bool (*godot_string_begins_with)(const godot_string *p_self, const godot_string *p_string);
godot_bool (*godot_string_begins_with_char_array)(const godot_string *p_self, const char *p_char_array);
godot_array (*godot_string_bigrams)(const godot_string *p_self);
godot_string (*godot_string_chr)(wchar_t p_character);
godot_bool (*godot_string_ends_with)(const godot_string *p_self, const godot_string *p_string);
godot_int (*godot_string_find)(const godot_string *p_self, godot_string p_what);
godot_int (*godot_string_find_from)(const godot_string *p_self, godot_string p_what, godot_int p_from);
godot_int (*godot_string_findmk)(const godot_string *p_self, const godot_array *p_keys);
godot_int (*godot_string_findmk_from)(const godot_string *p_self, const godot_array *p_keys, godot_int p_from);
godot_int (*godot_string_findmk_from_in_place)(const godot_string *p_self, const godot_array *p_keys, godot_int p_from, godot_int *r_key);
godot_int (*godot_string_findn)(const godot_string *p_self, godot_string p_what);
godot_int (*godot_string_findn_from)(const godot_string *p_self, godot_string p_what, godot_int p_from);
godot_int (*godot_string_find_last)(const godot_string *p_self, godot_string p_what);
godot_string (*godot_string_format)(const godot_string *p_self, const godot_variant *p_values);
godot_string (*godot_string_format_with_custom_placeholder)(const godot_string *p_self, const godot_variant *p_values, const char *p_placeholder);
godot_string (*godot_string_hex_encode_buffer)(const uint8_t *p_buffer, godot_int p_len);
godot_int (*godot_string_hex_to_int)(const godot_string *p_self);
godot_int (*godot_string_hex_to_int_without_prefix)(const godot_string *p_self);
godot_string (*godot_string_insert)(const godot_string *p_self, godot_int p_at_pos, godot_string p_string);
godot_bool (*godot_string_is_numeric)(const godot_string *p_self);
godot_bool (*godot_string_is_subsequence_of)(const godot_string *p_self, const godot_string *p_string);
godot_bool (*godot_string_is_subsequence_ofi)(const godot_string *p_self, const godot_string *p_string);
godot_string (*godot_string_lpad)(const godot_string *p_self, godot_int p_min_length);
godot_string (*godot_string_lpad_with_custom_character)(const godot_string *p_self, godot_int p_min_length, const godot_string *p_character);
godot_bool (*godot_string_match)(const godot_string *p_self, const godot_string *p_wildcard);
godot_bool (*godot_string_matchn)(const godot_string *p_self, const godot_string *p_wildcard);
godot_string (*godot_string_md5)(const uint8_t *p_md5);
godot_string (*godot_string_num)(double p_num);
godot_string (*godot_string_num_int64)(int64_t p_num, godot_int p_base);
godot_string (*godot_string_num_int64_capitalized)(int64_t p_num, godot_int p_base, godot_bool p_capitalize_hex);
godot_string (*godot_string_num_real)(double p_num);
godot_string (*godot_string_num_scientific)(double p_num);
godot_string (*godot_string_num_with_decimals)(double p_num, godot_int p_decimals);
godot_string (*godot_string_pad_decimals)(const godot_string *p_self, godot_int p_digits);
godot_string (*godot_string_pad_zeros)(const godot_string *p_self, godot_int p_digits);
godot_string (*godot_string_replace_first)(const godot_string *p_self, godot_string p_key, godot_string p_with);
godot_string (*godot_string_replace)(const godot_string *p_self, godot_string p_key, godot_string p_with);
godot_string (*godot_string_replacen)(const godot_string *p_self, godot_string p_key, godot_string p_with);
godot_int (*godot_string_rfind)(const godot_string *p_self, godot_string p_what);
godot_int (*godot_string_rfindn)(const godot_string *p_self, godot_string p_what);
godot_int (*godot_string_rfind_from)(const godot_string *p_self, godot_string p_what, godot_int p_from);
godot_int (*godot_string_rfindn_from)(const godot_string *p_self, godot_string p_what, godot_int p_from);
godot_string (*godot_string_rpad)(const godot_string *p_self, godot_int p_min_length);
godot_string (*godot_string_rpad_with_custom_character)(const godot_string *p_self, godot_int p_min_length, const godot_string *p_character);
godot_real (*godot_string_similarity)(const godot_string *p_self, const godot_string *p_string);
godot_string (*godot_string_sprintf)(const godot_string *p_self, const godot_array *p_values, godot_bool *p_error);
godot_string (*godot_string_substr)(const godot_string *p_self, godot_int p_from, godot_int p_chars);
double (*godot_string_to_double)(const godot_string *p_self);
godot_real (*godot_string_to_float)(const godot_string *p_self);
godot_int (*godot_string_to_int)(const godot_string *p_self);
godot_string (*godot_string_camelcase_to_underscore)(const godot_string *p_self);
godot_string (*godot_string_camelcase_to_underscore_lowercased)(const godot_string *p_self);
godot_string (*godot_string_capitalize)(const godot_string *p_self);
double (*godot_string_char_to_double)(const char *p_what);
godot_int (*godot_string_char_to_int)(const char *p_what);
int64_t (*godot_string_wchar_to_int)(const wchar_t *p_str);
godot_int (*godot_string_char_to_int_with_len)(const char *p_what, godot_int p_len);
int64_t (*godot_string_char_to_int64_with_len)(const wchar_t *p_str, int p_len);
int64_t (*godot_string_hex_to_int64)(const godot_string *p_self);
int64_t (*godot_string_hex_to_int64_with_prefix)(const godot_string *p_self);
int64_t (*godot_string_to_int64)(const godot_string *p_self);
double (*godot_string_unicode_char_to_double)(const wchar_t *p_str, const wchar_t **r_end);
godot_int (*godot_string_get_slice_count)(const godot_string *p_self, godot_string p_splitter);
godot_string (*godot_string_get_slice)(const godot_string *p_self, godot_string p_splitter, godot_int p_slice);
godot_string (*godot_string_get_slicec)(const godot_string *p_self, wchar_t p_splitter, godot_int p_slice);
godot_array (*godot_string_split)(const godot_string *p_self, const godot_string *p_splitter);
godot_array (*godot_string_split_allow_empty)(const godot_string *p_self, const godot_string *p_splitter);
godot_array (*godot_string_split_floats)(const godot_string *p_self, const godot_string *p_splitter);
godot_array (*godot_string_split_floats_allows_empty)(const godot_string *p_self, const godot_string *p_splitter);
godot_array (*godot_string_split_floats_mk)(const godot_string *p_self, const godot_array *p_splitters);
godot_array (*godot_string_split_floats_mk_allows_empty)(const godot_string *p_self, const godot_array *p_splitters);
godot_array (*godot_string_split_ints)(const godot_string *p_self, const godot_string *p_splitter);
godot_array (*godot_string_split_ints_allows_empty)(const godot_string *p_self, const godot_string *p_splitter);
godot_array (*godot_string_split_ints_mk)(const godot_string *p_self, const godot_array *p_splitters);
godot_array (*godot_string_split_ints_mk_allows_empty)(const godot_string *p_self, const godot_array *p_splitters);
godot_array (*godot_string_split_spaces)(const godot_string *p_self);
wchar_t (*godot_string_char_lowercase)(wchar_t p_char);
wchar_t (*godot_string_char_uppercase)(wchar_t p_char);
godot_string (*godot_string_to_lower)(const godot_string *p_self);
godot_string (*godot_string_to_upper)(const godot_string *p_self);
godot_string (*godot_string_get_basename)(const godot_string *p_self);
godot_string (*godot_string_get_extension)(const godot_string *p_self);
godot_string (*godot_string_left)(const godot_string *p_self, godot_int p_pos);
wchar_t (*godot_string_ord_at)(const godot_string *p_self, godot_int p_idx);
godot_string (*godot_string_plus_file)(const godot_string *p_self, const godot_string *p_file);
godot_string (*godot_string_right)(const godot_string *p_self, godot_int p_pos);
godot_string (*godot_string_strip_edges)(const godot_string *p_self, godot_bool p_left, godot_bool p_right);
godot_string (*godot_string_strip_escapes)(const godot_string *p_self);
void (*godot_string_erase)(godot_string *p_self, godot_int p_pos, godot_int p_chars);
godot_char_string (*godot_string_ascii)(const godot_string *p_self);
godot_char_string (*godot_string_ascii_extended)(const godot_string *p_self);
godot_char_string (*godot_string_utf8)(const godot_string *p_self);
godot_bool (*godot_string_parse_utf8)(godot_string *p_self, const char *p_utf8);
godot_bool (*godot_string_parse_utf8_with_len)(godot_string *p_self, const char *p_utf8, godot_int p_len);
godot_string (*godot_string_chars_to_utf8)(const char *p_utf8);
godot_string (*godot_string_chars_to_utf8_with_len)(const char *p_utf8, godot_int p_len);
uint32_t (*godot_string_hash)(const godot_string *p_self);
uint64_t (*godot_string_hash64)(const godot_string *p_self);
uint32_t (*godot_string_hash_chars)(const char *p_cstr);
uint32_t (*godot_string_hash_chars_with_len)(const char *p_cstr, godot_int p_len);
uint32_t (*godot_string_hash_utf8_chars)(const wchar_t *p_str);
uint32_t (*godot_string_hash_utf8_chars_with_len)(const wchar_t *p_str, godot_int p_len);
godot_pool_byte_array (*godot_string_md5_buffer)(const godot_string *p_self);
godot_string (*godot_string_md5_text)(const godot_string *p_self);
godot_pool_byte_array (*godot_string_sha256_buffer)(const godot_string *p_self);
godot_string (*godot_string_sha256_text)(const godot_string *p_self);
godot_bool (*godot_string_empty)(const godot_string *p_self);
godot_string (*godot_string_get_base_dir)(const godot_string *p_self);
godot_string (*godot_string_get_file)(const godot_string *p_self);
godot_string (*godot_string_humanize_size)(size_t p_size);
godot_bool (*godot_string_is_abs_path)(const godot_string *p_self);
godot_bool (*godot_string_is_rel_path)(const godot_string *p_self);
godot_bool (*godot_string_is_resource_file)(const godot_string *p_self);
godot_string (*godot_string_path_to)(const godot_string *p_self, const godot_string *p_path);
godot_string (*godot_string_path_to_file)(const godot_string *p_self, const godot_string *p_path);
godot_string (*godot_string_simplify_path)(const godot_string *p_self);
godot_string (*godot_string_c_escape)(const godot_string *p_self);
godot_string (*godot_string_c_escape_multiline)(const godot_string *p_self);
godot_string (*godot_string_c_unescape)(const godot_string *p_self);
godot_string (*godot_string_http_escape)(const godot_string *p_self);
godot_string (*godot_string_http_unescape)(const godot_string *p_self);
godot_string (*godot_string_json_escape)(const godot_string *p_self);
godot_string (*godot_string_word_wrap)(const godot_string *p_self, godot_int p_chars_per_line);
godot_string (*godot_string_xml_escape)(const godot_string *p_self);
godot_string (*godot_string_xml_escape_with_quotes)(const godot_string *p_self);
godot_string (*godot_string_xml_unescape)(const godot_string *p_self);
godot_string (*godot_string_percent_decode)(const godot_string *p_self);
godot_string (*godot_string_percent_encode)(const godot_string *p_self);
godot_bool (*godot_string_is_valid_float)(const godot_string *p_self);
godot_bool (*godot_string_is_valid_hex_number)(const godot_string *p_self, godot_bool p_with_prefix);
godot_bool (*godot_string_is_valid_html_color)(const godot_string *p_self);
godot_bool (*godot_string_is_valid_identifier)(const godot_string *p_self);
godot_bool (*godot_string_is_valid_integer)(const godot_string *p_self);
godot_bool (*godot_string_is_valid_ip_address)(const godot_string *p_self);
void (*godot_string_destroy)(godot_string *p_self);
void (*godot_string_name_new)(godot_string_name *r_dest, const godot_string *p_name);
void (*godot_string_name_new_data)(godot_string_name *r_dest, const char *p_name);
godot_string (*godot_string_name_get_name)(const godot_string_name *p_self);
uint32_t (*godot_string_name_get_hash)(const godot_string_name *p_self);
const void *(*godot_string_name_get_data_unique_pointer)(const godot_string_name *p_self);
godot_bool (*godot_string_name_operator_equal)(const godot_string_name *p_self, const godot_string_name *p_other);
godot_bool (*godot_string_name_operator_less)(const godot_string_name *p_self, const godot_string_name *p_other);
void (*godot_string_name_destroy)(godot_string_name *p_self);
void (*godot_object_destroy)(godot_object *p_o);
godot_object *(*godot_global_get_singleton)(char *p_name);
godot_method_bind *(*godot_method_bind_get_method)(const char *p_classname, const char *p_methodname);
void (*godot_method_bind_ptrcall)(godot_method_bind *p_method_bind, godot_object *p_instance, const void **p_args, void *p_ret);
godot_variant (*godot_method_bind_call)(godot_method_bind *p_method_bind, godot_object *p_instance, const godot_variant **p_args, const int p_arg_count, godot_variant_call_error *p_call_error);
godot_class_constructor (*godot_get_class_constructor)(const char *p_classname);
godot_dictionary (*godot_get_global_constants)();
void (*godot_register_native_call_type)(const char *call_type, native_call_cb p_callback);
void *(*godot_alloc)(int p_bytes);
void *(*godot_realloc)(void *p_ptr, int p_bytes);
void (*godot_free)(void *p_ptr);
void (*godot_print_error)(const char *p_description, const char *p_function, const char *p_file, int p_line);
void (*godot_print_warning)(const char *p_description, const char *p_function, const char *p_file, int p_line);
void (*godot_print)(const godot_string *p_message);
} godot_gdnative_core_api_struct;
#ifdef __cplusplus
}
#endif
#endif // GODOT_GDNATIVE_API_STRUCT_H

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@@ -0,0 +1,250 @@
/*************************************************************************/
/* godot_nativescript.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef GODOT_NATIVESCRIPT_H
#define GODOT_NATIVESCRIPT_H
#include <gdnative/gdnative.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef enum {
GODOT_METHOD_RPC_MODE_DISABLED,
GODOT_METHOD_RPC_MODE_REMOTE,
GODOT_METHOD_RPC_MODE_MASTER,
GODOT_METHOD_RPC_MODE_PUPPET,
GODOT_METHOD_RPC_MODE_SLAVE = GODOT_METHOD_RPC_MODE_PUPPET,
GODOT_METHOD_RPC_MODE_REMOTESYNC,
GODOT_METHOD_RPC_MODE_SYNC = GODOT_METHOD_RPC_MODE_REMOTESYNC,
GODOT_METHOD_RPC_MODE_MASTERSYNC,
GODOT_METHOD_RPC_MODE_PUPPETSYNC,
} godot_method_rpc_mode;
typedef enum {
GODOT_PROPERTY_HINT_NONE, ///< no hint provided.
GODOT_PROPERTY_HINT_RANGE, ///< hint_text = "min,max,step,slider; //slider is optional"
GODOT_PROPERTY_HINT_EXP_RANGE, ///< hint_text = "min,max,step", exponential edit
GODOT_PROPERTY_HINT_ENUM, ///< hint_text= "val1,val2,val3,etc"
GODOT_PROPERTY_HINT_EXP_EASING, /// exponential easing function (Math::ease)
GODOT_PROPERTY_HINT_LENGTH, ///< hint_text= "length" (as integer)
GODOT_PROPERTY_HINT_SPRITE_FRAME, // FIXME: Obsolete: drop whenever we can break compat
GODOT_PROPERTY_HINT_KEY_ACCEL, ///< hint_text= "length" (as integer)
GODOT_PROPERTY_HINT_FLAGS, ///< hint_text= "flag1,flag2,etc" (as bit flags)
GODOT_PROPERTY_HINT_LAYERS_2D_RENDER,
GODOT_PROPERTY_HINT_LAYERS_2D_PHYSICS,
GODOT_PROPERTY_HINT_LAYERS_3D_RENDER,
GODOT_PROPERTY_HINT_LAYERS_3D_PHYSICS,
GODOT_PROPERTY_HINT_FILE, ///< a file path must be passed, hint_text (optionally) is a filter "*.png,*.wav,*.doc,"
GODOT_PROPERTY_HINT_DIR, ///< a directory path must be passed
GODOT_PROPERTY_HINT_GLOBAL_FILE, ///< a file path must be passed, hint_text (optionally) is a filter "*.png,*.wav,*.doc,"
GODOT_PROPERTY_HINT_GLOBAL_DIR, ///< a directory path must be passed
GODOT_PROPERTY_HINT_RESOURCE_TYPE, ///< a resource object type
GODOT_PROPERTY_HINT_MULTILINE_TEXT, ///< used for string properties that can contain multiple lines
GODOT_PROPERTY_HINT_PLACEHOLDER_TEXT, ///< used to set a placeholder text for string properties
GODOT_PROPERTY_HINT_COLOR_NO_ALPHA, ///< used for ignoring alpha component when editing a color
GODOT_PROPERTY_HINT_IMAGE_COMPRESS_LOSSY,
GODOT_PROPERTY_HINT_IMAGE_COMPRESS_LOSSLESS,
GODOT_PROPERTY_HINT_OBJECT_ID,
GODOT_PROPERTY_HINT_TYPE_STRING, ///< a type string, the hint is the base type to choose
GODOT_PROPERTY_HINT_NODE_PATH_TO_EDITED_NODE, ///< so something else can provide this (used in scripts)
GODOT_PROPERTY_HINT_METHOD_OF_VARIANT_TYPE, ///< a method of a type
GODOT_PROPERTY_HINT_METHOD_OF_BASE_TYPE, ///< a method of a base type
GODOT_PROPERTY_HINT_METHOD_OF_INSTANCE, ///< a method of an instance
GODOT_PROPERTY_HINT_METHOD_OF_SCRIPT, ///< a method of a script & base
GODOT_PROPERTY_HINT_PROPERTY_OF_VARIANT_TYPE, ///< a property of a type
GODOT_PROPERTY_HINT_PROPERTY_OF_BASE_TYPE, ///< a property of a base type
GODOT_PROPERTY_HINT_PROPERTY_OF_INSTANCE, ///< a property of an instance
GODOT_PROPERTY_HINT_PROPERTY_OF_SCRIPT, ///< a property of a script & base
GODOT_PROPERTY_HINT_MAX,
} godot_property_hint;
typedef enum {
GODOT_PROPERTY_USAGE_STORAGE = 1,
GODOT_PROPERTY_USAGE_EDITOR = 2,
GODOT_PROPERTY_USAGE_NETWORK = 4,
GODOT_PROPERTY_USAGE_EDITOR_HELPER = 8,
GODOT_PROPERTY_USAGE_CHECKABLE = 16, //used for editing global variables
GODOT_PROPERTY_USAGE_CHECKED = 32, //used for editing global variables
GODOT_PROPERTY_USAGE_INTERNATIONALIZED = 64, //hint for internationalized strings
GODOT_PROPERTY_USAGE_GROUP = 128, //used for grouping props in the editor
GODOT_PROPERTY_USAGE_CATEGORY = 256,
GODOT_PROPERTY_USAGE_STORE_IF_NONZERO = 512, // FIXME: Obsolete: drop whenever we can break compat
GODOT_PROPERTY_USAGE_STORE_IF_NONONE = 1024, // FIXME: Obsolete: drop whenever we can break compat
GODOT_PROPERTY_USAGE_NO_INSTANCE_STATE = 2048,
GODOT_PROPERTY_USAGE_RESTART_IF_CHANGED = 4096,
GODOT_PROPERTY_USAGE_SCRIPT_VARIABLE = 8192,
GODOT_PROPERTY_USAGE_STORE_IF_NULL = 16384,
GODOT_PROPERTY_USAGE_ANIMATE_AS_TRIGGER = 32768,
GODOT_PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED = 65536,
GODOT_PROPERTY_USAGE_DEFAULT = GODOT_PROPERTY_USAGE_STORAGE | GODOT_PROPERTY_USAGE_EDITOR | GODOT_PROPERTY_USAGE_NETWORK,
GODOT_PROPERTY_USAGE_DEFAULT_INTL = GODOT_PROPERTY_USAGE_STORAGE | GODOT_PROPERTY_USAGE_EDITOR | GODOT_PROPERTY_USAGE_NETWORK | GODOT_PROPERTY_USAGE_INTERNATIONALIZED,
GODOT_PROPERTY_USAGE_NOEDITOR = GODOT_PROPERTY_USAGE_STORAGE | GODOT_PROPERTY_USAGE_NETWORK,
} godot_property_usage_flags;
typedef struct {
godot_method_rpc_mode rset_type;
godot_int type;
godot_property_hint hint;
godot_string hint_string;
godot_property_usage_flags usage;
godot_variant default_value;
} godot_property_attributes;
typedef struct {
// instance pointer, method_data - return user data
GDCALLINGCONV void *(*create_func)(godot_object *, void *);
void *method_data;
GDCALLINGCONV void (*free_func)(void *);
} godot_instance_create_func;
typedef struct {
// instance pointer, method data, user data
GDCALLINGCONV void (*destroy_func)(godot_object *, void *, void *);
void *method_data;
GDCALLINGCONV void (*free_func)(void *);
} godot_instance_destroy_func;
void GDAPI godot_nativescript_register_class(void *p_gdnative_handle, const char *p_name, const char *p_base, godot_instance_create_func p_create_func, godot_instance_destroy_func p_destroy_func);
void GDAPI godot_nativescript_register_tool_class(void *p_gdnative_handle, const char *p_name, const char *p_base, godot_instance_create_func p_create_func, godot_instance_destroy_func p_destroy_func);
typedef struct {
godot_method_rpc_mode rpc_type;
} godot_method_attributes;
typedef struct {
// instance pointer, method data, user data, num args, args - return result as varaint
GDCALLINGCONV godot_variant (*method)(godot_object *, void *, void *, int, godot_variant **);
void *method_data;
GDCALLINGCONV void (*free_func)(void *);
} godot_instance_method;
void GDAPI godot_nativescript_register_method(void *p_gdnative_handle, const char *p_name, const char *p_function_name, godot_method_attributes p_attr, godot_instance_method p_method);
typedef struct {
// instance pointer, method data, user data, value
GDCALLINGCONV void (*set_func)(godot_object *, void *, void *, godot_variant *);
void *method_data;
GDCALLINGCONV void (*free_func)(void *);
} godot_property_set_func;
typedef struct {
// instance pointer, method data, user data, value
GDCALLINGCONV godot_variant (*get_func)(godot_object *, void *, void *);
void *method_data;
GDCALLINGCONV void (*free_func)(void *);
} godot_property_get_func;
void GDAPI godot_nativescript_register_property(void *p_gdnative_handle, const char *p_name, const char *p_path, godot_property_attributes *p_attr, godot_property_set_func p_set_func, godot_property_get_func p_get_func);
typedef struct {
godot_string name;
godot_int type;
godot_property_hint hint;
godot_string hint_string;
godot_property_usage_flags usage;
godot_variant default_value;
} godot_signal_argument;
typedef struct {
godot_string name;
int num_args;
godot_signal_argument *args;
int num_default_args;
godot_variant *default_args;
} godot_signal;
void GDAPI godot_nativescript_register_signal(void *p_gdnative_handle, const char *p_name, const godot_signal *p_signal);
void GDAPI *godot_nativescript_get_userdata(godot_object *p_instance);
/*
*
*
* NativeScript 1.1
*
*
*/
// method registering with argument names
typedef struct {
godot_string name;
godot_variant_type type;
godot_property_hint hint;
godot_string hint_string;
} godot_method_arg;
void GDAPI godot_nativescript_set_method_argument_information(void *p_gdnative_handle, const char *p_name, const char *p_function_name, int p_num_args, const godot_method_arg *p_args);
// documentation
void GDAPI godot_nativescript_set_class_documentation(void *p_gdnative_handle, const char *p_name, godot_string p_documentation);
void GDAPI godot_nativescript_set_method_documentation(void *p_gdnative_handle, const char *p_name, const char *p_function_name, godot_string p_documentation);
void GDAPI godot_nativescript_set_property_documentation(void *p_gdnative_handle, const char *p_name, const char *p_path, godot_string p_documentation);
void GDAPI godot_nativescript_set_signal_documentation(void *p_gdnative_handle, const char *p_name, const char *p_signal_name, godot_string p_documentation);
// type tag API
void GDAPI godot_nativescript_set_global_type_tag(int p_idx, const char *p_name, const void *p_type_tag);
const void GDAPI *godot_nativescript_get_global_type_tag(int p_idx, const char *p_name);
void GDAPI godot_nativescript_set_type_tag(void *p_gdnative_handle, const char *p_name, const void *p_type_tag);
const void GDAPI *godot_nativescript_get_type_tag(const godot_object *p_object);
// instance binding API
typedef struct {
GDCALLINGCONV void *(*alloc_instance_binding_data)(void *, const void *, godot_object *);
GDCALLINGCONV void (*free_instance_binding_data)(void *, void *);
GDCALLINGCONV void (*refcount_incremented_instance_binding)(void *, godot_object *);
GDCALLINGCONV bool (*refcount_decremented_instance_binding)(void *, godot_object *);
void *data;
GDCALLINGCONV void (*free_func)(void *);
} godot_instance_binding_functions;
int GDAPI godot_nativescript_register_instance_binding_data_functions(godot_instance_binding_functions p_binding_functions);
void GDAPI godot_nativescript_unregister_instance_binding_data_functions(int p_idx);
void GDAPI *godot_nativescript_get_instance_binding_data(int p_idx, godot_object *p_object);
void GDAPI godot_nativescript_profiling_add_data(const char *p_signature, uint64_t p_time);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,121 @@
/*************************************************************************/
/* godot_net.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef GODOT_NATIVENET_H
#define GODOT_NATIVENET_H
#include <gdnative/gdnative.h>
#ifdef __cplusplus
extern "C" {
#endif
// For future versions of the API we should only add new functions at the end of the structure and use the
// version info to detect whether a call is available
// Use these to populate version in your plugin
#define GODOT_NET_API_MAJOR 3
#define GODOT_NET_API_MINOR 1
typedef struct {
godot_gdnative_api_version version; /* version of our API */
godot_object *data; /* User reference */
/* This is StreamPeer */
godot_error (*get_data)(void *user, uint8_t *p_buffer, int p_bytes);
godot_error (*get_partial_data)(void *user, uint8_t *p_buffer, int p_bytes, int *r_received);
godot_error (*put_data)(void *user, const uint8_t *p_data, int p_bytes);
godot_error (*put_partial_data)(void *user, const uint8_t *p_data, int p_bytes, int *r_sent);
int (*get_available_bytes)(const void *user);
void *next; /* For extension? */
} godot_net_stream_peer;
/* Binds a StreamPeerGDNative to the provided interface */
void godot_net_bind_stream_peer(godot_object *p_obj, const godot_net_stream_peer *p_interface);
typedef struct {
godot_gdnative_api_version version; /* version of our API */
godot_object *data; /* User reference */
/* This is PacketPeer */
godot_error (*get_packet)(void *, const uint8_t **, int *);
godot_error (*put_packet)(void *, const uint8_t *, int);
godot_int (*get_available_packet_count)(const void *);
godot_int (*get_max_packet_size)(const void *);
void *next; /* For extension? */
} godot_net_packet_peer;
/* Binds a PacketPeerGDNative to the provided interface */
void GDAPI godot_net_bind_packet_peer(godot_object *p_obj, const godot_net_packet_peer *);
typedef struct {
godot_gdnative_api_version version; /* version of our API */
godot_object *data; /* User reference */
/* This is PacketPeer */
godot_error (*get_packet)(void *, const uint8_t **, int *);
godot_error (*put_packet)(void *, const uint8_t *, int);
godot_int (*get_available_packet_count)(const void *);
godot_int (*get_max_packet_size)(const void *);
/* This is NetworkedMultiplayerPeer */
void (*set_transfer_mode)(void *, godot_int);
godot_int (*get_transfer_mode)(const void *);
// 0 = broadcast, 1 = server, <0 = all but abs(value)
void (*set_target_peer)(void *, godot_int);
godot_int (*get_packet_peer)(const void *);
godot_bool (*is_server)(const void *);
void (*poll)(void *);
// Must be > 0, 1 is for server
int32_t (*get_unique_id)(const void *);
void (*set_refuse_new_connections)(void *, godot_bool);
godot_bool (*is_refusing_new_connections)(const void *);
godot_int (*get_connection_status)(const void *);
void *next; /* For extension? Or maybe not... */
} godot_net_multiplayer_peer;
/* Binds a MultiplayerPeerGDNative to the provided interface */
void GDAPI godot_net_bind_multiplayer_peer(godot_object *p_obj, const godot_net_multiplayer_peer *);
#ifdef __cplusplus
}
#endif
// WebRTC Bindings
#include "net/godot_webrtc.h"
#endif /* GODOT_NATIVENET_H */

View File

@@ -0,0 +1,122 @@
/*************************************************************************/
/* godot_webrtc.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef GODOT_NATIVEWEBRTC_H
#define GODOT_NATIVEWEBRTC_H
#include <gdnative/gdnative.h>
#ifdef __cplusplus
extern "C" {
#endif
#define GODOT_NET_WEBRTC_API_MAJOR 3
#define GODOT_NET_WEBRTC_API_MINOR 2
/* Library Interface (used to set default GDNative WebRTC implementation */
typedef struct {
godot_gdnative_api_version version; /* version of our API */
/* Called when the library is unset as default interface via godot_net_set_webrtc_library */
void (*unregistered)();
/* Used by WebRTCPeerConnection create when GDNative is the default implementation. */
/* Takes a pointer to WebRTCPeerConnectionGDNative, should bind and return OK, failure if binding was unsuccessful. */
godot_error (*create_peer_connection)(godot_object *);
void *next; /* For extension */
} godot_net_webrtc_library;
/* WebRTCPeerConnection interface */
typedef struct {
godot_gdnative_api_version version; /* version of our API */
godot_object *data; /* User reference */
/* This is WebRTCPeerConnection */
godot_int (*get_connection_state)(const void *);
godot_error (*initialize)(void *, const godot_dictionary *);
godot_object *(*create_data_channel)(void *, const char *p_channel_name, const godot_dictionary *);
godot_error (*create_offer)(void *);
godot_error (*create_answer)(void *); /* unused for now, should be done automatically on set_local_description */
godot_error (*set_remote_description)(void *, const char *, const char *);
godot_error (*set_local_description)(void *, const char *, const char *);
godot_error (*add_ice_candidate)(void *, const char *, int, const char *);
godot_error (*poll)(void *);
void (*close)(void *);
void *next; /* For extension? */
} godot_net_webrtc_peer_connection;
/* WebRTCDataChannel interface */
typedef struct {
godot_gdnative_api_version version; /* version of our API */
godot_object *data; /* User reference */
/* This is PacketPeer */
godot_error (*get_packet)(void *, const uint8_t **, int *);
godot_error (*put_packet)(void *, const uint8_t *, int);
godot_int (*get_available_packet_count)(const void *);
godot_int (*get_max_packet_size)(const void *);
/* This is WebRTCDataChannel */
void (*set_write_mode)(void *, godot_int);
godot_int (*get_write_mode)(const void *);
bool (*was_string_packet)(const void *);
godot_int (*get_ready_state)(const void *);
const char *(*get_label)(const void *);
bool (*is_ordered)(const void *);
int (*get_id)(const void *);
int (*get_max_packet_life_time)(const void *);
int (*get_max_retransmits)(const void *);
const char *(*get_protocol)(const void *);
bool (*is_negotiated)(const void *);
godot_error (*poll)(void *);
void (*close)(void *);
void *next; /* For extension? */
} godot_net_webrtc_data_channel;
/* Set the default GDNative library */
godot_error GDAPI godot_net_set_webrtc_library(const godot_net_webrtc_library *);
/* Binds a WebRTCPeerConnectionGDNative to the provided interface */
void GDAPI godot_net_bind_webrtc_peer_connection(godot_object *p_obj, const godot_net_webrtc_peer_connection *);
/* Binds a WebRTCDataChannelGDNative to the provided interface */
void GDAPI godot_net_bind_webrtc_data_channel(godot_object *p_obj, const godot_net_webrtc_data_channel *);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,172 @@
/*************************************************************************/
/* godot_pluginscript.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef GODOT_PLUGINSCRIPT_H
#define GODOT_PLUGINSCRIPT_H
#include <gdnative/gdnative.h>
#include <nativescript/godot_nativescript.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef void godot_pluginscript_instance_data;
typedef void godot_pluginscript_script_data;
typedef void godot_pluginscript_language_data;
// --- Instance ---
// TODO: use godot_string_name for faster lookup ?
typedef struct {
godot_pluginscript_instance_data *(*init)(godot_pluginscript_script_data *p_data, godot_object *p_owner);
void (*finish)(godot_pluginscript_instance_data *p_data);
godot_bool (*set_prop)(godot_pluginscript_instance_data *p_data, const godot_string *p_name, const godot_variant *p_value);
godot_bool (*get_prop)(godot_pluginscript_instance_data *p_data, const godot_string *p_name, godot_variant *r_ret);
godot_variant (*call_method)(godot_pluginscript_instance_data *p_data,
const godot_string_name *p_method, const godot_variant **p_args,
int p_argcount, godot_variant_call_error *r_error);
void (*notification)(godot_pluginscript_instance_data *p_data, int p_notification);
// TODO: could this rpc mode stuff be moved to the godot_pluginscript_script_manifest ?
godot_method_rpc_mode (*get_rpc_mode)(godot_pluginscript_instance_data *p_data, const godot_string *p_method);
godot_method_rpc_mode (*get_rset_mode)(godot_pluginscript_instance_data *p_data, const godot_string *p_variable);
//this is used by script languages that keep a reference counter of their own
//you can make make Ref<> not die when it reaches zero, so deleting the reference
//depends entirely from the script.
// Note: You can set those function pointer to NULL if not needed.
void (*refcount_incremented)(godot_pluginscript_instance_data *p_data);
bool (*refcount_decremented)(godot_pluginscript_instance_data *p_data); // return true if it can die
} godot_pluginscript_instance_desc;
// --- Script ---
typedef struct {
godot_pluginscript_script_data *data;
godot_string_name name;
godot_bool is_tool;
godot_string_name base;
// Member lines format: {<string>: <int>}
godot_dictionary member_lines;
// Method info dictionary format
// {
// name: <string>
// args: [<dict:property>]
// default_args: [<variant>]
// return: <dict:property>
// flags: <int>
// rpc_mode: <int:godot_method_rpc_mode>
// }
godot_array methods;
// Same format than for methods
godot_array signals;
// Property info dictionary format
// {
// name: <string>
// type: <int:godot_variant_type>
// hint: <int:godot_property_hint>
// hint_string: <string>
// usage: <int:godot_property_usage_flags>
// default_value: <variant>
// rset_mode: <int:godot_method_rpc_mode>
// }
godot_array properties;
} godot_pluginscript_script_manifest;
typedef struct {
godot_pluginscript_script_manifest (*init)(godot_pluginscript_language_data *p_data, const godot_string *p_path, const godot_string *p_source, godot_error *r_error);
void (*finish)(godot_pluginscript_script_data *p_data);
godot_pluginscript_instance_desc instance_desc;
} godot_pluginscript_script_desc;
// --- Language ---
typedef struct {
godot_string_name signature;
godot_int call_count;
godot_int total_time; // In microseconds
godot_int self_time; // In microseconds
} godot_pluginscript_profiling_data;
typedef struct {
const char *name;
const char *type;
const char *extension;
const char **recognized_extensions; // NULL terminated array
godot_pluginscript_language_data *(*init)();
void (*finish)(godot_pluginscript_language_data *p_data);
const char **reserved_words; // NULL terminated array
const char **comment_delimiters; // NULL terminated array
const char **string_delimiters; // NULL terminated array
godot_bool has_named_classes;
godot_bool supports_builtin_mode;
godot_string (*get_template_source_code)(godot_pluginscript_language_data *p_data, const godot_string *p_class_name, const godot_string *p_base_class_name);
godot_bool (*validate)(godot_pluginscript_language_data *p_data, const godot_string *p_script, int *r_line_error, int *r_col_error, godot_string *r_test_error, const godot_string *p_path, godot_pool_string_array *r_functions);
int (*find_function)(godot_pluginscript_language_data *p_data, const godot_string *p_function, const godot_string *p_code); // Can be NULL
godot_string (*make_function)(godot_pluginscript_language_data *p_data, const godot_string *p_class, const godot_string *p_name, const godot_pool_string_array *p_args);
godot_error (*complete_code)(godot_pluginscript_language_data *p_data, const godot_string *p_code, const godot_string *p_path, godot_object *p_owner, godot_array *r_options, godot_bool *r_force, godot_string *r_call_hint);
void (*auto_indent_code)(godot_pluginscript_language_data *p_data, godot_string *p_code, int p_from_line, int p_to_line);
void (*add_global_constant)(godot_pluginscript_language_data *p_data, const godot_string *p_variable, const godot_variant *p_value);
godot_string (*debug_get_error)(godot_pluginscript_language_data *p_data);
int (*debug_get_stack_level_count)(godot_pluginscript_language_data *p_data);
int (*debug_get_stack_level_line)(godot_pluginscript_language_data *p_data, int p_level);
godot_string (*debug_get_stack_level_function)(godot_pluginscript_language_data *p_data, int p_level);
godot_string (*debug_get_stack_level_source)(godot_pluginscript_language_data *p_data, int p_level);
void (*debug_get_stack_level_locals)(godot_pluginscript_language_data *p_data, int p_level, godot_pool_string_array *p_locals, godot_array *p_values, int p_max_subitems, int p_max_depth);
void (*debug_get_stack_level_members)(godot_pluginscript_language_data *p_data, int p_level, godot_pool_string_array *p_members, godot_array *p_values, int p_max_subitems, int p_max_depth);
void (*debug_get_globals)(godot_pluginscript_language_data *p_data, godot_pool_string_array *p_locals, godot_array *p_values, int p_max_subitems, int p_max_depth);
godot_string (*debug_parse_stack_level_expression)(godot_pluginscript_language_data *p_data, int p_level, const godot_string *p_expression, int p_max_subitems, int p_max_depth);
// TODO: could this stuff be moved to the godot_pluginscript_language_desc ?
void (*get_public_functions)(godot_pluginscript_language_data *p_data, godot_array *r_functions);
void (*get_public_constants)(godot_pluginscript_language_data *p_data, godot_dictionary *r_constants);
void (*profiling_start)(godot_pluginscript_language_data *p_data);
void (*profiling_stop)(godot_pluginscript_language_data *p_data);
int (*profiling_get_accumulated_data)(godot_pluginscript_language_data *p_data, godot_pluginscript_profiling_data *r_info, int p_info_max);
int (*profiling_get_frame_data)(godot_pluginscript_language_data *p_data, godot_pluginscript_profiling_data *r_info, int p_info_max);
void (*profiling_frame)(godot_pluginscript_language_data *p_data);
godot_pluginscript_script_desc script_desc;
} godot_pluginscript_language_desc;
void GDAPI godot_pluginscript_register_language(const godot_pluginscript_language_desc *language_desc);
#ifdef __cplusplus
}
#endif
#endif // GODOT_PLUGINSCRIPT_H

View File

@@ -0,0 +1,75 @@
/*************************************************************************/
/* godot_videodecoder.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef GODOT_NATIVEVIDEODECODER_H
#define GODOT_NATIVEVIDEODECODER_H
#include <gdnative/gdnative.h>
#ifdef __cplusplus
extern "C" {
#endif
#define GODOTAV_API_MAJOR 0
#define GODOTAV_API_MINOR 1
typedef struct
{
godot_gdnative_api_version version;
void *next;
void *(*constructor)(godot_object *);
void (*destructor)(void *);
const char *(*get_plugin_name)(void);
const char **(*get_supported_extensions)(int *count);
godot_bool (*open_file)(void *, void *); // data struct, and a FileAccess pointer
godot_real (*get_length)(const void *);
godot_real (*get_playback_position)(const void *);
void (*seek)(void *, godot_real);
void (*set_audio_track)(void *, godot_int);
void (*update)(void *, godot_real);
godot_pool_byte_array *(*get_videoframe)(void *);
godot_int (*get_audioframe)(void *, float *, int);
godot_int (*get_channels)(const void *);
godot_int (*get_mix_rate)(const void *);
godot_vector2 (*get_texture_size)(const void *);
} godot_videodecoder_interface_gdnative;
typedef int (*GDNativeAudioMixCallback)(void *, const float *, int);
// FileAccess wrappers for custom FFmpeg IO
godot_int GDAPI godot_videodecoder_file_read(void *file_ptr, uint8_t *buf, int buf_size);
int64_t GDAPI godot_videodecoder_file_seek(void *file_ptr, int64_t pos, int whence);
void GDAPI godot_videodecoder_register_decoder(const godot_videodecoder_interface_gdnative *p_interface);
#ifdef __cplusplus
}
#endif
#endif /* GODOT_NATIVEVIDEODECODER_H */

View File

@@ -0,0 +1,82 @@
#ifndef AABB_H
#define AABB_H
#include "Vector3.hpp"
#include "Plane.hpp"
#include <cstdlib>
namespace godot {
class AABB {
public:
Vector3 position;
Vector3 size;
real_t get_area() const; /// get area
inline bool has_no_area() const {
return (size.x <= CMP_EPSILON || size.y <= CMP_EPSILON || size.z <= CMP_EPSILON);
}
inline bool has_no_surface() const {
return (size.x <= CMP_EPSILON && size.y <= CMP_EPSILON && size.z <= CMP_EPSILON);
}
inline const Vector3 &get_position() const { return position; }
inline void set_position(const Vector3 &p_position) { position = p_position; }
inline const Vector3 &get_size() const { return size; }
inline void set_size(const Vector3 &p_size) { size = p_size; }
bool operator==(const AABB &p_rval) const;
bool operator!=(const AABB &p_rval) const;
bool intersects(const AABB &p_aabb) const; /// Both AABBs overlap
bool intersects_inclusive(const AABB &p_aabb) const; /// Both AABBs (or their faces) overlap
bool encloses(const AABB &p_aabb) const; /// p_aabb is completely inside this
AABB merge(const AABB &p_with) const;
void merge_with(const AABB &p_aabb); ///merge with another AABB
AABB intersection(const AABB &p_aabb) const; ///get box where two intersect, empty if no intersection occurs
bool intersects_segment(const Vector3 &p_from, const Vector3 &p_to, Vector3 *r_clip = nullptr, Vector3 *r_normal = nullptr) const;
bool intersects_ray(const Vector3 &p_from, const Vector3 &p_dir, Vector3 *r_clip = nullptr, Vector3 *r_normal = nullptr) const;
bool smits_intersect_ray(const Vector3 &from, const Vector3 &p_dir, real_t t0, real_t t1) const;
bool intersects_convex_shape(const Plane *p_plane, int p_plane_count) const;
bool intersects_plane(const Plane &p_plane) const;
bool has_point(const Vector3 &p_point) const;
Vector3 get_support(const Vector3 &p_normal) const;
Vector3 get_longest_axis() const;
int get_longest_axis_index() const;
real_t get_longest_axis_size() const;
Vector3 get_shortest_axis() const;
int get_shortest_axis_index() const;
real_t get_shortest_axis_size() const;
AABB grow(real_t p_by) const;
void grow_by(real_t p_amount);
void get_edge(int p_edge, Vector3 &r_from, Vector3 &r_to) const;
Vector3 get_endpoint(int p_point) const;
AABB expand(const Vector3 &p_vector) const;
void project_range_in_plane(const Plane &p_plane, real_t &r_min, real_t &r_max) const;
void expand_to(const Vector3 &p_vector); /** expand to contain a point if necesary */
operator String() const;
inline AABB() {}
inline AABB(const Vector3 &p_pos, const Vector3 &p_size) {
position = p_pos;
size = p_size;
}
};
} // namespace godot
#endif // RECT3_H

View File

@@ -0,0 +1,154 @@
#ifndef ARRAY_H
#define ARRAY_H
#include <gdnative/array.h>
#include "String.hpp"
namespace godot {
namespace helpers {
template <typename T, typename ValueT>
T append_all(T appendable, ValueT value) {
appendable.append(value);
return appendable;
}
template <typename T, typename ValueT, typename... Args>
T append_all(T appendable, ValueT value, Args... args) {
appendable.append(value);
return append_all(appendable, args...);
}
template <typename T>
T append_all(T appendable) {
return appendable;
}
template <typename KV, typename KeyT, typename ValueT>
KV add_all(KV kv, KeyT key, ValueT value) {
kv[key] = value;
return kv;
}
template <typename KV, typename KeyT, typename ValueT, typename... Args>
KV add_all(KV kv, KeyT key, ValueT value, Args... args) {
kv[key] = value;
return add_all(kv, args...);
}
template <typename KV>
KV add_all(KV kv) {
return kv;
}
} // namespace helpers
class Variant;
class PoolByteArray;
class PoolIntArray;
class PoolRealArray;
class PoolStringArray;
class PoolVector2Array;
class PoolVector3Array;
class PoolColorArray;
class Object;
class Array {
godot_array _godot_array;
public:
Array();
Array(const Array &other);
Array &operator=(const Array &other);
Array(const PoolByteArray &a);
Array(const PoolIntArray &a);
Array(const PoolRealArray &a);
Array(const PoolStringArray &a);
Array(const PoolVector2Array &a);
Array(const PoolVector3Array &a);
Array(const PoolColorArray &a);
template <class... Args>
static Array make(Args... args) {
return helpers::append_all(Array(), args...);
}
Variant &operator[](const int idx);
Variant operator[](const int idx) const;
void append(const Variant &v);
void clear();
int count(const Variant &v);
bool empty() const;
void erase(const Variant &v);
Variant front() const;
Variant back() const;
int find(const Variant &what, const int from = 0);
int find_last(const Variant &what);
bool has(const Variant &what) const;
uint32_t hash() const;
void insert(const int pos, const Variant &value);
void invert();
bool is_shared() const;
Variant pop_back();
Variant pop_front();
void push_back(const Variant &v);
void push_front(const Variant &v);
void remove(const int idx);
int size() const;
void resize(const int size);
int rfind(const Variant &what, const int from = -1);
void sort();
void sort_custom(Object *obj, const String &func);
int bsearch(const Variant &value, const bool before = true);
int bsearch_custom(const Variant &value, const Object *obj,
const String &func, const bool before = true);
Array duplicate(const bool deep = false) const;
Variant max() const;
Variant min() const;
void shuffle();
~Array();
};
} // namespace godot
#endif // ARRAY_H

View File

@@ -0,0 +1,423 @@
#ifndef BASIS_H
#define BASIS_H
#include <gdnative/basis.h>
#include "Defs.hpp"
#include "Vector3.hpp"
namespace godot {
class Quat;
class Basis {
private:
// This helper template is for mimicking the behavior difference between the engine
// and script interfaces that logically script sees matrices as column major, while
// the engine stores them in row major to efficiently take advantage of SIMD
// instructions in case of matrix-vector multiplications.
// With this helper template native scripts see the data as if it was column major
// without actually transposing the basis matrix at the script-engine boundary.
template <int column>
class ColumnVector3 {
private:
template <int column1, int component>
class ColumnVectorComponent {
private:
Vector3 elements[3];
protected:
inline ColumnVectorComponent<column1, component> &operator=(const ColumnVectorComponent<column1, component> &p_value) {
return *this = real_t(p_value);
}
inline ColumnVectorComponent(const ColumnVectorComponent<column1, component> &p_value) {
*this = real_t(p_value);
}
inline ColumnVectorComponent<column1, component> &operator=(const real_t &p_value) {
elements[component][column1] = p_value;
return *this;
}
inline operator real_t() const {
return elements[component][column1];
}
};
public:
enum Axis {
AXIS_X,
AXIS_Y,
AXIS_Z,
};
union {
ColumnVectorComponent<column, 0> x;
ColumnVectorComponent<column, 1> y;
ColumnVectorComponent<column, 2> z;
Vector3 elements[3]; // Not for direct access, use [] operator instead
};
inline ColumnVector3<column> &operator=(const ColumnVector3<column> &p_value) {
return *this = Vector3(p_value);
}
inline ColumnVector3(const ColumnVector3<column> &p_value) {
*this = Vector3(p_value);
}
inline ColumnVector3<column> &operator=(const Vector3 &p_value) {
elements[0][column] = p_value.x;
elements[1][column] = p_value.y;
elements[2][column] = p_value.z;
return *this;
}
inline operator Vector3() const {
return Vector3(elements[0][column], elements[1][column], elements[2][column]);
}
// Unfortunately, we also need to replicate the other interfaces of Vector3 in
// order for being able to directly operate on these "meta-Vector3" objects without
// an explicit cast or an intermediate assignment to a real Vector3 object.
inline const real_t &operator[](int p_axis) const {
return elements[p_axis][column];
}
inline real_t &operator[](int p_axis) {
return elements[p_axis][column];
}
inline ColumnVector3<column> &operator+=(const Vector3 &p_v) {
return *this = *this + p_v;
}
inline Vector3 operator+(const Vector3 &p_v) const {
return Vector3(*this) + p_v;
}
inline ColumnVector3<column> &operator-=(const Vector3 &p_v) {
return *this = *this - p_v;
}
inline Vector3 operator-(const Vector3 &p_v) const {
return Vector3(*this) - p_v;
}
inline ColumnVector3<column> &operator*=(const Vector3 &p_v) {
return *this = *this * p_v;
}
inline Vector3 operator*(const Vector3 &p_v) const {
return Vector3(*this) * p_v;
}
inline ColumnVector3<column> &operator/=(const Vector3 &p_v) {
return *this = *this / p_v;
}
inline Vector3 operator/(const Vector3 &p_v) const {
return Vector3(*this) / p_v;
}
inline ColumnVector3<column> &operator*=(real_t p_scalar) {
return *this = *this * p_scalar;
}
inline Vector3 operator*(real_t p_scalar) const {
return Vector3(*this) * p_scalar;
}
inline ColumnVector3<column> &operator/=(real_t p_scalar) {
return *this = *this / p_scalar;
}
inline Vector3 operator/(real_t p_scalar) const {
return Vector3(*this) / p_scalar;
}
inline Vector3 operator-() const {
return -Vector3(*this);
}
inline bool operator==(const Vector3 &p_v) const {
return Vector3(*this) == p_v;
}
inline bool operator!=(const Vector3 &p_v) const {
return Vector3(*this) != p_v;
}
inline bool operator<(const Vector3 &p_v) const {
return Vector3(*this) < p_v;
}
inline bool operator<=(const Vector3 &p_v) const {
return Vector3(*this) <= p_v;
}
inline Vector3 abs() const {
return Vector3(*this).abs();
}
inline Vector3 ceil() const {
return Vector3(*this).ceil();
}
inline Vector3 cross(const Vector3 &b) const {
return Vector3(*this).cross(b);
}
inline Vector3 linear_interpolate(const Vector3 &p_b, real_t p_t) const {
return Vector3(*this).linear_interpolate(p_b, p_t);
}
inline Vector3 cubic_interpolate(const Vector3 &b, const Vector3 &pre_a, const Vector3 &post_b, const real_t t) const {
return Vector3(*this).cubic_interpolate(b, pre_a, post_b, t);
}
inline Vector3 bounce(const Vector3 &p_normal) const {
return Vector3(*this).bounce(p_normal);
}
inline real_t length() const {
return Vector3(*this).length();
}
inline real_t length_squared() const {
return Vector3(*this).length_squared();
}
inline real_t distance_squared_to(const Vector3 &b) const {
return Vector3(*this).distance_squared_to(b);
}
inline real_t distance_to(const Vector3 &b) const {
return Vector3(*this).distance_to(b);
}
inline real_t dot(const Vector3 &b) const {
return Vector3(*this).dot(b);
}
inline real_t angle_to(const Vector3 &b) const {
return Vector3(*this).angle_to(b);
}
inline Vector3 floor() const {
return Vector3(*this).floor();
}
inline Vector3 inverse() const {
return Vector3(*this).inverse();
}
inline bool is_normalized() const {
return Vector3(*this).is_normalized();
}
inline Basis outer(const Vector3 &b) const {
return Vector3(*this).outer(b);
}
inline int max_axis() const {
return Vector3(*this).max_axis();
}
inline int min_axis() const {
return Vector3(*this).min_axis();
}
inline void normalize() {
Vector3 v = *this;
v.normalize();
*this = v;
}
inline Vector3 normalized() const {
return Vector3(*this).normalized();
}
inline Vector3 reflect(const Vector3 &by) const {
return Vector3(*this).reflect(by);
}
inline Vector3 rotated(const Vector3 &axis, const real_t phi) const {
return Vector3(*this).rotated(axis, phi);
}
inline void rotate(const Vector3 &p_axis, real_t p_phi) {
Vector3 v = *this;
v.rotate(p_axis, p_phi);
*this = v;
}
inline Vector3 slide(const Vector3 &by) const {
return Vector3(*this).slide(by);
}
inline void snap(real_t p_val) {
Vector3 v = *this;
v.snap(p_val);
*this = v;
}
inline Vector3 snapped(const float by) {
return Vector3(*this).snapped(by);
}
inline operator String() const {
return String(Vector3(*this));
}
};
public:
union {
ColumnVector3<0> x;
ColumnVector3<1> y;
ColumnVector3<2> z;
Vector3 elements[3]; // Not for direct access, use [] operator instead
};
inline Basis(const Basis &p_basis) {
elements[0] = p_basis.elements[0];
elements[1] = p_basis.elements[1];
elements[2] = p_basis.elements[2];
}
inline Basis &operator=(const Basis &p_basis) {
elements[0] = p_basis.elements[0];
elements[1] = p_basis.elements[1];
elements[2] = p_basis.elements[2];
return *this;
}
Basis(const Quat &p_quat); // euler
Basis(const Vector3 &p_euler); // euler
Basis(const Vector3 &p_axis, real_t p_phi);
Basis(const Vector3 &row0, const Vector3 &row1, const Vector3 &row2);
Basis(real_t xx, real_t xy, real_t xz, real_t yx, real_t yy, real_t yz, real_t zx, real_t zy, real_t zz);
Basis();
const Vector3 operator[](int axis) const {
return get_axis(axis);
}
ColumnVector3<0> &operator[](int axis) {
// We need to do a little pointer magic to get this to work, because the
// ColumnVector3 template takes the axis as a template parameter.
// Don't touch this unless you're sure what you're doing!
return (reinterpret_cast<Basis *>(reinterpret_cast<real_t *>(this) + axis))->x;
}
void invert();
bool isequal_approx(const Basis &a, const Basis &b) const;
bool is_orthogonal() const;
bool is_rotation() const;
void transpose();
Basis inverse() const;
Basis transposed() const;
real_t determinant() const;
Vector3 get_axis(int p_axis) const;
void set_axis(int p_axis, const Vector3 &p_value);
void rotate(const Vector3 &p_axis, real_t p_phi);
Basis rotated(const Vector3 &p_axis, real_t p_phi) const;
void scale(const Vector3 &p_scale);
Basis scaled(const Vector3 &p_scale) const;
Vector3 get_scale() const;
Basis slerp(Basis b, float t) const;
Vector3 get_euler_xyz() const;
void set_euler_xyz(const Vector3 &p_euler);
Vector3 get_euler_yxz() const;
void set_euler_yxz(const Vector3 &p_euler);
inline Vector3 get_euler() const { return get_euler_yxz(); }
inline void set_euler(const Vector3 &p_euler) { set_euler_yxz(p_euler); }
// transposed dot products
real_t tdotx(const Vector3 &v) const;
real_t tdoty(const Vector3 &v) const;
real_t tdotz(const Vector3 &v) const;
bool operator==(const Basis &p_matrix) const;
bool operator!=(const Basis &p_matrix) const;
Vector3 xform(const Vector3 &p_vector) const;
Vector3 xform_inv(const Vector3 &p_vector) const;
void operator*=(const Basis &p_matrix);
Basis operator*(const Basis &p_matrix) const;
void operator+=(const Basis &p_matrix);
Basis operator+(const Basis &p_matrix) const;
void operator-=(const Basis &p_matrix);
Basis operator-(const Basis &p_matrix) const;
void operator*=(real_t p_val);
Basis operator*(real_t p_val) const;
int get_orthogonal_index() const; // down below
void set_orthogonal_index(int p_index); // down below
operator String() const;
void get_axis_and_angle(Vector3 &r_axis, real_t &r_angle) const;
/* create / set */
void set(real_t xx, real_t xy, real_t xz, real_t yx, real_t yy, real_t yz, real_t zx, real_t zy, real_t zz);
Vector3 get_column(int i) const;
Vector3 get_row(int i) const;
Vector3 get_main_diagonal() const;
void set_row(int i, const Vector3 &p_row);
Basis transpose_xform(const Basis &m) const;
void orthonormalize();
Basis orthonormalized() const;
bool is_symmetric() const;
Basis diagonalize();
operator Quat() const;
};
} // namespace godot
#endif // BASIS_H

View File

@@ -0,0 +1,125 @@
#ifndef COLOR_H
#define COLOR_H
#include <gdnative/color.h>
#include <cmath>
#include "String.hpp"
namespace godot {
struct Color {
private:
// static float _parse_col(const String& p_str, int p_ofs);
public:
union {
struct {
float r;
float g;
float b;
float a;
};
float components[4];
};
inline bool operator==(const Color &p_color) const { return (r == p_color.r && g == p_color.g && b == p_color.b && a == p_color.a); }
inline bool operator!=(const Color &p_color) const { return (r != p_color.r || g != p_color.g || b != p_color.b || a != p_color.a); }
uint32_t to_32() const;
uint32_t to_ARGB32() const;
uint32_t to_ABGR32() const;
uint64_t to_ABGR64() const;
uint64_t to_ARGB64() const;
uint32_t to_RGBA32() const;
uint64_t to_RGBA64() const;
float gray() const;
uint8_t get_r8() const;
uint8_t get_g8() const;
uint8_t get_b8() const;
uint8_t get_a8() const;
float get_h() const;
float get_s() const;
float get_v() const;
void set_hsv(float p_h, float p_s, float p_v, float p_alpha = 1.0);
Color darkened(const float amount) const;
Color lightened(const float amount) const;
Color from_hsv(float p_h, float p_s, float p_v, float p_a = 1.0) const;
inline float &operator[](int idx) {
return components[idx];
}
inline const float &operator[](int idx) const {
return components[idx];
}
void invert();
void contrast();
Color inverted() const;
Color contrasted() const;
Color linear_interpolate(const Color &p_b, float p_t) const;
Color blend(const Color &p_over) const;
Color to_linear() const;
static Color hex(uint32_t p_hex);
static Color html(const String &p_color);
static bool html_is_valid(const String &p_color);
String to_html(bool p_alpha = true) const;
bool operator<(const Color &p_color) const; //used in set keys
operator String() const;
/**
* No construct parameters, r=0, g=0, b=0. a=255
*/
inline Color() {
r = 0;
g = 0;
b = 0;
a = 1.0;
}
/**
* RGB / RGBA construct parameters. Alpha is optional, but defaults to 1.0
*/
inline Color(float p_r, float p_g, float p_b, float p_a = 1.0) {
r = p_r;
g = p_g;
b = p_b;
a = p_a;
}
};
} // namespace godot
#endif // COLOR_H

View File

@@ -0,0 +1,26 @@
#ifndef CORETYPES_H
#define CORETYPES_H
#include "Defs.hpp"
#include "AABB.hpp"
#include "Array.hpp"
#include "Basis.hpp"
#include "Color.hpp"
#include "Dictionary.hpp"
#include "NodePath.hpp"
#include "Plane.hpp"
#include "PoolArrays.hpp"
#include "Quat.hpp"
#include "RID.hpp"
#include "Rect2.hpp"
#include "String.hpp"
#include "Transform.hpp"
#include "Transform2D.hpp"
#include "Variant.hpp"
#include "Vector2.hpp"
#include "Vector3.hpp"
#include "Wrapped.hpp"
#endif // CORETYPES_H

View File

@@ -0,0 +1,259 @@
#ifndef DEFS_H
#define DEFS_H
namespace godot {
enum class Error {
OK,
FAILED, ///< Generic fail error
ERR_UNAVAILABLE, ///< What is requested is unsupported/unavailable
ERR_UNCONFIGURED, ///< The object being used hasnt been properly set up yet
ERR_UNAUTHORIZED, ///< Missing credentials for requested resource
ERR_PARAMETER_RANGE_ERROR, ///< Parameter given out of range (5)
ERR_OUT_OF_MEMORY, ///< Out of memory
ERR_FILE_NOT_FOUND,
ERR_FILE_BAD_DRIVE,
ERR_FILE_BAD_PATH,
ERR_FILE_NO_PERMISSION, // (10)
ERR_FILE_ALREADY_IN_USE,
ERR_FILE_CANT_OPEN,
ERR_FILE_CANT_WRITE,
ERR_FILE_CANT_READ,
ERR_FILE_UNRECOGNIZED, // (15)
ERR_FILE_CORRUPT,
ERR_FILE_MISSING_DEPENDENCIES,
ERR_FILE_EOF,
ERR_CANT_OPEN, ///< Can't open a resource/socket/file
ERR_CANT_CREATE, // (20)
ERR_QUERY_FAILED,
ERR_ALREADY_IN_USE,
ERR_LOCKED, ///< resource is locked
ERR_TIMEOUT,
ERR_CANT_CONNECT, // (25)
ERR_CANT_RESOLVE,
ERR_CONNECTION_ERROR,
ERR_CANT_AQUIRE_RESOURCE,
ERR_CANT_FORK,
ERR_INVALID_DATA, ///< Data passed is invalid (30)
ERR_INVALID_PARAMETER, ///< Parameter passed is invalid
ERR_ALREADY_EXISTS, ///< When adding, item already exists
ERR_DOES_NOT_EXIST, ///< When retrieving/erasing, it item does not exist
ERR_DATABASE_CANT_READ, ///< database is full
ERR_DATABASE_CANT_WRITE, ///< database is full (35)
ERR_COMPILATION_FAILED,
ERR_METHOD_NOT_FOUND,
ERR_LINK_FAILED,
ERR_SCRIPT_FAILED,
ERR_CYCLIC_LINK, // (40)
ERR_INVALID_DECLARATION,
ERR_DUPLICATE_SYMBOL,
ERR_PARSE_ERROR,
ERR_BUSY,
ERR_SKIP, // (45)
ERR_HELP, ///< user requested help!!
ERR_BUG, ///< a bug in the software certainly happened, due to a double check failing or unexpected behavior.
ERR_PRINTER_ON_FIRE, /// the parallel port printer is engulfed in flames
ERR_OMFG_THIS_IS_VERY_VERY_BAD, ///< shit happens, has never been used, though
ERR_WTF = ERR_OMFG_THIS_IS_VERY_VERY_BAD ///< short version of the above
};
} // namespace godot
#include <GodotGlobal.hpp>
typedef float real_t;
#define CMP_EPSILON 0.00001
#define CMP_EPSILON2 (CMP_EPSILON * CMP_EPSILON)
#define Math_PI 3.14159265358979323846
#define _PLANE_EQ_DOT_EPSILON 0.999
#define _PLANE_EQ_D_EPSILON 0.0001
#ifdef __GNUC__
#define likely(x) __builtin_expect(!!(x), 1)
#define unlikely(x) __builtin_expect(!!(x), 0)
#else
#define likely(x) x
#define unlikely(x) x
#endif
// Don't use this directly; instead, use any of the CRASH_* macros
#ifdef _MSC_VER
#define GENERATE_TRAP \
__debugbreak(); \
/* Avoid warning about control paths */ \
for (;;) { \
}
#else
#define GENERATE_TRAP __builtin_trap();
#endif
// ERR/WARN macros
#ifndef WARN_PRINT
#define WARN_PRINT(msg) godot::Godot::print_warning(msg, __func__, __FILE__, __LINE__)
#endif
#ifndef WARN_PRINTS
#define WARN_PRINTS(msg) WARN_PRINT((msg).utf8().get_data())
#endif
#ifndef ERR_PRINT
#define ERR_PRINT(msg) godot::Godot::print_error(msg, __func__, __FILE__, __LINE__)
#endif
#ifndef ERR_PRINTS
#define ERR_PRINTS(msg) ERR_PRINT((msg).utf8().get_data())
#endif
#ifndef FATAL_PRINT
#define FATAL_PRINT(msg) ERR_PRINT(godot::String("FATAL: ") + (msg))
#endif
#ifndef ERR_MSG_INDEX
#define ERR_MSG_INDEX(index, size) (godot::String("Index ") + #index + "=" + godot::String::num_int64(index) + " out of size (" + #size + "=" + godot::String::num_int64(size) + ")")
#endif
#ifndef ERR_MSG_NULL
#define ERR_MSG_NULL(param) (godot::String("Parameter '") + #param + "' is null.")
#endif
#ifndef ERR_MSG_COND
#define ERR_MSG_COND(cond) (godot::String("Condition '") + #cond + "' is true.")
#endif
#ifndef ERR_FAIL_INDEX
#define ERR_FAIL_INDEX(index, size) \
do { \
if (unlikely((index) < 0 || (index) >= (size))) { \
ERR_PRINT(ERR_MSG_INDEX(index, size)); \
return; \
} \
} while (0)
#endif
#ifndef ERR_FAIL_INDEX_V
#define ERR_FAIL_INDEX_V(index, size, ret) \
do { \
if (unlikely((index) < 0 || (index) >= (size))) { \
ERR_PRINT(ERR_MSG_INDEX(index, size)); \
return ret; \
} \
} while (0)
#endif
#ifndef ERR_FAIL_UNSIGNED_INDEX_V
#define ERR_FAIL_UNSIGNED_INDEX_V(index, size, ret) \
do { \
if (unlikely((index) >= (size))) { \
ERR_PRINT(ERR_MSG_INDEX(index, size)); \
return ret; \
} \
} while (0)
#endif
#ifndef CRASH_BAD_INDEX
#define CRASH_BAD_INDEX(index, size) \
do { \
if (unlikely((index) < 0 || (index) >= (size))) { \
FATAL_PRINT(ERR_MSG_INDEX(index, size)); \
GENERATE_TRAP; \
} \
} while (0)
#endif
#ifndef ERR_FAIL_NULL
#define ERR_FAIL_NULL(param) \
do { \
if (unlikely(!param)) { \
ERR_PRINT(ERR_MSG_NULL(param)); \
return; \
} \
} while (0)
#endif
#ifndef ERR_FAIL_NULL_V
#define ERR_FAIL_NULL_V(param, ret) \
do { \
if (unlikely(!param)) { \
ERR_PRINT(ERR_MSG_NULL(param)); \
return ret; \
} \
} while (0)
#endif
#ifndef ERR_FAIL_COND
#define ERR_FAIL_COND(cond) \
do { \
if (unlikely(cond)) { \
ERR_PRINT(ERR_MSG_COND(cond)); \
return; \
} \
} while (0)
#endif
#ifndef CRASH_COND
#define CRASH_COND(cond) \
do { \
if (unlikely(cond)) { \
FATAL_PRINT(ERR_MSG_COND(cond)); \
return; \
} \
} while (0)
#endif
#ifndef ERR_FAIL_COND_V
#define ERR_FAIL_COND_V(cond, ret) \
do { \
if (unlikely(cond)) { \
ERR_PRINT(ERR_MSG_COND(cond)); \
return ret; \
} \
} while (0)
#endif
#ifndef ERR_CONTINUE
#define ERR_CONTINUE(cond) \
{ \
if (unlikely(cond)) { \
ERR_PRINT(ERR_MSG_COND(cond)); \
continue; \
} \
}
#endif
#ifndef ERR_BREAK
#define ERR_BREAK(cond) \
{ \
if (unlikely(cond)) { \
ERR_PRINT(ERR_MSG_COND(cond)); \
break; \
} \
}
#endif
#ifndef ERR_FAIL
#define ERR_FAIL() \
do { \
ERR_PRINT("Method/Function Failed."); \
return; \
} while (0)
#endif
#ifndef ERR_FAIL_V
#define ERR_FAIL_V(ret) \
do { \
ERR_PRINT("Method/Function Failed."); \
return ret; \
} while (0)
#endif
#ifndef CRASH_NOW
#define CRASH_NOW() \
do { \
FATAL_PRINT("Method/Function Failed."); \
GENERATE_TRAP; \
} while (0)
#endif
#endif // DEFS_H

View File

@@ -0,0 +1,54 @@
#ifndef DICTIONARY_H
#define DICTIONARY_H
#include "Variant.hpp"
#include "Array.hpp"
#include <gdnative/dictionary.h>
namespace godot {
class Dictionary {
godot_dictionary _godot_dictionary;
public:
Dictionary();
Dictionary(const Dictionary &other);
Dictionary &operator=(const Dictionary &other);
template <class... Args>
static Dictionary make(Args... args) {
return helpers::add_all(Dictionary(), args...);
}
void clear();
bool empty() const;
void erase(const Variant &key);
bool has(const Variant &key) const;
bool has_all(const Array &keys) const;
uint32_t hash() const;
Array keys() const;
Variant &operator[](const Variant &key);
const Variant &operator[](const Variant &key) const;
int size() const;
String to_json() const;
Array values() const;
~Dictionary();
};
} // namespace godot
#endif // DICTIONARY_H

View File

@@ -0,0 +1,472 @@
#ifndef GODOT_HPP
#define GODOT_HPP
#include <cstdlib>
#include <cstring>
#include <gdnative_api_struct.gen.h>
#include <nativescript/godot_nativescript.h>
#include <typeinfo>
#include "CoreTypes.hpp"
#include "Ref.hpp"
#include "TagDB.hpp"
#include "Variant.hpp"
#include "Object.hpp"
#include "GodotGlobal.hpp"
#include <GDNativeLibrary.hpp>
#include <NativeScript.hpp>
namespace godot {
template <class T>
T *as(const Object *obj) {
return (obj) ? (T *)godot::nativescript_api->godot_nativescript_get_userdata(obj->_owner) : nullptr;
}
template <class T>
T *get_wrapper(godot_object *obj) {
return (T *)godot::nativescript_1_1_api->godot_nativescript_get_instance_binding_data(godot::_RegisterState::language_index, obj);
}
#define GODOT_CLASS(Name, Base) \
\
public: \
inline static const char *___get_type_name() { return static_cast<const char *>(#Name); } \
enum { ___CLASS_IS_SCRIPT = 1, \
}; \
inline static Name *_new() { \
godot::NativeScript *script = godot::NativeScript::_new(); \
script->set_library(godot::get_wrapper<godot::GDNativeLibrary>((godot_object *)godot::gdnlib)); \
script->set_class_name(#Name); \
Name *instance = godot::as<Name>(script->new_()); \
return instance; \
} \
inline static size_t ___get_id() { return typeid(Name).hash_code(); } \
inline static size_t ___get_base_id() { return typeid(Base).hash_code(); } \
inline static const char *___get_base_type_name() { return Base::___get_class_name(); } \
inline static Object *___get_from_variant(godot::Variant a) { return (godot::Object *)godot::as<Name>(godot::Object::___get_from_variant(a)); } \
\
private:
#define GODOT_SUBCLASS(Name, Base) \
\
public: \
inline static const char *___get_type_name() { return static_cast<const char *>(#Name); } \
enum { ___CLASS_IS_SCRIPT = 1, \
}; \
inline static Name *_new() { \
godot::NativeScript *script = godot::NativeScript::_new(); \
script->set_library(godot::get_wrapper<godot::GDNativeLibrary>((godot_object *)godot::gdnlib)); \
script->set_class_name(#Name); \
Name *instance = godot::as<Name>(script->new_()); \
return instance; \
} \
inline static size_t ___get_id() { return typeid(Name).hash_code(); }; \
inline static size_t ___get_base_id() { return typeid(Base).hash_code(); }; \
inline static const char *___get_base_type_name() { return #Base; } \
inline static Object *___get_from_variant(godot::Variant a) { return (godot::Object *)godot::as<Name>(godot::Object::___get_from_variant(a)); } \
\
private:
template <class T>
struct _ArgCast {
static T _arg_cast(Variant a) {
return a;
}
};
template <class T>
struct _ArgCast<T *> {
static T *_arg_cast(Variant a) {
return (T *)T::___get_from_variant(a);
}
};
template <>
struct _ArgCast<Variant> {
static Variant _arg_cast(Variant a) {
return a;
}
};
// instance and destroy funcs
template <class T>
void *_godot_class_instance_func(godot_object *p, void *method_data) {
T *d = new T();
d->_owner = p;
d->_type_tag = typeid(T).hash_code();
d->_init();
return d;
}
template <class T>
void _godot_class_destroy_func(godot_object *p, void *method_data, void *data) {
T *d = (T *)data;
delete d;
}
template <class T>
void register_class() {
godot_instance_create_func create = {};
create.create_func = _godot_class_instance_func<T>;
godot_instance_destroy_func destroy = {};
destroy.destroy_func = _godot_class_destroy_func<T>;
_TagDB::register_type(T::___get_id(), T::___get_base_id());
godot::nativescript_api->godot_nativescript_register_class(godot::_RegisterState::nativescript_handle, T::___get_type_name(), T::___get_base_type_name(), create, destroy);
godot::nativescript_1_1_api->godot_nativescript_set_type_tag(godot::_RegisterState::nativescript_handle, T::___get_type_name(), (const void *)typeid(T).hash_code());
T::_register_methods();
}
template <class T>
void register_tool_class() {
godot_instance_create_func create = {};
create.create_func = _godot_class_instance_func<T>;
godot_instance_destroy_func destroy = {};
destroy.destroy_func = _godot_class_destroy_func<T>;
_TagDB::register_type(T::___get_id(), T::___get_base_id());
godot::nativescript_api->godot_nativescript_register_tool_class(godot::_RegisterState::nativescript_handle, T::___get_type_name(), T::___get_base_type_name(), create, destroy);
godot::nativescript_1_1_api->godot_nativescript_set_type_tag(godot::_RegisterState::nativescript_handle, T::___get_type_name(), (const void *)typeid(T).hash_code());
T::_register_methods();
}
// method registering
typedef godot_variant (*__godot_wrapper_method)(godot_object *, void *, void *, int, godot_variant **);
template <class T, class R, class... args>
const char *___get_method_class_name(R (T::*p)(args... a)) {
return T::___get_type_name();
}
template <class T, class R, class... args>
const char *___get_method_class_name(R (T::*p)(args... a) const) {
return T::___get_type_name();
}
// Okay, time for some template magic.
// Many thanks to manpat from the GDL Discord Server.
// This is stuff that's available in C++14 I think, but whatever.
template <int... I>
struct __Sequence {};
template <int N, int... I>
struct __construct_sequence {
using type = typename __construct_sequence<N - 1, N - 1, I...>::type;
};
template <int... I>
struct __construct_sequence<0, I...> {
using type = __Sequence<I...>;
};
// Now the wrapping part.
template <class T, class R, class... As>
struct _WrappedMethod {
R(T::*f)
(As...);
template <int... I>
void apply(Variant *ret, T *obj, Variant **args, __Sequence<I...>) {
*ret = (obj->*f)(_ArgCast<As>::_arg_cast(*args[I])...);
}
};
template <class T, class... As>
struct _WrappedMethod<T, void, As...> {
void (T::*f)(As...);
template <int... I>
void apply(Variant *ret, T *obj, Variant **args, __Sequence<I...>) {
(obj->*f)(_ArgCast<As>::_arg_cast(*args[I])...);
}
};
template <class T, class R, class... As>
godot_variant __wrapped_method(godot_object *, void *method_data, void *user_data, int num_args, godot_variant **args) {
godot_variant v;
godot::api->godot_variant_new_nil(&v);
T *obj = (T *)user_data;
_WrappedMethod<T, R, As...> *method = (_WrappedMethod<T, R, As...> *)method_data;
Variant *var = (Variant *)&v;
Variant **arg = (Variant **)args;
method->apply(var, obj, arg, typename __construct_sequence<sizeof...(As)>::type{});
return v;
}
template <class T, class R, class... As>
void *___make_wrapper_function(R (T::*f)(As...)) {
using MethodType = _WrappedMethod<T, R, As...>;
MethodType *p = (MethodType *)godot::api->godot_alloc(sizeof(MethodType));
p->f = f;
return (void *)p;
}
template <class T, class R, class... As>
__godot_wrapper_method ___get_wrapper_function(R (T::*f)(As...)) {
return (__godot_wrapper_method)&__wrapped_method<T, R, As...>;
}
template <class T, class R, class... A>
void *___make_wrapper_function(R (T::*f)(A...) const) {
return ___make_wrapper_function((R(T::*)(A...))f);
}
template <class T, class R, class... A>
__godot_wrapper_method ___get_wrapper_function(R (T::*f)(A...) const) {
return ___get_wrapper_function((R(T::*)(A...))f);
}
template <class M>
void register_method(const char *name, M method_ptr, godot_method_rpc_mode rpc_type = GODOT_METHOD_RPC_MODE_DISABLED) {
godot_instance_method method = {};
method.method_data = ___make_wrapper_function(method_ptr);
method.free_func = godot::api->godot_free;
method.method = (__godot_wrapper_method)___get_wrapper_function(method_ptr);
godot_method_attributes attr = {};
attr.rpc_type = rpc_type;
godot::nativescript_api->godot_nativescript_register_method(godot::_RegisterState::nativescript_handle, ___get_method_class_name(method_ptr), name, attr, method);
}
template <class T, class P>
struct _PropertySetFunc {
void (T::*f)(P);
static void _wrapped_setter(godot_object *object, void *method_data, void *user_data, godot_variant *value) {
_PropertySetFunc<T, P> *set_func = (_PropertySetFunc<T, P> *)method_data;
T *obj = (T *)user_data;
Variant *v = (Variant *)value;
(obj->*(set_func->f))(_ArgCast<P>::_arg_cast(*v));
}
};
template <class T, class P>
struct _PropertyGetFunc {
P(T::*f)
();
static godot_variant _wrapped_getter(godot_object *object, void *method_data, void *user_data) {
_PropertyGetFunc<T, P> *get_func = (_PropertyGetFunc<T, P> *)method_data;
T *obj = (T *)user_data;
godot_variant var;
godot::api->godot_variant_new_nil(&var);
Variant *v = (Variant *)&var;
*v = (obj->*(get_func->f))();
return var;
}
};
template <class T, class P>
struct _PropertyDefaultSetFunc {
P(T::*f);
static void _wrapped_setter(godot_object *object, void *method_data, void *user_data, godot_variant *value) {
_PropertyDefaultSetFunc<T, P> *set_func = (_PropertyDefaultSetFunc<T, P> *)method_data;
T *obj = (T *)user_data;
Variant *v = (Variant *)value;
(obj->*(set_func->f)) = _ArgCast<P>::_arg_cast(*v);
}
};
template <class T, class P>
struct _PropertyDefaultGetFunc {
P(T::*f);
static godot_variant _wrapped_getter(godot_object *object, void *method_data, void *user_data) {
_PropertyDefaultGetFunc<T, P> *get_func = (_PropertyDefaultGetFunc<T, P> *)method_data;
T *obj = (T *)user_data;
godot_variant var;
godot::api->godot_variant_new_nil(&var);
Variant *v = (Variant *)&var;
*v = (obj->*(get_func->f));
return var;
}
};
template <class T, class P>
void register_property(const char *name, P(T::*var), P default_value, godot_method_rpc_mode rpc_mode = GODOT_METHOD_RPC_MODE_DISABLED, godot_property_usage_flags usage = GODOT_PROPERTY_USAGE_DEFAULT, godot_property_hint hint = GODOT_PROPERTY_HINT_NONE, String hint_string = "") {
Variant def_val = default_value;
usage = (godot_property_usage_flags)((int)usage | GODOT_PROPERTY_USAGE_SCRIPT_VARIABLE);
if (def_val.get_type() == Variant::OBJECT) {
Object *o = get_wrapper<Object>(def_val.operator godot_object *());
if (o && o->is_class("Resource")) {
hint = (godot_property_hint)((int)hint | GODOT_PROPERTY_HINT_RESOURCE_TYPE);
hint_string = o->get_class();
}
}
godot_string *_hint_string = (godot_string *)&hint_string;
godot_property_attributes attr = {};
if (def_val.get_type() == Variant::NIL) {
attr.type = Variant::OBJECT;
} else {
attr.type = def_val.get_type();
attr.default_value = *(godot_variant *)&def_val;
}
attr.hint = hint;
attr.rset_type = rpc_mode;
attr.usage = usage;
attr.hint_string = *_hint_string;
_PropertyDefaultSetFunc<T, P> *wrapped_set = (_PropertyDefaultSetFunc<T, P> *)godot::api->godot_alloc(sizeof(_PropertyDefaultSetFunc<T, P>));
wrapped_set->f = var;
_PropertyDefaultGetFunc<T, P> *wrapped_get = (_PropertyDefaultGetFunc<T, P> *)godot::api->godot_alloc(sizeof(_PropertyDefaultGetFunc<T, P>));
wrapped_get->f = var;
godot_property_set_func set_func = {};
set_func.method_data = (void *)wrapped_set;
set_func.free_func = godot::api->godot_free;
set_func.set_func = &_PropertyDefaultSetFunc<T, P>::_wrapped_setter;
godot_property_get_func get_func = {};
get_func.method_data = (void *)wrapped_get;
get_func.free_func = godot::api->godot_free;
get_func.get_func = &_PropertyDefaultGetFunc<T, P>::_wrapped_getter;
godot::nativescript_api->godot_nativescript_register_property(godot::_RegisterState::nativescript_handle, T::___get_type_name(), name, &attr, set_func, get_func);
}
template <class T, class P>
void register_property(const char *name, void (T::*setter)(P), P (T::*getter)(), P default_value, godot_method_rpc_mode rpc_mode = GODOT_METHOD_RPC_MODE_DISABLED, godot_property_usage_flags usage = GODOT_PROPERTY_USAGE_DEFAULT, godot_property_hint hint = GODOT_PROPERTY_HINT_NONE, String hint_string = "") {
Variant def_val = default_value;
godot_string *_hint_string = (godot_string *)&hint_string;
godot_property_attributes attr = {};
if (def_val.get_type() == Variant::NIL) {
attr.type = Variant::OBJECT;
} else {
attr.type = def_val.get_type();
attr.default_value = *(godot_variant *)&def_val;
}
attr.hint = hint;
attr.rset_type = rpc_mode;
attr.usage = usage;
attr.hint_string = *_hint_string;
_PropertySetFunc<T, P> *wrapped_set = (_PropertySetFunc<T, P> *)godot::api->godot_alloc(sizeof(_PropertySetFunc<T, P>));
wrapped_set->f = setter;
_PropertyGetFunc<T, P> *wrapped_get = (_PropertyGetFunc<T, P> *)godot::api->godot_alloc(sizeof(_PropertyGetFunc<T, P>));
wrapped_get->f = getter;
godot_property_set_func set_func = {};
set_func.method_data = (void *)wrapped_set;
set_func.free_func = godot::api->godot_free;
set_func.set_func = &_PropertySetFunc<T, P>::_wrapped_setter;
godot_property_get_func get_func = {};
get_func.method_data = (void *)wrapped_get;
get_func.free_func = godot::api->godot_free;
get_func.get_func = &_PropertyGetFunc<T, P>::_wrapped_getter;
godot::nativescript_api->godot_nativescript_register_property(godot::_RegisterState::nativescript_handle, T::___get_type_name(), name, &attr, set_func, get_func);
}
template <class T, class P>
void register_property(const char *name, void (T::*setter)(P), P (T::*getter)() const, P default_value, godot_method_rpc_mode rpc_mode = GODOT_METHOD_RPC_MODE_DISABLED, godot_property_usage_flags usage = GODOT_PROPERTY_USAGE_DEFAULT, godot_property_hint hint = GODOT_PROPERTY_HINT_NONE, String hint_string = "") {
register_property(name, setter, (P(T::*)())getter, default_value, rpc_mode, usage, hint, hint_string);
}
template <class T>
void register_signal(String name, Dictionary args = Dictionary()) {
godot_signal signal = {};
signal.name = *(godot_string *)&name;
signal.num_args = args.size();
signal.num_default_args = 0;
// Need to check because malloc(0) is platform-dependent. Zero arguments will leave args to nullptr.
if (signal.num_args != 0) {
signal.args = (godot_signal_argument *)godot::api->godot_alloc(sizeof(godot_signal_argument) * signal.num_args);
memset((void *)signal.args, 0, sizeof(godot_signal_argument) * signal.num_args);
}
for (int i = 0; i < signal.num_args; i++) {
// Array entry = args[i];
// String name = entry[0];
String name = args.keys()[i];
godot_string *_key = (godot_string *)&name;
godot::api->godot_string_new_copy(&signal.args[i].name, _key);
// if (entry.size() > 1) {
// signal.args[i].type = entry[1];
// }
signal.args[i].type = args.values()[i];
}
godot::nativescript_api->godot_nativescript_register_signal(godot::_RegisterState::nativescript_handle, T::___get_type_name(), &signal);
for (int i = 0; i < signal.num_args; i++) {
godot::api->godot_string_destroy(&signal.args[i].name);
}
if (signal.args) {
godot::api->godot_free(signal.args);
}
}
template <class T, class... Args>
void register_signal(String name, Args... varargs) {
register_signal<T>(name, Dictionary::make(varargs...));
}
#ifndef GODOT_CPP_NO_OBJECT_CAST
template <class T>
T *Object::cast_to(const Object *obj) {
if (!obj)
return nullptr;
size_t have_tag = (size_t)godot::nativescript_1_1_api->godot_nativescript_get_type_tag(obj->_owner);
if (have_tag) {
if (!godot::_TagDB::is_type_known((size_t)have_tag)) {
have_tag = 0;
}
}
if (!have_tag) {
have_tag = obj->_type_tag;
}
if (godot::_TagDB::is_type_compatible(typeid(T).hash_code(), have_tag)) {
return (T::___CLASS_IS_SCRIPT) ? godot::as<T>(obj) : (T *)obj;
} else {
return nullptr;
}
}
#endif
} // namespace godot
#endif // GODOT_H

View File

@@ -0,0 +1,52 @@
#ifndef GODOT_GLOBAL_HPP
#define GODOT_GLOBAL_HPP
#include "Array.hpp"
#include "String.hpp"
#include <gdnative_api_struct.gen.h>
namespace godot {
extern "C" const godot_gdnative_core_api_struct *api;
extern "C" const godot_gdnative_core_1_1_api_struct *core_1_1_api;
extern "C" const godot_gdnative_core_1_2_api_struct *core_1_2_api;
extern "C" const godot_gdnative_ext_nativescript_api_struct *nativescript_api;
extern "C" const godot_gdnative_ext_nativescript_1_1_api_struct *nativescript_1_1_api;
extern "C" const godot_gdnative_ext_pluginscript_api_struct *pluginscript_api;
extern "C" const godot_gdnative_ext_android_api_struct *android_api;
extern "C" const godot_gdnative_ext_arvr_api_struct *arvr_api;
extern "C" const godot_gdnative_ext_videodecoder_api_struct *videodecoder_api;
extern "C" const godot_gdnative_ext_net_api_struct *net_api;
extern "C" const godot_gdnative_ext_net_3_2_api_struct *net_3_2_api;
extern "C" const void *gdnlib;
class Godot {
public:
static void print(const String &message);
static void print_warning(const String &description, const String &function, const String &file, int line);
static void print_error(const String &description, const String &function, const String &file, int line);
static void gdnative_init(godot_gdnative_init_options *o);
static void gdnative_terminate(godot_gdnative_terminate_options *o);
static void nativescript_init(void *handle);
static void nativescript_terminate(void *handle);
static void gdnative_profiling_add_data(const char *p_signature, uint64_t p_time);
template <class... Args>
static void print(const String &fmt, Args... values) {
print(fmt.format(Array::make(values...)));
}
};
struct _RegisterState {
static void *nativescript_handle;
static int language_index;
};
} // namespace godot
#endif

View File

@@ -0,0 +1,34 @@
#ifndef GODOT_PROFILING_HPP
#define GODOT_PROFILING_HPP
#include "OS.hpp"
namespace godot {
class FunctionProfiling {
char signature[1024];
uint64_t ticks;
public:
FunctionProfiling(const char *p_function, const int p_line) {
snprintf(signature, 1024, "::%d::%s", p_line, p_function);
ticks = OS::get_singleton()->get_ticks_usec();
}
~FunctionProfiling() {
uint64_t t = OS::get_singleton()->get_ticks_usec() - ticks;
if (t > 0) {
Godot::gdnative_profiling_add_data(signature, t);
}
}
};
}
#ifdef DEBUG_ENABLED
#define GODOT_PROFILING_FUNCTION FunctionProfiling __function_profiling(__FUNCTION__, __LINE__);
#else
#define GODOT_PROFILING_FUNCTION
#endif
#endif

View File

@@ -0,0 +1,49 @@
#ifndef NODEPATH_H
#define NODEPATH_H
#include "String.hpp"
#include <gdnative/node_path.h>
namespace godot {
class NodePath {
godot_node_path _node_path;
public:
NodePath();
NodePath(const NodePath &other);
NodePath(const String &from);
NodePath(const char *contents);
String get_name(const int idx) const;
int get_name_count() const;
String get_subname(const int idx) const;
int get_subname_count() const;
bool is_absolute() const;
bool is_empty() const;
NodePath get_as_property_path() const;
String get_concatenated_subnames() const;
operator String() const;
void operator=(const NodePath &other);
bool operator==(const NodePath &other);
~NodePath();
};
} // namespace godot
#endif // NODEPATH_H

View File

@@ -0,0 +1,68 @@
#ifndef PLANE_H
#define PLANE_H
#include "Vector3.hpp"
#include <cmath>
namespace godot {
enum ClockDirection {
CLOCKWISE,
COUNTERCLOCKWISE
};
class Plane {
public:
Vector3 normal;
real_t d;
void set_normal(const Vector3 &p_normal);
inline Vector3 get_normal() const { return normal; } ///Point is coplanar, CMP_EPSILON for precision
void normalize();
Plane normalized() const;
/* Plane-Point operations */
inline Vector3 center() const { return normal * d; }
Vector3 get_any_point() const;
Vector3 get_any_perpendicular_normal() const;
bool is_point_over(const Vector3 &p_point) const; ///< Point is over plane
real_t distance_to(const Vector3 &p_point) const;
bool has_point(const Vector3 &p_point, real_t _epsilon = CMP_EPSILON) const;
/* intersections */
bool intersect_3(const Plane &p_plane1, const Plane &p_plane2, Vector3 *r_result = 0) const;
bool intersects_ray(Vector3 p_from, Vector3 p_dir, Vector3 *p_intersection) const;
bool intersects_segment(Vector3 p_begin, Vector3 p_end, Vector3 *p_intersection) const;
Vector3 project(const Vector3 &p_point) const;
/* misc */
inline Plane operator-() const { return Plane(-normal, -d); }
bool is_almost_like(const Plane &p_plane) const;
bool operator==(const Plane &p_plane) const;
bool operator!=(const Plane &p_plane) const;
operator String() const;
inline Plane() { d = 0; }
inline Plane(real_t p_a, real_t p_b, real_t p_c, real_t p_d) :
normal(p_a, p_b, p_c),
d(p_d) {}
Plane(const Vector3 &p_normal, real_t p_d);
Plane(const Vector3 &p_point, const Vector3 &p_normal);
Plane(const Vector3 &p_point1, const Vector3 &p_point2, const Vector3 &p_point3, ClockDirection p_dir = CLOCKWISE);
};
} // namespace godot
#endif // PLANE_H

View File

@@ -0,0 +1,700 @@
#ifndef POOLARRAYS_H
#define POOLARRAYS_H
#include "Defs.hpp"
#include "Color.hpp"
#include "GodotGlobal.hpp"
#include "String.hpp"
#include "Vector2.hpp"
#include "Vector3.hpp"
#include <gdnative/pool_arrays.h>
namespace godot {
class Array;
class PoolByteArray {
godot_pool_byte_array _godot_array;
public:
class Read {
friend class PoolByteArray;
godot_pool_byte_array_read_access *_read_access;
public:
inline Read() {
_read_access = nullptr;
}
inline Read(const Read &p_other) {
_read_access = godot::api->godot_pool_byte_array_read_access_copy(p_other._read_access);
}
inline ~Read() {
godot::api->godot_pool_byte_array_read_access_destroy(_read_access);
}
inline const uint8_t *ptr() const {
return godot::api->godot_pool_byte_array_read_access_ptr(_read_access);
}
inline const uint8_t &operator[](int p_idx) const {
return ptr()[p_idx];
}
inline void operator=(const Read &p_other) {
godot::api->godot_pool_byte_array_read_access_operator_assign(_read_access, p_other._read_access);
}
};
class Write {
friend class PoolByteArray;
godot_pool_byte_array_write_access *_write_access;
public:
inline Write() {
_write_access = nullptr;
}
inline Write(const Write &p_other) {
_write_access = godot::api->godot_pool_byte_array_write_access_copy(p_other._write_access);
}
inline ~Write() {
godot::api->godot_pool_byte_array_write_access_destroy(_write_access);
}
inline uint8_t *ptr() const {
return godot::api->godot_pool_byte_array_write_access_ptr(_write_access);
}
inline uint8_t &operator[](int p_idx) const {
return ptr()[p_idx];
}
inline void operator=(const Write &p_other) {
godot::api->godot_pool_byte_array_write_access_operator_assign(_write_access, p_other._write_access);
}
};
PoolByteArray();
PoolByteArray(const PoolByteArray &p_other);
PoolByteArray &operator=(const PoolByteArray &p_other);
PoolByteArray(const Array &array);
Read read() const;
Write write();
void append(const uint8_t data);
void append_array(const PoolByteArray &array);
int insert(const int idx, const uint8_t data);
void invert();
void push_back(const uint8_t data);
void remove(const int idx);
void resize(const int size);
void set(const int idx, const uint8_t data);
uint8_t operator[](const int idx);
int size() const;
~PoolByteArray();
};
class PoolIntArray {
godot_pool_int_array _godot_array;
public:
class Read {
friend class PoolIntArray;
godot_pool_int_array_read_access *_read_access;
public:
inline Read() {
_read_access = nullptr;
}
inline Read(const Read &p_other) {
_read_access = godot::api->godot_pool_int_array_read_access_copy(p_other._read_access);
}
inline ~Read() {
godot::api->godot_pool_int_array_read_access_destroy(_read_access);
}
inline const int *ptr() const {
return godot::api->godot_pool_int_array_read_access_ptr(_read_access);
}
inline const int &operator[](int p_idx) const {
return ptr()[p_idx];
}
inline void operator=(const Read &p_other) {
godot::api->godot_pool_int_array_read_access_operator_assign(_read_access, p_other._read_access);
}
};
class Write {
friend class PoolIntArray;
godot_pool_int_array_write_access *_write_access;
public:
inline Write() {
_write_access = nullptr;
}
inline Write(const Write &p_other) {
_write_access = godot::api->godot_pool_int_array_write_access_copy(p_other._write_access);
}
inline ~Write() {
godot::api->godot_pool_int_array_write_access_destroy(_write_access);
}
inline int *ptr() const {
return godot::api->godot_pool_int_array_write_access_ptr(_write_access);
}
inline int &operator[](int p_idx) const {
return ptr()[p_idx];
}
inline void operator=(const Write &p_other) {
godot::api->godot_pool_int_array_write_access_operator_assign(_write_access, p_other._write_access);
}
};
PoolIntArray();
PoolIntArray(const PoolIntArray &p_other);
PoolIntArray &operator=(const PoolIntArray &p_other);
PoolIntArray(const Array &array);
Read read() const;
Write write();
void append(const int data);
void append_array(const PoolIntArray &array);
int insert(const int idx, const int data);
void invert();
void push_back(const int data);
void remove(const int idx);
void resize(const int size);
void set(const int idx, const int data);
int operator[](const int idx);
int size() const;
~PoolIntArray();
};
class PoolRealArray {
godot_pool_real_array _godot_array;
public:
class Read {
friend class PoolRealArray;
godot_pool_real_array_read_access *_read_access;
public:
inline Read() {
_read_access = nullptr;
}
inline Read(const Read &p_other) {
_read_access = godot::api->godot_pool_real_array_read_access_copy(p_other._read_access);
}
inline ~Read() {
godot::api->godot_pool_real_array_read_access_destroy(_read_access);
}
inline const real_t *ptr() const {
return godot::api->godot_pool_real_array_read_access_ptr(_read_access);
}
inline const real_t &operator[](int p_idx) const {
return ptr()[p_idx];
}
inline void operator=(const Read &p_other) {
godot::api->godot_pool_real_array_read_access_operator_assign(_read_access, p_other._read_access);
}
};
class Write {
friend class PoolRealArray;
godot_pool_real_array_write_access *_write_access;
public:
inline Write() {
_write_access = nullptr;
}
inline Write(const Write &p_other) {
_write_access = godot::api->godot_pool_real_array_write_access_copy(p_other._write_access);
}
inline ~Write() {
godot::api->godot_pool_real_array_write_access_destroy(_write_access);
}
inline real_t *ptr() const {
return godot::api->godot_pool_real_array_write_access_ptr(_write_access);
}
inline real_t &operator[](int p_idx) const {
return ptr()[p_idx];
}
inline void operator=(const Write &p_other) {
godot::api->godot_pool_real_array_write_access_operator_assign(_write_access, p_other._write_access);
}
};
PoolRealArray();
PoolRealArray(const PoolRealArray &p_other);
PoolRealArray &operator=(const PoolRealArray &p_other);
PoolRealArray(const Array &array);
Read read() const;
Write write();
void append(const real_t data);
void append_array(const PoolRealArray &array);
int insert(const int idx, const real_t data);
void invert();
void push_back(const real_t data);
void remove(const int idx);
void resize(const int size);
void set(const int idx, const real_t data);
real_t operator[](const int idx);
int size() const;
~PoolRealArray();
};
class PoolStringArray {
godot_pool_string_array _godot_array;
public:
class Read {
friend class PoolStringArray;
godot_pool_string_array_read_access *_read_access;
public:
inline Read() {
_read_access = nullptr;
}
inline Read(const Read &p_other) {
_read_access = godot::api->godot_pool_string_array_read_access_copy(p_other._read_access);
}
inline ~Read() {
godot::api->godot_pool_string_array_read_access_destroy(_read_access);
}
inline const String *ptr() const {
return (const String *)godot::api->godot_pool_string_array_read_access_ptr(_read_access);
}
inline const String &operator[](int p_idx) const {
return ptr()[p_idx];
}
inline void operator=(const Read &p_other) {
godot::api->godot_pool_string_array_read_access_operator_assign(_read_access, p_other._read_access);
}
};
class Write {
friend class PoolStringArray;
godot_pool_string_array_write_access *_write_access;
public:
inline Write() {
_write_access = nullptr;
}
inline Write(const Write &p_other) {
_write_access = godot::api->godot_pool_string_array_write_access_copy(p_other._write_access);
}
inline ~Write() {
godot::api->godot_pool_string_array_write_access_destroy(_write_access);
}
inline String *ptr() const {
return (String *)godot::api->godot_pool_string_array_write_access_ptr(_write_access);
}
inline String &operator[](int p_idx) const {
return ptr()[p_idx];
}
inline void operator=(const Write &p_other) {
godot::api->godot_pool_string_array_write_access_operator_assign(_write_access, p_other._write_access);
}
};
PoolStringArray();
PoolStringArray(const PoolStringArray &p_other);
PoolStringArray &operator=(const PoolStringArray &p_other);
PoolStringArray(const Array &array);
Read read() const;
Write write();
void append(const String &data);
void append_array(const PoolStringArray &array);
int insert(const int idx, const String &data);
void invert();
void push_back(const String &data);
void remove(const int idx);
void resize(const int size);
void set(const int idx, const String &data);
const String operator[](const int idx);
int size() const;
~PoolStringArray();
};
class PoolVector2Array {
godot_pool_vector2_array _godot_array;
public:
class Read {
friend class PoolVector2Array;
godot_pool_vector2_array_read_access *_read_access;
public:
inline Read() {
_read_access = nullptr;
}
inline Read(const Read &p_other) {
_read_access = godot::api->godot_pool_vector2_array_read_access_copy(p_other._read_access);
}
inline ~Read() {
godot::api->godot_pool_vector2_array_read_access_destroy(_read_access);
}
inline const Vector2 *ptr() const {
return (const Vector2 *)godot::api->godot_pool_vector2_array_read_access_ptr(_read_access);
}
inline const Vector2 &operator[](int p_idx) const {
return ptr()[p_idx];
}
inline void operator=(const Read &p_other) {
godot::api->godot_pool_vector2_array_read_access_operator_assign(_read_access, p_other._read_access);
}
};
class Write {
friend class PoolVector2Array;
godot_pool_vector2_array_write_access *_write_access;
public:
inline Write() {
_write_access = nullptr;
}
inline Write(const Write &p_other) {
_write_access = godot::api->godot_pool_vector2_array_write_access_copy(p_other._write_access);
}
inline ~Write() {
godot::api->godot_pool_vector2_array_write_access_destroy(_write_access);
}
inline Vector2 *ptr() const {
return (Vector2 *)godot::api->godot_pool_vector2_array_write_access_ptr(_write_access);
}
inline Vector2 &operator[](int p_idx) const {
return ptr()[p_idx];
}
inline void operator=(const Write &p_other) {
godot::api->godot_pool_vector2_array_write_access_operator_assign(_write_access, p_other._write_access);
}
};
PoolVector2Array();
PoolVector2Array(const PoolVector2Array &p_other);
PoolVector2Array &operator=(const PoolVector2Array &p_other);
PoolVector2Array(const Array &array);
Read read() const;
Write write();
void append(const Vector2 &data);
void append_array(const PoolVector2Array &array);
int insert(const int idx, const Vector2 &data);
void invert();
void push_back(const Vector2 &data);
void remove(const int idx);
void resize(const int size);
void set(const int idx, const Vector2 &data);
const Vector2 operator[](const int idx);
int size() const;
~PoolVector2Array();
};
class PoolVector3Array {
godot_pool_vector3_array _godot_array;
public:
class Read {
friend class PoolVector3Array;
godot_pool_vector3_array_read_access *_read_access;
public:
inline Read() {
_read_access = nullptr;
}
inline Read(const Read &p_other) {
_read_access = godot::api->godot_pool_vector3_array_read_access_copy(p_other._read_access);
}
inline ~Read() {
godot::api->godot_pool_vector3_array_read_access_destroy(_read_access);
}
inline const Vector3 *ptr() const {
return (const Vector3 *)godot::api->godot_pool_vector3_array_read_access_ptr(_read_access);
}
inline const Vector3 &operator[](int p_idx) const {
return ptr()[p_idx];
}
inline void operator=(const Read &p_other) {
godot::api->godot_pool_vector3_array_read_access_operator_assign(_read_access, p_other._read_access);
}
};
class Write {
friend class PoolVector3Array;
godot_pool_vector3_array_write_access *_write_access;
public:
inline Write() {
_write_access = nullptr;
}
inline Write(const Write &p_other) {
_write_access = godot::api->godot_pool_vector3_array_write_access_copy(p_other._write_access);
}
inline ~Write() {
godot::api->godot_pool_vector3_array_write_access_destroy(_write_access);
}
inline Vector3 *ptr() const {
return (Vector3 *)godot::api->godot_pool_vector3_array_write_access_ptr(_write_access);
}
inline Vector3 &operator[](int p_idx) const {
return ptr()[p_idx];
}
inline void operator=(const Write &p_other) {
godot::api->godot_pool_vector3_array_write_access_operator_assign(_write_access, p_other._write_access);
}
};
PoolVector3Array();
PoolVector3Array(const PoolVector3Array &p_other);
PoolVector3Array &operator=(const PoolVector3Array &p_other);
PoolVector3Array(const Array &array);
Read read() const;
Write write();
void append(const Vector3 &data);
void append_array(const PoolVector3Array &array);
int insert(const int idx, const Vector3 &data);
void invert();
void push_back(const Vector3 &data);
void remove(const int idx);
void resize(const int size);
void set(const int idx, const Vector3 &data);
const Vector3 operator[](const int idx);
int size() const;
~PoolVector3Array();
};
class PoolColorArray {
godot_pool_color_array _godot_array;
public:
class Read {
friend class PoolColorArray;
godot_pool_color_array_read_access *_read_access;
public:
inline Read() {
_read_access = nullptr;
}
inline Read(const Read &p_other) {
_read_access = godot::api->godot_pool_color_array_read_access_copy(p_other._read_access);
}
inline ~Read() {
godot::api->godot_pool_color_array_read_access_destroy(_read_access);
}
inline const Color *ptr() const {
return (const Color *)godot::api->godot_pool_color_array_read_access_ptr(_read_access);
}
inline const Color &operator[](int p_idx) const {
return ptr()[p_idx];
}
inline void operator=(const Read &p_other) {
godot::api->godot_pool_color_array_read_access_operator_assign(_read_access, p_other._read_access);
}
};
class Write {
friend class PoolColorArray;
godot_pool_color_array_write_access *_write_access;
public:
inline Write() {
_write_access = nullptr;
}
inline Write(const Write &p_other) {
_write_access = godot::api->godot_pool_color_array_write_access_copy(p_other._write_access);
}
inline ~Write() {
godot::api->godot_pool_color_array_write_access_destroy(_write_access);
}
inline Color *ptr() const {
return (Color *)godot::api->godot_pool_color_array_write_access_ptr(_write_access);
}
inline Color &operator[](int p_idx) const {
return ptr()[p_idx];
}
inline void operator=(const Write &p_other) {
godot::api->godot_pool_color_array_write_access_operator_assign(_write_access, p_other._write_access);
}
};
PoolColorArray();
PoolColorArray(const PoolColorArray &p_other);
PoolColorArray &operator=(const PoolColorArray &p_other);
PoolColorArray(const Array &array);
Read read() const;
Write write();
void append(const Color &data);
void append_array(const PoolColorArray &array);
int insert(const int idx, const Color &data);
void invert();
void push_back(const Color &data);
void remove(const int idx);
void resize(const int size);
void set(const int idx, const Color &data);
const Color operator[](const int idx);
int size() const;
~PoolColorArray();
};
} // namespace godot
#endif // POOLARRAYS_H

View File

@@ -0,0 +1,93 @@
#ifndef QUAT_H
#define QUAT_H
#include <cmath>
#include "Vector3.hpp"
// #include "Basis.h"
namespace godot {
class Quat {
public:
real_t x, y, z, w;
real_t length_squared() const;
real_t length() const;
void normalize();
Quat normalized() const;
bool is_normalized() const;
Quat inverse() const;
void set_euler_xyz(const Vector3 &p_euler);
Vector3 get_euler_xyz() const;
void set_euler_yxz(const Vector3 &p_euler);
Vector3 get_euler_yxz() const;
inline void set_euler(const Vector3 &p_euler) { set_euler_yxz(p_euler); }
inline Vector3 get_euler() const { return get_euler_yxz(); }
real_t dot(const Quat &q) const;
Quat slerp(const Quat &q, const real_t &t) const;
Quat slerpni(const Quat &q, const real_t &t) const;
Quat cubic_slerp(const Quat &q, const Quat &prep, const Quat &postq, const real_t &t) const;
void get_axis_and_angle(Vector3 &r_axis, real_t &r_angle) const;
void set_axis_angle(const Vector3 &axis, const float angle);
void operator*=(const Quat &q);
Quat operator*(const Quat &q) const;
Quat operator*(const Vector3 &v) const;
Vector3 xform(const Vector3 &v) const;
void operator+=(const Quat &q);
void operator-=(const Quat &q);
void operator*=(const real_t &s);
void operator/=(const real_t &s);
Quat operator+(const Quat &q2) const;
Quat operator-(const Quat &q2) const;
Quat operator-() const;
Quat operator*(const real_t &s) const;
Quat operator/(const real_t &s) const;
bool operator==(const Quat &p_quat) const;
bool operator!=(const Quat &p_quat) const;
operator String() const;
inline void set(real_t p_x, real_t p_y, real_t p_z, real_t p_w) {
x = p_x;
y = p_y;
z = p_z;
w = p_w;
}
inline Quat(real_t p_x, real_t p_y, real_t p_z, real_t p_w) {
x = p_x;
y = p_y;
z = p_z;
w = p_w;
}
Quat(const Vector3 &axis, const real_t &angle);
Quat(const Vector3 &v0, const Vector3 &v1);
inline Quat() {
x = y = z = 0;
w = 1;
}
};
} // namespace godot
#endif // QUAT_H

View File

@@ -0,0 +1,35 @@
#ifndef RID_H
#define RID_H
#include <gdnative/rid.h>
namespace godot {
class Object;
class RID {
godot_rid _godot_rid;
public:
RID();
RID(Object *p);
int32_t get_rid() const;
inline bool is_valid() const {
// is_valid() is not available in the C API...
return *this != RID();
}
bool operator==(const RID &p_other) const;
bool operator!=(const RID &p_other) const;
bool operator<(const RID &p_other) const;
bool operator>(const RID &p_other) const;
bool operator<=(const RID &p_other) const;
bool operator>=(const RID &p_other) const;
};
} // namespace godot
#endif // RID_H

View File

@@ -0,0 +1,135 @@
#ifndef RECT2_H
#define RECT2_H
#include "Vector2.hpp"
#include <cmath>
#include <cstdlib>
namespace godot {
class String;
typedef Vector2 Size2;
typedef Vector2 Point2;
struct Transform2D;
struct Rect2 {
Point2 position;
Size2 size;
inline const Vector2 &get_position() const { return position; }
inline void set_position(const Vector2 &p_position) { position = p_position; }
inline const Vector2 &get_size() const { return size; }
inline void set_size(const Vector2 &p_size) { size = p_size; }
inline real_t get_area() const { return size.width * size.height; }
inline bool intersects(const Rect2 &p_rect) const {
if (position.x >= (p_rect.position.x + p_rect.size.width))
return false;
if ((position.x + size.width) <= p_rect.position.x)
return false;
if (position.y >= (p_rect.position.y + p_rect.size.height))
return false;
if ((position.y + size.height) <= p_rect.position.y)
return false;
return true;
}
real_t distance_to(const Vector2 &p_point) const;
bool intersects_transformed(const Transform2D &p_xform, const Rect2 &p_rect) const;
bool intersects_segment(const Point2 &p_from, const Point2 &p_to, Point2 *r_position = nullptr, Point2 *r_normal = nullptr) const;
inline bool encloses(const Rect2 &p_rect) const {
return (p_rect.position.x >= position.x) && (p_rect.position.y >= position.y) &&
((p_rect.position.x + p_rect.size.x) < (position.x + size.x)) &&
((p_rect.position.y + p_rect.size.y) < (position.y + size.y));
}
inline bool has_no_area() const {
return (size.x <= 0 || size.y <= 0);
}
Rect2 clip(const Rect2 &p_rect) const;
Rect2 merge(const Rect2 &p_rect) const;
inline bool has_point(const Point2 &p_point) const {
if (p_point.x < position.x)
return false;
if (p_point.y < position.y)
return false;
if (p_point.x >= (position.x + size.x))
return false;
if (p_point.y >= (position.y + size.y))
return false;
return true;
}
inline bool no_area() const { return (size.width <= 0 || size.height <= 0); }
inline bool operator==(const Rect2 &p_rect) const { return position == p_rect.position && size == p_rect.size; }
inline bool operator!=(const Rect2 &p_rect) const { return position != p_rect.position || size != p_rect.size; }
inline Rect2 grow(real_t p_by) const {
Rect2 g = *this;
g.position.x -= p_by;
g.position.y -= p_by;
g.size.width += p_by * 2;
g.size.height += p_by * 2;
return g;
}
inline Rect2 expand(const Vector2 &p_vector) const {
Rect2 r = *this;
r.expand_to(p_vector);
return r;
}
inline void expand_to(const Vector2 &p_vector) { //in place function for speed
Vector2 begin = position;
Vector2 end = position + size;
if (p_vector.x < begin.x)
begin.x = p_vector.x;
if (p_vector.y < begin.y)
begin.y = p_vector.y;
if (p_vector.x > end.x)
end.x = p_vector.x;
if (p_vector.y > end.y)
end.y = p_vector.y;
position = begin;
size = end - begin;
}
operator String() const;
inline Rect2() {}
inline Rect2(real_t p_x, real_t p_y, real_t p_width, real_t p_height) {
position = Point2(p_x, p_y);
size = Size2(p_width, p_height);
}
inline Rect2(const Point2 &p_position, const Size2 &p_size) {
position = p_position;
size = p_size;
}
};
} // namespace godot
#endif // RECT2_H

View File

@@ -0,0 +1,214 @@
#ifndef REF_H
#define REF_H
#include "GodotGlobal.hpp"
#include "Reference.hpp"
#include "Variant.hpp"
namespace godot {
// Replicates Godot's Ref<T> behavior
// Rewritten from f5234e70be7dec4930c2d5a0e829ff480d044b1d.
template <class T>
class Ref {
T *reference = nullptr;
void ref(const Ref &p_from) {
if (p_from.reference == reference)
return;
unref();
reference = p_from.reference;
if (reference)
reference->reference();
}
void ref_pointer(T *p_ref) {
ERR_FAIL_COND(!p_ref);
if (p_ref->init_ref())
reference = p_ref;
}
public:
inline bool operator<(const Ref<T> &p_r) const {
return reference < p_r.reference;
}
inline bool operator==(const Ref<T> &p_r) const {
return reference == p_r.reference;
}
inline bool operator!=(const Ref<T> &p_r) const {
return reference != p_r.reference;
}
inline T *operator->() {
return reference;
}
inline T *operator*() {
return reference;
}
inline const T *operator->() const {
return reference;
}
inline const T *ptr() const {
return reference;
}
inline T *ptr() {
return reference;
}
inline const T *operator*() const {
return reference;
}
operator Variant() const {
// Note: the C API handles the cases where the object is a Reference,
// so the Variant will be correctly constructed with a RefPtr engine-side
return Variant((Object *)reference);
}
void operator=(const Ref &p_from) {
ref(p_from);
}
template <class T_Other>
void operator=(const Ref<T_Other> &p_from) {
// TODO We need a safe cast
Reference *refb = const_cast<Reference *>(static_cast<const Reference *>(p_from.ptr()));
if (!refb) {
unref();
return;
}
Ref r;
//r.reference = Object::cast_to<T>(refb);
r.reference = (T *)refb;
ref(r);
r.reference = nullptr;
}
void operator=(const Variant &p_variant) {
// TODO We need a safe cast
Reference *refb = (Reference *)T::___get_from_variant(p_variant);
if (!refb) {
unref();
return;
}
Ref r;
// TODO We need a safe cast
//r.reference = Object::cast_to<T>(refb);
r.reference = (T *)refb;
ref(r);
r.reference = nullptr;
}
Ref(const Ref &p_from) {
reference = nullptr;
ref(p_from);
}
template <class T_Other>
Ref(const Ref<T_Other> &p_from) {
reference = nullptr;
// TODO We need a safe cast
Reference *refb = const_cast<Reference *>(static_cast<const Reference *>(p_from.ptr()));
if (!refb) {
unref();
return;
}
Ref r;
// TODO We need a safe cast
//r.reference = Object::cast_to<T>(refb);
r.reference = (T *)refb;
ref(r);
r.reference = nullptr;
}
Ref(T *p_reference) {
if (p_reference)
ref_pointer(p_reference);
else
reference = nullptr;
}
Ref(const Variant &p_variant) {
reference = nullptr;
// TODO We need a safe cast
Reference *refb = (Reference *)T::___get_from_variant(p_variant);
if (!refb) {
unref();
return;
}
Ref r;
// TODO We need a safe cast
//r.reference = Object::cast_to<T>(refb);
r.reference = (T *)refb;
ref(r);
r.reference = nullptr;
}
inline bool is_valid() const { return reference != nullptr; }
inline bool is_null() const { return reference == nullptr; }
void unref() {
//TODO this should be moved to mutexes, since this engine does not really
// do a lot of referencing on references and stuff
// mutexes will avoid more crashes?
if (reference && reference->unreference()) {
//memdelete(reference);
reference->free();
}
reference = nullptr;
}
void instance() {
//ref(memnew(T));
ref(T::_new());
}
Ref() {
reference = nullptr;
}
~Ref() {
unref();
}
// Used exclusively in the bindings to recreate the Ref Godot encapsulates in return values,
// without adding to the refcount.
inline static Ref<T> __internal_constructor(Object *obj) {
Ref<T> r;
r.reference = (T *)obj;
return r;
}
};
} // namespace godot
#endif

View File

@@ -0,0 +1,147 @@
#ifndef STRING_H
#define STRING_H
#include <gdnative/string.h>
namespace godot {
class NodePath;
class Variant;
class PoolByteArray;
class PoolIntArray;
class PoolRealArray;
class PoolStringArray;
class String;
class CharString {
friend class String;
godot_char_string _char_string;
public:
~CharString();
int length() const;
const char *get_data() const;
};
class String {
godot_string _godot_string;
public:
String();
String(const char *contents);
String(const wchar_t *contents);
String(const wchar_t c);
String(const String &other);
~String();
static String num(double p_num, int p_decimals = -1);
static String num_scientific(double p_num);
static String num_real(double p_num);
static String num_int64(int64_t p_num, int base = 10, bool capitalize_hex = false);
static String chr(godot_char_type p_char);
static String md5(const uint8_t *p_md5);
static String hex_encode_buffer(const uint8_t *p_buffer, int p_len);
wchar_t &operator[](const int idx);
wchar_t operator[](const int idx) const;
void operator=(const String &s);
bool operator==(const String &s) const;
bool operator!=(const String &s) const;
String operator+(const String &s) const;
void operator+=(const String &s);
void operator+=(const wchar_t c);
bool operator<(const String &s) const;
bool operator<=(const String &s) const;
bool operator>(const String &s) const;
bool operator>=(const String &s) const;
operator NodePath() const;
int length() const;
const wchar_t *unicode_str() const;
char *alloc_c_string() const;
CharString utf8() const;
CharString ascii(bool p_extended = false) const;
bool begins_with(String &s) const;
bool begins_with_char_array(const char *p_char_array) const;
PoolStringArray bigrams() const;
String c_escape() const;
String c_unescape() const;
String capitalize() const;
bool empty() const;
bool ends_with(String &text) const;
void erase(int position, int chars);
int find(String what, int from = 0) const;
int find_last(String what) const;
int findn(String what, int from = 0) const;
String format(Variant values) const;
String format(Variant values, String placeholder) const;
String get_base_dir() const;
String get_basename() const;
String get_extension() const;
String get_file() const;
int hash() const;
int hex_to_int() const;
String insert(int position, String what) const;
bool is_abs_path() const;
bool is_rel_path() const;
bool is_subsequence_of(String text) const;
bool is_subsequence_ofi(String text) const;
bool is_valid_float() const;
bool is_valid_html_color() const;
bool is_valid_identifier() const;
bool is_valid_integer() const;
bool is_valid_ip_address() const;
String json_escape() const;
String left(int position) const;
bool match(String expr) const;
bool matchn(String expr) const;
PoolByteArray md5_buffer() const;
String md5_text() const;
int ord_at(int at) const;
String pad_decimals(int digits) const;
String pad_zeros(int digits) const;
String percent_decode() const;
String percent_encode() const;
String plus_file(String file) const;
String replace(String what, String forwhat) const;
String replacen(String what, String forwhat) const;
int rfind(String what, int from = -1) const;
int rfindn(String what, int from = -1) const;
String right(int position) const;
PoolByteArray sha256_buffer() const;
String sha256_text() const;
float similarity(String text) const;
PoolStringArray split(String divisor, bool allow_empty = true) const;
PoolIntArray split_ints(String divisor, bool allow_empty = true) const;
PoolRealArray split_floats(String divisor, bool allow_empty = true) const;
String strip_edges(bool left = true, bool right = true) const;
String substr(int from, int len) const;
float to_float() const;
int64_t to_int() const;
String to_lower() const;
String to_upper() const;
String xml_escape() const;
String xml_unescape() const;
signed char casecmp_to(String p_str) const;
signed char nocasecmp_to(String p_str) const;
signed char naturalnocasecmp_to(String p_str) const;
String dedent() const;
PoolStringArray rsplit(const String &divisor, const bool allow_empty = true, const int maxsplit = 0) const;
String rstrip(const String &chars) const;
String trim_prefix(const String &prefix) const;
String trim_suffix(const String &suffix) const;
};
String operator+(const char *a, const String &b);
String operator+(const wchar_t *a, const String &b);
} // namespace godot
#endif // STRING_H

View File

@@ -0,0 +1,19 @@
#ifndef TAGDB_HPP
#define TAGDB_HPP
#include <stddef.h>
namespace godot {
namespace _TagDB {
void register_type(size_t type_tag, size_t base_type_tag);
bool is_type_known(size_t type_tag);
void register_global_type(const char *name, size_t type_tag, size_t base_type_tag);
bool is_type_compatible(size_t type_tag, size_t base_type_tag);
} // namespace _TagDB
} // namespace godot
#endif // TAGDB_HPP

View File

@@ -0,0 +1,86 @@
#ifndef TRANSFORM_H
#define TRANSFORM_H
#include "Basis.hpp"
#include "AABB.hpp"
#include "Plane.hpp"
namespace godot {
class Transform {
public:
Basis basis;
Vector3 origin;
void invert();
Transform inverse() const;
void affine_invert();
Transform affine_inverse() const;
Transform rotated(const Vector3 &p_axis, real_t p_phi) const;
void rotate(const Vector3 &p_axis, real_t p_phi);
void rotate_basis(const Vector3 &p_axis, real_t p_phi);
void set_look_at(const Vector3 &p_eye, const Vector3 &p_target, const Vector3 &p_up);
Transform looking_at(const Vector3 &p_target, const Vector3 &p_up) const;
void scale(const Vector3 &p_scale);
Transform scaled(const Vector3 &p_scale) const;
void scale_basis(const Vector3 &p_scale);
void translate(real_t p_tx, real_t p_ty, real_t p_tz);
void translate(const Vector3 &p_translation);
Transform translated(const Vector3 &p_translation) const;
inline const Basis &get_basis() const { return basis; }
inline void set_basis(const Basis &p_basis) { basis = p_basis; }
inline const Vector3 &get_origin() const { return origin; }
inline void set_origin(const Vector3 &p_origin) { origin = p_origin; }
void orthonormalize();
Transform orthonormalized() const;
bool operator==(const Transform &p_transform) const;
bool operator!=(const Transform &p_transform) const;
Vector3 xform(const Vector3 &p_vector) const;
Vector3 xform_inv(const Vector3 &p_vector) const;
Plane xform(const Plane &p_plane) const;
Plane xform_inv(const Plane &p_plane) const;
AABB xform(const AABB &p_aabb) const;
AABB xform_inv(const AABB &p_aabb) const;
void operator*=(const Transform &p_transform);
Transform operator*(const Transform &p_transform) const;
inline Vector3 operator*(const Vector3 &p_vector) const {
return Vector3(
basis.elements[0].dot(p_vector) + origin.x,
basis.elements[1].dot(p_vector) + origin.y,
basis.elements[2].dot(p_vector) + origin.z);
}
Transform interpolate_with(const Transform &p_transform, real_t p_c) const;
Transform inverse_xform(const Transform &t) const;
void set(real_t xx, real_t xy, real_t xz, real_t yx, real_t yy, real_t yz, real_t zx, real_t zy, real_t zz, real_t tx, real_t ty, real_t tz);
operator String() const;
inline Transform(real_t xx, real_t xy, real_t xz, real_t yx, real_t yy, real_t yz, real_t zx, real_t zy, real_t zz, real_t tx, real_t ty, real_t tz) {
set(xx, xy, xz, yx, yy, yz, zx, zy, zz, tx, ty, tz);
}
Transform(const Basis &p_basis, const Vector3 &p_origin = Vector3());
inline Transform() {}
};
} // namespace godot
#endif // TRANSFORM_H

View File

@@ -0,0 +1,102 @@
#ifndef TRANSFORM2D_H
#define TRANSFORM2D_H
#include "Vector2.hpp"
namespace godot {
typedef Vector2 Size2;
struct Rect2;
struct Transform2D {
// Warning #1: basis of Transform2D is stored differently from Basis. In terms of elements array, the basis matrix looks like "on paper":
// M = (elements[0][0] elements[1][0])
// (elements[0][1] elements[1][1])
// This is such that the columns, which can be interpreted as basis vectors of the coordinate system "painted" on the object, can be accessed as elements[i].
// Note that this is the opposite of the indices in mathematical texts, meaning: $M_{12}$ in a math book corresponds to elements[1][0] here.
// This requires additional care when working with explicit indices.
// See https://en.wikipedia.org/wiki/Row-_and_column-major_order for further reading.
// Warning #2: 2D be aware that unlike 3D code, 2D code uses a left-handed coordinate system: Y-axis points down,
// and angle is measure from +X to +Y in a clockwise-fashion.
Vector2 elements[3];
inline real_t tdotx(const Vector2 &v) const { return elements[0][0] * v.x + elements[1][0] * v.y; }
inline real_t tdoty(const Vector2 &v) const { return elements[0][1] * v.x + elements[1][1] * v.y; }
inline const Vector2 &operator[](int p_idx) const { return elements[p_idx]; }
inline Vector2 &operator[](int p_idx) { return elements[p_idx]; }
inline Vector2 get_axis(int p_axis) const {
ERR_FAIL_INDEX_V(p_axis, 3, Vector2());
return elements[p_axis];
}
inline void set_axis(int p_axis, const Vector2 &p_vec) {
ERR_FAIL_INDEX(p_axis, 3);
elements[p_axis] = p_vec;
}
void invert();
Transform2D inverse() const;
void affine_invert();
Transform2D affine_inverse() const;
void set_rotation(real_t p_phi);
real_t get_rotation() const;
void set_rotation_and_scale(real_t p_phi, const Size2 &p_scale);
void rotate(real_t p_phi);
void scale(const Size2 &p_scale);
void scale_basis(const Size2 &p_scale);
void translate(real_t p_tx, real_t p_ty);
void translate(const Vector2 &p_translation);
real_t basis_determinant() const;
Size2 get_scale() const;
inline const Vector2 &get_origin() const { return elements[2]; }
inline void set_origin(const Vector2 &p_origin) { elements[2] = p_origin; }
Transform2D scaled(const Size2 &p_scale) const;
Transform2D basis_scaled(const Size2 &p_scale) const;
Transform2D translated(const Vector2 &p_offset) const;
Transform2D rotated(real_t p_phi) const;
Transform2D untranslated() const;
void orthonormalize();
Transform2D orthonormalized() const;
bool operator==(const Transform2D &p_transform) const;
bool operator!=(const Transform2D &p_transform) const;
void operator*=(const Transform2D &p_transform);
Transform2D operator*(const Transform2D &p_transform) const;
Transform2D interpolate_with(const Transform2D &p_transform, real_t p_c) const;
Vector2 basis_xform(const Vector2 &p_vec) const;
Vector2 basis_xform_inv(const Vector2 &p_vec) const;
Vector2 xform(const Vector2 &p_vec) const;
Vector2 xform_inv(const Vector2 &p_vec) const;
Rect2 xform(const Rect2 &p_vec) const;
Rect2 xform_inv(const Rect2 &p_vec) const;
operator String() const;
Transform2D(real_t xx, real_t xy, real_t yx, real_t yy, real_t ox, real_t oy);
Transform2D(real_t p_rot, const Vector2 &p_pos);
inline Transform2D() {
elements[0][0] = 1.0;
elements[1][1] = 1.0;
}
};
} // namespace godot
#endif // TRANSFORM2D_H

View File

@@ -0,0 +1,269 @@
#ifndef VARIANT_H
#define VARIANT_H
#include <gdnative/variant.h>
#include "Defs.hpp"
#include "AABB.hpp"
#include "Basis.hpp"
#include "Color.hpp"
#include "NodePath.hpp"
#include "Plane.hpp"
#include "PoolArrays.hpp"
#include "Quat.hpp"
#include "RID.hpp"
#include "Rect2.hpp"
#include "String.hpp"
#include "Transform.hpp"
#include "Transform2D.hpp"
#include "Vector2.hpp"
#include "Vector3.hpp"
#include <iostream>
namespace godot {
class Dictionary;
class Array;
class Variant {
godot_variant _godot_variant;
public:
enum Type {
NIL,
// atomic types
BOOL,
INT,
REAL,
STRING,
// math types
VECTOR2, // 5
RECT2,
VECTOR3,
TRANSFORM2D,
PLANE,
QUAT, // 10
RECT3, //sorry naming convention fail :( not like it's used often
BASIS,
TRANSFORM,
// misc types
COLOR,
NODE_PATH, // 15
_RID,
OBJECT,
DICTIONARY,
ARRAY,
// arrays
POOL_BYTE_ARRAY, // 20
POOL_INT_ARRAY,
POOL_REAL_ARRAY,
POOL_STRING_ARRAY,
POOL_VECTOR2_ARRAY,
POOL_VECTOR3_ARRAY, // 25
POOL_COLOR_ARRAY,
VARIANT_MAX
};
enum Operator {
//comparation
OP_EQUAL,
OP_NOT_EQUAL,
OP_LESS,
OP_LESS_EQUAL,
OP_GREATER,
OP_GREATER_EQUAL,
//mathematic
OP_ADD,
OP_SUBSTRACT,
OP_MULTIPLY,
OP_DIVIDE,
OP_NEGATE,
OP_POSITIVE,
OP_MODULE,
OP_STRING_CONCAT,
//bitwise
OP_SHIFT_LEFT,
OP_SHIFT_RIGHT,
OP_BIT_AND,
OP_BIT_OR,
OP_BIT_XOR,
OP_BIT_NEGATE,
//logic
OP_AND,
OP_OR,
OP_XOR,
OP_NOT,
//containment
OP_IN,
OP_MAX
};
Variant();
Variant(const Variant &v);
Variant(bool p_bool);
Variant(signed int p_int);
Variant(unsigned int p_int);
Variant(signed short p_short);
inline Variant(unsigned short p_short) :
Variant((unsigned int)p_short) {}
inline Variant(signed char p_char) :
Variant((signed int)p_char) {}
inline Variant(unsigned char p_char) :
Variant((unsigned int)p_char) {}
Variant(int64_t p_char);
Variant(uint64_t p_char);
Variant(float p_float);
Variant(double p_double);
Variant(const String &p_string);
Variant(const char *const p_cstring);
Variant(const wchar_t *p_wstring);
Variant(const Vector2 &p_vector2);
Variant(const Rect2 &p_rect2);
Variant(const Vector3 &p_vector3);
Variant(const Plane &p_plane);
Variant(const AABB &p_aabb);
Variant(const Quat &p_quat);
Variant(const Basis &p_transform);
Variant(const Transform2D &p_transform);
Variant(const Transform &p_transform);
Variant(const Color &p_color);
Variant(const NodePath &p_path);
Variant(const RID &p_rid);
Variant(const Object *p_object);
Variant(const Dictionary &p_dictionary);
Variant(const Array &p_array);
Variant(const PoolByteArray &p_raw_array);
Variant(const PoolIntArray &p_int_array);
Variant(const PoolRealArray &p_real_array);
Variant(const PoolStringArray &p_string_array);
Variant(const PoolVector2Array &p_vector2_array);
Variant(const PoolVector3Array &p_vector3_array);
Variant(const PoolColorArray &p_color_array);
Variant &operator=(const Variant &v);
operator bool() const;
operator signed int() const;
operator unsigned int() const;
operator signed short() const;
operator unsigned short() const;
operator signed char() const;
operator unsigned char() const;
operator int64_t() const;
operator uint64_t() const;
operator wchar_t() const;
operator float() const;
operator double() const;
operator String() const;
operator Vector2() const;
operator Rect2() const;
operator Vector3() const;
operator Plane() const;
operator AABB() const;
operator Quat() const;
operator Basis() const;
operator Transform() const;
operator Transform2D() const;
operator Color() const;
operator NodePath() const;
operator RID() const;
operator godot_object *() const;
template <typename T> operator T*() const { return static_cast<T*>(T::___get_from_variant(*this)); }
operator Dictionary() const;
operator Array() const;
operator PoolByteArray() const;
operator PoolIntArray() const;
operator PoolRealArray() const;
operator PoolStringArray() const;
operator PoolVector2Array() const;
operator PoolVector3Array() const;
operator PoolColorArray() const;
Type get_type() const;
Variant call(const String &method, const Variant **args, const int arg_count);
bool has_method(const String &method);
bool operator==(const Variant &b) const;
bool operator!=(const Variant &b) const;
bool operator<(const Variant &b) const;
bool operator<=(const Variant &b) const;
bool operator>(const Variant &b) const;
bool operator>=(const Variant &b) const;
bool hash_compare(const Variant &b) const;
bool booleanize() const;
~Variant();
};
} // namespace godot
#endif // VARIANT_H

View File

@@ -0,0 +1,232 @@
#ifndef VECTOR2_H
#define VECTOR2_H
#include <gdnative/vector2.h>
#include "Defs.hpp"
#include <cmath>
namespace godot {
class String;
struct Vector2 {
union {
real_t x;
real_t width;
};
union {
real_t y;
real_t height;
};
inline Vector2(real_t p_x, real_t p_y) {
x = p_x;
y = p_y;
}
inline Vector2() {
x = 0;
y = 0;
}
inline real_t &operator[](int p_idx) {
return p_idx ? y : x;
}
inline const real_t &operator[](int p_idx) const {
return p_idx ? y : x;
}
inline Vector2 operator+(const Vector2 &p_v) const {
return Vector2(x + p_v.x, y + p_v.y);
}
inline void operator+=(const Vector2 &p_v) {
x += p_v.x;
y += p_v.y;
}
inline Vector2 operator-(const Vector2 &p_v) const {
return Vector2(x - p_v.x, y - p_v.y);
}
inline void operator-=(const Vector2 &p_v) {
x -= p_v.x;
y -= p_v.y;
}
inline Vector2 operator*(const Vector2 &p_v1) const {
return Vector2(x * p_v1.x, y * p_v1.y);
}
inline Vector2 operator*(const real_t &rvalue) const {
return Vector2(x * rvalue, y * rvalue);
}
inline void operator*=(const real_t &rvalue) {
x *= rvalue;
y *= rvalue;
}
inline void operator*=(const Vector2 &rvalue) {
*this = *this * rvalue;
}
inline Vector2 operator/(const Vector2 &p_v1) const {
return Vector2(x / p_v1.x, y / p_v1.y);
}
inline Vector2 operator/(const real_t &rvalue) const {
return Vector2(x / rvalue, y / rvalue);
}
inline void operator/=(const real_t &rvalue) {
x /= rvalue;
y /= rvalue;
}
inline Vector2 operator-() const {
return Vector2(-x, -y);
}
bool operator==(const Vector2 &p_vec2) const;
bool operator!=(const Vector2 &p_vec2) const;
inline bool operator<(const Vector2 &p_vec2) const { return (x == p_vec2.x) ? (y < p_vec2.y) : (x < p_vec2.x); }
inline bool operator<=(const Vector2 &p_vec2) const { return (x == p_vec2.x) ? (y <= p_vec2.y) : (x <= p_vec2.x); }
inline void normalize() {
real_t l = x * x + y * y;
if (l != 0) {
l = sqrt(l);
x /= l;
y /= l;
}
}
inline Vector2 normalized() const {
Vector2 v = *this;
v.normalize();
return v;
}
inline real_t length() const {
return sqrt(x * x + y * y);
}
inline real_t length_squared() const {
return x * x + y * y;
}
inline real_t distance_to(const Vector2 &p_vector2) const {
return sqrt((x - p_vector2.x) * (x - p_vector2.x) + (y - p_vector2.y) * (y - p_vector2.y));
}
inline real_t distance_squared_to(const Vector2 &p_vector2) const {
return (x - p_vector2.x) * (x - p_vector2.x) + (y - p_vector2.y) * (y - p_vector2.y);
}
inline real_t angle_to(const Vector2 &p_vector2) const {
return atan2(cross(p_vector2), dot(p_vector2));
}
inline real_t angle_to_point(const Vector2 &p_vector2) const {
return atan2(y - p_vector2.y, x - p_vector2.x);
}
inline real_t dot(const Vector2 &p_other) const {
return x * p_other.x + y * p_other.y;
}
inline real_t cross(const Vector2 &p_other) const {
return x * p_other.y - y * p_other.x;
}
inline Vector2 cross(real_t p_other) const {
return Vector2(p_other * y, -p_other * x);
}
Vector2 project(const Vector2 &p_vec) const;
Vector2 plane_project(real_t p_d, const Vector2 &p_vec) const;
Vector2 clamped(real_t p_len) const;
static inline Vector2 linear_interpolate(const Vector2 &p_a, const Vector2 &p_b, real_t p_t) {
Vector2 res = p_a;
res.x += (p_t * (p_b.x - p_a.x));
res.y += (p_t * (p_b.y - p_a.y));
return res;
}
inline Vector2 linear_interpolate(const Vector2 &p_b, real_t p_t) const {
Vector2 res = *this;
res.x += (p_t * (p_b.x - x));
res.y += (p_t * (p_b.y - y));
return res;
}
Vector2 cubic_interpolate(const Vector2 &p_b, const Vector2 &p_pre_a, const Vector2 &p_post_b, real_t p_t) const;
inline Vector2 slide(const Vector2 &p_vec) const {
return p_vec - *this * this->dot(p_vec);
}
inline Vector2 bounce(const Vector2 &p_normal) const {
return -reflect(p_normal);
}
inline Vector2 reflect(const Vector2 &p_vec) const {
return p_vec - *this * this->dot(p_vec) * 2.0;
}
inline real_t angle() const {
return atan2(y, x);
}
inline void set_rotation(real_t p_radians) {
x = cosf(p_radians);
y = sinf(p_radians);
}
inline Vector2 abs() const {
return Vector2(fabs(x), fabs(y));
}
inline Vector2 rotated(real_t p_by) const {
Vector2 v;
v.set_rotation(angle() + p_by);
v *= length();
return v;
}
inline Vector2 tangent() const {
return Vector2(y, -x);
}
inline Vector2 floor() const {
return Vector2(::floor(x), ::floor(y));
}
inline Vector2 snapped(const Vector2 &p_by) const {
return Vector2(
p_by.x != 0 ? ::floor(x / p_by.x + 0.5) * p_by.x : x,
p_by.y != 0 ? ::floor(y / p_by.y + 0.5) * p_by.y : y);
}
inline real_t aspect() const { return width / height; }
operator String() const;
};
inline Vector2 operator*(real_t p_scalar, const Vector2 &p_vec) {
return p_vec * p_scalar;
}
} // namespace godot
#endif // VECTOR2_H

View File

@@ -0,0 +1,279 @@
#ifndef VECTOR3_H
#define VECTOR3_H
#include <gdnative/vector3.h>
#include "Defs.hpp"
#include "String.hpp"
#include <cmath>
namespace godot {
class Basis;
struct Vector3 {
enum Axis {
AXIS_X,
AXIS_Y,
AXIS_Z,
};
union {
struct {
real_t x;
real_t y;
real_t z;
};
real_t coord[3]; // Not for direct access, use [] operator instead
};
inline Vector3(real_t x, real_t y, real_t z) {
this->x = x;
this->y = y;
this->z = z;
}
inline Vector3() {
this->x = 0;
this->y = 0;
this->z = 0;
}
inline const real_t &operator[](int p_axis) const {
return coord[p_axis];
}
inline real_t &operator[](int p_axis) {
return coord[p_axis];
}
inline Vector3 &operator+=(const Vector3 &p_v) {
x += p_v.x;
y += p_v.y;
z += p_v.z;
return *this;
}
inline Vector3 operator+(const Vector3 &p_v) const {
Vector3 v = *this;
v += p_v;
return v;
}
inline Vector3 &operator-=(const Vector3 &p_v) {
x -= p_v.x;
y -= p_v.y;
z -= p_v.z;
return *this;
}
inline Vector3 operator-(const Vector3 &p_v) const {
Vector3 v = *this;
v -= p_v;
return v;
}
inline Vector3 &operator*=(const Vector3 &p_v) {
x *= p_v.x;
y *= p_v.y;
z *= p_v.z;
return *this;
}
inline Vector3 operator*(const Vector3 &p_v) const {
Vector3 v = *this;
v *= p_v;
return v;
}
inline Vector3 &operator/=(const Vector3 &p_v) {
x /= p_v.x;
y /= p_v.y;
z /= p_v.z;
return *this;
}
inline Vector3 operator/(const Vector3 &p_v) const {
Vector3 v = *this;
v /= p_v;
return v;
}
inline Vector3 &operator*=(real_t p_scalar) {
*this *= Vector3(p_scalar, p_scalar, p_scalar);
return *this;
}
inline Vector3 operator*(real_t p_scalar) const {
Vector3 v = *this;
v *= p_scalar;
return v;
}
inline Vector3 &operator/=(real_t p_scalar) {
*this /= Vector3(p_scalar, p_scalar, p_scalar);
return *this;
}
inline Vector3 operator/(real_t p_scalar) const {
Vector3 v = *this;
v /= p_scalar;
return v;
}
inline Vector3 operator-() const {
return Vector3(-x, -y, -z);
}
inline bool operator==(const Vector3 &p_v) const {
return (x == p_v.x && y == p_v.y && z == p_v.z);
}
inline bool operator!=(const Vector3 &p_v) const {
return (x != p_v.x || y != p_v.y || z != p_v.z);
}
bool operator<(const Vector3 &p_v) const;
bool operator<=(const Vector3 &p_v) const;
inline Vector3 abs() const {
return Vector3(::fabs(x), ::fabs(y), ::fabs(z));
}
inline Vector3 ceil() const {
return Vector3(::ceil(x), ::ceil(y), ::ceil(z));
}
inline Vector3 cross(const Vector3 &b) const {
Vector3 ret(
(y * b.z) - (z * b.y),
(z * b.x) - (x * b.z),
(x * b.y) - (y * b.x));
return ret;
}
inline Vector3 linear_interpolate(const Vector3 &p_b, real_t p_t) const {
return Vector3(
x + (p_t * (p_b.x - x)),
y + (p_t * (p_b.y - y)),
z + (p_t * (p_b.z - z)));
}
Vector3 cubic_interpolate(const Vector3 &b, const Vector3 &pre_a, const Vector3 &post_b, const real_t t) const;
Vector3 bounce(const Vector3 &p_normal) const {
return -reflect(p_normal);
}
inline real_t length() const {
real_t x2 = x * x;
real_t y2 = y * y;
real_t z2 = z * z;
return ::sqrt(x2 + y2 + z2);
}
inline real_t length_squared() const {
real_t x2 = x * x;
real_t y2 = y * y;
real_t z2 = z * z;
return x2 + y2 + z2;
}
inline real_t distance_squared_to(const Vector3 &b) const {
return (b - *this).length_squared();
}
inline real_t distance_to(const Vector3 &b) const {
return (b - *this).length();
}
inline real_t dot(const Vector3 &b) const {
return x * b.x + y * b.y + z * b.z;
}
inline real_t angle_to(const Vector3 &b) const {
return std::atan2(cross(b).length(), dot(b));
}
inline Vector3 floor() const {
return Vector3(::floor(x), ::floor(y), ::floor(z));
}
inline Vector3 inverse() const {
return Vector3(1.f / x, 1.f / y, 1.f / z);
}
inline bool is_normalized() const {
return std::abs(length_squared() - 1.f) < 0.00001f;
}
Basis outer(const Vector3 &b) const;
int max_axis() const;
int min_axis() const;
inline void normalize() {
real_t l = length();
if (l == 0) {
x = y = z = 0;
} else {
x /= l;
y /= l;
z /= l;
}
}
inline Vector3 normalized() const {
Vector3 v = *this;
v.normalize();
return v;
}
inline Vector3 reflect(const Vector3 &by) const {
return by - *this * this->dot(by) * 2.f;
}
inline Vector3 rotated(const Vector3 &axis, const real_t phi) const {
Vector3 v = *this;
v.rotate(axis, phi);
return v;
}
void rotate(const Vector3 &p_axis, real_t p_phi);
inline Vector3 slide(const Vector3 &by) const {
return by - *this * this->dot(by);
}
void snap(real_t p_val);
inline Vector3 snapped(const float by) {
Vector3 v = *this;
v.snap(by);
return v;
}
operator String() const;
};
inline Vector3 operator*(real_t p_scalar, const Vector3 &p_vec) {
return p_vec * p_scalar;
}
inline Vector3 vec3_cross(const Vector3 &p_a, const Vector3 &p_b) {
return p_a.cross(p_b);
}
} // namespace godot
#endif // VECTOR3_H

View File

@@ -0,0 +1,16 @@
#ifndef WRAPPED_HPP
#define WRAPPED_HPP
#include <gdnative/gdnative.h>
namespace godot {
class _Wrapped {
public:
godot_object *_owner;
size_t _type_tag;
};
} // namespace godot
#endif // WRAPPED_HPP

2
GodoBinding/include/gen/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
*
!.gitignore