2020-01-31 19:52:37 +01:00
|
|
|
/*
|
|
|
|
Copyright (c) 2019-2020 Péter Magyar
|
|
|
|
|
|
|
|
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.
|
|
|
|
*/
|
|
|
|
|
2019-05-31 22:54:31 +02:00
|
|
|
#include "voxelman_library.h"
|
|
|
|
|
2020-06-27 18:25:23 +02:00
|
|
|
#ifdef PROPS_PRESENT
|
2020-06-27 17:04:40 +02:00
|
|
|
#include "../../props/props/prop_data.h"
|
2020-06-27 18:25:23 +02:00
|
|
|
#endif
|
|
|
|
|
2020-04-04 17:22:07 +02:00
|
|
|
#include "scene/resources/packed_scene.h"
|
2020-02-16 02:54:17 +01:00
|
|
|
|
2020-05-23 10:34:47 +02:00
|
|
|
#include "../defines.h"
|
2020-04-09 12:34:39 +02:00
|
|
|
|
2020-04-17 19:21:46 +02:00
|
|
|
bool VoxelmanLibrary::get_initialized() const {
|
|
|
|
return _initialized;
|
|
|
|
}
|
|
|
|
void VoxelmanLibrary::set_initialized(const bool value) {
|
|
|
|
_initialized = value;
|
|
|
|
}
|
|
|
|
|
2020-03-29 20:19:38 +02:00
|
|
|
//Materials
|
2020-10-27 23:24:24 +01:00
|
|
|
Ref<Material> VoxelmanLibrary::material_get(const int index) {
|
2020-03-29 20:19:38 +02:00
|
|
|
ERR_FAIL_INDEX_V(index, _materials.size(), Ref<VoxelSurface>(NULL));
|
|
|
|
|
|
|
|
return _materials[index];
|
|
|
|
}
|
|
|
|
|
2020-10-27 23:24:24 +01:00
|
|
|
void VoxelmanLibrary::material_add(const Ref<Material> &value) {
|
2020-03-29 20:19:38 +02:00
|
|
|
ERR_FAIL_COND(!value.is_valid());
|
|
|
|
|
|
|
|
_materials.push_back(value);
|
|
|
|
}
|
|
|
|
|
2020-10-27 23:24:24 +01:00
|
|
|
void VoxelmanLibrary::material_set(const int index, const Ref<Material> &value) {
|
2020-03-29 20:19:38 +02:00
|
|
|
ERR_FAIL_INDEX(index, _materials.size());
|
|
|
|
|
|
|
|
_materials.set(index, value);
|
|
|
|
}
|
|
|
|
|
2020-10-27 23:24:24 +01:00
|
|
|
void VoxelmanLibrary::material_remove(const int index) {
|
2020-03-29 20:19:38 +02:00
|
|
|
_materials.remove(index);
|
|
|
|
}
|
|
|
|
|
2020-10-27 23:24:24 +01:00
|
|
|
int VoxelmanLibrary::material_get_num() const {
|
2020-03-29 20:19:38 +02:00
|
|
|
return _materials.size();
|
|
|
|
}
|
|
|
|
|
2020-10-27 23:24:24 +01:00
|
|
|
void VoxelmanLibrary::materials_clear() {
|
2020-03-29 20:19:38 +02:00
|
|
|
_materials.clear();
|
|
|
|
}
|
|
|
|
|
2020-10-27 23:24:24 +01:00
|
|
|
Vector<Variant> VoxelmanLibrary::materials_get() {
|
2020-05-23 10:34:47 +02:00
|
|
|
VARIANT_ARRAY_GET(_materials);
|
2020-03-29 20:19:38 +02:00
|
|
|
}
|
|
|
|
|
2020-10-27 23:24:24 +01:00
|
|
|
void VoxelmanLibrary::materials_set(const Vector<Variant> &materials) {
|
2020-03-29 20:19:38 +02:00
|
|
|
_materials.clear();
|
|
|
|
|
|
|
|
for (int i = 0; i < materials.size(); i++) {
|
|
|
|
Ref<Material> material = Ref<Material>(materials[i]);
|
|
|
|
|
|
|
|
_materials.push_back(material);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//Liquid Materials
|
2020-10-27 23:24:24 +01:00
|
|
|
Ref<Material> VoxelmanLibrary::liquid_material_get(const int index) {
|
2020-03-29 20:19:38 +02:00
|
|
|
ERR_FAIL_INDEX_V(index, _liquid_materials.size(), Ref<VoxelSurface>(NULL));
|
|
|
|
|
|
|
|
return _liquid_materials[index];
|
|
|
|
}
|
|
|
|
|
2020-10-27 23:24:24 +01:00
|
|
|
void VoxelmanLibrary::liquid_material_add(const Ref<Material> &value) {
|
2020-03-29 20:19:38 +02:00
|
|
|
ERR_FAIL_COND(!value.is_valid());
|
|
|
|
|
|
|
|
_liquid_materials.push_back(value);
|
|
|
|
}
|
|
|
|
|
2020-10-27 23:24:24 +01:00
|
|
|
void VoxelmanLibrary::liquid_material_set(const int index, const Ref<Material> &value) {
|
2020-03-29 20:19:38 +02:00
|
|
|
ERR_FAIL_INDEX(index, _liquid_materials.size());
|
|
|
|
|
|
|
|
_liquid_materials.set(index, value);
|
|
|
|
}
|
|
|
|
|
2020-10-27 23:24:24 +01:00
|
|
|
void VoxelmanLibrary::liquid_material_remove(const int index) {
|
2020-03-29 20:19:38 +02:00
|
|
|
_liquid_materials.remove(index);
|
|
|
|
}
|
|
|
|
|
2020-10-27 23:24:24 +01:00
|
|
|
int VoxelmanLibrary::liquid_material_get_num() const {
|
2020-03-29 20:19:38 +02:00
|
|
|
return _liquid_materials.size();
|
|
|
|
}
|
|
|
|
|
2020-10-27 23:24:24 +01:00
|
|
|
void VoxelmanLibrary::liquid_materials_clear() {
|
2020-03-29 20:19:38 +02:00
|
|
|
_liquid_materials.clear();
|
|
|
|
}
|
|
|
|
|
2020-10-27 23:24:24 +01:00
|
|
|
Vector<Variant> VoxelmanLibrary::liquid_materials_get() {
|
2020-05-23 10:34:47 +02:00
|
|
|
VARIANT_ARRAY_GET(_liquid_materials);
|
2019-11-10 13:42:59 +01:00
|
|
|
}
|
2020-03-29 20:19:38 +02:00
|
|
|
|
2020-10-27 23:24:24 +01:00
|
|
|
void VoxelmanLibrary::liquid_materials_set(const Vector<Variant> &materials) {
|
2020-03-29 20:19:38 +02:00
|
|
|
_liquid_materials.clear();
|
|
|
|
|
|
|
|
for (int i = 0; i < materials.size(); i++) {
|
|
|
|
Ref<Material> material = Ref<Material>(materials[i]);
|
|
|
|
|
|
|
|
_liquid_materials.push_back(material);
|
|
|
|
}
|
2019-05-31 22:54:31 +02:00
|
|
|
}
|
|
|
|
|
2020-06-22 21:49:58 +02:00
|
|
|
//Prop Materials
|
2020-10-27 23:24:24 +01:00
|
|
|
Ref<Material> VoxelmanLibrary::prop_material_get(const int index) {
|
2020-06-22 21:49:58 +02:00
|
|
|
ERR_FAIL_INDEX_V(index, _prop_materials.size(), Ref<VoxelSurface>(NULL));
|
|
|
|
|
|
|
|
return _prop_materials[index];
|
|
|
|
}
|
|
|
|
|
2020-10-27 23:24:24 +01:00
|
|
|
void VoxelmanLibrary::prop_material_add(const Ref<Material> &value) {
|
2020-06-22 21:49:58 +02:00
|
|
|
ERR_FAIL_COND(!value.is_valid());
|
|
|
|
|
|
|
|
_prop_materials.push_back(value);
|
|
|
|
}
|
|
|
|
|
2020-10-27 23:24:24 +01:00
|
|
|
void VoxelmanLibrary::prop_material_set(const int index, const Ref<Material> &value) {
|
2020-06-22 21:49:58 +02:00
|
|
|
ERR_FAIL_INDEX(index, _prop_materials.size());
|
|
|
|
|
|
|
|
_prop_materials.set(index, value);
|
|
|
|
}
|
|
|
|
|
2020-10-27 23:24:24 +01:00
|
|
|
void VoxelmanLibrary::prop_material_remove(const int index) {
|
2020-06-22 21:49:58 +02:00
|
|
|
_prop_materials.remove(index);
|
|
|
|
}
|
|
|
|
|
2020-10-27 23:24:24 +01:00
|
|
|
int VoxelmanLibrary::prop_material_get_num() const {
|
2020-06-22 21:49:58 +02:00
|
|
|
return _prop_materials.size();
|
|
|
|
}
|
|
|
|
|
2020-10-27 23:24:24 +01:00
|
|
|
void VoxelmanLibrary::prop_materials_clear() {
|
2020-06-22 21:49:58 +02:00
|
|
|
_prop_materials.clear();
|
|
|
|
}
|
|
|
|
|
2020-10-27 23:24:24 +01:00
|
|
|
Vector<Variant> VoxelmanLibrary::prop_materials_get() {
|
2020-07-29 00:02:42 +02:00
|
|
|
VARIANT_ARRAY_GET(_prop_materials);
|
2020-06-22 21:49:58 +02:00
|
|
|
}
|
|
|
|
|
2020-10-27 23:24:24 +01:00
|
|
|
void VoxelmanLibrary::prop_materials_set(const Vector<Variant> &materials) {
|
2020-07-29 00:02:42 +02:00
|
|
|
VARIANT_ARRAY_SET(materials, _prop_materials, Material);
|
2020-06-22 21:49:58 +02:00
|
|
|
}
|
|
|
|
|
2019-11-09 23:39:19 +01:00
|
|
|
//Surfaces
|
2020-10-27 23:24:24 +01:00
|
|
|
Ref<VoxelSurface> VoxelmanLibrary::voxel_surface_get(const int index) {
|
2019-11-09 17:26:16 +01:00
|
|
|
return Ref<VoxelSurface>();
|
2019-05-31 22:54:31 +02:00
|
|
|
}
|
2020-10-27 23:24:24 +01:00
|
|
|
void VoxelmanLibrary::voxel_surface_add(Ref<VoxelSurface> value) {
|
2019-11-10 22:18:31 +01:00
|
|
|
}
|
2020-10-27 23:24:24 +01:00
|
|
|
void VoxelmanLibrary::voxel_surface_set(int index, Ref<VoxelSurface> value) {
|
2019-05-31 22:54:31 +02:00
|
|
|
}
|
2020-10-27 23:24:24 +01:00
|
|
|
void VoxelmanLibrary::voxel_surface_remove(const int index) {
|
2019-05-31 22:54:31 +02:00
|
|
|
}
|
2020-10-27 23:24:24 +01:00
|
|
|
int VoxelmanLibrary::voxel_surface_get_num() const {
|
2019-11-09 17:26:16 +01:00
|
|
|
return 0;
|
2019-05-31 22:54:31 +02:00
|
|
|
}
|
2020-10-27 23:24:24 +01:00
|
|
|
void VoxelmanLibrary::voxel_surfaces_clear() {
|
2019-11-09 23:39:19 +01:00
|
|
|
}
|
2019-05-31 22:54:31 +02:00
|
|
|
|
2020-10-27 23:24:24 +01:00
|
|
|
Ref<PackedScene> VoxelmanLibrary::scene_get(const int id) {
|
2020-04-04 17:22:07 +02:00
|
|
|
return Ref<PackedScene>();
|
2020-02-16 02:54:17 +01:00
|
|
|
}
|
2020-10-27 23:24:24 +01:00
|
|
|
void VoxelmanLibrary::scene_add(Ref<PackedScene> value) {
|
2020-06-22 21:49:58 +02:00
|
|
|
}
|
2020-10-27 23:24:24 +01:00
|
|
|
void VoxelmanLibrary::scene_set(int id, Ref<PackedScene> value) {
|
2020-02-16 02:54:17 +01:00
|
|
|
}
|
2020-10-27 23:24:24 +01:00
|
|
|
void VoxelmanLibrary::scene_remove(const int id) {
|
2020-06-22 21:49:58 +02:00
|
|
|
}
|
2020-10-27 23:24:24 +01:00
|
|
|
int VoxelmanLibrary::scene_get_num() const {
|
2020-06-22 21:49:58 +02:00
|
|
|
return 0;
|
|
|
|
}
|
2020-10-27 23:24:24 +01:00
|
|
|
void VoxelmanLibrary::scenes_clear() {
|
2020-06-22 21:49:58 +02:00
|
|
|
}
|
|
|
|
|
2020-06-27 18:25:23 +02:00
|
|
|
#ifdef PROPS_PRESENT
|
2020-10-27 23:24:24 +01:00
|
|
|
Ref<PropData> VoxelmanLibrary::prop_get(const int id) {
|
2020-06-22 21:49:58 +02:00
|
|
|
return Ref<PropData>();
|
|
|
|
}
|
2020-10-27 23:24:24 +01:00
|
|
|
void VoxelmanLibrary::prop_add(Ref<PropData> value) {
|
2020-06-22 21:49:58 +02:00
|
|
|
}
|
2020-10-27 23:24:24 +01:00
|
|
|
bool VoxelmanLibrary::prop_has(const Ref<PropData> &value) const {
|
2020-07-20 21:21:28 +02:00
|
|
|
return false;
|
|
|
|
}
|
2020-10-27 23:24:24 +01:00
|
|
|
void VoxelmanLibrary::prop_set(int id, Ref<PropData> value) {
|
2020-02-16 02:54:17 +01:00
|
|
|
}
|
2020-10-27 23:24:24 +01:00
|
|
|
void VoxelmanLibrary::prop_remove(const int id) {
|
2020-02-16 02:54:17 +01:00
|
|
|
}
|
2020-10-27 23:24:24 +01:00
|
|
|
int VoxelmanLibrary::prop_get_num() const {
|
2020-02-16 02:54:17 +01:00
|
|
|
return 0;
|
|
|
|
}
|
2020-10-27 23:24:24 +01:00
|
|
|
void VoxelmanLibrary::props_clear() {
|
2020-02-16 02:54:17 +01:00
|
|
|
}
|
2020-06-28 21:31:26 +02:00
|
|
|
|
|
|
|
Rect2 VoxelmanLibrary::get_prop_uv_rect(const Ref<Texture> &texture) {
|
|
|
|
return Rect2(0, 0, 1, 1);
|
|
|
|
}
|
2020-06-27 18:25:23 +02:00
|
|
|
#endif
|
2020-02-16 02:54:17 +01:00
|
|
|
|
2019-11-09 23:39:19 +01:00
|
|
|
//Rects
|
|
|
|
void VoxelmanLibrary::refresh_rects() {
|
2020-04-17 19:21:46 +02:00
|
|
|
_initialized = true;
|
2019-05-31 22:54:31 +02:00
|
|
|
}
|
|
|
|
|
2019-11-25 12:03:45 +01:00
|
|
|
void VoxelmanLibrary::setup_material_albedo(int material_index, Ref<Texture> texture) {
|
|
|
|
if (has_method("_setup_material_albedo"))
|
|
|
|
call("_setup_material_albedo", material_index, texture);
|
|
|
|
}
|
|
|
|
|
2019-11-10 13:42:59 +01:00
|
|
|
VoxelmanLibrary::VoxelmanLibrary() {
|
2020-04-17 19:21:46 +02:00
|
|
|
_initialized = false;
|
2019-11-10 13:42:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
VoxelmanLibrary::~VoxelmanLibrary() {
|
2020-03-29 20:19:38 +02:00
|
|
|
_materials.clear();
|
|
|
|
_liquid_materials.clear();
|
2020-06-22 21:49:58 +02:00
|
|
|
_prop_materials.clear();
|
2019-11-10 13:42:59 +01:00
|
|
|
}
|
|
|
|
|
2019-05-31 22:54:31 +02:00
|
|
|
void VoxelmanLibrary::_bind_methods() {
|
2020-04-17 19:21:46 +02:00
|
|
|
ClassDB::bind_method(D_METHOD("get_initialized"), &VoxelmanLibrary::get_initialized);
|
|
|
|
ClassDB::bind_method(D_METHOD("set_initialized", "value"), &VoxelmanLibrary::set_initialized);
|
2020-04-17 22:16:25 +02:00
|
|
|
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "initialized", PROPERTY_HINT_NONE, "", 0), "set_initialized", "get_initialized");
|
2020-04-17 19:21:46 +02:00
|
|
|
|
2019-11-25 12:03:45 +01:00
|
|
|
BIND_VMETHOD(MethodInfo("_setup_material_albedo", PropertyInfo(Variant::INT, "material_index"), PropertyInfo(Variant::OBJECT, "texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture")));
|
|
|
|
|
2020-10-27 23:24:24 +01:00
|
|
|
ClassDB::bind_method(D_METHOD("material_get", "index"), &VoxelmanLibrary::material_get);
|
|
|
|
ClassDB::bind_method(D_METHOD("material_add", "value"), &VoxelmanLibrary::material_add);
|
|
|
|
ClassDB::bind_method(D_METHOD("material_set", "index", "value"), &VoxelmanLibrary::material_set);
|
|
|
|
ClassDB::bind_method(D_METHOD("material_remove", "index"), &VoxelmanLibrary::material_remove);
|
|
|
|
ClassDB::bind_method(D_METHOD("material_get_num"), &VoxelmanLibrary::material_get_num);
|
|
|
|
ClassDB::bind_method(D_METHOD("materials_clear"), &VoxelmanLibrary::materials_clear);
|
|
|
|
|
|
|
|
ClassDB::bind_method(D_METHOD("materials_get"), &VoxelmanLibrary::materials_get);
|
|
|
|
ClassDB::bind_method(D_METHOD("materials_set"), &VoxelmanLibrary::materials_set);
|
|
|
|
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "materials", PROPERTY_HINT_NONE, "17/17:Material", PROPERTY_USAGE_DEFAULT, "Material"), "materials_set", "materials_get");
|
|
|
|
|
|
|
|
ClassDB::bind_method(D_METHOD("liquid_material_get", "index"), &VoxelmanLibrary::liquid_material_get);
|
|
|
|
ClassDB::bind_method(D_METHOD("liquid_material_add", "value"), &VoxelmanLibrary::liquid_material_add);
|
|
|
|
ClassDB::bind_method(D_METHOD("liquid_material_set", "index", "value"), &VoxelmanLibrary::liquid_material_set);
|
|
|
|
ClassDB::bind_method(D_METHOD("liquid_material_remove", "index"), &VoxelmanLibrary::liquid_material_remove);
|
|
|
|
ClassDB::bind_method(D_METHOD("liquid_material_get_num"), &VoxelmanLibrary::liquid_material_get_num);
|
|
|
|
ClassDB::bind_method(D_METHOD("liquid_materials_clear"), &VoxelmanLibrary::liquid_materials_clear);
|
|
|
|
|
|
|
|
ClassDB::bind_method(D_METHOD("liquid_materials_get"), &VoxelmanLibrary::liquid_materials_get);
|
|
|
|
ClassDB::bind_method(D_METHOD("liquid_materials_set"), &VoxelmanLibrary::liquid_materials_set);
|
|
|
|
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "liquid_materials", PROPERTY_HINT_NONE, "17/17:Material", PROPERTY_USAGE_DEFAULT, "Material"), "liquid_materials_set", "liquid_materials_get");
|
|
|
|
|
|
|
|
ClassDB::bind_method(D_METHOD("prop_material_get", "index"), &VoxelmanLibrary::prop_material_get);
|
|
|
|
ClassDB::bind_method(D_METHOD("prop_material_add", "value"), &VoxelmanLibrary::prop_material_add);
|
|
|
|
ClassDB::bind_method(D_METHOD("prop_material_set", "index", "value"), &VoxelmanLibrary::prop_material_set);
|
|
|
|
ClassDB::bind_method(D_METHOD("prop_material_remove", "index"), &VoxelmanLibrary::prop_material_remove);
|
|
|
|
ClassDB::bind_method(D_METHOD("prop_material_get_num"), &VoxelmanLibrary::prop_material_get_num);
|
|
|
|
ClassDB::bind_method(D_METHOD("prop_materials_clear"), &VoxelmanLibrary::prop_materials_clear);
|
|
|
|
|
|
|
|
ClassDB::bind_method(D_METHOD("prop_materials_get"), &VoxelmanLibrary::prop_materials_get);
|
|
|
|
ClassDB::bind_method(D_METHOD("prop_materials_set"), &VoxelmanLibrary::prop_materials_set);
|
|
|
|
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "prop_materials", PROPERTY_HINT_NONE, "17/17:Material", PROPERTY_USAGE_DEFAULT, "Material"), "prop_materials_set", "prop_materials_get");
|
|
|
|
|
|
|
|
ClassDB::bind_method(D_METHOD("voxel_surface_get", "index"), &VoxelmanLibrary::voxel_surface_get);
|
|
|
|
ClassDB::bind_method(D_METHOD("voxel_surface_add", "value"), &VoxelmanLibrary::voxel_surface_add);
|
|
|
|
ClassDB::bind_method(D_METHOD("voxel_surface_set", "index", "surface"), &VoxelmanLibrary::voxel_surface_set);
|
|
|
|
ClassDB::bind_method(D_METHOD("voxel_surface_remove", "index"), &VoxelmanLibrary::voxel_surface_remove);
|
|
|
|
ClassDB::bind_method(D_METHOD("voxel_surface_get_num"), &VoxelmanLibrary::voxel_surface_get_num);
|
|
|
|
ClassDB::bind_method(D_METHOD("voxel_surfaces_clear"), &VoxelmanLibrary::voxel_surfaces_clear);
|
|
|
|
|
|
|
|
ClassDB::bind_method(D_METHOD("scene_get", "index"), &VoxelmanLibrary::scene_get);
|
|
|
|
ClassDB::bind_method(D_METHOD("scene_add", "value"), &VoxelmanLibrary::scene_add);
|
|
|
|
ClassDB::bind_method(D_METHOD("scene_set", "index", "value"), &VoxelmanLibrary::scene_set);
|
|
|
|
ClassDB::bind_method(D_METHOD("scene_remove", "index"), &VoxelmanLibrary::scene_remove);
|
|
|
|
ClassDB::bind_method(D_METHOD("scene_get_num"), &VoxelmanLibrary::scene_get_num);
|
|
|
|
ClassDB::bind_method(D_METHOD("scenes_clear"), &VoxelmanLibrary::scenes_clear);
|
2019-11-09 23:39:19 +01:00
|
|
|
|
2020-06-27 18:25:23 +02:00
|
|
|
#ifdef PROPS_PRESENT
|
2020-10-27 23:24:24 +01:00
|
|
|
ClassDB::bind_method(D_METHOD("prop_get", "id"), &VoxelmanLibrary::prop_get);
|
|
|
|
ClassDB::bind_method(D_METHOD("prop_add", "value"), &VoxelmanLibrary::prop_add);
|
|
|
|
ClassDB::bind_method(D_METHOD("prop_has", "prop"), &VoxelmanLibrary::prop_has);
|
|
|
|
ClassDB::bind_method(D_METHOD("prop_set", "id", "surface"), &VoxelmanLibrary::prop_set);
|
|
|
|
ClassDB::bind_method(D_METHOD("prop_remove", "id"), &VoxelmanLibrary::prop_remove);
|
|
|
|
ClassDB::bind_method(D_METHOD("prop_get_num"), &VoxelmanLibrary::prop_get_num);
|
|
|
|
ClassDB::bind_method(D_METHOD("props_clear"), &VoxelmanLibrary::props_clear);
|
2020-06-27 18:25:23 +02:00
|
|
|
#endif
|
2020-02-16 02:54:17 +01:00
|
|
|
|
2019-11-09 17:26:16 +01:00
|
|
|
ClassDB::bind_method(D_METHOD("refresh_rects"), &VoxelmanLibrary::refresh_rects);
|
2019-11-25 12:03:45 +01:00
|
|
|
|
|
|
|
ClassDB::bind_method(D_METHOD("setup_material_albedo", "material_index", "texture"), &VoxelmanLibrary::setup_material_albedo);
|
|
|
|
|
|
|
|
BIND_CONSTANT(MATERIAL_INDEX_VOXELS);
|
|
|
|
BIND_CONSTANT(MATERIAL_INDEX_LIQUID);
|
2020-06-22 21:49:58 +02:00
|
|
|
BIND_CONSTANT(MATERIAL_INDEX_PROP);
|
2019-05-31 22:54:31 +02:00
|
|
|
}
|