mirror of
https://github.com/Relintai/voxelman.git
synced 2025-03-12 18:18:50 +01:00
Changed the Voxelman prefix of the classes to just Voxel as suggested by filipworksdev. Closes #5. Thanks.
This commit is contained in:
parent
950453f9eb
commit
fe4a83b909
24
README.md
24
README.md
@ -1,4 +1,4 @@
|
||||
# Voxelman
|
||||
# Voxel
|
||||
|
||||
A voxel engine module for godot, focusing more on editor integration, gameplay-related features, and extendability (even from gdscript), without sacrificing too much speed.
|
||||
|
||||
@ -11,8 +11,8 @@ check whether it works from time to time.
|
||||
|
||||
## Optional Dependencies
|
||||
|
||||
`https://github.com/Relintai/thread_pool`: Threaded chunk generation. Without this Voxelman is single threaded! \
|
||||
`https://github.com/Relintai/texture_packer`: You get access to [VoxelmanLibraryMerger](#voxelmanlibrarymerger). \
|
||||
`https://github.com/Relintai/thread_pool`: Threaded chunk generation. Without this Voxel is single threaded! \
|
||||
`https://github.com/Relintai/texture_packer`: You get access to [VoxelLibraryMerger](#voxellibrarymerger). \
|
||||
`https://github.com/Relintai/mesh_data_resource`: You get access to a bunch of properties, and methods that can manipulate meshes.\
|
||||
`https://github.com/Relintai/props`: You get access to a bunch of properties, and methods that can manipulate, and use props.\
|
||||
`https://github.com/Relintai/mesh_utils`: Lets you use lod levels higher than 4 by default.
|
||||
@ -24,7 +24,7 @@ repo, should you want to. It contains all my modules.
|
||||
|
||||
## Usage
|
||||
|
||||
First create a scene, and add a VoxelWorldBlocky node into it. Create a VoxelmanLibrary, and assign it to the Library property.
|
||||
First create a scene, and add a VoxelWorldBlocky node into it. Create a VoxelLibrary, and assign it to the Library property.
|
||||
Also, add a VoxelSurface into your library.
|
||||
|
||||
(VoxelWorldBlocky is the only one that works properly for now, this will soon be fixed!)
|
||||
@ -34,19 +34,19 @@ voxel at the inspector's camera's location.
|
||||
|
||||
Select the add button, and now you can just add voxels with the mouse, by clicking on the newly added voxel.
|
||||
|
||||
## VoxelmanLibrary
|
||||
## VoxelLibrary
|
||||
|
||||
This class stores the materials, and the VoxelSurfaces.
|
||||
|
||||
Note: If you want lods, assign equal (or more) materials than your maximum lod level. If you only want one material just assign it
|
||||
multiple times. If you don't then your meshes won't have materials (They will be white).
|
||||
|
||||
### VoxelmanLibrarySimple
|
||||
### VoxelLibrarySimple
|
||||
|
||||
The simplest library, just assign a material with a texture, and using the atlas_rows and atlas_culomns properties to tell the system
|
||||
how the UVs should be divided.
|
||||
|
||||
### VoxelmanLibraryMerger
|
||||
### VoxelLibraryMerger
|
||||
|
||||
You will only have this if your godot also contains https://github.com/Relintai/texture_packer
|
||||
|
||||
@ -81,7 +81,7 @@ You can write your own algorithm by implementing the ``` void _generate_chunk(ch
|
||||
|
||||
## VoxelJobs
|
||||
|
||||
Producing just a terrarin mesh for a chunk is not that hard by itself. However when you start adding layers/features
|
||||
Producing just a terrain mesh for a chunk is not that hard by itself. However when you start adding layers/features
|
||||
like lod generation, collision meshes (especially since manipulating the physics server is not threadsafe),
|
||||
vertex volumetric lights, props, snapping props, props with vertex lights, etc
|
||||
chunk mesh generation can quicly become a serious mess.
|
||||
@ -105,9 +105,9 @@ If you implement your own jobs, when your job finishes call `next_job()`.
|
||||
|
||||
This is the job that will generate vertex light based ao, random ao, and will bake your `VoxelLight`s.
|
||||
|
||||
### VoxelTerrarinJob
|
||||
### VoxelTerrainJob
|
||||
|
||||
This will generate your terrarin collider and mesh (with lods) for you, using the meshers that you add into it.
|
||||
This will generate your terrain collider and mesh (with lods) for you, using the meshers that you add into it.
|
||||
|
||||
### VoxelPropJob
|
||||
|
||||
@ -134,7 +134,7 @@ This is done by `setup_chunk(shunk)` in `VoxelWorld`.
|
||||
# We need to check whether or not we need to initialize jobs
|
||||
if chunk.job_get_count() == 0:
|
||||
# Setup a blocky (minecratf like) mesher job
|
||||
var tj : VoxelTerrarinJob = VoxelTerrarinJob.new()
|
||||
var tj : VoxelTerrainJob = VoxelTerrainJob.new()
|
||||
|
||||
tj.add_mesher(VoxelMesherBlocky.new())
|
||||
tj.add_liquid_mesher(VoxelMesherLiquidBlocky.new())
|
||||
@ -148,7 +148,7 @@ This is done by `setup_chunk(shunk)` in `VoxelWorld`.
|
||||
|
||||
#### VoxelChunk
|
||||
|
||||
Stores terrarin data, prop data. And mesh data (VoxelChunkDefault), and the mesh generation jobs.
|
||||
Stores terrain data, prop data. And mesh data (VoxelChunkDefault), and the mesh generation jobs.
|
||||
|
||||
When it starts building meshes it will start submitting jobs to thread_pool (if present) one by one.
|
||||
|
||||
|
14
SCsub
14
SCsub
@ -25,10 +25,10 @@ sources = [
|
||||
|
||||
"register_types.cpp",
|
||||
|
||||
"library/voxelman_library.cpp",
|
||||
"library/voxelman_library_simple.cpp",
|
||||
"library/voxel_library.cpp",
|
||||
"library/voxel_library_simple.cpp",
|
||||
|
||||
"nodes/voxelman_light.cpp",
|
||||
"nodes/voxel_light_node.cpp",
|
||||
|
||||
"library/voxel_surface.cpp",
|
||||
"library/voxel_surface_simple.cpp",
|
||||
@ -63,8 +63,8 @@ sources = [
|
||||
"meshers/cubic/voxel_mesher_cubic.cpp",
|
||||
"meshers/cubic/voxel_cube_points.cpp",
|
||||
|
||||
"level_generator/voxelman_level_generator.cpp",
|
||||
"level_generator/voxelman_level_generator_flat.cpp",
|
||||
"level_generator/voxel_level_generator.cpp",
|
||||
"level_generator/voxel_level_generator_flat.cpp",
|
||||
|
||||
"world/cubic/voxel_chunk_cubic.cpp",
|
||||
"world/cubic/voxel_world_cubic.cpp",
|
||||
@ -76,13 +76,13 @@ sources = [
|
||||
"thirdparty/lz4/lz4.c",
|
||||
|
||||
"world/jobs/voxel_job.cpp",
|
||||
"world/jobs/voxel_terrarin_job.cpp",
|
||||
"world/jobs/voxel_terrain_job.cpp",
|
||||
"world/jobs/voxel_light_job.cpp",
|
||||
"world/jobs/voxel_prop_job.cpp",
|
||||
]
|
||||
|
||||
if has_texture_packer:
|
||||
sources.append("library/voxelman_library_merger.cpp")
|
||||
sources.append("library/voxel_library_merger.cpp")
|
||||
sources.append("library/voxel_surface_merger.cpp")
|
||||
|
||||
if ARGUMENTS.get('custom_modules_shared', 'no') == 'yes':
|
||||
|
14
config.py
14
config.py
@ -13,17 +13,17 @@ def get_doc_classes():
|
||||
"WorldArea",
|
||||
|
||||
"VoxelLight",
|
||||
"VoxelmanLight",
|
||||
"VoxelLightNode",
|
||||
|
||||
"VoxelmanLevelGenerator",
|
||||
"VoxelmanLevelGeneratorFlat",
|
||||
"VoxelLevelGenerator",
|
||||
"VoxelLevelGeneratorFlat",
|
||||
|
||||
"VoxelSurfaceMerger",
|
||||
"VoxelSurfaceSimple",
|
||||
"VoxelSurface",
|
||||
"VoxelmanLibraryMerger",
|
||||
"VoxelmanLibrarySimple",
|
||||
"VoxelmanLibrary",
|
||||
"VoxelLibraryMerger",
|
||||
"VoxelLibrarySimple",
|
||||
"VoxelLibrary",
|
||||
|
||||
"VoxelCubePoints",
|
||||
"VoxelMesherCubic",
|
||||
@ -57,7 +57,7 @@ def get_doc_classes():
|
||||
"VoxelWorldDefault",
|
||||
|
||||
"VoxelJob",
|
||||
"VoxelTerrarinJob",
|
||||
"VoxelTerrainJob",
|
||||
"VoxelLightJob",
|
||||
"VoxelPropJob",
|
||||
]
|
||||
|
@ -1,6 +1,6 @@
|
||||
|
||||
#ifndef VOXELMAN_DEFINES_H
|
||||
#define VOXELMAN_DEFINES_H
|
||||
#ifndef VOXEL_DEFINES_H
|
||||
#define VOXEL_DEFINES_H
|
||||
|
||||
#include "core/version.h"
|
||||
|
||||
@ -114,11 +114,15 @@ typedef class RenderingServer VS;
|
||||
#define CONNECT(sig, obj, target_method_class, method) connect(sig, callable_mp(obj, &target_method_class::method))
|
||||
#define DISCONNECT(sig, obj, target_method_class, method) disconnect(sig, callable_mp(obj, &target_method_class::method))
|
||||
#define GET_WORLD get_world_3d
|
||||
#define INSTANCE instantiate
|
||||
#define VREMOVE remove_at
|
||||
#else
|
||||
#define INSTANCE_VALIDATE(var) ObjectDB::instance_validate(var)
|
||||
#define CONNECT(sig, obj, target_method_class, method) connect(sig, obj, #method)
|
||||
#define DISCONNECT(sig, obj, target_method_class, method) disconnect(sig, obj, #method)
|
||||
#define GET_WORLD get_world
|
||||
#define INSTANCE instance
|
||||
#define VREMOVE remove
|
||||
#endif
|
||||
|
||||
#endif
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="BlockVoxelStructure" inherits="VoxelStructure" version="3.2">
|
||||
<class name="BlockVoxelStructure" inherits="VoxelStructure" version="3.5">
|
||||
<brief_description>
|
||||
</brief_description>
|
||||
<description>
|
||||
@ -7,65 +7,37 @@
|
||||
<tutorials>
|
||||
</tutorials>
|
||||
<methods>
|
||||
<method name="get_voxel" qualifiers="const">
|
||||
<return type="int">
|
||||
</return>
|
||||
<argument index="0" name="x" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="y" type="int">
|
||||
</argument>
|
||||
<argument index="2" name="z" type="int">
|
||||
</argument>
|
||||
<argument index="3" name="channel_index" type="int" default="0">
|
||||
</argument>
|
||||
<method name="get_voxel_isolevel" qualifiers="const">
|
||||
<return type="int" />
|
||||
<argument index="0" name="x" type="int" />
|
||||
<argument index="1" name="y" type="int" />
|
||||
<argument index="2" name="z" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_voxel_data" qualifiers="const">
|
||||
<return type="PoolByteArray">
|
||||
</return>
|
||||
<argument index="0" name="x" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="y" type="int">
|
||||
</argument>
|
||||
<argument index="2" name="z" type="int">
|
||||
</argument>
|
||||
<method name="get_voxel_type" qualifiers="const">
|
||||
<return type="int" />
|
||||
<argument index="0" name="x" type="int" />
|
||||
<argument index="1" name="y" type="int" />
|
||||
<argument index="2" name="z" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_voxel">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="value" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="x" type="int">
|
||||
</argument>
|
||||
<argument index="2" name="y" type="int">
|
||||
</argument>
|
||||
<argument index="3" name="z" type="int">
|
||||
</argument>
|
||||
<argument index="4" name="channel_index" type="int" default="0">
|
||||
</argument>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_voxel_data">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="arr" type="PoolByteArray">
|
||||
</argument>
|
||||
<argument index="1" name="x" type="int">
|
||||
</argument>
|
||||
<argument index="2" name="y" type="int">
|
||||
</argument>
|
||||
<argument index="3" name="z" type="int">
|
||||
</argument>
|
||||
<return type="void" />
|
||||
<argument index="0" name="x" type="int" />
|
||||
<argument index="1" name="y" type="int" />
|
||||
<argument index="2" name="z" type="int" />
|
||||
<argument index="3" name="type" type="int" />
|
||||
<argument index="4" name="isolevel" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
</methods>
|
||||
<members>
|
||||
<member name="channel_count" type="int" setter="set_channel_count" getter="get_channel_count" default="0">
|
||||
<member name="channel_isolevel" type="int" setter="set_channel_isolevel" getter="get_channel_isolevel" default="0">
|
||||
</member>
|
||||
<member name="channel_type" type="int" setter="set_channel_type" getter="get_channel_type" default="0">
|
||||
</member>
|
||||
</members>
|
||||
<constants>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="EnvironmentData" inherits="Resource" version="3.2">
|
||||
<class name="EnvironmentData" inherits="Resource" version="3.5">
|
||||
<brief_description>
|
||||
</brief_description>
|
||||
<description>
|
||||
@ -8,80 +8,57 @@
|
||||
</tutorials>
|
||||
<methods>
|
||||
<method name="_setup" qualifiers="virtual">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="world_environment" type="WorldEnvironment">
|
||||
</argument>
|
||||
<argument index="1" name="primary_light" type="DirectionalLight">
|
||||
</argument>
|
||||
<argument index="2" name="secondary_light" type="DirectionalLight">
|
||||
</argument>
|
||||
<return type="void" />
|
||||
<argument index="0" name="world_environment" type="WorldEnvironment" />
|
||||
<argument index="1" name="primary_light" type="DirectionalLight" />
|
||||
<argument index="2" name="secondary_light" type="DirectionalLight" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_color">
|
||||
<return type="Color">
|
||||
</return>
|
||||
<argument index="0" name="index" type="int">
|
||||
</argument>
|
||||
<return type="Color" />
|
||||
<argument index="0" name="index" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_energy">
|
||||
<return type="float">
|
||||
</return>
|
||||
<argument index="0" name="index" type="int">
|
||||
</argument>
|
||||
<return type="float" />
|
||||
<argument index="0" name="index" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_indirect_energy">
|
||||
<return type="float">
|
||||
</return>
|
||||
<argument index="0" name="index" type="int">
|
||||
</argument>
|
||||
<return type="float" />
|
||||
<argument index="0" name="index" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_color">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="index" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="value" type="Color">
|
||||
</argument>
|
||||
<return type="void" />
|
||||
<argument index="0" name="index" type="int" />
|
||||
<argument index="1" name="value" type="Color" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_energy">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="index" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="value" type="float">
|
||||
</argument>
|
||||
<return type="void" />
|
||||
<argument index="0" name="index" type="int" />
|
||||
<argument index="1" name="value" type="float" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_indirect_energy">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="index" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="value" type="float">
|
||||
</argument>
|
||||
<return type="void" />
|
||||
<argument index="0" name="index" type="int" />
|
||||
<argument index="1" name="value" type="float" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="setup">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="world_environment" type="Node">
|
||||
</argument>
|
||||
<argument index="1" name="primary_light" type="Node">
|
||||
</argument>
|
||||
<argument index="2" name="secondary_light" type="Node">
|
||||
</argument>
|
||||
<return type="void" />
|
||||
<argument index="0" name="world_environment" type="Node" />
|
||||
<argument index="1" name="primary_light" type="Node" />
|
||||
<argument index="2" name="secondary_light" type="Node" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="MarchingCubesCellData" inherits="Reference" version="3.2">
|
||||
<class name="MarchingCubesCellData" inherits="Reference" version="3.5">
|
||||
<brief_description>
|
||||
</brief_description>
|
||||
<description>
|
||||
@ -8,48 +8,37 @@
|
||||
</tutorials>
|
||||
<methods>
|
||||
<method name="get_triangle_count" qualifiers="const">
|
||||
<return type="int">
|
||||
</return>
|
||||
<return type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_vertex_count" qualifiers="const">
|
||||
<return type="int">
|
||||
</return>
|
||||
<return type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_vertex_index" qualifiers="const">
|
||||
<return type="int">
|
||||
</return>
|
||||
<argument index="0" name="index" type="int">
|
||||
</argument>
|
||||
<return type="int" />
|
||||
<argument index="0" name="index" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_triangle_count">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="value" type="int">
|
||||
</argument>
|
||||
<return type="void" />
|
||||
<argument index="0" name="value" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_vertex_count">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="value" type="int">
|
||||
</argument>
|
||||
<return type="void" />
|
||||
<argument index="0" name="value" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_vertex_index">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="index" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="value" type="int">
|
||||
</argument>
|
||||
<return type="void" />
|
||||
<argument index="0" name="index" type="int" />
|
||||
<argument index="1" name="value" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
|
@ -1 +0,0 @@
|
||||
Doc classes will appear here when generating
|
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="VoxelChunkBlocky" inherits="VoxelChunkDefault" version="3.2">
|
||||
<class name="VoxelChunkBlocky" inherits="VoxelChunkDefault" version="3.5">
|
||||
<brief_description>
|
||||
</brief_description>
|
||||
<description>
|
||||
@ -9,7 +9,7 @@
|
||||
<methods>
|
||||
</methods>
|
||||
<members>
|
||||
<member name="data_channel" type="PoolByteArray" setter="set_channel_compressed" getter="get_channel_compressed" default="PoolByteArray( )">
|
||||
<member name="data_channel" type="PoolByteArray" setter="channel_set_compressed" getter="channel_get_compressed" default="PoolByteArray( )">
|
||||
</member>
|
||||
</members>
|
||||
<constants>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="VoxelChunkCubic" inherits="VoxelChunkDefault" version="3.2">
|
||||
<class name="VoxelChunkCubic" inherits="VoxelChunkDefault" version="3.5">
|
||||
<brief_description>
|
||||
</brief_description>
|
||||
<description>
|
||||
@ -9,9 +9,9 @@
|
||||
<methods>
|
||||
</methods>
|
||||
<members>
|
||||
<member name="data_channel" type="PoolByteArray" setter="set_channel_compressed" getter="get_channel_compressed" default="PoolByteArray( )">
|
||||
<member name="data_channel" type="PoolByteArray" setter="channel_set_compressed" getter="channel_get_compressed" default="PoolByteArray( )">
|
||||
</member>
|
||||
<member name="isolevel_channel" type="PoolByteArray" setter="set_channel_compressed" getter="get_channel_compressed" default="PoolByteArray( )">
|
||||
<member name="isolevel_channel" type="PoolByteArray" setter="channel_set_compressed" getter="channel_get_compressed" default="PoolByteArray( )">
|
||||
</member>
|
||||
</members>
|
||||
<constants>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="VoxelChunkDefault" inherits="VoxelChunk" version="3.2">
|
||||
<class name="VoxelChunkDefault" inherits="VoxelChunk" version="3.5">
|
||||
<brief_description>
|
||||
</brief_description>
|
||||
<description>
|
||||
@ -7,403 +7,249 @@
|
||||
<tutorials>
|
||||
</tutorials>
|
||||
<methods>
|
||||
<method name="_build_phase" qualifiers="virtual">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="phase" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="_build_phase_physics_process" qualifiers="virtual">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="phase" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="_build_phase_process" qualifiers="virtual">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="phase" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="_draw_debug_voxel_lights" qualifiers="virtual">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="debug_drawer" type="ImmediateGeometry">
|
||||
</argument>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="build_phase">
|
||||
<return type="void">
|
||||
</return>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="build_phase_physics_process">
|
||||
<return type="void">
|
||||
</return>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="build_phase_process">
|
||||
<return type="void">
|
||||
</return>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="clear_mesh_rids">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="mesh_index" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="mesh_type_index" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="clear_rids">
|
||||
<return type="void">
|
||||
</return>
|
||||
<return type="void" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="create_colliders">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="mesh_index" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="layer_mask" type="int" default="1">
|
||||
</argument>
|
||||
<return type="void" />
|
||||
<argument index="0" name="mesh_index" type="int" />
|
||||
<argument index="1" name="layer_mask" type="int" default="1" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="create_debug_immediate_geometry">
|
||||
<return type="void">
|
||||
</return>
|
||||
<method name="debug_mesh_add_vertices_to">
|
||||
<return type="void" />
|
||||
<argument index="0" name="arr" type="PoolVector3Array" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="create_meshes">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="mesh_index" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="mesh_count" type="int">
|
||||
</argument>
|
||||
<method name="debug_mesh_allocate">
|
||||
<return type="void" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="debug_mesh_array_clear">
|
||||
<return type="void" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="debug_mesh_clear">
|
||||
<return type="void" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="debug_mesh_free">
|
||||
<return type="void" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="debug_mesh_has">
|
||||
<return type="bool" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="debug_mesh_send">
|
||||
<return type="void" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="draw_cross_voxels">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="max" type="Vector3">
|
||||
</argument>
|
||||
<return type="void" />
|
||||
<argument index="0" name="max" type="Vector3" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="draw_cross_voxels_fill">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="max" type="Vector3">
|
||||
</argument>
|
||||
<argument index="1" name="fill" type="float">
|
||||
</argument>
|
||||
<return type="void" />
|
||||
<argument index="0" name="max" type="Vector3" />
|
||||
<argument index="1" name="fill" type="float" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="draw_debug_mdr_colliders">
|
||||
<return type="void" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="draw_debug_voxel_lights">
|
||||
<return type="void">
|
||||
</return>
|
||||
<return type="void" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="draw_debug_voxels">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="max" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="color" type="Color" default="Color( 1, 1, 1, 1 )">
|
||||
</argument>
|
||||
<return type="void" />
|
||||
<argument index="0" name="max" type="int" />
|
||||
<argument index="1" name="color" type="Color" default="Color( 1, 1, 1, 1 )" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="emit_build_finished">
|
||||
<return type="void">
|
||||
</return>
|
||||
<return type="void" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="free_chunk">
|
||||
<return type="void">
|
||||
</return>
|
||||
<return type="void" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="free_colliders">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="mesh_index" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="free_debug_immediate_geometry">
|
||||
<return type="void">
|
||||
</return>
|
||||
<return type="void" />
|
||||
<argument index="0" name="mesh_index" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="free_index">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="mesh_index" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="free_meshes">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="mesh_index" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="free_rids">
|
||||
<return type="void">
|
||||
</return>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="generate_ao">
|
||||
<return type="void">
|
||||
</return>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="generate_random_ao">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="seed" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="octaves" type="int" default="4">
|
||||
</argument>
|
||||
<argument index="2" name="period" type="int" default="30">
|
||||
</argument>
|
||||
<argument index="3" name="persistence" type="float" default="0.3">
|
||||
</argument>
|
||||
<argument index="4" name="scale_factor" type="float" default="0.6">
|
||||
</argument>
|
||||
<return type="void" />
|
||||
<argument index="0" name="mesh_index" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_light">
|
||||
<return type="VoxelLight">
|
||||
</return>
|
||||
<argument index="0" name="index" type="int">
|
||||
</argument>
|
||||
<return type="VoxelLight" />
|
||||
<argument index="0" name="index" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_light_count" qualifiers="const">
|
||||
<return type="int">
|
||||
</return>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_mesh_rid">
|
||||
<return type="RID">
|
||||
</return>
|
||||
<argument index="0" name="mesh_index" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="mesh_type_index" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_mesh_rid_count">
|
||||
<return type="int">
|
||||
</return>
|
||||
<argument index="0" name="mesh_index" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="mesh_type_index" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_mesh_rid_index">
|
||||
<return type="RID">
|
||||
</return>
|
||||
<argument index="0" name="mesh_index" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="mesh_type_index" type="int">
|
||||
</argument>
|
||||
<argument index="2" name="index" type="int">
|
||||
</argument>
|
||||
<return type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_mesh_rids">
|
||||
<return type="Dictionary">
|
||||
</return>
|
||||
<return type="Dictionary" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_meshes">
|
||||
<return type="Array">
|
||||
</return>
|
||||
<argument index="0" name="mesh_index" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="mesh_type_index" type="int">
|
||||
</argument>
|
||||
<method name="mesh_rid_get">
|
||||
<return type="RID" />
|
||||
<argument index="0" name="mesh_index" type="int" />
|
||||
<argument index="1" name="mesh_type_index" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="has_meshes">
|
||||
<return type="bool">
|
||||
</return>
|
||||
<argument index="0" name="mesh_index" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="mesh_type_index" type="int">
|
||||
</argument>
|
||||
<method name="mesh_rid_get_count">
|
||||
<return type="int" />
|
||||
<argument index="0" name="mesh_index" type="int" />
|
||||
<argument index="1" name="mesh_type_index" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="has_next_phase">
|
||||
<return type="bool">
|
||||
</return>
|
||||
<method name="mesh_rid_get_index">
|
||||
<return type="RID" />
|
||||
<argument index="0" name="mesh_index" type="int" />
|
||||
<argument index="1" name="mesh_type_index" type="int" />
|
||||
<argument index="2" name="index" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="next_phase">
|
||||
<return type="void">
|
||||
</return>
|
||||
<method name="mesh_rid_set">
|
||||
<return type="void" />
|
||||
<argument index="0" name="mesh_index" type="int" />
|
||||
<argument index="1" name="mesh_type_index" type="int" />
|
||||
<argument index="2" name="value" type="RID" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_mesh_rid">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="mesh_index" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="mesh_type_index" type="int">
|
||||
</argument>
|
||||
<argument index="2" name="value" type="RID">
|
||||
</argument>
|
||||
<method name="mesh_rid_set_index">
|
||||
<return type="void" />
|
||||
<argument index="0" name="mesh_index" type="int" />
|
||||
<argument index="1" name="mesh_type_index" type="int" />
|
||||
<argument index="2" name="index" type="int" />
|
||||
<argument index="3" name="value" type="RID" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_mesh_rid_index">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="mesh_index" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="mesh_type_index" type="int">
|
||||
</argument>
|
||||
<argument index="2" name="index" type="int">
|
||||
</argument>
|
||||
<argument index="3" name="value" type="RID">
|
||||
</argument>
|
||||
<method name="mesh_rids_clear">
|
||||
<return type="void" />
|
||||
<argument index="0" name="mesh_index" type="int" />
|
||||
<argument index="1" name="mesh_type_index" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="meshes_create">
|
||||
<return type="void" />
|
||||
<argument index="0" name="mesh_index" type="int" />
|
||||
<argument index="1" name="mesh_count" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="meshes_free">
|
||||
<return type="void" />
|
||||
<argument index="0" name="mesh_index" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="meshes_get">
|
||||
<return type="Array" />
|
||||
<argument index="0" name="mesh_index" type="int" />
|
||||
<argument index="1" name="mesh_type_index" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="meshes_has">
|
||||
<return type="bool" />
|
||||
<argument index="0" name="mesh_index" type="int" />
|
||||
<argument index="1" name="mesh_type_index" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="meshes_set">
|
||||
<return type="void" />
|
||||
<argument index="0" name="mesh_index" type="int" />
|
||||
<argument index="1" name="mesh_type_index" type="int" />
|
||||
<argument index="2" name="meshes" type="Array" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="rids_free">
|
||||
<return type="void" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_mesh_rids">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="rids" type="Dictionary">
|
||||
</argument>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_meshes">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="mesh_index" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="mesh_type_index" type="int">
|
||||
</argument>
|
||||
<argument index="2" name="meshes" type="Array">
|
||||
</argument>
|
||||
<return type="void" />
|
||||
<argument index="0" name="rids" type="Dictionary" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
</methods>
|
||||
<members>
|
||||
<member name="active_build_phase_type" type="int" setter="set_active_build_phase_type" getter="get_active_build_phase_type" enum="VoxelChunkDefault.ActiveBuildPhaseType">
|
||||
</member>
|
||||
<member name="build_flags" type="int" setter="set_build_flags" getter="get_build_flags">
|
||||
</member>
|
||||
<member name="current_build_phase" type="int" setter="set_current_build_phase" getter="get_current_build_phase">
|
||||
</member>
|
||||
<member name="current_lod_level" type="int" setter="set_current_lod_level" getter="get_current_lod_level" default="0">
|
||||
</member>
|
||||
<member name="lights_dirty" type="bool" setter="set_lights_dirty" getter="get_lights_dirty">
|
||||
</member>
|
||||
<member name="lod_num" type="int" setter="set_lod_num" getter="get_lod_num">
|
||||
</member>
|
||||
<member name="lod_size" type="int" setter="set_lod_size" getter="get_lod_size">
|
||||
</member>
|
||||
<member name="max_build_phase" type="int" setter="set_max_build_phase" getter="get_max_build_phase">
|
||||
</member>
|
||||
</members>
|
||||
<constants>
|
||||
<constant name="BUILD_PHASE_DONE" value="0">
|
||||
</constant>
|
||||
<constant name="BUILD_PHASE_SETUP" value="1">
|
||||
</constant>
|
||||
<constant name="BUILD_PHASE_TERRARIN_MESH_SETUP" value="2">
|
||||
</constant>
|
||||
<constant name="BUILD_PHASE_TERRARIN_MESH_COLLIDER" value="3">
|
||||
</constant>
|
||||
<constant name="BUILD_PHASE_TERRARIN_MESH" value="5">
|
||||
</constant>
|
||||
<constant name="BUILD_PHASE_LIGHTS" value="4">
|
||||
</constant>
|
||||
<constant name="BUILD_PHASE_FINALIZE" value="6">
|
||||
</constant>
|
||||
<constant name="BUILD_PHASE_MAX" value="7">
|
||||
</constant>
|
||||
<constant name="VOXEL_CHUNK_STATE_GENERATION_QUEUED" value="1">
|
||||
</constant>
|
||||
<constant name="VOXEL_CHUNK_STATE_GENERATION" value="2">
|
||||
</constant>
|
||||
<constant name="VOXEL_CHUNK_STATE_MESH_GENERATION_QUEUED" value="3">
|
||||
</constant>
|
||||
<constant name="VOXEL_CHUNK_STATE_MESH_GENERATION" value="4">
|
||||
</constant>
|
||||
<constant name="VOXEL_CHUNK_STATE_MAX" value="5">
|
||||
</constant>
|
||||
<constant name="DEFAULT_CHANNEL_TYPE" value="0" enum="DefaultChannels">
|
||||
</constant>
|
||||
<constant name="DEFAULT_CHANNEL_ISOLEVEL" value="1" enum="DefaultChannels">
|
||||
</constant>
|
||||
<constant name="DEFAULT_CHANNEL_LIGHT_COLOR_R" value="2" enum="DefaultChannels">
|
||||
<constant name="DEFAULT_CHANNEL_ALT_TYPE" value="2" enum="DefaultChannels">
|
||||
</constant>
|
||||
<constant name="DEFAULT_CHANNEL_LIGHT_COLOR_G" value="3" enum="DefaultChannels">
|
||||
<constant name="DEFAULT_CHANNEL_ALT_ISOLEVEL" value="3" enum="DefaultChannels">
|
||||
</constant>
|
||||
<constant name="DEFAULT_CHANNEL_LIGHT_COLOR_B" value="4" enum="DefaultChannels">
|
||||
<constant name="DEFAULT_CHANNEL_LIGHT_COLOR_R" value="4" enum="DefaultChannels">
|
||||
</constant>
|
||||
<constant name="DEFAULT_CHANNEL_AO" value="5" enum="DefaultChannels">
|
||||
<constant name="DEFAULT_CHANNEL_LIGHT_COLOR_G" value="5" enum="DefaultChannels">
|
||||
</constant>
|
||||
<constant name="DEFAULT_CHANNEL_RANDOM_AO" value="6" enum="DefaultChannels">
|
||||
<constant name="DEFAULT_CHANNEL_LIGHT_COLOR_B" value="6" enum="DefaultChannels">
|
||||
</constant>
|
||||
<constant name="DEFAULT_CHANNEL_LIQUID_FLOW" value="7" enum="DefaultChannels">
|
||||
<constant name="DEFAULT_CHANNEL_AO" value="7" enum="DefaultChannels">
|
||||
</constant>
|
||||
<constant name="MAX_DEFAULT_CHANNELS" value="8" enum="DefaultChannels">
|
||||
<constant name="DEFAULT_CHANNEL_RANDOM_AO" value="8" enum="DefaultChannels">
|
||||
</constant>
|
||||
<constant name="BUILD_PHASE_TYPE_NORMAL" value="0" enum="ActiveBuildPhaseType">
|
||||
<constant name="DEFAULT_CHANNEL_LIQUID_FLOW" value="9" enum="DefaultChannels">
|
||||
</constant>
|
||||
<constant name="BUILD_PHASE_TYPE_PROCESS" value="1" enum="ActiveBuildPhaseType">
|
||||
<constant name="MAX_DEFAULT_CHANNELS" value="10" enum="DefaultChannels">
|
||||
</constant>
|
||||
<constant name="BUILD_PHASE_TYPE_PHYSICS_PROCESS" value="2" enum="ActiveBuildPhaseType">
|
||||
</constant>
|
||||
<constant name="MESH_INDEX_TERRARIN" value="0">
|
||||
<constant name="MESH_INDEX_TERRAIN" value="0">
|
||||
</constant>
|
||||
<constant name="MESH_INDEX_PROP" value="1">
|
||||
</constant>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="VoxelChunkMarchingCubes" inherits="VoxelChunkDefault" version="3.2">
|
||||
<class name="VoxelChunkMarchingCubes" inherits="VoxelChunkDefault" version="3.5">
|
||||
<brief_description>
|
||||
</brief_description>
|
||||
<description>
|
||||
@ -9,9 +9,9 @@
|
||||
<methods>
|
||||
</methods>
|
||||
<members>
|
||||
<member name="data_channel" type="PoolByteArray" setter="set_channel_compressed" getter="get_channel_compressed" default="PoolByteArray( )">
|
||||
<member name="data_channel" type="PoolByteArray" setter="channel_set_compressed" getter="channel_get_compressed" default="PoolByteArray( )">
|
||||
</member>
|
||||
<member name="isolevel_channel" type="PoolByteArray" setter="set_channel_compressed" getter="get_channel_compressed" default="PoolByteArray( )">
|
||||
<member name="isolevel_channel" type="PoolByteArray" setter="channel_set_compressed" getter="channel_get_compressed" default="PoolByteArray( )">
|
||||
</member>
|
||||
</members>
|
||||
<constants>
|
||||
|
@ -1,53 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="VoxelChunkPropData" inherits="Resource" version="3.2">
|
||||
<brief_description>
|
||||
</brief_description>
|
||||
<description>
|
||||
</description>
|
||||
<tutorials>
|
||||
</tutorials>
|
||||
<methods>
|
||||
<method name="free_prop">
|
||||
<return type="void">
|
||||
</return>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_translation_for_chunk">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="chunk" type="VoxelChunk">
|
||||
</argument>
|
||||
<argument index="1" name="local_x" type="int">
|
||||
</argument>
|
||||
<argument index="2" name="local_y" type="int">
|
||||
</argument>
|
||||
<argument index="3" name="local_z" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="spawn_prop">
|
||||
<return type="Node">
|
||||
</return>
|
||||
<argument index="0" name="parent" type="Node">
|
||||
</argument>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
</methods>
|
||||
<members>
|
||||
<member name="owner" type="VoxelChunk" setter="set_owner" getter="get_owner">
|
||||
</member>
|
||||
<member name="scene" type="PackedScene" setter="set_scene" getter="get_scene">
|
||||
</member>
|
||||
<member name="scene_id" type="int" setter="set_scene_id" getter="get_scene_id" default="0">
|
||||
</member>
|
||||
<member name="spawned_prop" type="Node" setter="set_spawned_prop" getter="get_spawned_prop">
|
||||
</member>
|
||||
<member name="transform" type="Transform" setter="set_transform" getter="get_transform" default="Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )">
|
||||
</member>
|
||||
</members>
|
||||
<constants>
|
||||
</constants>
|
||||
</class>
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="VoxelCubePoints" inherits="Reference" version="3.2">
|
||||
<class name="VoxelCubePoints" inherits="Reference" version="3.5">
|
||||
<brief_description>
|
||||
</brief_description>
|
||||
<description>
|
||||
@ -8,259 +8,197 @@
|
||||
</tutorials>
|
||||
<methods>
|
||||
<method name="get_bottom_left_point">
|
||||
<return type="Vector3">
|
||||
</return>
|
||||
<argument index="0" name="face" type="int">
|
||||
</argument>
|
||||
<return type="Vector3" />
|
||||
<argument index="0" name="face" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_bottom_right_point">
|
||||
<return type="Vector3">
|
||||
</return>
|
||||
<argument index="0" name="face" type="int">
|
||||
</argument>
|
||||
<return type="Vector3" />
|
||||
<argument index="0" name="face" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_face_light_direction">
|
||||
<return type="Vector3">
|
||||
</return>
|
||||
<argument index="0" name="face" type="int">
|
||||
</argument>
|
||||
<return type="Vector3" />
|
||||
<argument index="0" name="face" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_face_point_ao">
|
||||
<return type="int">
|
||||
</return>
|
||||
<argument index="0" name="face" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="index" type="int">
|
||||
</argument>
|
||||
<return type="int" />
|
||||
<argument index="0" name="face" type="int" />
|
||||
<argument index="1" name="index" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_face_point_ao_color">
|
||||
<return type="Color">
|
||||
</return>
|
||||
<argument index="0" name="face" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="index" type="int">
|
||||
</argument>
|
||||
<return type="Color" />
|
||||
<argument index="0" name="face" type="int" />
|
||||
<argument index="1" name="index" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_face_point_color_mixed">
|
||||
<return type="Color">
|
||||
</return>
|
||||
<argument index="0" name="face" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="index" type="int">
|
||||
</argument>
|
||||
<return type="Color" />
|
||||
<argument index="0" name="face" type="int" />
|
||||
<argument index="1" name="index" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_face_point_light_color">
|
||||
<return type="Color">
|
||||
</return>
|
||||
<argument index="0" name="face" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="index" type="int">
|
||||
</argument>
|
||||
<return type="Color" />
|
||||
<argument index="0" name="face" type="int" />
|
||||
<argument index="1" name="index" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_face_type">
|
||||
<return type="int" />
|
||||
<argument index="0" name="face" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_opposite_face">
|
||||
<return type="int">
|
||||
</return>
|
||||
<argument index="0" name="face" type="int">
|
||||
</argument>
|
||||
<return type="int" />
|
||||
<argument index="0" name="face" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_point">
|
||||
<return type="Vector3">
|
||||
</return>
|
||||
<argument index="0" name="index" type="int">
|
||||
</argument>
|
||||
<return type="Vector3" />
|
||||
<argument index="0" name="index" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_point_ao">
|
||||
<return type="int">
|
||||
</return>
|
||||
<argument index="0" name="index" type="int">
|
||||
</argument>
|
||||
<return type="int" />
|
||||
<argument index="0" name="index" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_point_fill">
|
||||
<return type="int">
|
||||
</return>
|
||||
<argument index="0" name="index" type="int">
|
||||
</argument>
|
||||
<return type="int" />
|
||||
<argument index="0" name="index" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_point_for_face">
|
||||
<return type="Vector3">
|
||||
</return>
|
||||
<argument index="0" name="face" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="index" type="int">
|
||||
</argument>
|
||||
<return type="Vector3" />
|
||||
<argument index="0" name="face" type="int" />
|
||||
<argument index="1" name="index" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_point_id">
|
||||
<return type="int">
|
||||
</return>
|
||||
<argument index="0" name="x" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="y" type="int">
|
||||
</argument>
|
||||
<argument index="2" name="z" type="int">
|
||||
</argument>
|
||||
<return type="int" />
|
||||
<argument index="0" name="x" type="int" />
|
||||
<argument index="1" name="y" type="int" />
|
||||
<argument index="2" name="z" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_point_index">
|
||||
<return type="int">
|
||||
</return>
|
||||
<argument index="0" name="face" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="index" type="int">
|
||||
</argument>
|
||||
<return type="int" />
|
||||
<argument index="0" name="face" type="int" />
|
||||
<argument index="1" name="index" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_point_neighbours">
|
||||
<return type="int">
|
||||
</return>
|
||||
<argument index="0" name="index" type="int">
|
||||
</argument>
|
||||
<return type="int" />
|
||||
<argument index="0" name="index" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_point_type">
|
||||
<return type="int">
|
||||
</return>
|
||||
<argument index="0" name="index" type="int">
|
||||
</argument>
|
||||
<return type="int" />
|
||||
<argument index="0" name="index" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_point_uv_direction">
|
||||
<return type="Vector2">
|
||||
</return>
|
||||
<argument index="0" name="face" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="index" type="int">
|
||||
</argument>
|
||||
<return type="Vector2" />
|
||||
<argument index="0" name="face" type="int" />
|
||||
<argument index="1" name="index" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_points_for_face">
|
||||
<return type="Vector3">
|
||||
</return>
|
||||
<argument index="0" name="face" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="index" type="int">
|
||||
</argument>
|
||||
<return type="Vector3" />
|
||||
<argument index="0" name="face" type="int" />
|
||||
<argument index="1" name="index" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_top_left_point">
|
||||
<return type="Vector3">
|
||||
</return>
|
||||
<argument index="0" name="face" type="int">
|
||||
</argument>
|
||||
<return type="Vector3" />
|
||||
<argument index="0" name="face" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_top_right_point">
|
||||
<return type="Vector3">
|
||||
</return>
|
||||
<argument index="0" name="face" type="int">
|
||||
</argument>
|
||||
<return type="Vector3" />
|
||||
<argument index="0" name="face" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_vertex_vector3_for_point">
|
||||
<return type="Vector3">
|
||||
</return>
|
||||
<argument index="0" name="face" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="index" type="int">
|
||||
</argument>
|
||||
<return type="Vector3" />
|
||||
<argument index="0" name="face" type="int" />
|
||||
<argument index="1" name="index" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="has_points">
|
||||
<return type="bool">
|
||||
</return>
|
||||
<return type="bool" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="is_face_visible">
|
||||
<return type="bool">
|
||||
</return>
|
||||
<argument index="0" name="face" type="int">
|
||||
</argument>
|
||||
<return type="bool" />
|
||||
<argument index="0" name="face" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="is_sub_voxel_point">
|
||||
<return type="bool">
|
||||
</return>
|
||||
<argument index="0" name="x" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="y" type="int">
|
||||
</argument>
|
||||
<argument index="2" name="z" type="int">
|
||||
</argument>
|
||||
<return type="bool" />
|
||||
<argument index="0" name="x" type="int" />
|
||||
<argument index="1" name="y" type="int" />
|
||||
<argument index="2" name="z" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="refresh_points">
|
||||
<return type="void">
|
||||
</return>
|
||||
<return type="void" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_point">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="point" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="x" type="int">
|
||||
</argument>
|
||||
<argument index="2" name="y" type="int">
|
||||
</argument>
|
||||
<argument index="3" name="z" type="int">
|
||||
</argument>
|
||||
<return type="void" />
|
||||
<argument index="0" name="point" type="int" />
|
||||
<argument index="1" name="x" type="int" />
|
||||
<argument index="2" name="y" type="int" />
|
||||
<argument index="3" name="z" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="setup">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="chunk" type="VoxelChunk">
|
||||
</argument>
|
||||
<argument index="1" name="x" type="int">
|
||||
</argument>
|
||||
<argument index="2" name="y" type="int">
|
||||
</argument>
|
||||
<argument index="3" name="z" type="int">
|
||||
</argument>
|
||||
<argument index="4" name="size" type="int" default="1">
|
||||
</argument>
|
||||
<return type="void" />
|
||||
<argument index="0" name="chunk" type="VoxelChunk" />
|
||||
<argument index="1" name="x" type="int" />
|
||||
<argument index="2" name="y" type="int" />
|
||||
<argument index="3" name="z" type="int" />
|
||||
<argument index="4" name="size" type="int" default="1" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
</methods>
|
||||
<members>
|
||||
<member name="channel_index_isolevel" type="int" setter="set_channel_index_isolevel" getter="get_channel_index_isolevel" default="0">
|
||||
</member>
|
||||
<member name="channel_index_type" type="int" setter="set_channel_index_type" getter="get_channel_index_type" default="0">
|
||||
</member>
|
||||
<member name="size" type="int" setter="set_size" getter="get_size" default="1">
|
||||
</member>
|
||||
<member name="x" type="int" setter="set_x" getter="get_x" default="0">
|
||||
|
107
doc_classes/VoxelJob.xml
Normal file
107
doc_classes/VoxelJob.xml
Normal file
@ -0,0 +1,107 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="VoxelJob" inherits="ThreadPoolJob" version="3.5">
|
||||
<brief_description>
|
||||
</brief_description>
|
||||
<description>
|
||||
</description>
|
||||
<tutorials>
|
||||
</tutorials>
|
||||
<methods>
|
||||
<method name="_execute_phase" qualifiers="virtual">
|
||||
<return type="void" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="_physics_process" qualifiers="virtual">
|
||||
<return type="void" />
|
||||
<argument index="0" name="delta" type="float" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="_process" qualifiers="virtual">
|
||||
<return type="void" />
|
||||
<argument index="0" name="delta" type="float" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="_reset" qualifiers="virtual">
|
||||
<return type="void" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="chunk_exit_tree">
|
||||
<return type="void" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="execute_phase">
|
||||
<return type="void" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="generate_ao">
|
||||
<return type="void" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="generate_random_ao">
|
||||
<return type="void" />
|
||||
<argument index="0" name="seed" type="int" />
|
||||
<argument index="1" name="octaves" type="int" default="4" />
|
||||
<argument index="2" name="period" type="int" default="30" />
|
||||
<argument index="3" name="persistence" type="float" default="0.3" />
|
||||
<argument index="4" name="scale_factor" type="float" default="0.6" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_build_done">
|
||||
<return type="bool" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_phase">
|
||||
<return type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="next_job">
|
||||
<return type="void" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="next_phase">
|
||||
<return type="void" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="reset">
|
||||
<return type="void" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_build_done">
|
||||
<return type="void" />
|
||||
<argument index="0" name="val" type="bool" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_chunk">
|
||||
<return type="void" />
|
||||
<argument index="0" name="chunk" type="VoxelChunk" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_phase">
|
||||
<return type="void" />
|
||||
<argument index="0" name="phase" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
</methods>
|
||||
<members>
|
||||
<member name="build_phase_type" type="int" setter="set_build_phase_type" getter="get_build_phase_type" enum="VoxelJob.ActiveBuildPhaseType" default="0">
|
||||
</member>
|
||||
</members>
|
||||
<constants>
|
||||
</constants>
|
||||
</class>
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="VoxelmanLevelGenerator" inherits="Resource" version="3.2">
|
||||
<class name="VoxelLevelGenerator" inherits="Resource" version="3.5">
|
||||
<brief_description>
|
||||
</brief_description>
|
||||
<description>
|
||||
@ -8,18 +8,14 @@
|
||||
</tutorials>
|
||||
<methods>
|
||||
<method name="_generate_chunk" qualifiers="virtual">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="chunk" type="VoxelChunk">
|
||||
</argument>
|
||||
<return type="void" />
|
||||
<argument index="0" name="chunk" type="VoxelChunk" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="generate_chunk">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="chunk" type="VoxelChunk">
|
||||
</argument>
|
||||
<return type="void" />
|
||||
<argument index="0" name="chunk" type="VoxelChunk" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="VoxelmanLevelGeneratorFlat" inherits="VoxelmanLevelGenerator" version="3.2">
|
||||
<class name="VoxelLevelGeneratorFlat" inherits="VoxelLevelGenerator" version="3.5">
|
||||
<brief_description>
|
||||
</brief_description>
|
||||
<description>
|
264
doc_classes/VoxelLibrary.xml
Normal file
264
doc_classes/VoxelLibrary.xml
Normal file
@ -0,0 +1,264 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="VoxelLibrary" inherits="Resource" version="3.5">
|
||||
<brief_description>
|
||||
</brief_description>
|
||||
<description>
|
||||
</description>
|
||||
<tutorials>
|
||||
</tutorials>
|
||||
<methods>
|
||||
<method name="_setup_material_albedo" qualifiers="virtual">
|
||||
<return type="void" />
|
||||
<argument index="0" name="material_index" type="int" />
|
||||
<argument index="1" name="texture" type="Texture" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="liquid_material_add">
|
||||
<return type="void" />
|
||||
<argument index="0" name="value" type="Material" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="liquid_material_get">
|
||||
<return type="Material" />
|
||||
<argument index="0" name="index" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="liquid_material_get_num" qualifiers="const">
|
||||
<return type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="liquid_material_remove">
|
||||
<return type="void" />
|
||||
<argument index="0" name="index" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="liquid_material_set">
|
||||
<return type="void" />
|
||||
<argument index="0" name="index" type="int" />
|
||||
<argument index="1" name="value" type="Material" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="liquid_materials_clear">
|
||||
<return type="void" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="material_add">
|
||||
<return type="void" />
|
||||
<argument index="0" name="value" type="Material" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="material_get">
|
||||
<return type="Material" />
|
||||
<argument index="0" name="index" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="material_get_num" qualifiers="const">
|
||||
<return type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="material_remove">
|
||||
<return type="void" />
|
||||
<argument index="0" name="index" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="material_set">
|
||||
<return type="void" />
|
||||
<argument index="0" name="index" type="int" />
|
||||
<argument index="1" name="value" type="Material" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="materials_clear">
|
||||
<return type="void" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="prop_add">
|
||||
<return type="void" />
|
||||
<argument index="0" name="value" type="PropData" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="prop_get">
|
||||
<return type="PropData" />
|
||||
<argument index="0" name="id" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="prop_get_num" qualifiers="const">
|
||||
<return type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="prop_has" qualifiers="const">
|
||||
<return type="bool" />
|
||||
<argument index="0" name="prop" type="PropData" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="prop_material_add">
|
||||
<return type="void" />
|
||||
<argument index="0" name="value" type="Material" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="prop_material_get">
|
||||
<return type="Material" />
|
||||
<argument index="0" name="index" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="prop_material_get_num" qualifiers="const">
|
||||
<return type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="prop_material_remove">
|
||||
<return type="void" />
|
||||
<argument index="0" name="index" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="prop_material_set">
|
||||
<return type="void" />
|
||||
<argument index="0" name="index" type="int" />
|
||||
<argument index="1" name="value" type="Material" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="prop_materials_clear">
|
||||
<return type="void" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="prop_remove">
|
||||
<return type="void" />
|
||||
<argument index="0" name="id" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="prop_set">
|
||||
<return type="void" />
|
||||
<argument index="0" name="id" type="int" />
|
||||
<argument index="1" name="surface" type="PropData" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="props_clear">
|
||||
<return type="void" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="refresh_rects">
|
||||
<return type="void" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="scene_add">
|
||||
<return type="void" />
|
||||
<argument index="0" name="value" type="PackedScene" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="scene_get">
|
||||
<return type="PackedScene" />
|
||||
<argument index="0" name="index" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="scene_get_num" qualifiers="const">
|
||||
<return type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="scene_remove">
|
||||
<return type="void" />
|
||||
<argument index="0" name="index" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="scene_set">
|
||||
<return type="void" />
|
||||
<argument index="0" name="index" type="int" />
|
||||
<argument index="1" name="value" type="PackedScene" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="scenes_clear">
|
||||
<return type="void" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="setup_material_albedo">
|
||||
<return type="void" />
|
||||
<argument index="0" name="material_index" type="int" />
|
||||
<argument index="1" name="texture" type="Texture" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="voxel_surface_add">
|
||||
<return type="void" />
|
||||
<argument index="0" name="value" type="VoxelSurface" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="voxel_surface_get">
|
||||
<return type="VoxelSurface" />
|
||||
<argument index="0" name="index" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="voxel_surface_get_num" qualifiers="const">
|
||||
<return type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="voxel_surface_remove">
|
||||
<return type="void" />
|
||||
<argument index="0" name="index" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="voxel_surface_set">
|
||||
<return type="void" />
|
||||
<argument index="0" name="index" type="int" />
|
||||
<argument index="1" name="surface" type="VoxelSurface" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="voxel_surfaces_clear">
|
||||
<return type="void" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
</methods>
|
||||
<members>
|
||||
<member name="initialized" type="bool" setter="set_initialized" getter="get_initialized">
|
||||
</member>
|
||||
<member name="liquid_materials" type="Array" setter="liquid_materials_set" getter="liquid_materials_get" default="[ ]">
|
||||
</member>
|
||||
<member name="materials" type="Array" setter="materials_set" getter="materials_get" default="[ ]">
|
||||
</member>
|
||||
<member name="prop_materials" type="Array" setter="prop_materials_set" getter="prop_materials_get" default="[ ]">
|
||||
</member>
|
||||
</members>
|
||||
<constants>
|
||||
<constant name="MATERIAL_INDEX_VOXELS" value="0">
|
||||
</constant>
|
||||
<constant name="MATERIAL_INDEX_LIQUID" value="1">
|
||||
</constant>
|
||||
<constant name="MATERIAL_INDEX_PROP" value="2">
|
||||
</constant>
|
||||
</constants>
|
||||
</class>
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="VoxelmanLibraryMerger" inherits="VoxelmanLibrary" version="3.2">
|
||||
<class name="VoxelLibraryMerger" inherits="VoxelLibrary" version="3.5">
|
||||
<brief_description>
|
||||
</brief_description>
|
||||
<description>
|
||||
@ -7,6 +7,17 @@
|
||||
<tutorials>
|
||||
</tutorials>
|
||||
<methods>
|
||||
<method name="get_prop_packer">
|
||||
<return type="TexturePacker" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_prop_uv_rect">
|
||||
<return type="Rect2" />
|
||||
<argument index="0" name="texture" type="Texture" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
</methods>
|
||||
<members>
|
||||
<member name="background_color" type="Color" setter="set_background_color" getter="get_background_color" default="Color( 0, 0, 0, 1 )">
|
||||
@ -17,6 +28,8 @@
|
||||
</member>
|
||||
<member name="max_atlas_size" type="int" setter="set_max_atlas_size" getter="get_max_atlas_size" default="1024">
|
||||
</member>
|
||||
<member name="props" type="Array" setter="set_props" getter="get_props" default="[ ]">
|
||||
</member>
|
||||
<member name="texture_flags" type="int" setter="set_texture_flags" getter="get_texture_flags" default="5">
|
||||
</member>
|
||||
<member name="voxel_surfaces" type="Array" setter="set_voxel_surfaces" getter="get_voxel_surfaces" default="[ ]">
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="VoxelmanLibrarySimple" inherits="VoxelmanLibrary" version="3.2">
|
||||
<class name="VoxelLibrarySimple" inherits="VoxelLibrary" version="3.5">
|
||||
<brief_description>
|
||||
</brief_description>
|
||||
<description>
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="VoxelLight" inherits="Reference" version="3.2">
|
||||
<class name="VoxelLight" inherits="Reference" version="3.5">
|
||||
<brief_description>
|
||||
</brief_description>
|
||||
<description>
|
||||
@ -8,32 +8,25 @@
|
||||
</tutorials>
|
||||
<methods>
|
||||
<method name="get_world_position_x" qualifiers="const">
|
||||
<return type="int">
|
||||
</return>
|
||||
<return type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_world_position_y" qualifiers="const">
|
||||
<return type="int">
|
||||
</return>
|
||||
<return type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_world_position_z" qualifiers="const">
|
||||
<return type="int">
|
||||
</return>
|
||||
<return type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_world_position">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="x" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="y" type="int">
|
||||
</argument>
|
||||
<argument index="2" name="z" type="int">
|
||||
</argument>
|
||||
<return type="void" />
|
||||
<argument index="0" name="x" type="int" />
|
||||
<argument index="1" name="y" type="int" />
|
||||
<argument index="2" name="z" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
|
13
doc_classes/VoxelLightJob.xml
Normal file
13
doc_classes/VoxelLightJob.xml
Normal file
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="VoxelLightJob" inherits="VoxelJob" version="3.5">
|
||||
<brief_description>
|
||||
</brief_description>
|
||||
<description>
|
||||
</description>
|
||||
<tutorials>
|
||||
</tutorials>
|
||||
<methods>
|
||||
</methods>
|
||||
<constants>
|
||||
</constants>
|
||||
</class>
|
13
doc_classes/VoxelLightNode.xml
Normal file
13
doc_classes/VoxelLightNode.xml
Normal file
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="VoxelLightNode" inherits="Spatial" version="3.5">
|
||||
<brief_description>
|
||||
</brief_description>
|
||||
<description>
|
||||
</description>
|
||||
<tutorials>
|
||||
</tutorials>
|
||||
<methods>
|
||||
</methods>
|
||||
<constants>
|
||||
</constants>
|
||||
</class>
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="VoxelMesher" inherits="Reference" version="3.2">
|
||||
<class name="VoxelMesher" inherits="Reference" version="3.5">
|
||||
<brief_description>
|
||||
</brief_description>
|
||||
<description>
|
||||
@ -8,348 +8,274 @@
|
||||
</tutorials>
|
||||
<methods>
|
||||
<method name="_add_chunk" qualifiers="virtual">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="chunk" type="VoxelChunk">
|
||||
</argument>
|
||||
<return type="void" />
|
||||
<argument index="0" name="chunk" type="VoxelChunk" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="_add_mesher" qualifiers="virtual">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="mesher" type="VoxelMesher">
|
||||
</argument>
|
||||
<return type="void" />
|
||||
<argument index="0" name="mesher" type="VoxelMesher" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="_bake_colors" qualifiers="virtual">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="chunk" type="VoxelChunk">
|
||||
</argument>
|
||||
<return type="void" />
|
||||
<argument index="0" name="chunk" type="VoxelChunk" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="_bake_liquid_colors" qualifiers="virtual">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="chunk" type="VoxelChunk">
|
||||
</argument>
|
||||
<return type="void" />
|
||||
<argument index="0" name="chunk" type="VoxelChunk" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="add_chunk">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="chunk" type="VoxelChunk">
|
||||
</argument>
|
||||
<return type="void" />
|
||||
<argument index="0" name="chunk" type="VoxelChunk" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="add_color">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="color" type="Color">
|
||||
</argument>
|
||||
<return type="void" />
|
||||
<argument index="0" name="color" type="Color" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="add_indices">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="indice" type="int">
|
||||
</argument>
|
||||
<return type="void" />
|
||||
<argument index="0" name="indice" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="add_mesh_data_resource">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="mesh" type="MeshDataResource">
|
||||
</argument>
|
||||
<argument index="1" name="position" type="Vector3" default="Rect2( 0, 0, 1, 1 )">
|
||||
</argument>
|
||||
<argument index="2" name="rotation" type="Vector3" default="Vector3( 1, 1, 1 )">
|
||||
</argument>
|
||||
<argument index="3" name="scale" type="Vector3" default="Vector3( 0, 0, 0 )">
|
||||
</argument>
|
||||
<argument index="4" name="uv_rect" type="Rect2" default="Vector3( 0, 0, 0 )">
|
||||
</argument>
|
||||
<return type="void" />
|
||||
<argument index="0" name="mesh" type="MeshDataResource" />
|
||||
<argument index="1" name="position" type="Vector3" default="Rect2( 0, 0, 1, 1 )" />
|
||||
<argument index="2" name="rotation" type="Vector3" default="Vector3( 1, 1, 1 )" />
|
||||
<argument index="3" name="scale" type="Vector3" default="Vector3( 0, 0, 0 )" />
|
||||
<argument index="4" name="uv_rect" type="Rect2" default="Vector3( 0, 0, 0 )" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="add_mesh_data_resource_transform">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="mesh" type="MeshDataResource">
|
||||
</argument>
|
||||
<argument index="1" name="transform" type="Transform">
|
||||
</argument>
|
||||
<argument index="2" name="uv_rect" type="Rect2" default="Rect2( 0, 0, 1, 1 )">
|
||||
</argument>
|
||||
<return type="void" />
|
||||
<argument index="0" name="mesh" type="MeshDataResource" />
|
||||
<argument index="1" name="transform" type="Transform" />
|
||||
<argument index="2" name="uv_rect" type="Rect2" default="Rect2( 0, 0, 1, 1 )" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="add_mesh_data_resource_transform_colored">
|
||||
<return type="void" />
|
||||
<argument index="0" name="mesh" type="MeshDataResource" />
|
||||
<argument index="1" name="transform" type="Transform" />
|
||||
<argument index="2" name="colors" type="PoolColorArray" />
|
||||
<argument index="3" name="uv_rect" type="Rect2" default="Rect2( 0, 0, 1, 1 )" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="add_mesher">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="mesher" type="VoxelMesher">
|
||||
</argument>
|
||||
<return type="void" />
|
||||
<argument index="0" name="mesher" type="VoxelMesher" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="add_normal">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="normal" type="Vector3">
|
||||
</argument>
|
||||
<return type="void" />
|
||||
<argument index="0" name="normal" type="Vector3" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="add_uv">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="uv" type="Vector2">
|
||||
</argument>
|
||||
<return type="void" />
|
||||
<argument index="0" name="uv" type="Vector2" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="add_uv2">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="uv" type="Vector2">
|
||||
</argument>
|
||||
<return type="void" />
|
||||
<argument index="0" name="uv" type="Vector2" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="add_vertex">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="vertex" type="Vector3">
|
||||
</argument>
|
||||
<return type="void" />
|
||||
<argument index="0" name="vertex" type="Vector3" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="bake_colors">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="chunk" type="VoxelChunk">
|
||||
</argument>
|
||||
<return type="void" />
|
||||
<argument index="0" name="chunk" type="VoxelChunk" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="bake_liquid_colors">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="chunk" type="VoxelChunk">
|
||||
</argument>
|
||||
<return type="void" />
|
||||
<argument index="0" name="chunk" type="VoxelChunk" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="build_collider" qualifiers="const">
|
||||
<return type="PoolVector3Array">
|
||||
</return>
|
||||
<return type="PoolVector3Array" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="build_mesh">
|
||||
<return type="Array">
|
||||
</return>
|
||||
<return type="Array" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="build_mesh_into">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="mesh_rid" type="RID">
|
||||
</argument>
|
||||
<return type="void" />
|
||||
<argument index="0" name="mesh_rid" type="RID" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="generate_normals">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="flip" type="bool" default="false">
|
||||
</argument>
|
||||
<return type="void" />
|
||||
<argument index="0" name="flip" type="bool" default="false" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_color" qualifiers="const">
|
||||
<return type="Color">
|
||||
</return>
|
||||
<argument index="0" name="idx" type="int">
|
||||
</argument>
|
||||
<return type="Color" />
|
||||
<argument index="0" name="idx" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_colors" qualifiers="const">
|
||||
<return type="PoolColorArray">
|
||||
</return>
|
||||
<return type="PoolColorArray" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_index" qualifiers="const">
|
||||
<return type="int">
|
||||
</return>
|
||||
<argument index="0" name="idx" type="int">
|
||||
</argument>
|
||||
<return type="int" />
|
||||
<argument index="0" name="idx" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_indices" qualifiers="const">
|
||||
<return type="PoolIntArray">
|
||||
</return>
|
||||
<return type="PoolIntArray" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_indices_count" qualifiers="const">
|
||||
<return type="int">
|
||||
</return>
|
||||
<return type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_normal" qualifiers="const">
|
||||
<return type="Vector3">
|
||||
</return>
|
||||
<argument index="0" name="idx" type="int">
|
||||
</argument>
|
||||
<return type="Vector3" />
|
||||
<argument index="0" name="idx" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_normals" qualifiers="const">
|
||||
<return type="PoolVector3Array">
|
||||
</return>
|
||||
<return type="PoolVector3Array" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_uv" qualifiers="const">
|
||||
<return type="Vector2">
|
||||
</return>
|
||||
<argument index="0" name="idx" type="int">
|
||||
</argument>
|
||||
<return type="Vector2" />
|
||||
<argument index="0" name="idx" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_uv2" qualifiers="const">
|
||||
<return type="Vector2">
|
||||
</return>
|
||||
<argument index="0" name="idx" type="int">
|
||||
</argument>
|
||||
<return type="Vector2" />
|
||||
<argument index="0" name="idx" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_uv2s" qualifiers="const">
|
||||
<return type="PoolVector2Array">
|
||||
</return>
|
||||
<return type="PoolVector2Array" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_uvs" qualifiers="const">
|
||||
<return type="PoolVector2Array">
|
||||
</return>
|
||||
<return type="PoolVector2Array" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_vertex" qualifiers="const">
|
||||
<return type="Vector3">
|
||||
</return>
|
||||
<argument index="0" name="idx" type="int">
|
||||
</argument>
|
||||
<return type="Vector3" />
|
||||
<argument index="0" name="idx" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_vertex_count" qualifiers="const">
|
||||
<return type="int">
|
||||
</return>
|
||||
<return type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_vertices" qualifiers="const">
|
||||
<return type="PoolVector3Array">
|
||||
</return>
|
||||
<return type="PoolVector3Array" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="remove_doubles">
|
||||
<return type="void">
|
||||
</return>
|
||||
<return type="void" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="remove_doubles_hashed">
|
||||
<return type="void">
|
||||
</return>
|
||||
<return type="void" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="remove_index">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="idx" type="int">
|
||||
</argument>
|
||||
<return type="void" />
|
||||
<argument index="0" name="idx" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="remove_vertex">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="idx" type="int">
|
||||
</argument>
|
||||
<return type="void" />
|
||||
<argument index="0" name="idx" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="reset">
|
||||
<return type="void">
|
||||
</return>
|
||||
<return type="void" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_colors">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="values" type="PoolColorArray">
|
||||
</argument>
|
||||
<return type="void" />
|
||||
<argument index="0" name="values" type="PoolColorArray" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_indices">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="values" type="PoolIntArray">
|
||||
</argument>
|
||||
<return type="void" />
|
||||
<argument index="0" name="values" type="PoolIntArray" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_normals">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="values" type="PoolVector3Array">
|
||||
</argument>
|
||||
<return type="void" />
|
||||
<argument index="0" name="values" type="PoolVector3Array" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_uv2s">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="values" type="PoolVector2Array">
|
||||
</argument>
|
||||
<return type="void" />
|
||||
<argument index="0" name="values" type="PoolVector2Array" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_uvs">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="values" type="PoolVector2Array">
|
||||
</argument>
|
||||
<return type="void" />
|
||||
<argument index="0" name="values" type="PoolVector2Array" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_vertices">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="values" type="PoolVector3Array">
|
||||
</argument>
|
||||
<return type="void" />
|
||||
<argument index="0" name="values" type="PoolVector3Array" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
@ -359,16 +285,20 @@
|
||||
</member>
|
||||
<member name="base_light_value" type="float" setter="set_base_light_value" getter="get_base_light_value" default="0.5">
|
||||
</member>
|
||||
<member name="channel_index_isolevel" type="int" setter="set_channel_index_isolevel" getter="get_channel_index_isolevel" default="0">
|
||||
</member>
|
||||
<member name="channel_index_type" type="int" setter="set_channel_index_type" getter="get_channel_index_type" default="0">
|
||||
</member>
|
||||
<member name="format" type="int" setter="set_format" getter="get_format" default="0">
|
||||
</member>
|
||||
<member name="library" type="VoxelmanLibrary" setter="set_library" getter="get_library">
|
||||
</member>
|
||||
<member name="lod_size" type="int" setter="set_lod_size" getter="get_lod_size" default="1">
|
||||
<member name="library" type="VoxelLibrary" setter="set_library" getter="get_library">
|
||||
</member>
|
||||
<member name="material" type="Material" setter="set_material" getter="get_material">
|
||||
</member>
|
||||
<member name="mesher_index" type="int" setter="set_mesher_index" getter="get_mesher_index" default="0">
|
||||
</member>
|
||||
<member name="texture_scale" type="int" setter="set_texture_scale" getter="get_texture_scale" default="1">
|
||||
</member>
|
||||
<member name="uv_margin" type="Rect2" setter="set_uv_margin" getter="get_uv_margin" default="Rect2( 0, 0, 1, 1 )">
|
||||
</member>
|
||||
<member name="voxel_scale" type="float" setter="set_voxel_scale" getter="get_voxel_scale" default="1.0">
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="VoxelMesherBlocky" inherits="VoxelMesherDefault" version="3.2">
|
||||
<class name="VoxelMesherBlocky" inherits="VoxelMesherDefault" version="3.5">
|
||||
<brief_description>
|
||||
</brief_description>
|
||||
<description>
|
||||
@ -8,6 +8,10 @@
|
||||
</tutorials>
|
||||
<methods>
|
||||
</methods>
|
||||
<members>
|
||||
<member name="always_add_colors" type="bool" setter="set_always_add_colors" getter="get_always_add_colors" default="false">
|
||||
</member>
|
||||
</members>
|
||||
<constants>
|
||||
</constants>
|
||||
</class>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="VoxelMesherCubic" inherits="VoxelMesherDefault" version="3.2">
|
||||
<class name="VoxelMesherCubic" inherits="VoxelMesherDefault" version="3.5">
|
||||
<brief_description>
|
||||
</brief_description>
|
||||
<description>
|
||||
@ -9,7 +9,7 @@
|
||||
<methods>
|
||||
</methods>
|
||||
<members>
|
||||
<member name="format" type="int" setter="set_format" getter="get_format" override="true" default="26" />
|
||||
<member name="format" type="int" setter="set_format" getter="get_format" overrides="VoxelMesher" default="26" />
|
||||
</members>
|
||||
<constants>
|
||||
</constants>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="VoxelMesherDefault" inherits="VoxelMesher" version="3.2">
|
||||
<class name="VoxelMesherDefault" inherits="VoxelMesher" version="3.5">
|
||||
<brief_description>
|
||||
</brief_description>
|
||||
<description>
|
||||
@ -11,7 +11,7 @@
|
||||
<members>
|
||||
<member name="build_flags" type="int" setter="set_build_flags" getter="get_build_flags" default="384">
|
||||
</member>
|
||||
<member name="format" type="int" setter="set_format" getter="get_format" override="true" default="18" />
|
||||
<member name="format" type="int" setter="set_format" getter="get_format" overrides="VoxelMesher" default="18" />
|
||||
</members>
|
||||
<constants>
|
||||
</constants>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="VoxelMesherLiquidBlocky" inherits="VoxelMesherDefault" version="3.2">
|
||||
<class name="VoxelMesherLiquidBlocky" inherits="VoxelMesherDefault" version="3.5">
|
||||
<brief_description>
|
||||
</brief_description>
|
||||
<description>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="VoxelMesherMarchingCubes" inherits="VoxelMesherDefault" version="3.2">
|
||||
<class name="VoxelMesherMarchingCubes" inherits="VoxelMesherDefault" version="3.5">
|
||||
<brief_description>
|
||||
</brief_description>
|
||||
<description>
|
||||
@ -8,94 +8,68 @@
|
||||
</tutorials>
|
||||
<methods>
|
||||
<method name="corner_id_to_vertex" qualifiers="const">
|
||||
<return type="Vector3">
|
||||
</return>
|
||||
<argument index="0" name="index1" type="int">
|
||||
</argument>
|
||||
<return type="Vector3" />
|
||||
<argument index="0" name="index1" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_regular_cell_class" qualifiers="const">
|
||||
<return type="int">
|
||||
</return>
|
||||
<argument index="0" name="index" type="int">
|
||||
</argument>
|
||||
<return type="int" />
|
||||
<argument index="0" name="index" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_regular_cell_data" qualifiers="const">
|
||||
<return type="MarchingCubesCellData">
|
||||
</return>
|
||||
<argument index="0" name="index" type="int">
|
||||
</argument>
|
||||
<return type="MarchingCubesCellData" />
|
||||
<argument index="0" name="index" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_regular_vertex_data" qualifiers="const">
|
||||
<return type="int">
|
||||
</return>
|
||||
<argument index="0" name="index1" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="index2" type="int">
|
||||
</argument>
|
||||
<return type="int" />
|
||||
<argument index="0" name="index1" type="int" />
|
||||
<argument index="1" name="index2" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_regular_vertex_data_first_vertex" qualifiers="const">
|
||||
<return type="int">
|
||||
</return>
|
||||
<argument index="0" name="index1" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="index2" type="int">
|
||||
</argument>
|
||||
<return type="int" />
|
||||
<argument index="0" name="index1" type="int" />
|
||||
<argument index="1" name="index2" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_regular_vertex_data_second_vertex" qualifiers="const">
|
||||
<return type="int">
|
||||
</return>
|
||||
<argument index="0" name="index1" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="index2" type="int">
|
||||
</argument>
|
||||
<return type="int" />
|
||||
<argument index="0" name="index1" type="int" />
|
||||
<argument index="1" name="index2" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_regular_vertex_direction" qualifiers="const">
|
||||
<return type="Vector3">
|
||||
</return>
|
||||
<argument index="0" name="index1" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="index2" type="int">
|
||||
</argument>
|
||||
<return type="Vector3" />
|
||||
<argument index="0" name="index1" type="int" />
|
||||
<argument index="1" name="index2" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_regular_vertex_first_position" qualifiers="const">
|
||||
<return type="Vector3">
|
||||
</return>
|
||||
<argument index="0" name="index1" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="index2" type="int">
|
||||
</argument>
|
||||
<return type="Vector3" />
|
||||
<argument index="0" name="index1" type="int" />
|
||||
<argument index="1" name="index2" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_regular_vertex_second_position" qualifiers="const">
|
||||
<return type="Vector3">
|
||||
</return>
|
||||
<argument index="0" name="index1" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="index2" type="int">
|
||||
</argument>
|
||||
<return type="Vector3" />
|
||||
<argument index="0" name="index1" type="int" />
|
||||
<argument index="1" name="index2" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
</methods>
|
||||
<members>
|
||||
<member name="format" type="int" setter="set_format" getter="get_format" override="true" default="58" />
|
||||
<member name="texture_scale" type="int" setter="set_texture_scale" getter="get_texture_scale" default="4">
|
||||
</member>
|
||||
<member name="format" type="int" setter="set_format" getter="get_format" overrides="VoxelMesher" default="58" />
|
||||
</members>
|
||||
<constants>
|
||||
<constant name="VOXEL_ENTRY_INDEX_000" value="0" enum="VoxelEntryIndices">
|
||||
|
18
doc_classes/VoxelPropJob.xml
Normal file
18
doc_classes/VoxelPropJob.xml
Normal file
@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="VoxelPropJob" inherits="VoxelJob" version="3.5">
|
||||
<brief_description>
|
||||
</brief_description>
|
||||
<description>
|
||||
</description>
|
||||
<tutorials>
|
||||
</tutorials>
|
||||
<methods>
|
||||
</methods>
|
||||
<members>
|
||||
<member name="build_phase_type" type="int" setter="set_build_phase_type" getter="get_build_phase_type" overrides="VoxelJob" enum="VoxelJob.ActiveBuildPhaseType" default="2" />
|
||||
<member name="prop_mesher" type="VoxelMesher" setter="set_prop_mesher" getter="get_prop_mesher">
|
||||
</member>
|
||||
</members>
|
||||
<constants>
|
||||
</constants>
|
||||
</class>
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="VoxelStructure" inherits="Resource" version="3.2">
|
||||
<class name="VoxelStructure" inherits="Resource" version="3.5">
|
||||
<brief_description>
|
||||
</brief_description>
|
||||
<description>
|
||||
@ -8,30 +8,22 @@
|
||||
</tutorials>
|
||||
<methods>
|
||||
<method name="_write_to_chunk" qualifiers="virtual">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="chunk" type="VoxelChunk">
|
||||
</argument>
|
||||
<return type="void" />
|
||||
<argument index="0" name="chunk" type="VoxelChunk" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_position">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="x" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="y" type="int">
|
||||
</argument>
|
||||
<argument index="2" name="z" type="int">
|
||||
</argument>
|
||||
<return type="void" />
|
||||
<argument index="0" name="x" type="int" />
|
||||
<argument index="1" name="y" type="int" />
|
||||
<argument index="2" name="z" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="write_to_chunk">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="chunk" type="VoxelChunk">
|
||||
</argument>
|
||||
<return type="void" />
|
||||
<argument index="0" name="chunk" type="VoxelChunk" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="VoxelSurface" inherits="Resource" version="3.2">
|
||||
<class name="VoxelSurface" inherits="Resource" version="3.5">
|
||||
<brief_description>
|
||||
</brief_description>
|
||||
<description>
|
||||
@ -8,52 +8,37 @@
|
||||
</tutorials>
|
||||
<methods>
|
||||
<method name="get_rect" qualifiers="const">
|
||||
<return type="Rect2">
|
||||
</return>
|
||||
<argument index="0" name="side" type="int" enum="VoxelSurface.VoxelSurfaceSides">
|
||||
</argument>
|
||||
<return type="Rect2" />
|
||||
<argument index="0" name="side" type="int" enum="VoxelSurface.VoxelSurfaceSides" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="refresh_rects">
|
||||
<return type="void">
|
||||
</return>
|
||||
<return type="void" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_rect">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="side" type="int" enum="VoxelSurface.VoxelSurfaceSides">
|
||||
</argument>
|
||||
<argument index="1" name="rect" type="Rect2">
|
||||
</argument>
|
||||
<return type="void" />
|
||||
<argument index="0" name="side" type="int" enum="VoxelSurface.VoxelSurfaceSides" />
|
||||
<argument index="1" name="rect" type="Rect2" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="transform_uv" qualifiers="const">
|
||||
<return type="Vector2">
|
||||
</return>
|
||||
<argument index="0" name="side" type="int" enum="VoxelSurface.VoxelSurfaceSides">
|
||||
</argument>
|
||||
<argument index="1" name="uv" type="Vector2">
|
||||
</argument>
|
||||
<return type="Vector2" />
|
||||
<argument index="0" name="side" type="int" enum="VoxelSurface.VoxelSurfaceSides" />
|
||||
<argument index="1" name="uv" type="Vector2" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="transform_uv_scaled" qualifiers="const">
|
||||
<return type="Vector2">
|
||||
</return>
|
||||
<argument index="0" name="side" type="int" enum="VoxelSurface.VoxelSurfaceSides">
|
||||
</argument>
|
||||
<argument index="1" name="uv" type="Vector2">
|
||||
</argument>
|
||||
<argument index="2" name="p_current_x" type="int">
|
||||
</argument>
|
||||
<argument index="3" name="p_current_y" type="int">
|
||||
</argument>
|
||||
<argument index="4" name="max" type="int">
|
||||
</argument>
|
||||
<return type="Vector2" />
|
||||
<argument index="0" name="side" type="int" enum="VoxelSurface.VoxelSurfaceSides" />
|
||||
<argument index="1" name="uv" type="Vector2" />
|
||||
<argument index="2" name="p_current_x" type="int" />
|
||||
<argument index="3" name="p_current_y" type="int" />
|
||||
<argument index="4" name="max" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="VoxelSurfaceMerger" inherits="VoxelSurface" version="3.2">
|
||||
<class name="VoxelSurfaceMerger" inherits="VoxelSurface" version="3.5">
|
||||
<brief_description>
|
||||
</brief_description>
|
||||
<description>
|
||||
@ -8,38 +8,28 @@
|
||||
</tutorials>
|
||||
<methods>
|
||||
<method name="get_region">
|
||||
<return type="AtlasTexture">
|
||||
</return>
|
||||
<argument index="0" name="side" type="int" enum="VoxelSurface.VoxelSurfaceSides">
|
||||
</argument>
|
||||
<return type="AtlasTexture" />
|
||||
<argument index="0" name="side" type="int" enum="VoxelSurface.VoxelSurfaceSides" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_texture">
|
||||
<return type="Texture">
|
||||
</return>
|
||||
<argument index="0" name="side" type="int" enum="VoxelSurface.VoxelSurfaceSides">
|
||||
</argument>
|
||||
<return type="Texture" />
|
||||
<argument index="0" name="side" type="int" enum="VoxelSurface.VoxelSurfaceSides" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_region">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="side" type="int" enum="VoxelSurface.VoxelSurfaceSides">
|
||||
</argument>
|
||||
<argument index="1" name="texture" type="AtlasTexture">
|
||||
</argument>
|
||||
<return type="void" />
|
||||
<argument index="0" name="side" type="int" enum="VoxelSurface.VoxelSurfaceSides" />
|
||||
<argument index="1" name="texture" type="AtlasTexture" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_texture">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="side" type="int" enum="VoxelSurface.VoxelSurfaceSides">
|
||||
</argument>
|
||||
<argument index="1" name="texture" type="Texture">
|
||||
</argument>
|
||||
<return type="void" />
|
||||
<argument index="0" name="side" type="int" enum="VoxelSurface.VoxelSurfaceSides" />
|
||||
<argument index="1" name="texture" type="Texture" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="VoxelSurfaceSimple" inherits="VoxelSurface" version="3.2">
|
||||
<class name="VoxelSurfaceSimple" inherits="VoxelSurface" version="3.5">
|
||||
<brief_description>
|
||||
</brief_description>
|
||||
<description>
|
||||
@ -8,38 +8,28 @@
|
||||
</tutorials>
|
||||
<methods>
|
||||
<method name="get_atlas_x" qualifiers="const">
|
||||
<return type="int">
|
||||
</return>
|
||||
<argument index="0" name="side" type="int" enum="VoxelSurface.VoxelSurfaceSides">
|
||||
</argument>
|
||||
<return type="int" />
|
||||
<argument index="0" name="side" type="int" enum="VoxelSurface.VoxelSurfaceSides" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_atlas_y" qualifiers="const">
|
||||
<return type="int">
|
||||
</return>
|
||||
<argument index="0" name="side" type="int" enum="VoxelSurface.VoxelSurfaceSides">
|
||||
</argument>
|
||||
<return type="int" />
|
||||
<argument index="0" name="side" type="int" enum="VoxelSurface.VoxelSurfaceSides" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_atlas_x">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="side" type="int" enum="VoxelSurface.VoxelSurfaceSides">
|
||||
</argument>
|
||||
<argument index="1" name="value" type="int">
|
||||
</argument>
|
||||
<return type="void" />
|
||||
<argument index="0" name="side" type="int" enum="VoxelSurface.VoxelSurfaceSides" />
|
||||
<argument index="1" name="value" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_atlas_y">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="side" type="int" enum="VoxelSurface.VoxelSurfaceSides">
|
||||
</argument>
|
||||
<argument index="1" name="value" type="int">
|
||||
</argument>
|
||||
<return type="void" />
|
||||
<argument index="0" name="side" type="int" enum="VoxelSurface.VoxelSurfaceSides" />
|
||||
<argument index="1" name="value" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
|
73
doc_classes/VoxelTerrainJob.xml
Normal file
73
doc_classes/VoxelTerrainJob.xml
Normal file
@ -0,0 +1,73 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="VoxelTerrainJob" inherits="VoxelJob" version="3.5">
|
||||
<brief_description>
|
||||
</brief_description>
|
||||
<description>
|
||||
</description>
|
||||
<tutorials>
|
||||
</tutorials>
|
||||
<methods>
|
||||
<method name="add_liquid_mesher">
|
||||
<return type="void" />
|
||||
<argument index="0" name="mesher" type="VoxelMesher" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="add_mesher">
|
||||
<return type="void" />
|
||||
<argument index="0" name="mesher" type="VoxelMesher" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_liquid_mesher" qualifiers="const">
|
||||
<return type="VoxelMesher" />
|
||||
<argument index="0" name="index" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_liquid_mesher_count" qualifiers="const">
|
||||
<return type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_mesher" qualifiers="const">
|
||||
<return type="VoxelMesher" />
|
||||
<argument index="0" name="index" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_mesher_count" qualifiers="const">
|
||||
<return type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="remove_liquid_mesher">
|
||||
<return type="void" />
|
||||
<argument index="0" name="index" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="remove_mesher">
|
||||
<return type="void" />
|
||||
<argument index="0" name="index" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_liquid_mesher">
|
||||
<return type="void" />
|
||||
<argument index="0" name="index" type="int" />
|
||||
<argument index="1" name="mesher" type="VoxelMesher" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_mesher">
|
||||
<return type="void" />
|
||||
<argument index="0" name="index" type="int" />
|
||||
<argument index="1" name="mesher" type="VoxelMesher" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
</methods>
|
||||
<constants>
|
||||
</constants>
|
||||
</class>
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="VoxelWorld" inherits="Navigation" version="3.2">
|
||||
<class name="VoxelWorld" inherits="Navigation" version="3.5">
|
||||
<brief_description>
|
||||
</brief_description>
|
||||
<description>
|
||||
@ -7,441 +7,351 @@
|
||||
<tutorials>
|
||||
</tutorials>
|
||||
<methods>
|
||||
<method name="_add_prop" qualifiers="virtual">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="prop" type="VoxelChunkPropData">
|
||||
</argument>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="_chunk_added" qualifiers="virtual">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="chunk" type="VoxelChunk">
|
||||
</argument>
|
||||
<return type="void" />
|
||||
<argument index="0" name="chunk" type="VoxelChunk" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="_create_chunk" qualifiers="virtual">
|
||||
<return type="VoxelChunk">
|
||||
</return>
|
||||
<argument index="0" name="x" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="y" type="int">
|
||||
</argument>
|
||||
<argument index="2" name="z" type="int">
|
||||
</argument>
|
||||
<argument index="3" name="chunk" type="VoxelChunk">
|
||||
</argument>
|
||||
<return type="VoxelChunk" />
|
||||
<argument index="0" name="x" type="int" />
|
||||
<argument index="1" name="y" type="int" />
|
||||
<argument index="2" name="z" type="int" />
|
||||
<argument index="3" name="chunk" type="VoxelChunk" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="_generate_chunk" qualifiers="virtual">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="chunk" type="VoxelChunk">
|
||||
</argument>
|
||||
<return type="void" />
|
||||
<argument index="0" name="chunk" type="VoxelChunk" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="_generation_finished" qualifiers="virtual">
|
||||
<return type="void">
|
||||
</return>
|
||||
<return type="void" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="_get_channel_index_info" qualifiers="virtual">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="channel_type" type="int">
|
||||
</argument>
|
||||
<return type="int" />
|
||||
<argument index="0" name="channel_type" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="_prepare_chunk_for_generation" qualifiers="virtual">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="chunk" type="VoxelChunk">
|
||||
</argument>
|
||||
<return type="void" />
|
||||
<argument index="0" name="chunk" type="VoxelChunk" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="add_chunk">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="chunk" type="VoxelChunk">
|
||||
</argument>
|
||||
<argument index="1" name="x" type="int">
|
||||
</argument>
|
||||
<argument index="2" name="y" type="int">
|
||||
</argument>
|
||||
<argument index="3" name="z" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="add_light">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="light" type="VoxelLight">
|
||||
</argument>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="add_prop">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="prop" type="VoxelChunkPropData">
|
||||
</argument>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="add_to_generation">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="chunk" type="VoxelChunk">
|
||||
</argument>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="add_to_generation_queue">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="chunk" type="VoxelChunk">
|
||||
</argument>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="add_voxel_structure">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="structure" type="VoxelStructure">
|
||||
</argument>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="add_voxel_structure_at_position">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="structure" type="VoxelStructure">
|
||||
</argument>
|
||||
<argument index="1" name="world_position" type="Vector3">
|
||||
</argument>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="add_world_area">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="area" type="WorldArea">
|
||||
</argument>
|
||||
<method name="_set_voxel_with_tool" qualifiers="virtual">
|
||||
<return type="void" />
|
||||
<argument index="0" name="mode_add" type="bool" />
|
||||
<argument index="1" name="hit_position" type="Vector3" />
|
||||
<argument index="2" name="hit_normal" type="Vector3" />
|
||||
<argument index="3" name="selected_voxel" type="int" />
|
||||
<argument index="4" name="isolevel" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="can_chunk_do_build_step">
|
||||
<return type="bool">
|
||||
</return>
|
||||
<return type="bool" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="clear_chunks">
|
||||
<return type="void">
|
||||
</return>
|
||||
<method name="chunk_add">
|
||||
<return type="void" />
|
||||
<argument index="0" name="chunk" type="VoxelChunk" />
|
||||
<argument index="1" name="x" type="int" />
|
||||
<argument index="2" name="y" type="int" />
|
||||
<argument index="3" name="z" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="clear_lights">
|
||||
<return type="void">
|
||||
</return>
|
||||
<method name="chunk_create">
|
||||
<return type="VoxelChunk" />
|
||||
<argument index="0" name="x" type="int" />
|
||||
<argument index="1" name="y" type="int" />
|
||||
<argument index="2" name="z" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="clear_voxel_structures">
|
||||
<return type="void">
|
||||
</return>
|
||||
<method name="chunk_get">
|
||||
<return type="VoxelChunk" />
|
||||
<argument index="0" name="x" type="int" />
|
||||
<argument index="1" name="y" type="int" />
|
||||
<argument index="2" name="z" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="clear_world_areas">
|
||||
<return type="void">
|
||||
</return>
|
||||
<method name="chunk_get_count" qualifiers="const">
|
||||
<return type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="create_chunk">
|
||||
<return type="VoxelChunk">
|
||||
</return>
|
||||
<argument index="0" name="x" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="y" type="int">
|
||||
</argument>
|
||||
<argument index="2" name="z" type="int">
|
||||
</argument>
|
||||
<method name="chunk_get_index">
|
||||
<return type="VoxelChunk" />
|
||||
<argument index="0" name="index" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="chunk_get_or_create">
|
||||
<return type="VoxelChunk" />
|
||||
<argument index="0" name="x" type="int" />
|
||||
<argument index="1" name="y" type="int" />
|
||||
<argument index="2" name="z" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="chunk_has" qualifiers="const">
|
||||
<return type="bool" />
|
||||
<argument index="0" name="x" type="int" />
|
||||
<argument index="1" name="y" type="int" />
|
||||
<argument index="2" name="z" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="chunk_remove">
|
||||
<return type="VoxelChunk" />
|
||||
<argument index="0" name="x" type="int" />
|
||||
<argument index="1" name="y" type="int" />
|
||||
<argument index="2" name="z" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="chunk_remove_index">
|
||||
<return type="VoxelChunk" />
|
||||
<argument index="0" name="index" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="chunk_setup">
|
||||
<return type="void" />
|
||||
<argument index="0" name="chunk" type="VoxelChunk" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="chunks_clear">
|
||||
<return type="void" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="generation_add_to">
|
||||
<return type="void" />
|
||||
<argument index="0" name="chunk" type="VoxelChunk" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="generation_get_index">
|
||||
<return type="VoxelChunk" />
|
||||
<argument index="0" name="index" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="generation_get_size" qualifiers="const">
|
||||
<return type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="generation_queue_add_to">
|
||||
<return type="void" />
|
||||
<argument index="0" name="chunk" type="VoxelChunk" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="generation_queue_get_index">
|
||||
<return type="VoxelChunk" />
|
||||
<argument index="0" name="index" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="generation_queue_get_size" qualifiers="const">
|
||||
<return type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="generation_queue_remove_index">
|
||||
<return type="void" />
|
||||
<argument index="0" name="index" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="generation_remove_index">
|
||||
<return type="void" />
|
||||
<argument index="0" name="index" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_channel_index_info">
|
||||
<return type="int">
|
||||
</return>
|
||||
<argument index="0" name="channel_type" type="int" enum="VoxelWorld.ChannelTypeInfo">
|
||||
</argument>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_chunk">
|
||||
<return type="VoxelChunk">
|
||||
</return>
|
||||
<argument index="0" name="x" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="y" type="int">
|
||||
</argument>
|
||||
<argument index="2" name="z" type="int">
|
||||
</argument>
|
||||
<return type="int" />
|
||||
<argument index="0" name="channel_type" type="int" enum="VoxelWorld.ChannelTypeInfo" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_chunk_at_world_position">
|
||||
<return type="VoxelChunk">
|
||||
</return>
|
||||
<argument index="0" name="world_position" type="Vector3">
|
||||
</argument>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_chunk_count" qualifiers="const">
|
||||
<return type="int">
|
||||
</return>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_chunk_index">
|
||||
<return type="VoxelChunk">
|
||||
</return>
|
||||
<argument index="0" name="index" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_generation_index">
|
||||
<return type="VoxelChunk">
|
||||
</return>
|
||||
<argument index="0" name="index" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_generation_queue_index">
|
||||
<return type="VoxelChunk">
|
||||
</return>
|
||||
<argument index="0" name="index" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_generation_queue_size" qualifiers="const">
|
||||
<return type="int">
|
||||
</return>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_generation_size" qualifiers="const">
|
||||
<return type="int">
|
||||
</return>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_light">
|
||||
<return type="VoxelLight">
|
||||
</return>
|
||||
<argument index="0" name="index" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_light_count" qualifiers="const">
|
||||
<return type="int">
|
||||
</return>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_lights">
|
||||
<return type="Array">
|
||||
</return>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_or_create_chunk">
|
||||
<return type="VoxelChunk">
|
||||
</return>
|
||||
<argument index="0" name="x" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="y" type="int">
|
||||
</argument>
|
||||
<argument index="2" name="z" type="int">
|
||||
</argument>
|
||||
<return type="VoxelChunk" />
|
||||
<argument index="0" name="world_position" type="Vector3" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_or_create_chunk_at_world_position">
|
||||
<return type="VoxelChunk">
|
||||
</return>
|
||||
<argument index="0" name="world_position" type="Vector3">
|
||||
</argument>
|
||||
<return type="VoxelChunk" />
|
||||
<argument index="0" name="world_position" type="Vector3" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_voxel_at_world_position">
|
||||
<return type="int">
|
||||
</return>
|
||||
<argument index="0" name="world_position" type="Vector3">
|
||||
</argument>
|
||||
<argument index="1" name="channel_index" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_voxel_structure" qualifiers="const">
|
||||
<return type="VoxelStructure">
|
||||
</return>
|
||||
<argument index="0" name="index" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_voxel_structure_count" qualifiers="const">
|
||||
<return type="int">
|
||||
</return>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_world_area" qualifiers="const">
|
||||
<return type="WorldArea">
|
||||
</return>
|
||||
<argument index="0" name="index" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_world_area_count" qualifiers="const">
|
||||
<return type="int">
|
||||
</return>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="has_chunk" qualifiers="const">
|
||||
<return type="bool">
|
||||
</return>
|
||||
<argument index="0" name="x" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="y" type="int">
|
||||
</argument>
|
||||
<argument index="2" name="z" type="int">
|
||||
</argument>
|
||||
<return type="int" />
|
||||
<argument index="0" name="world_position" type="Vector3" />
|
||||
<argument index="1" name="channel_index" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="is_position_walkable">
|
||||
<return type="bool">
|
||||
</return>
|
||||
<argument index="0" name="position" type="Vector3">
|
||||
</argument>
|
||||
<return type="bool" />
|
||||
<argument index="0" name="position" type="Vector3" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="light_add">
|
||||
<return type="void" />
|
||||
<argument index="0" name="light" type="VoxelLight" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="light_get">
|
||||
<return type="VoxelLight" />
|
||||
<argument index="0" name="index" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="light_get_count" qualifiers="const">
|
||||
<return type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="light_remove">
|
||||
<return type="void" />
|
||||
<argument index="0" name="index" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="lights_clear">
|
||||
<return type="void" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="lights_get">
|
||||
<return type="Array" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="lights_set">
|
||||
<return type="void" />
|
||||
<argument index="0" name="chunks" type="Array" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="on_chunk_mesh_generation_finished">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="chunk" type="VoxelChunk">
|
||||
</argument>
|
||||
<return type="void" />
|
||||
<argument index="0" name="chunk" type="VoxelChunk" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="remove_chunk">
|
||||
<return type="VoxelChunk">
|
||||
</return>
|
||||
<argument index="0" name="x" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="y" type="int">
|
||||
</argument>
|
||||
<argument index="2" name="z" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="remove_chunk_index">
|
||||
<return type="VoxelChunk">
|
||||
</return>
|
||||
<argument index="0" name="index" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="remove_generation_index">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="index" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="remove_generation_queue_index">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="index" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="remove_light">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="index" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="remove_voxel_structure">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="structure" type="VoxelStructure">
|
||||
</argument>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="remove_voxel_structure_index">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="index" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="remove_world_area">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="index" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_lights">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="chunks" type="Array">
|
||||
</argument>
|
||||
<method name="prop_add">
|
||||
<return type="void" />
|
||||
<argument index="0" name="transform" type="Transform" />
|
||||
<argument index="1" name="prop" type="PropData" />
|
||||
<argument index="2" name="apply_voxel_scael" type="bool" default="true" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_voxel_at_world_position">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="world_position" type="Vector3">
|
||||
</argument>
|
||||
<argument index="1" name="data" type="int">
|
||||
</argument>
|
||||
<argument index="2" name="channel_index" type="int">
|
||||
</argument>
|
||||
<return type="void" />
|
||||
<argument index="0" name="world_position" type="Vector3" />
|
||||
<argument index="1" name="data" type="int" />
|
||||
<argument index="2" name="channel_index" type="int" />
|
||||
<argument index="3" name="rebuild" type="bool" default="true" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_voxel_with_tool">
|
||||
<return type="void" />
|
||||
<argument index="0" name="mode_add" type="bool" />
|
||||
<argument index="1" name="hit_position" type="Vector3" />
|
||||
<argument index="2" name="hit_normal" type="Vector3" />
|
||||
<argument index="3" name="selected_voxel" type="int" />
|
||||
<argument index="4" name="isolevel" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="voxel_structure_add">
|
||||
<return type="void" />
|
||||
<argument index="0" name="structure" type="VoxelStructure" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="voxel_structure_add_at_position">
|
||||
<return type="void" />
|
||||
<argument index="0" name="structure" type="VoxelStructure" />
|
||||
<argument index="1" name="world_position" type="Vector3" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="voxel_structure_get" qualifiers="const">
|
||||
<return type="VoxelStructure" />
|
||||
<argument index="0" name="index" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="voxel_structure_get_count" qualifiers="const">
|
||||
<return type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="voxel_structure_remove">
|
||||
<return type="void" />
|
||||
<argument index="0" name="structure" type="VoxelStructure" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="voxel_structure_remove_index">
|
||||
<return type="void" />
|
||||
<argument index="0" name="index" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="voxel_structures_clear">
|
||||
<return type="void" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="world_area_add">
|
||||
<return type="void" />
|
||||
<argument index="0" name="area" type="WorldArea" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="world_area_get" qualifiers="const">
|
||||
<return type="WorldArea" />
|
||||
<argument index="0" name="index" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="world_area_get_count" qualifiers="const">
|
||||
<return type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="world_area_remove">
|
||||
<return type="void" />
|
||||
<argument index="0" name="index" type="int" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="world_areas_clear">
|
||||
<return type="void" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
@ -455,7 +365,7 @@
|
||||
</member>
|
||||
<member name="chunk_spawn_range" type="int" setter="set_chunk_spawn_range" getter="get_chunk_spawn_range" default="4">
|
||||
</member>
|
||||
<member name="chunks" type="Array" setter="set_chunks" getter="get_chunks" default="[ ]">
|
||||
<member name="chunks" type="Array" setter="chunks_set" getter="chunks_get" default="[ ]">
|
||||
</member>
|
||||
<member name="current_seed" type="int" setter="set_current_seed" getter="get_current_seed" default="0">
|
||||
</member>
|
||||
@ -465,9 +375,9 @@
|
||||
</member>
|
||||
<member name="editable" type="bool" setter="set_editable" getter="get_editable" default="false">
|
||||
</member>
|
||||
<member name="level_generator" type="VoxelmanLevelGenerator" setter="set_level_generator" getter="get_level_generator">
|
||||
<member name="level_generator" type="VoxelLevelGenerator" setter="set_level_generator" getter="get_level_generator">
|
||||
</member>
|
||||
<member name="library" type="VoxelmanLibrary" setter="set_library" getter="get_library">
|
||||
<member name="library" type="VoxelLibrary" setter="set_library" getter="get_library">
|
||||
</member>
|
||||
<member name="max_concurrent_generations" type="int" setter="set_max_concurrent_generations" getter="get_max_concurrent_generations" default="3">
|
||||
</member>
|
||||
@ -481,13 +391,12 @@
|
||||
</member>
|
||||
<member name="voxel_scale" type="float" setter="set_voxel_scale" getter="get_voxel_scale" default="1.0">
|
||||
</member>
|
||||
<member name="voxel_structures" type="Array" setter="set_voxel_structures" getter="get_voxel_structures" default="[ ]">
|
||||
<member name="voxel_structures" type="Array" setter="voxel_structures_set" getter="voxel_structures_get" default="[ ]">
|
||||
</member>
|
||||
</members>
|
||||
<signals>
|
||||
<signal name="chunk_mesh_generation_finished">
|
||||
<argument index="0" name="chunk" type="VoxelChunk">
|
||||
</argument>
|
||||
<argument index="0" name="chunk" type="VoxelChunk" />
|
||||
<description>
|
||||
</description>
|
||||
</signal>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="VoxelWorldBlocky" inherits="VoxelWorldDefault" version="3.2">
|
||||
<class name="VoxelWorldBlocky" inherits="VoxelWorldDefault" version="3.5">
|
||||
<brief_description>
|
||||
</brief_description>
|
||||
<description>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="VoxelWorldCubic" inherits="VoxelWorldDefault" version="3.2">
|
||||
<class name="VoxelWorldCubic" inherits="VoxelWorldDefault" version="3.5">
|
||||
<brief_description>
|
||||
</brief_description>
|
||||
<description>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="VoxelWorldDefault" inherits="VoxelWorld" version="3.2">
|
||||
<class name="VoxelWorldDefault" inherits="VoxelWorld" version="3.5">
|
||||
<brief_description>
|
||||
</brief_description>
|
||||
<description>
|
||||
@ -8,14 +8,21 @@
|
||||
</tutorials>
|
||||
<methods>
|
||||
<method name="_update_lods" qualifiers="virtual">
|
||||
<return type="void">
|
||||
</return>
|
||||
<return type="void" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_vertex_colors">
|
||||
<return type="PoolColorArray" />
|
||||
<argument index="0" name="transform" type="Transform" />
|
||||
<argument index="1" name="vertices" type="PoolVector3Array" />
|
||||
<argument index="2" name="base_light_value" type="float" default="0.45" />
|
||||
<argument index="3" name="ao_strength" type="float" default="0.2" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="update_lods">
|
||||
<return type="void">
|
||||
</return>
|
||||
<return type="void" />
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
@ -23,10 +30,14 @@
|
||||
<members>
|
||||
<member name="build_flags" type="int" setter="set_build_flags" getter="get_build_flags" default="384">
|
||||
</member>
|
||||
<member name="data_margin_end" type="int" setter="set_data_margin_end" getter="get_data_margin_end" override="true" default="1" />
|
||||
<member name="data_margin_start" type="int" setter="set_data_margin_start" getter="get_data_margin_start" override="true" default="1" />
|
||||
<member name="chunk_lod_falloff" type="int" setter="set_chunk_lod_falloff" getter="get_chunk_lod_falloff" default="2">
|
||||
</member>
|
||||
<member name="data_margin_end" type="int" setter="set_data_margin_end" getter="get_data_margin_end" overrides="VoxelWorld" default="1" />
|
||||
<member name="data_margin_start" type="int" setter="set_data_margin_start" getter="get_data_margin_start" overrides="VoxelWorld" default="1" />
|
||||
<member name="lod_update_interval" type="float" setter="set_lod_update_interval" getter="get_lod_update_interval" default="0.5">
|
||||
</member>
|
||||
<member name="num_lods" type="int" setter="set_num_lods" getter="get_num_lods" default="4">
|
||||
</member>
|
||||
</members>
|
||||
<constants>
|
||||
</constants>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="VoxelWorldMarchingCubes" inherits="VoxelWorldDefault" version="3.2">
|
||||
<class name="VoxelWorldMarchingCubes" inherits="VoxelWorldDefault" version="3.5">
|
||||
<brief_description>
|
||||
</brief_description>
|
||||
<description>
|
||||
@ -9,7 +9,7 @@
|
||||
<methods>
|
||||
</methods>
|
||||
<members>
|
||||
<member name="data_margin_end" type="int" setter="set_data_margin_end" getter="get_data_margin_end" override="true" default="2" />
|
||||
<member name="data_margin_end" type="int" setter="set_data_margin_end" getter="get_data_margin_end" overrides="VoxelWorld" default="2" />
|
||||
</members>
|
||||
<constants>
|
||||
</constants>
|
||||
|
@ -1,235 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="VoxelmanLibrary" inherits="Resource" version="3.2">
|
||||
<brief_description>
|
||||
</brief_description>
|
||||
<description>
|
||||
</description>
|
||||
<tutorials>
|
||||
</tutorials>
|
||||
<methods>
|
||||
<method name="_setup_material_albedo" qualifiers="virtual">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="material_index" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="texture" type="Texture">
|
||||
</argument>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="add_liquid_material">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="value" type="Material">
|
||||
</argument>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="add_material">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="value" type="Material">
|
||||
</argument>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="add_prop">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="value" type="PackedScene">
|
||||
</argument>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="add_voxel_surface">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="value" type="VoxelSurface">
|
||||
</argument>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="clear_liquid_materials">
|
||||
<return type="void">
|
||||
</return>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="clear_materials">
|
||||
<return type="void">
|
||||
</return>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="clear_props">
|
||||
<return type="void">
|
||||
</return>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="clear_surfaces">
|
||||
<return type="void">
|
||||
</return>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_liquid_material">
|
||||
<return type="Material">
|
||||
</return>
|
||||
<argument index="0" name="index" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_material">
|
||||
<return type="Material">
|
||||
</return>
|
||||
<argument index="0" name="index" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_num_liquid_materials" qualifiers="const">
|
||||
<return type="int">
|
||||
</return>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_num_materials" qualifiers="const">
|
||||
<return type="int">
|
||||
</return>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_num_props" qualifiers="const">
|
||||
<return type="int">
|
||||
</return>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_num_surfaces" qualifiers="const">
|
||||
<return type="int">
|
||||
</return>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_prop">
|
||||
<return type="PackedScene">
|
||||
</return>
|
||||
<argument index="0" name="id" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_voxel_surface">
|
||||
<return type="VoxelSurface">
|
||||
</return>
|
||||
<argument index="0" name="index" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="refresh_rects">
|
||||
<return type="void">
|
||||
</return>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="remove_liquid_material">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="index" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="remove_material">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="index" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="remove_prop">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="id" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="remove_surface">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="index" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_liquid_material">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="index" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="value" type="Material">
|
||||
</argument>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_material">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="index" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="value" type="Material">
|
||||
</argument>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_prop">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="id" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="surface" type="PackedScene">
|
||||
</argument>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_voxel_surface">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="index" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="surface" type="VoxelSurface">
|
||||
</argument>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="setup_material_albedo">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="material_index" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="texture" type="Texture">
|
||||
</argument>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
</methods>
|
||||
<members>
|
||||
<member name="initialized" type="bool" setter="set_initialized" getter="get_initialized">
|
||||
</member>
|
||||
<member name="liquid_materials" type="Array" setter="set_liquid_materials" getter="get_liquid_materials" default="[ ]">
|
||||
</member>
|
||||
<member name="materials" type="Array" setter="set_materials" getter="get_materials" default="[ ]">
|
||||
</member>
|
||||
</members>
|
||||
<constants>
|
||||
<constant name="MATERIAL_INDEX_VOXELS" value="0">
|
||||
</constant>
|
||||
<constant name="MATERIAL_INDEX_LIQUID" value="1">
|
||||
</constant>
|
||||
</constants>
|
||||
</class>
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="WorldArea" inherits="Reference" version="3.2">
|
||||
<class name="WorldArea" inherits="Reference" version="3.5">
|
||||
<brief_description>
|
||||
</brief_description>
|
||||
<description>
|
||||
|
@ -20,24 +20,34 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "voxelman_level_generator.h"
|
||||
#include "voxel_level_generator.h"
|
||||
|
||||
#include "core/version.h"
|
||||
|
||||
#include "../world/voxel_chunk.h"
|
||||
|
||||
void VoxelmanLevelGenerator::generate_chunk(Ref<VoxelChunk> chunk) {
|
||||
void VoxelLevelGenerator::generate_chunk(Ref<VoxelChunk> chunk) {
|
||||
#if VERSION_MAJOR < 4
|
||||
if (has_method("_generate_chunk")) {
|
||||
call("_generate_chunk", chunk);
|
||||
}
|
||||
#else
|
||||
GDVIRTUAL_CALL(_generate_chunk, chunk);
|
||||
#endif
|
||||
}
|
||||
|
||||
VoxelmanLevelGenerator::VoxelmanLevelGenerator() {
|
||||
VoxelLevelGenerator::VoxelLevelGenerator() {
|
||||
}
|
||||
|
||||
VoxelmanLevelGenerator::~VoxelmanLevelGenerator() {
|
||||
VoxelLevelGenerator::~VoxelLevelGenerator() {
|
||||
}
|
||||
|
||||
void VoxelmanLevelGenerator::_bind_methods() {
|
||||
void VoxelLevelGenerator::_bind_methods() {
|
||||
#if VERSION_MAJOR < 4
|
||||
BIND_VMETHOD(MethodInfo("_generate_chunk", PropertyInfo(Variant::OBJECT, "chunk", PROPERTY_HINT_RESOURCE_TYPE, "VoxelChunk")));
|
||||
#else
|
||||
GDVIRTUAL_BIND(_generate_chunk, "chunk");
|
||||
#endif
|
||||
|
||||
ClassDB::bind_method(D_METHOD("generate_chunk", "chunk"), &VoxelmanLevelGenerator::generate_chunk);
|
||||
ClassDB::bind_method(D_METHOD("generate_chunk", "chunk"), &VoxelLevelGenerator::generate_chunk);
|
||||
}
|
@ -20,27 +20,33 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef VOXELMAN_LEVEL_GENERATOR_H
|
||||
#define VOXELMAN_LEVEL_GENERATOR_H
|
||||
#ifndef VOXEL_LEVEL_GENERATOR_H
|
||||
#define VOXEL_LEVEL_GENERATOR_H
|
||||
|
||||
#include "core/version.h"
|
||||
|
||||
#if VERSION_MAJOR > 3
|
||||
#include "core/io/resource.h"
|
||||
#include "core/object/gdvirtual.gen.inc"
|
||||
#include "core/object/script_language.h"
|
||||
#else
|
||||
#include "core/resource.h"
|
||||
#endif
|
||||
|
||||
class VoxelChunk;
|
||||
|
||||
class VoxelmanLevelGenerator : public Resource {
|
||||
GDCLASS(VoxelmanLevelGenerator, Resource);
|
||||
class VoxelLevelGenerator : public Resource {
|
||||
GDCLASS(VoxelLevelGenerator, Resource);
|
||||
|
||||
public:
|
||||
void generate_chunk(Ref<VoxelChunk> chunk);
|
||||
|
||||
VoxelmanLevelGenerator();
|
||||
~VoxelmanLevelGenerator();
|
||||
#if VERSION_MAJOR >= 4
|
||||
GDVIRTUAL1(_generate_chunk, Ref<VoxelChunk>);
|
||||
#endif
|
||||
|
||||
VoxelLevelGenerator();
|
||||
~VoxelLevelGenerator();
|
||||
|
||||
protected:
|
||||
static void _bind_methods();
|
@ -20,25 +20,25 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "voxelman_level_generator_flat.h"
|
||||
#include "voxel_level_generator_flat.h"
|
||||
|
||||
#include "../world/voxel_chunk.h"
|
||||
|
||||
int VoxelmanLevelGeneratorFlat::get_floor_position() const {
|
||||
int VoxelLevelGeneratorFlat::get_floor_position() const {
|
||||
return _floor_position;
|
||||
}
|
||||
void VoxelmanLevelGeneratorFlat::set_floor_position(const int floor_height) {
|
||||
void VoxelLevelGeneratorFlat::set_floor_position(const int floor_height) {
|
||||
_floor_position = floor_height;
|
||||
}
|
||||
|
||||
Dictionary VoxelmanLevelGeneratorFlat::get_channel_map() {
|
||||
Dictionary VoxelLevelGeneratorFlat::get_channel_map() {
|
||||
return _channel_map;
|
||||
}
|
||||
void VoxelmanLevelGeneratorFlat::set_channel_map(const Dictionary &map) {
|
||||
void VoxelLevelGeneratorFlat::set_channel_map(const Dictionary &map) {
|
||||
_channel_map = map;
|
||||
}
|
||||
|
||||
void VoxelmanLevelGeneratorFlat::_generate_chunk(Ref<VoxelChunk> chunk) {
|
||||
void VoxelLevelGeneratorFlat::_generate_chunk(Ref<VoxelChunk> chunk) {
|
||||
int dymin = chunk->get_position_y() * chunk->get_size_y();
|
||||
int dymax = dymin + chunk->get_size_y() + chunk->get_margin_end();
|
||||
|
||||
@ -82,22 +82,22 @@ void VoxelmanLevelGeneratorFlat::_generate_chunk(Ref<VoxelChunk> chunk) {
|
||||
}
|
||||
}
|
||||
|
||||
VoxelmanLevelGeneratorFlat::VoxelmanLevelGeneratorFlat() {
|
||||
VoxelLevelGeneratorFlat::VoxelLevelGeneratorFlat() {
|
||||
_floor_position = 0;
|
||||
}
|
||||
|
||||
VoxelmanLevelGeneratorFlat::~VoxelmanLevelGeneratorFlat() {
|
||||
VoxelLevelGeneratorFlat::~VoxelLevelGeneratorFlat() {
|
||||
_channel_map.clear();
|
||||
}
|
||||
|
||||
void VoxelmanLevelGeneratorFlat::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("get_floor_position"), &VoxelmanLevelGeneratorFlat::get_floor_position);
|
||||
ClassDB::bind_method(D_METHOD("set_floor_position", "value"), &VoxelmanLevelGeneratorFlat::set_floor_position);
|
||||
void VoxelLevelGeneratorFlat::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("get_floor_position"), &VoxelLevelGeneratorFlat::get_floor_position);
|
||||
ClassDB::bind_method(D_METHOD("set_floor_position", "value"), &VoxelLevelGeneratorFlat::set_floor_position);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "floor_position"), "set_floor_position", "get_floor_position");
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_channel_map"), &VoxelmanLevelGeneratorFlat::get_channel_map);
|
||||
ClassDB::bind_method(D_METHOD("set_channel_map", "value"), &VoxelmanLevelGeneratorFlat::set_channel_map);
|
||||
ClassDB::bind_method(D_METHOD("get_channel_map"), &VoxelLevelGeneratorFlat::get_channel_map);
|
||||
ClassDB::bind_method(D_METHOD("set_channel_map", "value"), &VoxelLevelGeneratorFlat::set_channel_map);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::DICTIONARY, "channel_map"), "set_channel_map", "get_channel_map");
|
||||
|
||||
ClassDB::bind_method(D_METHOD("_generate_chunk", "chunk"), &VoxelmanLevelGeneratorFlat::_generate_chunk);
|
||||
ClassDB::bind_method(D_METHOD("_generate_chunk", "chunk"), &VoxelLevelGeneratorFlat::_generate_chunk);
|
||||
}
|
@ -20,15 +20,15 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef VOXELMAN_LEVEL_GENERATOR_FLAT_H
|
||||
#define VOXELMAN_LEVEL_GENERATOR_FLAT_H
|
||||
#ifndef VOXEL_LEVEL_GENERATOR_FLAT_H
|
||||
#define VOXEL_LEVEL_GENERATOR_FLAT_H
|
||||
|
||||
#include "voxelman_level_generator.h"
|
||||
#include "voxel_level_generator.h"
|
||||
|
||||
class VoxelChunk;
|
||||
|
||||
class VoxelmanLevelGeneratorFlat : public VoxelmanLevelGenerator {
|
||||
GDCLASS(VoxelmanLevelGeneratorFlat, VoxelmanLevelGenerator);
|
||||
class VoxelLevelGeneratorFlat : public VoxelLevelGenerator {
|
||||
GDCLASS(VoxelLevelGeneratorFlat, VoxelLevelGenerator);
|
||||
|
||||
public:
|
||||
int get_floor_position() const;
|
||||
@ -39,8 +39,8 @@ public:
|
||||
|
||||
virtual void _generate_chunk(Ref<VoxelChunk> chunk);
|
||||
|
||||
VoxelmanLevelGeneratorFlat();
|
||||
~VoxelmanLevelGeneratorFlat();
|
||||
VoxelLevelGeneratorFlat();
|
||||
~VoxelLevelGeneratorFlat();
|
||||
|
||||
protected:
|
||||
static void _bind_methods();
|
336
library/voxel_library.cpp
Normal file
336
library/voxel_library.cpp
Normal file
@ -0,0 +1,336 @@
|
||||
/*
|
||||
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.
|
||||
*/
|
||||
|
||||
#include "voxel_library.h"
|
||||
|
||||
#ifdef PROPS_PRESENT
|
||||
#include "../../props/props/prop_data.h"
|
||||
#endif
|
||||
|
||||
#include "scene/resources/packed_scene.h"
|
||||
|
||||
#include "../defines.h"
|
||||
|
||||
bool VoxelLibrary::get_initialized() const {
|
||||
return _initialized;
|
||||
}
|
||||
void VoxelLibrary::set_initialized(const bool value) {
|
||||
_initialized = value;
|
||||
}
|
||||
|
||||
//Materials
|
||||
Ref<Material> VoxelLibrary::material_get(const int index) {
|
||||
ERR_FAIL_INDEX_V(index, _materials.size(), Ref<VoxelSurface>(NULL));
|
||||
|
||||
return _materials[index];
|
||||
}
|
||||
|
||||
void VoxelLibrary::material_add(const Ref<Material> &value) {
|
||||
ERR_FAIL_COND(!value.is_valid());
|
||||
|
||||
_materials.push_back(value);
|
||||
}
|
||||
|
||||
void VoxelLibrary::material_set(const int index, const Ref<Material> &value) {
|
||||
ERR_FAIL_INDEX(index, _materials.size());
|
||||
|
||||
_materials.set(index, value);
|
||||
}
|
||||
|
||||
void VoxelLibrary::material_remove(const int index) {
|
||||
#if VERSION_MAJOR <= 3
|
||||
_materials.remove(index);
|
||||
#else
|
||||
_materials.remove_at(index);
|
||||
#endif
|
||||
}
|
||||
|
||||
int VoxelLibrary::material_get_num() const {
|
||||
return _materials.size();
|
||||
}
|
||||
|
||||
void VoxelLibrary::materials_clear() {
|
||||
_materials.clear();
|
||||
}
|
||||
|
||||
Vector<Variant> VoxelLibrary::materials_get() {
|
||||
VARIANT_ARRAY_GET(_materials);
|
||||
}
|
||||
|
||||
void VoxelLibrary::materials_set(const Vector<Variant> &materials) {
|
||||
_materials.clear();
|
||||
|
||||
for (int i = 0; i < materials.size(); i++) {
|
||||
Ref<Material> material = Ref<Material>(materials[i]);
|
||||
|
||||
_materials.push_back(material);
|
||||
}
|
||||
}
|
||||
|
||||
//Liquid Materials
|
||||
Ref<Material> VoxelLibrary::liquid_material_get(const int index) {
|
||||
ERR_FAIL_INDEX_V(index, _liquid_materials.size(), Ref<VoxelSurface>(NULL));
|
||||
|
||||
return _liquid_materials[index];
|
||||
}
|
||||
|
||||
void VoxelLibrary::liquid_material_add(const Ref<Material> &value) {
|
||||
ERR_FAIL_COND(!value.is_valid());
|
||||
|
||||
_liquid_materials.push_back(value);
|
||||
}
|
||||
|
||||
void VoxelLibrary::liquid_material_set(const int index, const Ref<Material> &value) {
|
||||
ERR_FAIL_INDEX(index, _liquid_materials.size());
|
||||
|
||||
_liquid_materials.set(index, value);
|
||||
}
|
||||
|
||||
void VoxelLibrary::liquid_material_remove(const int index) {
|
||||
#if VERSION_MAJOR <= 3
|
||||
_liquid_materials.remove(index);
|
||||
#else
|
||||
_liquid_materials.remove_at(index);
|
||||
#endif
|
||||
}
|
||||
|
||||
int VoxelLibrary::liquid_material_get_num() const {
|
||||
return _liquid_materials.size();
|
||||
}
|
||||
|
||||
void VoxelLibrary::liquid_materials_clear() {
|
||||
_liquid_materials.clear();
|
||||
}
|
||||
|
||||
Vector<Variant> VoxelLibrary::liquid_materials_get() {
|
||||
VARIANT_ARRAY_GET(_liquid_materials);
|
||||
}
|
||||
|
||||
void VoxelLibrary::liquid_materials_set(const Vector<Variant> &materials) {
|
||||
_liquid_materials.clear();
|
||||
|
||||
for (int i = 0; i < materials.size(); i++) {
|
||||
Ref<Material> material = Ref<Material>(materials[i]);
|
||||
|
||||
_liquid_materials.push_back(material);
|
||||
}
|
||||
}
|
||||
|
||||
//Prop Materials
|
||||
Ref<Material> VoxelLibrary::prop_material_get(const int index) {
|
||||
ERR_FAIL_INDEX_V(index, _prop_materials.size(), Ref<VoxelSurface>(NULL));
|
||||
|
||||
return _prop_materials[index];
|
||||
}
|
||||
|
||||
void VoxelLibrary::prop_material_add(const Ref<Material> &value) {
|
||||
ERR_FAIL_COND(!value.is_valid());
|
||||
|
||||
_prop_materials.push_back(value);
|
||||
}
|
||||
|
||||
void VoxelLibrary::prop_material_set(const int index, const Ref<Material> &value) {
|
||||
ERR_FAIL_INDEX(index, _prop_materials.size());
|
||||
|
||||
_prop_materials.set(index, value);
|
||||
}
|
||||
|
||||
void VoxelLibrary::prop_material_remove(const int index) {
|
||||
#if VERSION_MAJOR <= 3
|
||||
_prop_materials.remove(index);
|
||||
#else
|
||||
_prop_materials.remove_at(index);
|
||||
#endif
|
||||
}
|
||||
|
||||
int VoxelLibrary::prop_material_get_num() const {
|
||||
return _prop_materials.size();
|
||||
}
|
||||
|
||||
void VoxelLibrary::prop_materials_clear() {
|
||||
_prop_materials.clear();
|
||||
}
|
||||
|
||||
Vector<Variant> VoxelLibrary::prop_materials_get() {
|
||||
VARIANT_ARRAY_GET(_prop_materials);
|
||||
}
|
||||
|
||||
void VoxelLibrary::prop_materials_set(const Vector<Variant> &materials) {
|
||||
VARIANT_ARRAY_SET(materials, _prop_materials, Material);
|
||||
}
|
||||
|
||||
//Surfaces
|
||||
Ref<VoxelSurface> VoxelLibrary::voxel_surface_get(const int index) {
|
||||
return Ref<VoxelSurface>();
|
||||
}
|
||||
void VoxelLibrary::voxel_surface_add(Ref<VoxelSurface> value) {
|
||||
}
|
||||
void VoxelLibrary::voxel_surface_set(int index, Ref<VoxelSurface> value) {
|
||||
}
|
||||
void VoxelLibrary::voxel_surface_remove(const int index) {
|
||||
}
|
||||
int VoxelLibrary::voxel_surface_get_num() const {
|
||||
return 0;
|
||||
}
|
||||
void VoxelLibrary::voxel_surfaces_clear() {
|
||||
}
|
||||
|
||||
Ref<PackedScene> VoxelLibrary::scene_get(const int id) {
|
||||
return Ref<PackedScene>();
|
||||
}
|
||||
void VoxelLibrary::scene_add(Ref<PackedScene> value) {
|
||||
}
|
||||
void VoxelLibrary::scene_set(int id, Ref<PackedScene> value) {
|
||||
}
|
||||
void VoxelLibrary::scene_remove(const int id) {
|
||||
}
|
||||
int VoxelLibrary::scene_get_num() const {
|
||||
return 0;
|
||||
}
|
||||
void VoxelLibrary::scenes_clear() {
|
||||
}
|
||||
|
||||
#ifdef PROPS_PRESENT
|
||||
Ref<PropData> VoxelLibrary::prop_get(const int id) {
|
||||
return Ref<PropData>();
|
||||
}
|
||||
void VoxelLibrary::prop_add(Ref<PropData> value) {
|
||||
}
|
||||
bool VoxelLibrary::prop_has(const Ref<PropData> &value) const {
|
||||
return false;
|
||||
}
|
||||
void VoxelLibrary::prop_set(int id, Ref<PropData> value) {
|
||||
}
|
||||
void VoxelLibrary::prop_remove(const int id) {
|
||||
}
|
||||
int VoxelLibrary::prop_get_num() const {
|
||||
return 0;
|
||||
}
|
||||
void VoxelLibrary::props_clear() {
|
||||
}
|
||||
|
||||
Rect2 VoxelLibrary::get_prop_uv_rect(const Ref<Texture> &texture) {
|
||||
return Rect2(0, 0, 1, 1);
|
||||
}
|
||||
#endif
|
||||
|
||||
//Rects
|
||||
void VoxelLibrary::refresh_rects() {
|
||||
_initialized = true;
|
||||
}
|
||||
|
||||
void VoxelLibrary::setup_material_albedo(int material_index, Ref<Texture> texture) {
|
||||
#if VERSION_MAJOR < 4
|
||||
if (has_method("_setup_material_albedo")) {
|
||||
call("_setup_material_albedo", material_index, texture);
|
||||
}
|
||||
#else
|
||||
GDVIRTUAL_CALL(_setup_material_albedo, material_index, texture);
|
||||
#endif
|
||||
}
|
||||
|
||||
VoxelLibrary::VoxelLibrary() {
|
||||
_initialized = false;
|
||||
}
|
||||
|
||||
VoxelLibrary::~VoxelLibrary() {
|
||||
_materials.clear();
|
||||
_liquid_materials.clear();
|
||||
_prop_materials.clear();
|
||||
}
|
||||
|
||||
void VoxelLibrary::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("get_initialized"), &VoxelLibrary::get_initialized);
|
||||
ClassDB::bind_method(D_METHOD("set_initialized", "value"), &VoxelLibrary::set_initialized);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "initialized", PROPERTY_HINT_NONE, "", 0), "set_initialized", "get_initialized");
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
BIND_VMETHOD(MethodInfo("_setup_material_albedo", PropertyInfo(Variant::INT, "material_index"), PropertyInfo(Variant::OBJECT, "texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture")));
|
||||
#else
|
||||
GDVIRTUAL_BIND(_setup_material_albedo, "material_index", "texture");
|
||||
#endif
|
||||
|
||||
ClassDB::bind_method(D_METHOD("material_get", "index"), &VoxelLibrary::material_get);
|
||||
ClassDB::bind_method(D_METHOD("material_add", "value"), &VoxelLibrary::material_add);
|
||||
ClassDB::bind_method(D_METHOD("material_set", "index", "value"), &VoxelLibrary::material_set);
|
||||
ClassDB::bind_method(D_METHOD("material_remove", "index"), &VoxelLibrary::material_remove);
|
||||
ClassDB::bind_method(D_METHOD("material_get_num"), &VoxelLibrary::material_get_num);
|
||||
ClassDB::bind_method(D_METHOD("materials_clear"), &VoxelLibrary::materials_clear);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("materials_get"), &VoxelLibrary::materials_get);
|
||||
ClassDB::bind_method(D_METHOD("materials_set"), &VoxelLibrary::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"), &VoxelLibrary::liquid_material_get);
|
||||
ClassDB::bind_method(D_METHOD("liquid_material_add", "value"), &VoxelLibrary::liquid_material_add);
|
||||
ClassDB::bind_method(D_METHOD("liquid_material_set", "index", "value"), &VoxelLibrary::liquid_material_set);
|
||||
ClassDB::bind_method(D_METHOD("liquid_material_remove", "index"), &VoxelLibrary::liquid_material_remove);
|
||||
ClassDB::bind_method(D_METHOD("liquid_material_get_num"), &VoxelLibrary::liquid_material_get_num);
|
||||
ClassDB::bind_method(D_METHOD("liquid_materials_clear"), &VoxelLibrary::liquid_materials_clear);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("liquid_materials_get"), &VoxelLibrary::liquid_materials_get);
|
||||
ClassDB::bind_method(D_METHOD("liquid_materials_set"), &VoxelLibrary::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"), &VoxelLibrary::prop_material_get);
|
||||
ClassDB::bind_method(D_METHOD("prop_material_add", "value"), &VoxelLibrary::prop_material_add);
|
||||
ClassDB::bind_method(D_METHOD("prop_material_set", "index", "value"), &VoxelLibrary::prop_material_set);
|
||||
ClassDB::bind_method(D_METHOD("prop_material_remove", "index"), &VoxelLibrary::prop_material_remove);
|
||||
ClassDB::bind_method(D_METHOD("prop_material_get_num"), &VoxelLibrary::prop_material_get_num);
|
||||
ClassDB::bind_method(D_METHOD("prop_materials_clear"), &VoxelLibrary::prop_materials_clear);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("prop_materials_get"), &VoxelLibrary::prop_materials_get);
|
||||
ClassDB::bind_method(D_METHOD("prop_materials_set"), &VoxelLibrary::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"), &VoxelLibrary::voxel_surface_get);
|
||||
ClassDB::bind_method(D_METHOD("voxel_surface_add", "value"), &VoxelLibrary::voxel_surface_add);
|
||||
ClassDB::bind_method(D_METHOD("voxel_surface_set", "index", "surface"), &VoxelLibrary::voxel_surface_set);
|
||||
ClassDB::bind_method(D_METHOD("voxel_surface_remove", "index"), &VoxelLibrary::voxel_surface_remove);
|
||||
ClassDB::bind_method(D_METHOD("voxel_surface_get_num"), &VoxelLibrary::voxel_surface_get_num);
|
||||
ClassDB::bind_method(D_METHOD("voxel_surfaces_clear"), &VoxelLibrary::voxel_surfaces_clear);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("scene_get", "index"), &VoxelLibrary::scene_get);
|
||||
ClassDB::bind_method(D_METHOD("scene_add", "value"), &VoxelLibrary::scene_add);
|
||||
ClassDB::bind_method(D_METHOD("scene_set", "index", "value"), &VoxelLibrary::scene_set);
|
||||
ClassDB::bind_method(D_METHOD("scene_remove", "index"), &VoxelLibrary::scene_remove);
|
||||
ClassDB::bind_method(D_METHOD("scene_get_num"), &VoxelLibrary::scene_get_num);
|
||||
ClassDB::bind_method(D_METHOD("scenes_clear"), &VoxelLibrary::scenes_clear);
|
||||
|
||||
#ifdef PROPS_PRESENT
|
||||
ClassDB::bind_method(D_METHOD("prop_get", "id"), &VoxelLibrary::prop_get);
|
||||
ClassDB::bind_method(D_METHOD("prop_add", "value"), &VoxelLibrary::prop_add);
|
||||
ClassDB::bind_method(D_METHOD("prop_has", "prop"), &VoxelLibrary::prop_has);
|
||||
ClassDB::bind_method(D_METHOD("prop_set", "id", "surface"), &VoxelLibrary::prop_set);
|
||||
ClassDB::bind_method(D_METHOD("prop_remove", "id"), &VoxelLibrary::prop_remove);
|
||||
ClassDB::bind_method(D_METHOD("prop_get_num"), &VoxelLibrary::prop_get_num);
|
||||
ClassDB::bind_method(D_METHOD("props_clear"), &VoxelLibrary::props_clear);
|
||||
#endif
|
||||
|
||||
ClassDB::bind_method(D_METHOD("refresh_rects"), &VoxelLibrary::refresh_rects);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("setup_material_albedo", "material_index", "texture"), &VoxelLibrary::setup_material_albedo);
|
||||
|
||||
BIND_CONSTANT(MATERIAL_INDEX_VOXELS);
|
||||
BIND_CONSTANT(MATERIAL_INDEX_LIQUID);
|
||||
BIND_CONSTANT(MATERIAL_INDEX_PROP);
|
||||
}
|
@ -20,8 +20,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef VOXELMAN_LIBRARY_H
|
||||
#define VOXELMAN_LIBRARY_H
|
||||
#ifndef VOXEL_LIBRARY_H
|
||||
#define VOXEL_LIBRARY_H
|
||||
|
||||
#include "core/version.h"
|
||||
|
||||
@ -50,8 +50,8 @@ class PackedScene;
|
||||
class PropData;
|
||||
#endif
|
||||
|
||||
class VoxelmanLibrary : public Resource {
|
||||
GDCLASS(VoxelmanLibrary, Resource)
|
||||
class VoxelLibrary : public Resource {
|
||||
GDCLASS(VoxelLibrary, Resource)
|
||||
|
||||
public:
|
||||
enum {
|
||||
@ -129,8 +129,8 @@ public:
|
||||
GDVIRTUAL2(_setup_material_albedo, int, Ref<Texture>);
|
||||
#endif
|
||||
|
||||
VoxelmanLibrary();
|
||||
~VoxelmanLibrary();
|
||||
VoxelLibrary();
|
||||
~VoxelLibrary();
|
||||
|
||||
protected:
|
||||
static void _bind_methods();
|
@ -20,7 +20,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "voxelman_library_merger.h"
|
||||
#include "voxel_library_merger.h"
|
||||
|
||||
#include "scene/resources/packed_scene.h"
|
||||
#include "scene/resources/texture.h"
|
||||
@ -37,63 +37,63 @@ SOFTWARE.
|
||||
|
||||
#include "../defines.h"
|
||||
|
||||
int VoxelmanLibraryMerger::get_texture_flags() const {
|
||||
int VoxelLibraryMerger::get_texture_flags() const {
|
||||
return _packer->get_texture_flags();
|
||||
}
|
||||
void VoxelmanLibraryMerger::set_texture_flags(const int flags) {
|
||||
void VoxelLibraryMerger::set_texture_flags(const int flags) {
|
||||
_packer->set_texture_flags(flags);
|
||||
_prop_packer->set_texture_flags(flags);
|
||||
}
|
||||
|
||||
int VoxelmanLibraryMerger::get_max_atlas_size() const {
|
||||
int VoxelLibraryMerger::get_max_atlas_size() const {
|
||||
return _packer->get_max_atlas_size();
|
||||
}
|
||||
void VoxelmanLibraryMerger::set_max_atlas_size(const int size) {
|
||||
void VoxelLibraryMerger::set_max_atlas_size(const int size) {
|
||||
_packer->set_max_atlas_size(size);
|
||||
_prop_packer->set_max_atlas_size(size);
|
||||
}
|
||||
|
||||
bool VoxelmanLibraryMerger::get_keep_original_atlases() const {
|
||||
bool VoxelLibraryMerger::get_keep_original_atlases() const {
|
||||
return _packer->get_keep_original_atlases();
|
||||
}
|
||||
void VoxelmanLibraryMerger::set_keep_original_atlases(const bool value) {
|
||||
void VoxelLibraryMerger::set_keep_original_atlases(const bool value) {
|
||||
_packer->set_keep_original_atlases(value);
|
||||
_prop_packer->set_keep_original_atlases(value);
|
||||
}
|
||||
|
||||
Color VoxelmanLibraryMerger::get_background_color() const {
|
||||
Color VoxelLibraryMerger::get_background_color() const {
|
||||
return _packer->get_background_color();
|
||||
}
|
||||
void VoxelmanLibraryMerger::set_background_color(const Color &color) {
|
||||
void VoxelLibraryMerger::set_background_color(const Color &color) {
|
||||
_packer->set_background_color(color);
|
||||
_prop_packer->set_background_color(color);
|
||||
}
|
||||
|
||||
int VoxelmanLibraryMerger::get_margin() const {
|
||||
int VoxelLibraryMerger::get_margin() const {
|
||||
return _packer->get_margin();
|
||||
}
|
||||
void VoxelmanLibraryMerger::set_margin(const int margin) {
|
||||
void VoxelLibraryMerger::set_margin(const int margin) {
|
||||
_packer->set_margin(margin);
|
||||
_prop_packer->set_margin(margin);
|
||||
}
|
||||
|
||||
//Surfaces
|
||||
Ref<VoxelSurface> VoxelmanLibraryMerger::voxel_surface_get(const int index) {
|
||||
Ref<VoxelSurface> VoxelLibraryMerger::voxel_surface_get(const int index) {
|
||||
ERR_FAIL_INDEX_V(index, _voxel_surfaces.size(), Ref<VoxelSurface>(NULL));
|
||||
|
||||
return _voxel_surfaces[index];
|
||||
}
|
||||
|
||||
void VoxelmanLibraryMerger::voxel_surface_add(Ref<VoxelSurface> value) {
|
||||
void VoxelLibraryMerger::voxel_surface_add(Ref<VoxelSurface> value) {
|
||||
ERR_FAIL_COND(!value.is_valid());
|
||||
|
||||
value->set_library(Ref<VoxelmanLibraryMerger>(this));
|
||||
value->set_library(Ref<VoxelLibraryMerger>(this));
|
||||
value->set_id(_voxel_surfaces.size());
|
||||
|
||||
_voxel_surfaces.push_back(value);
|
||||
}
|
||||
|
||||
void VoxelmanLibraryMerger::voxel_surface_set(const int index, Ref<VoxelSurface> value) {
|
||||
void VoxelLibraryMerger::voxel_surface_set(const int index, Ref<VoxelSurface> value) {
|
||||
ERR_FAIL_COND(index < 0);
|
||||
|
||||
if (_voxel_surfaces.size() < index) {
|
||||
@ -101,25 +101,25 @@ void VoxelmanLibraryMerger::voxel_surface_set(const int index, Ref<VoxelSurface>
|
||||
}
|
||||
|
||||
if (_voxel_surfaces[index].is_valid()) {
|
||||
_voxel_surfaces.get(index)->set_library(Ref<VoxelmanLibraryMerger>(NULL));
|
||||
_voxel_surfaces.get(index)->set_library(Ref<VoxelLibraryMerger>(NULL));
|
||||
}
|
||||
|
||||
if (value.is_valid()) {
|
||||
value->set_library(Ref<VoxelmanLibraryMerger>(this));
|
||||
value->set_library(Ref<VoxelLibraryMerger>(this));
|
||||
|
||||
_voxel_surfaces.set(index, value);
|
||||
}
|
||||
}
|
||||
|
||||
void VoxelmanLibraryMerger::voxel_surface_remove(const int index) {
|
||||
_voxel_surfaces.remove(index);
|
||||
void VoxelLibraryMerger::voxel_surface_remove(const int index) {
|
||||
_voxel_surfaces.VREMOVE(index);
|
||||
}
|
||||
|
||||
int VoxelmanLibraryMerger::voxel_surface_get_num() const {
|
||||
int VoxelLibraryMerger::voxel_surface_get_num() const {
|
||||
return _voxel_surfaces.size();
|
||||
}
|
||||
|
||||
void VoxelmanLibraryMerger::voxel_surfaces_clear() {
|
||||
void VoxelLibraryMerger::voxel_surfaces_clear() {
|
||||
_packer->clear();
|
||||
|
||||
for (int i = 0; i < _voxel_surfaces.size(); i++) {
|
||||
@ -133,11 +133,11 @@ void VoxelmanLibraryMerger::voxel_surfaces_clear() {
|
||||
_voxel_surfaces.clear();
|
||||
}
|
||||
|
||||
Vector<Variant> VoxelmanLibraryMerger::get_voxel_surfaces() {
|
||||
Vector<Variant> VoxelLibraryMerger::get_voxel_surfaces() {
|
||||
VARIANT_ARRAY_GET(_voxel_surfaces);
|
||||
}
|
||||
|
||||
void VoxelmanLibraryMerger::set_voxel_surfaces(const Vector<Variant> &surfaces) {
|
||||
void VoxelLibraryMerger::set_voxel_surfaces(const Vector<Variant> &surfaces) {
|
||||
_voxel_surfaces.clear();
|
||||
|
||||
for (int i = 0; i < surfaces.size(); i++) {
|
||||
@ -152,43 +152,43 @@ void VoxelmanLibraryMerger::set_voxel_surfaces(const Vector<Variant> &surfaces)
|
||||
}
|
||||
|
||||
#ifdef PROPS_PRESENT
|
||||
Ref<PropData> VoxelmanLibraryMerger::get_prop(const int index) {
|
||||
Ref<PropData> VoxelLibraryMerger::get_prop(const int index) {
|
||||
ERR_FAIL_INDEX_V(index, _props.size(), Ref<PropData>());
|
||||
|
||||
return _props[index];
|
||||
}
|
||||
void VoxelmanLibraryMerger::add_prop(Ref<PropData> value) {
|
||||
void VoxelLibraryMerger::add_prop(Ref<PropData> value) {
|
||||
_props.push_back(value);
|
||||
}
|
||||
bool VoxelmanLibraryMerger::has_prop(const Ref<PropData> &value) const {
|
||||
bool VoxelLibraryMerger::has_prop(const Ref<PropData> &value) const {
|
||||
return _props.find(value) != -1;
|
||||
}
|
||||
void VoxelmanLibraryMerger::set_prop(const int index, const Ref<PropData> &value) {
|
||||
void VoxelLibraryMerger::set_prop(const int index, const Ref<PropData> &value) {
|
||||
ERR_FAIL_INDEX(index, _props.size());
|
||||
|
||||
_props.write[index] = value;
|
||||
}
|
||||
void VoxelmanLibraryMerger::remove_prop(const int index) {
|
||||
void VoxelLibraryMerger::remove_prop(const int index) {
|
||||
ERR_FAIL_INDEX(index, _props.size());
|
||||
|
||||
_props.remove(index);
|
||||
_props.VREMOVE(index);
|
||||
}
|
||||
int VoxelmanLibraryMerger::get_num_props() const {
|
||||
int VoxelLibraryMerger::get_num_props() const {
|
||||
return _props.size();
|
||||
}
|
||||
void VoxelmanLibraryMerger::clear_props() {
|
||||
void VoxelLibraryMerger::clear_props() {
|
||||
_props.clear();
|
||||
}
|
||||
|
||||
Vector<Variant> VoxelmanLibraryMerger::get_props() {
|
||||
Vector<Variant> VoxelLibraryMerger::get_props() {
|
||||
VARIANT_ARRAY_GET(_props);
|
||||
}
|
||||
|
||||
void VoxelmanLibraryMerger::set_props(const Vector<Variant> &props) {
|
||||
void VoxelLibraryMerger::set_props(const Vector<Variant> &props) {
|
||||
VARIANT_ARRAY_SET(props, _props, PropData);
|
||||
}
|
||||
|
||||
Rect2 VoxelmanLibraryMerger::get_prop_uv_rect(const Ref<Texture> &texture) {
|
||||
Rect2 VoxelLibraryMerger::get_prop_uv_rect(const Ref<Texture> &texture) {
|
||||
if (!texture.is_valid()) {
|
||||
return Rect2(0, 0, 1, 1);
|
||||
}
|
||||
@ -207,7 +207,11 @@ Rect2 VoxelmanLibraryMerger::get_prop_uv_rect(const Ref<Texture> &texture) {
|
||||
return Rect2(0, 0, 1, 1);
|
||||
}
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
Ref<Image> image = tex->get_data();
|
||||
#else
|
||||
Ref<Image> image = tex->get_image();
|
||||
#endif
|
||||
|
||||
if (!image.is_valid()) {
|
||||
return Rect2(0, 0, 1, 1);
|
||||
@ -222,12 +226,12 @@ Rect2 VoxelmanLibraryMerger::get_prop_uv_rect(const Ref<Texture> &texture) {
|
||||
return region;
|
||||
}
|
||||
|
||||
Ref<TexturePacker> VoxelmanLibraryMerger::get_prop_packer() {
|
||||
Ref<TexturePacker> VoxelLibraryMerger::get_prop_packer() {
|
||||
return _prop_packer;
|
||||
}
|
||||
#endif
|
||||
|
||||
void VoxelmanLibraryMerger::refresh_rects() {
|
||||
void VoxelLibraryMerger::refresh_rects() {
|
||||
bool texture_added = false;
|
||||
for (int i = 0; i < _voxel_surfaces.size(); i++) {
|
||||
Ref<VoxelSurfaceMerger> surface = Ref<VoxelSurfaceMerger>(_voxel_surfaces[i]);
|
||||
@ -295,7 +299,7 @@ void VoxelmanLibraryMerger::refresh_rects() {
|
||||
set_initialized(true);
|
||||
}
|
||||
|
||||
void VoxelmanLibraryMerger::_setup_material_albedo(const int material_index, const Ref<Texture> &texture) {
|
||||
void VoxelLibraryMerger::_setup_material_albedo(const int material_index, const Ref<Texture> &texture) {
|
||||
Ref<SpatialMaterial> mat;
|
||||
|
||||
int count = 0;
|
||||
@ -313,7 +317,6 @@ void VoxelmanLibraryMerger::_setup_material_albedo(const int material_index, con
|
||||
}
|
||||
|
||||
for (int i = 0; i < count; ++i) {
|
||||
|
||||
switch (material_index) {
|
||||
case MATERIAL_INDEX_VOXELS:
|
||||
mat = material_get(i);
|
||||
@ -353,8 +356,8 @@ void VoxelmanLibraryMerger::_setup_material_albedo(const int material_index, con
|
||||
}
|
||||
}
|
||||
|
||||
VoxelmanLibraryMerger::VoxelmanLibraryMerger() {
|
||||
_packer.instance();
|
||||
VoxelLibraryMerger::VoxelLibraryMerger() {
|
||||
_packer.INSTANCE();
|
||||
|
||||
#if GODOT4
|
||||
#warning implement
|
||||
@ -366,7 +369,7 @@ VoxelmanLibraryMerger::VoxelmanLibraryMerger() {
|
||||
_packer->set_keep_original_atlases(false);
|
||||
_packer->set_margin(0);
|
||||
|
||||
_prop_packer.instance();
|
||||
_prop_packer.INSTANCE();
|
||||
|
||||
#if GODOT4
|
||||
#warning implement
|
||||
@ -379,12 +382,12 @@ VoxelmanLibraryMerger::VoxelmanLibraryMerger() {
|
||||
_prop_packer->set_margin(0);
|
||||
}
|
||||
|
||||
VoxelmanLibraryMerger::~VoxelmanLibraryMerger() {
|
||||
VoxelLibraryMerger::~VoxelLibraryMerger() {
|
||||
for (int i = 0; i < _voxel_surfaces.size(); ++i) {
|
||||
Ref<VoxelSurface> surface = _voxel_surfaces[i];
|
||||
|
||||
if (surface.is_valid()) {
|
||||
surface->set_library(Ref<VoxelmanLibraryMerger>());
|
||||
surface->set_library(Ref<VoxelLibraryMerger>());
|
||||
}
|
||||
}
|
||||
|
||||
@ -398,7 +401,7 @@ VoxelmanLibraryMerger::~VoxelmanLibraryMerger() {
|
||||
}
|
||||
|
||||
#ifdef PROPS_PRESENT
|
||||
bool VoxelmanLibraryMerger::process_prop_textures(Ref<PropData> prop) {
|
||||
bool VoxelLibraryMerger::process_prop_textures(Ref<PropData> prop) {
|
||||
if (!prop.is_valid()) {
|
||||
return false;
|
||||
}
|
||||
@ -432,40 +435,40 @@ bool VoxelmanLibraryMerger::process_prop_textures(Ref<PropData> prop) {
|
||||
}
|
||||
#endif
|
||||
|
||||
void VoxelmanLibraryMerger::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("get_texture_flags"), &VoxelmanLibraryMerger::get_texture_flags);
|
||||
ClassDB::bind_method(D_METHOD("set_texture_flags", "flags"), &VoxelmanLibraryMerger::set_texture_flags);
|
||||
void VoxelLibraryMerger::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("get_texture_flags"), &VoxelLibraryMerger::get_texture_flags);
|
||||
ClassDB::bind_method(D_METHOD("set_texture_flags", "flags"), &VoxelLibraryMerger::set_texture_flags);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "texture_flags", PROPERTY_HINT_FLAGS, "Mipmaps,Repeat,Filter,Anisotropic Linear,Convert to Linear,Mirrored Repeat,Video Surface"), "set_texture_flags", "get_texture_flags");
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_max_atlas_size"), &VoxelmanLibraryMerger::get_max_atlas_size);
|
||||
ClassDB::bind_method(D_METHOD("set_max_atlas_size", "size"), &VoxelmanLibraryMerger::set_max_atlas_size);
|
||||
ClassDB::bind_method(D_METHOD("get_max_atlas_size"), &VoxelLibraryMerger::get_max_atlas_size);
|
||||
ClassDB::bind_method(D_METHOD("set_max_atlas_size", "size"), &VoxelLibraryMerger::set_max_atlas_size);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "max_atlas_size"), "set_max_atlas_size", "get_max_atlas_size");
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_keep_original_atlases"), &VoxelmanLibraryMerger::get_keep_original_atlases);
|
||||
ClassDB::bind_method(D_METHOD("set_keep_original_atlases", "value"), &VoxelmanLibraryMerger::set_keep_original_atlases);
|
||||
ClassDB::bind_method(D_METHOD("get_keep_original_atlases"), &VoxelLibraryMerger::get_keep_original_atlases);
|
||||
ClassDB::bind_method(D_METHOD("set_keep_original_atlases", "value"), &VoxelLibraryMerger::set_keep_original_atlases);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "keep_original_atlases"), "set_keep_original_atlases", "get_keep_original_atlases");
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_background_color"), &VoxelmanLibraryMerger::get_background_color);
|
||||
ClassDB::bind_method(D_METHOD("set_background_color", "color"), &VoxelmanLibraryMerger::set_background_color);
|
||||
ClassDB::bind_method(D_METHOD("get_background_color"), &VoxelLibraryMerger::get_background_color);
|
||||
ClassDB::bind_method(D_METHOD("set_background_color", "color"), &VoxelLibraryMerger::set_background_color);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::COLOR, "background_color"), "set_background_color", "get_background_color");
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_margin"), &VoxelmanLibraryMerger::get_margin);
|
||||
ClassDB::bind_method(D_METHOD("set_margin", "size"), &VoxelmanLibraryMerger::set_margin);
|
||||
ClassDB::bind_method(D_METHOD("get_margin"), &VoxelLibraryMerger::get_margin);
|
||||
ClassDB::bind_method(D_METHOD("set_margin", "size"), &VoxelLibraryMerger::set_margin);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "margin"), "set_margin", "get_margin");
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_voxel_surfaces"), &VoxelmanLibraryMerger::get_voxel_surfaces);
|
||||
ClassDB::bind_method(D_METHOD("set_voxel_surfaces"), &VoxelmanLibraryMerger::set_voxel_surfaces);
|
||||
ClassDB::bind_method(D_METHOD("get_voxel_surfaces"), &VoxelLibraryMerger::get_voxel_surfaces);
|
||||
ClassDB::bind_method(D_METHOD("set_voxel_surfaces"), &VoxelLibraryMerger::set_voxel_surfaces);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "voxel_surfaces", PROPERTY_HINT_NONE, "17/17:VoxelSurfaceMerger", PROPERTY_USAGE_DEFAULT, "VoxelSurfaceMerger"), "set_voxel_surfaces", "get_voxel_surfaces");
|
||||
|
||||
#ifdef PROPS_PRESENT
|
||||
ClassDB::bind_method(D_METHOD("get_props"), &VoxelmanLibraryMerger::get_props);
|
||||
ClassDB::bind_method(D_METHOD("set_props"), &VoxelmanLibraryMerger::set_props);
|
||||
ClassDB::bind_method(D_METHOD("get_props"), &VoxelLibraryMerger::get_props);
|
||||
ClassDB::bind_method(D_METHOD("set_props"), &VoxelLibraryMerger::set_props);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "props", PROPERTY_HINT_NONE, "17/17:PropData", PROPERTY_USAGE_DEFAULT, "PropData"), "set_props", "get_props");
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_prop_uv_rect", "texture"), &VoxelmanLibraryMerger::get_prop_uv_rect);
|
||||
ClassDB::bind_method(D_METHOD("get_prop_uv_rect", "texture"), &VoxelLibraryMerger::get_prop_uv_rect);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_prop_packer"), &VoxelmanLibraryMerger::get_prop_packer);
|
||||
ClassDB::bind_method(D_METHOD("get_prop_packer"), &VoxelLibraryMerger::get_prop_packer);
|
||||
#endif
|
||||
|
||||
ClassDB::bind_method(D_METHOD("_setup_material_albedo", "material_index", "texture"), &VoxelmanLibraryMerger::_setup_material_albedo);
|
||||
ClassDB::bind_method(D_METHOD("_setup_material_albedo", "material_index", "texture"), &VoxelLibraryMerger::_setup_material_albedo);
|
||||
}
|
@ -20,8 +20,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef VOXELMAN_LIBRARY_MERGER_H
|
||||
#define VOXELMAN_LIBRARY_MERGER_H
|
||||
#ifndef VOXEL_LIBRARY_MERGER_H
|
||||
#define VOXEL_LIBRARY_MERGER_H
|
||||
|
||||
#include "core/version.h"
|
||||
|
||||
@ -33,7 +33,7 @@ SOFTWARE.
|
||||
#include "core/map.h"
|
||||
#endif
|
||||
|
||||
#include "voxelman_library.h"
|
||||
#include "voxel_library.h"
|
||||
|
||||
#include "scene/resources/material.h"
|
||||
|
||||
@ -44,8 +44,8 @@ class VoxelSurfaceSimple;
|
||||
class VoxelMesher;
|
||||
class PackedScene;
|
||||
|
||||
class VoxelmanLibraryMerger : public VoxelmanLibrary {
|
||||
GDCLASS(VoxelmanLibraryMerger, VoxelmanLibrary)
|
||||
class VoxelLibraryMerger : public VoxelLibrary {
|
||||
GDCLASS(VoxelLibraryMerger, VoxelLibrary)
|
||||
|
||||
public:
|
||||
int get_texture_flags() const;
|
||||
@ -94,8 +94,8 @@ public:
|
||||
|
||||
void _setup_material_albedo(const int material_index, const Ref<Texture> &texture);
|
||||
|
||||
VoxelmanLibraryMerger();
|
||||
~VoxelmanLibraryMerger();
|
||||
VoxelLibraryMerger();
|
||||
~VoxelLibraryMerger();
|
||||
|
||||
protected:
|
||||
#ifdef PROPS_PRESENT
|
@ -20,45 +20,45 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "voxelman_library_simple.h"
|
||||
#include "voxel_library_simple.h"
|
||||
|
||||
#include "../defines.h"
|
||||
|
||||
int VoxelmanLibrarySimple::get_atlas_columns() const {
|
||||
int VoxelLibrarySimple::get_atlas_columns() const {
|
||||
return _atlas_columns;
|
||||
}
|
||||
|
||||
void VoxelmanLibrarySimple::set_atlas_columns(int s) {
|
||||
void VoxelLibrarySimple::set_atlas_columns(int s) {
|
||||
ERR_FAIL_COND(s < 0);
|
||||
_atlas_columns = s;
|
||||
}
|
||||
|
||||
int VoxelmanLibrarySimple::get_atlas_rows() const {
|
||||
int VoxelLibrarySimple::get_atlas_rows() const {
|
||||
return _atlas_rows;
|
||||
}
|
||||
|
||||
void VoxelmanLibrarySimple::set_atlas_rows(int s) {
|
||||
void VoxelLibrarySimple::set_atlas_rows(int s) {
|
||||
ERR_FAIL_COND(s < 0);
|
||||
_atlas_rows = s;
|
||||
}
|
||||
|
||||
//Surfaces
|
||||
Ref<VoxelSurface> VoxelmanLibrarySimple::voxel_surface_get(const int index) {
|
||||
Ref<VoxelSurface> VoxelLibrarySimple::voxel_surface_get(const int index) {
|
||||
ERR_FAIL_INDEX_V(index, _voxel_surfaces.size(), Ref<VoxelSurface>(NULL));
|
||||
|
||||
return _voxel_surfaces[index];
|
||||
}
|
||||
|
||||
void VoxelmanLibrarySimple::voxel_surface_add(Ref<VoxelSurface> value) {
|
||||
void VoxelLibrarySimple::voxel_surface_add(Ref<VoxelSurface> value) {
|
||||
ERR_FAIL_COND(!value.is_valid());
|
||||
|
||||
value->set_library(Ref<VoxelmanLibrarySimple>(this));
|
||||
value->set_library(Ref<VoxelLibrarySimple>(this));
|
||||
value->set_id(_voxel_surfaces.size());
|
||||
|
||||
_voxel_surfaces.push_back(value);
|
||||
}
|
||||
|
||||
void VoxelmanLibrarySimple::voxel_surface_set(const int index, Ref<VoxelSurface> value) {
|
||||
void VoxelLibrarySimple::voxel_surface_set(const int index, Ref<VoxelSurface> value) {
|
||||
ERR_FAIL_COND(index < 0);
|
||||
|
||||
if (_voxel_surfaces.size() < index) {
|
||||
@ -66,17 +66,17 @@ void VoxelmanLibrarySimple::voxel_surface_set(const int index, Ref<VoxelSurface>
|
||||
}
|
||||
|
||||
if (_voxel_surfaces[index].is_valid()) {
|
||||
_voxel_surfaces.get(index)->set_library(Ref<VoxelmanLibrarySimple>(NULL));
|
||||
_voxel_surfaces.get(index)->set_library(Ref<VoxelLibrarySimple>(NULL));
|
||||
}
|
||||
|
||||
if (value.is_valid()) {
|
||||
value->set_library(Ref<VoxelmanLibrarySimple>(this));
|
||||
value->set_library(Ref<VoxelLibrarySimple>(this));
|
||||
|
||||
_voxel_surfaces.set(index, value);
|
||||
}
|
||||
}
|
||||
|
||||
void VoxelmanLibrarySimple::voxel_surface_remove(const int index) {
|
||||
void VoxelLibrarySimple::voxel_surface_remove(const int index) {
|
||||
#if VERSION_MAJOR <= 3
|
||||
_voxel_surfaces.remove(index);
|
||||
#else
|
||||
@ -84,19 +84,19 @@ void VoxelmanLibrarySimple::voxel_surface_remove(const int index) {
|
||||
#endif
|
||||
}
|
||||
|
||||
int VoxelmanLibrarySimple::voxel_surface_get_num() const {
|
||||
int VoxelLibrarySimple::voxel_surface_get_num() const {
|
||||
return _voxel_surfaces.size();
|
||||
}
|
||||
|
||||
void VoxelmanLibrarySimple::voxel_surfaces_clear() {
|
||||
void VoxelLibrarySimple::voxel_surfaces_clear() {
|
||||
_voxel_surfaces.clear();
|
||||
}
|
||||
|
||||
Vector<Variant> VoxelmanLibrarySimple::get_voxel_surfaces() {
|
||||
Vector<Variant> VoxelLibrarySimple::get_voxel_surfaces() {
|
||||
VARIANT_ARRAY_GET(_voxel_surfaces);
|
||||
}
|
||||
|
||||
void VoxelmanLibrarySimple::set_voxel_surfaces(const Vector<Variant> &surfaces) {
|
||||
void VoxelLibrarySimple::set_voxel_surfaces(const Vector<Variant> &surfaces) {
|
||||
_voxel_surfaces.clear();
|
||||
|
||||
for (int i = 0; i < surfaces.size(); i++) {
|
||||
@ -113,7 +113,7 @@ void VoxelmanLibrarySimple::set_voxel_surfaces(const Vector<Variant> &surfaces)
|
||||
set_initialized(true);
|
||||
}
|
||||
|
||||
void VoxelmanLibrarySimple::refresh_rects() {
|
||||
void VoxelLibrarySimple::refresh_rects() {
|
||||
for (int i = 0; i < _voxel_surfaces.size(); i++) {
|
||||
Ref<VoxelSurfaceSimple> surface = Ref<VoxelSurfaceSimple>(_voxel_surfaces[i]);
|
||||
|
||||
@ -123,33 +123,33 @@ void VoxelmanLibrarySimple::refresh_rects() {
|
||||
}
|
||||
}
|
||||
|
||||
VoxelmanLibrarySimple::VoxelmanLibrarySimple() {
|
||||
VoxelLibrarySimple::VoxelLibrarySimple() {
|
||||
_atlas_rows = 8;
|
||||
_atlas_columns = 8;
|
||||
}
|
||||
|
||||
VoxelmanLibrarySimple::~VoxelmanLibrarySimple() {
|
||||
VoxelLibrarySimple::~VoxelLibrarySimple() {
|
||||
for (int i = 0; i < _voxel_surfaces.size(); ++i) {
|
||||
Ref<VoxelSurface> surface = _voxel_surfaces[i];
|
||||
|
||||
if (surface.is_valid()) {
|
||||
surface->set_library(Ref<VoxelmanLibrarySimple>());
|
||||
surface->set_library(Ref<VoxelLibrarySimple>());
|
||||
}
|
||||
}
|
||||
|
||||
_voxel_surfaces.clear();
|
||||
}
|
||||
|
||||
void VoxelmanLibrarySimple::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("get_atlas_columns"), &VoxelmanLibrarySimple::get_atlas_columns);
|
||||
ClassDB::bind_method(D_METHOD("set_atlas_columns", "value"), &VoxelmanLibrarySimple::set_atlas_columns);
|
||||
void VoxelLibrarySimple::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("get_atlas_columns"), &VoxelLibrarySimple::get_atlas_columns);
|
||||
ClassDB::bind_method(D_METHOD("set_atlas_columns", "value"), &VoxelLibrarySimple::set_atlas_columns);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "atlas_columns"), "set_atlas_columns", "get_atlas_columns");
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_atlas_rows"), &VoxelmanLibrarySimple::get_atlas_rows);
|
||||
ClassDB::bind_method(D_METHOD("set_atlas_rows", "value"), &VoxelmanLibrarySimple::set_atlas_rows);
|
||||
ClassDB::bind_method(D_METHOD("get_atlas_rows"), &VoxelLibrarySimple::get_atlas_rows);
|
||||
ClassDB::bind_method(D_METHOD("set_atlas_rows", "value"), &VoxelLibrarySimple::set_atlas_rows);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "atlas_rows"), "set_atlas_rows", "get_atlas_rows");
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_voxel_surfaces"), &VoxelmanLibrarySimple::get_voxel_surfaces);
|
||||
ClassDB::bind_method(D_METHOD("set_voxel_surfaces"), &VoxelmanLibrarySimple::set_voxel_surfaces);
|
||||
ClassDB::bind_method(D_METHOD("get_voxel_surfaces"), &VoxelLibrarySimple::get_voxel_surfaces);
|
||||
ClassDB::bind_method(D_METHOD("set_voxel_surfaces"), &VoxelLibrarySimple::set_voxel_surfaces);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "voxel_surfaces", PROPERTY_HINT_NONE, "17/17:VoxelSurfaceSimple", PROPERTY_USAGE_DEFAULT, "VoxelSurfaceSimple"), "set_voxel_surfaces", "get_voxel_surfaces");
|
||||
}
|
@ -20,8 +20,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef VOXELMAN_LIBRARY_SIMPLE_H
|
||||
#define VOXELMAN_LIBRARY_SIMPLE_H
|
||||
#ifndef VOXEL_LIBRARY_SIMPLE_H
|
||||
#define VOXEL_LIBRARY_SIMPLE_H
|
||||
|
||||
#include "core/version.h"
|
||||
|
||||
@ -34,7 +34,7 @@ SOFTWARE.
|
||||
#include "core/resource.h"
|
||||
#endif
|
||||
|
||||
#include "voxelman_library.h"
|
||||
#include "voxel_library.h"
|
||||
|
||||
#include "scene/resources/material.h"
|
||||
|
||||
@ -44,8 +44,8 @@ SOFTWARE.
|
||||
class VoxelSurfaceSimple;
|
||||
class VoxelMesher;
|
||||
|
||||
class VoxelmanLibrarySimple : public VoxelmanLibrary {
|
||||
GDCLASS(VoxelmanLibrarySimple, VoxelmanLibrary)
|
||||
class VoxelLibrarySimple : public VoxelLibrary {
|
||||
GDCLASS(VoxelLibrarySimple, VoxelLibrary)
|
||||
|
||||
public:
|
||||
int get_atlas_columns() const;
|
||||
@ -66,8 +66,8 @@ public:
|
||||
|
||||
void refresh_rects();
|
||||
|
||||
VoxelmanLibrarySimple();
|
||||
~VoxelmanLibrarySimple();
|
||||
VoxelLibrarySimple();
|
||||
~VoxelLibrarySimple();
|
||||
|
||||
protected:
|
||||
static void _bind_methods();
|
@ -57,11 +57,11 @@ void VoxelSurface::set_rect(const VoxelSurfaceSides side, const Rect2 &rect) {
|
||||
_rects[side] = rect;
|
||||
}
|
||||
|
||||
Ref<VoxelmanLibrary> VoxelSurface::get_library() const {
|
||||
return Ref<VoxelmanLibrary>(_library);
|
||||
Ref<VoxelLibrary> VoxelSurface::get_library() const {
|
||||
return Ref<VoxelLibrary>(_library);
|
||||
}
|
||||
|
||||
void VoxelSurface::set_library(Ref<VoxelmanLibrary> library) {
|
||||
void VoxelSurface::set_library(Ref<VoxelLibrary> library) {
|
||||
_library = (*library);
|
||||
}
|
||||
|
||||
|
@ -39,9 +39,9 @@ SOFTWARE.
|
||||
#include "core/math/rect2.h"
|
||||
#include "scene/resources/material.h"
|
||||
|
||||
#include "voxelman_library.h"
|
||||
#include "voxel_library.h"
|
||||
|
||||
class VoxelmanLibrary;
|
||||
class VoxelLibrary;
|
||||
|
||||
class VoxelSurface : public Resource {
|
||||
GDCLASS(VoxelSurface, Resource)
|
||||
@ -88,8 +88,8 @@ public:
|
||||
Rect2 get_rect(const VoxelSurfaceSides side) const;
|
||||
void set_rect(const VoxelSurfaceSides side, const Rect2 &rect);
|
||||
|
||||
Ref<VoxelmanLibrary> get_library() const;
|
||||
void set_library(Ref<VoxelmanLibrary> library);
|
||||
Ref<VoxelLibrary> get_library() const;
|
||||
void set_library(Ref<VoxelLibrary> library);
|
||||
|
||||
Vector2 transform_uv(const VoxelSurfaceSides p_side, const Vector2 &p_uv) const;
|
||||
Vector2 transform_uv_scaled(const VoxelSurfaceSides p_side, const Vector2 &p_uv, const int p_current_x, const int p_current_y, const int p_max) const;
|
||||
@ -102,7 +102,7 @@ public:
|
||||
protected:
|
||||
static void _bind_methods();
|
||||
|
||||
VoxelmanLibrary *_library;
|
||||
VoxelLibrary *_library;
|
||||
|
||||
int _id;
|
||||
int _mesher_index;
|
||||
|
@ -22,7 +22,7 @@ SOFTWARE.
|
||||
|
||||
#include "voxel_surface_merger.h"
|
||||
|
||||
#include "voxelman_library_merger.h"
|
||||
#include "voxel_library_merger.h"
|
||||
|
||||
#include "../defines.h"
|
||||
|
||||
@ -45,7 +45,7 @@ void VoxelSurfaceMerger::set_texture(const VoxelSurfaceSides side, const Ref<Tex
|
||||
}
|
||||
|
||||
void VoxelSurfaceMerger::refresh_rects() {
|
||||
VoxelmanLibraryMerger *lib = Object::cast_to<VoxelmanLibraryMerger>(_library);
|
||||
VoxelLibraryMerger *lib = Object::cast_to<VoxelLibraryMerger>(_library);
|
||||
|
||||
ERR_FAIL_COND(lib == NULL);
|
||||
|
||||
|
@ -22,7 +22,7 @@ SOFTWARE.
|
||||
|
||||
#include "voxel_surface_simple.h"
|
||||
|
||||
#include "voxelman_library_simple.h"
|
||||
#include "voxel_library_simple.h"
|
||||
|
||||
int VoxelSurfaceSimple::get_atlas_x(const VoxelSurfaceSides side) const {
|
||||
int indx = (side * 2);
|
||||
@ -47,7 +47,7 @@ void VoxelSurfaceSimple::set_atlas_y(const VoxelSurfaceSides side, int value) {
|
||||
}
|
||||
|
||||
void VoxelSurfaceSimple::refresh_rects() {
|
||||
VoxelmanLibrarySimple *lib = Object::cast_to<VoxelmanLibrarySimple>(_library);
|
||||
VoxelLibrarySimple *lib = Object::cast_to<VoxelLibrarySimple>(_library);
|
||||
|
||||
ERR_FAIL_COND(lib == NULL);
|
||||
|
||||
|
@ -1,336 +0,0 @@
|
||||
/*
|
||||
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.
|
||||
*/
|
||||
|
||||
#include "voxelman_library.h"
|
||||
|
||||
#ifdef PROPS_PRESENT
|
||||
#include "../../props/props/prop_data.h"
|
||||
#endif
|
||||
|
||||
#include "scene/resources/packed_scene.h"
|
||||
|
||||
#include "../defines.h"
|
||||
|
||||
bool VoxelmanLibrary::get_initialized() const {
|
||||
return _initialized;
|
||||
}
|
||||
void VoxelmanLibrary::set_initialized(const bool value) {
|
||||
_initialized = value;
|
||||
}
|
||||
|
||||
//Materials
|
||||
Ref<Material> VoxelmanLibrary::material_get(const int index) {
|
||||
ERR_FAIL_INDEX_V(index, _materials.size(), Ref<VoxelSurface>(NULL));
|
||||
|
||||
return _materials[index];
|
||||
}
|
||||
|
||||
void VoxelmanLibrary::material_add(const Ref<Material> &value) {
|
||||
ERR_FAIL_COND(!value.is_valid());
|
||||
|
||||
_materials.push_back(value);
|
||||
}
|
||||
|
||||
void VoxelmanLibrary::material_set(const int index, const Ref<Material> &value) {
|
||||
ERR_FAIL_INDEX(index, _materials.size());
|
||||
|
||||
_materials.set(index, value);
|
||||
}
|
||||
|
||||
void VoxelmanLibrary::material_remove(const int index) {
|
||||
#if VERSION_MAJOR <= 3
|
||||
_materials.remove(index);
|
||||
#else
|
||||
_materials.remove_at(index);
|
||||
#endif
|
||||
}
|
||||
|
||||
int VoxelmanLibrary::material_get_num() const {
|
||||
return _materials.size();
|
||||
}
|
||||
|
||||
void VoxelmanLibrary::materials_clear() {
|
||||
_materials.clear();
|
||||
}
|
||||
|
||||
Vector<Variant> VoxelmanLibrary::materials_get() {
|
||||
VARIANT_ARRAY_GET(_materials);
|
||||
}
|
||||
|
||||
void VoxelmanLibrary::materials_set(const Vector<Variant> &materials) {
|
||||
_materials.clear();
|
||||
|
||||
for (int i = 0; i < materials.size(); i++) {
|
||||
Ref<Material> material = Ref<Material>(materials[i]);
|
||||
|
||||
_materials.push_back(material);
|
||||
}
|
||||
}
|
||||
|
||||
//Liquid Materials
|
||||
Ref<Material> VoxelmanLibrary::liquid_material_get(const int index) {
|
||||
ERR_FAIL_INDEX_V(index, _liquid_materials.size(), Ref<VoxelSurface>(NULL));
|
||||
|
||||
return _liquid_materials[index];
|
||||
}
|
||||
|
||||
void VoxelmanLibrary::liquid_material_add(const Ref<Material> &value) {
|
||||
ERR_FAIL_COND(!value.is_valid());
|
||||
|
||||
_liquid_materials.push_back(value);
|
||||
}
|
||||
|
||||
void VoxelmanLibrary::liquid_material_set(const int index, const Ref<Material> &value) {
|
||||
ERR_FAIL_INDEX(index, _liquid_materials.size());
|
||||
|
||||
_liquid_materials.set(index, value);
|
||||
}
|
||||
|
||||
void VoxelmanLibrary::liquid_material_remove(const int index) {
|
||||
#if VERSION_MAJOR <= 3
|
||||
_liquid_materials.remove(index);
|
||||
#else
|
||||
_liquid_materials.remove_at(index);
|
||||
#endif
|
||||
}
|
||||
|
||||
int VoxelmanLibrary::liquid_material_get_num() const {
|
||||
return _liquid_materials.size();
|
||||
}
|
||||
|
||||
void VoxelmanLibrary::liquid_materials_clear() {
|
||||
_liquid_materials.clear();
|
||||
}
|
||||
|
||||
Vector<Variant> VoxelmanLibrary::liquid_materials_get() {
|
||||
VARIANT_ARRAY_GET(_liquid_materials);
|
||||
}
|
||||
|
||||
void VoxelmanLibrary::liquid_materials_set(const Vector<Variant> &materials) {
|
||||
_liquid_materials.clear();
|
||||
|
||||
for (int i = 0; i < materials.size(); i++) {
|
||||
Ref<Material> material = Ref<Material>(materials[i]);
|
||||
|
||||
_liquid_materials.push_back(material);
|
||||
}
|
||||
}
|
||||
|
||||
//Prop Materials
|
||||
Ref<Material> VoxelmanLibrary::prop_material_get(const int index) {
|
||||
ERR_FAIL_INDEX_V(index, _prop_materials.size(), Ref<VoxelSurface>(NULL));
|
||||
|
||||
return _prop_materials[index];
|
||||
}
|
||||
|
||||
void VoxelmanLibrary::prop_material_add(const Ref<Material> &value) {
|
||||
ERR_FAIL_COND(!value.is_valid());
|
||||
|
||||
_prop_materials.push_back(value);
|
||||
}
|
||||
|
||||
void VoxelmanLibrary::prop_material_set(const int index, const Ref<Material> &value) {
|
||||
ERR_FAIL_INDEX(index, _prop_materials.size());
|
||||
|
||||
_prop_materials.set(index, value);
|
||||
}
|
||||
|
||||
void VoxelmanLibrary::prop_material_remove(const int index) {
|
||||
#if VERSION_MAJOR <= 3
|
||||
_prop_materials.remove(index);
|
||||
#else
|
||||
_prop_materials.remove_at(index);
|
||||
#endif
|
||||
}
|
||||
|
||||
int VoxelmanLibrary::prop_material_get_num() const {
|
||||
return _prop_materials.size();
|
||||
}
|
||||
|
||||
void VoxelmanLibrary::prop_materials_clear() {
|
||||
_prop_materials.clear();
|
||||
}
|
||||
|
||||
Vector<Variant> VoxelmanLibrary::prop_materials_get() {
|
||||
VARIANT_ARRAY_GET(_prop_materials);
|
||||
}
|
||||
|
||||
void VoxelmanLibrary::prop_materials_set(const Vector<Variant> &materials) {
|
||||
VARIANT_ARRAY_SET(materials, _prop_materials, Material);
|
||||
}
|
||||
|
||||
//Surfaces
|
||||
Ref<VoxelSurface> VoxelmanLibrary::voxel_surface_get(const int index) {
|
||||
return Ref<VoxelSurface>();
|
||||
}
|
||||
void VoxelmanLibrary::voxel_surface_add(Ref<VoxelSurface> value) {
|
||||
}
|
||||
void VoxelmanLibrary::voxel_surface_set(int index, Ref<VoxelSurface> value) {
|
||||
}
|
||||
void VoxelmanLibrary::voxel_surface_remove(const int index) {
|
||||
}
|
||||
int VoxelmanLibrary::voxel_surface_get_num() const {
|
||||
return 0;
|
||||
}
|
||||
void VoxelmanLibrary::voxel_surfaces_clear() {
|
||||
}
|
||||
|
||||
Ref<PackedScene> VoxelmanLibrary::scene_get(const int id) {
|
||||
return Ref<PackedScene>();
|
||||
}
|
||||
void VoxelmanLibrary::scene_add(Ref<PackedScene> value) {
|
||||
}
|
||||
void VoxelmanLibrary::scene_set(int id, Ref<PackedScene> value) {
|
||||
}
|
||||
void VoxelmanLibrary::scene_remove(const int id) {
|
||||
}
|
||||
int VoxelmanLibrary::scene_get_num() const {
|
||||
return 0;
|
||||
}
|
||||
void VoxelmanLibrary::scenes_clear() {
|
||||
}
|
||||
|
||||
#ifdef PROPS_PRESENT
|
||||
Ref<PropData> VoxelmanLibrary::prop_get(const int id) {
|
||||
return Ref<PropData>();
|
||||
}
|
||||
void VoxelmanLibrary::prop_add(Ref<PropData> value) {
|
||||
}
|
||||
bool VoxelmanLibrary::prop_has(const Ref<PropData> &value) const {
|
||||
return false;
|
||||
}
|
||||
void VoxelmanLibrary::prop_set(int id, Ref<PropData> value) {
|
||||
}
|
||||
void VoxelmanLibrary::prop_remove(const int id) {
|
||||
}
|
||||
int VoxelmanLibrary::prop_get_num() const {
|
||||
return 0;
|
||||
}
|
||||
void VoxelmanLibrary::props_clear() {
|
||||
}
|
||||
|
||||
Rect2 VoxelmanLibrary::get_prop_uv_rect(const Ref<Texture> &texture) {
|
||||
return Rect2(0, 0, 1, 1);
|
||||
}
|
||||
#endif
|
||||
|
||||
//Rects
|
||||
void VoxelmanLibrary::refresh_rects() {
|
||||
_initialized = true;
|
||||
}
|
||||
|
||||
void VoxelmanLibrary::setup_material_albedo(int material_index, Ref<Texture> texture) {
|
||||
if (has_method("_setup_material_albedo")) {
|
||||
#if VERSION_MAJOR < 4
|
||||
call("_setup_material_albedo", material_index, texture);
|
||||
#else
|
||||
GDVIRTUAL_CALL(_setup_material_albedo, material_index, texture);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
VoxelmanLibrary::VoxelmanLibrary() {
|
||||
_initialized = false;
|
||||
}
|
||||
|
||||
VoxelmanLibrary::~VoxelmanLibrary() {
|
||||
_materials.clear();
|
||||
_liquid_materials.clear();
|
||||
_prop_materials.clear();
|
||||
}
|
||||
|
||||
void VoxelmanLibrary::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("get_initialized"), &VoxelmanLibrary::get_initialized);
|
||||
ClassDB::bind_method(D_METHOD("set_initialized", "value"), &VoxelmanLibrary::set_initialized);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "initialized", PROPERTY_HINT_NONE, "", 0), "set_initialized", "get_initialized");
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
BIND_VMETHOD(MethodInfo("_setup_material_albedo", PropertyInfo(Variant::INT, "material_index"), PropertyInfo(Variant::OBJECT, "texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture")));
|
||||
#else
|
||||
GDVIRTUAL_BIND(_setup_material_albedo, "material_index", "texture");
|
||||
#endif
|
||||
|
||||
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);
|
||||
|
||||
#ifdef PROPS_PRESENT
|
||||
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);
|
||||
#endif
|
||||
|
||||
ClassDB::bind_method(D_METHOD("refresh_rects"), &VoxelmanLibrary::refresh_rects);
|
||||
|
||||
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);
|
||||
BIND_CONSTANT(MATERIAL_INDEX_PROP);
|
||||
}
|
@ -49,7 +49,7 @@ void VoxelMesherCubic::_add_chunk(Ref<VoxelChunk> p_chunk) {
|
||||
float voxel_scale = get_voxel_scale();
|
||||
|
||||
Ref<VoxelCubePoints> cube_points;
|
||||
cube_points.instance();
|
||||
cube_points.INSTANCE();
|
||||
cube_points->set_channel_index_type(_channel_index_type);
|
||||
cube_points->set_channel_index_isolevel(_channel_index_isolevel);
|
||||
|
||||
|
@ -112,10 +112,10 @@ void VoxelMesher::set_texture_scale(const int value) {
|
||||
_texture_scale = value;
|
||||
}
|
||||
|
||||
Ref<VoxelmanLibrary> VoxelMesher::get_library() {
|
||||
Ref<VoxelLibrary> VoxelMesher::get_library() {
|
||||
return _library;
|
||||
}
|
||||
void VoxelMesher::set_library(const Ref<VoxelmanLibrary> &library) {
|
||||
void VoxelMesher::set_library(const Ref<VoxelLibrary> &library) {
|
||||
_library = library;
|
||||
}
|
||||
|
||||
@ -905,7 +905,7 @@ void VoxelMesher::remove_index(const int idx) {
|
||||
#endif
|
||||
}
|
||||
|
||||
VoxelMesher::VoxelMesher(const Ref<VoxelmanLibrary> &library) {
|
||||
VoxelMesher::VoxelMesher(const Ref<VoxelLibrary> &library) {
|
||||
_library = library;
|
||||
|
||||
_mesher_index = 0;
|
||||
@ -971,7 +971,7 @@ void VoxelMesher::_bind_methods() {
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_library"), &VoxelMesher::get_library);
|
||||
ClassDB::bind_method(D_METHOD("set_library", "value"), &VoxelMesher::set_library);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "library", PROPERTY_HINT_RESOURCE_TYPE, "VoxelmanLibrary"), "set_library", "get_library");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "library", PROPERTY_HINT_RESOURCE_TYPE, "VoxelLibrary"), "set_library", "get_library");
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_material"), &VoxelMesher::get_material);
|
||||
ClassDB::bind_method(D_METHOD("set_material", "value"), &VoxelMesher::set_material);
|
||||
|
@ -56,12 +56,12 @@ include_pool_vector
|
||||
#include "../../mesh_data_resource/mesh_data_resource.h"
|
||||
#endif
|
||||
|
||||
#include "../library/voxelman_library.h"
|
||||
#include "../library/voxel_library.h"
|
||||
|
||||
const double PI_2 = 3.141592653589793238463 / 2;
|
||||
const double PI = 3.141592653589793238463;
|
||||
|
||||
class VoxelmanLibrary;
|
||||
class VoxelLibrary;
|
||||
class VoxelChunk;
|
||||
|
||||
class VoxelMesher : public Reference {
|
||||
@ -113,8 +113,8 @@ public:
|
||||
int get_texture_scale() const;
|
||||
void set_texture_scale(const int value);
|
||||
|
||||
Ref<VoxelmanLibrary> get_library();
|
||||
void set_library(const Ref<VoxelmanLibrary> &library);
|
||||
Ref<VoxelLibrary> get_library();
|
||||
void set_library(const Ref<VoxelLibrary> &library);
|
||||
|
||||
Ref<Material> get_material();
|
||||
void set_material(const Ref<Material> &material);
|
||||
@ -199,7 +199,7 @@ public:
|
||||
GDVIRTUAL1(_add_mesher, Ref<VoxelMesher>);
|
||||
#endif
|
||||
|
||||
VoxelMesher(const Ref<VoxelmanLibrary> &library);
|
||||
VoxelMesher(const Ref<VoxelLibrary> &library);
|
||||
VoxelMesher();
|
||||
~VoxelMesher();
|
||||
|
||||
@ -226,7 +226,7 @@ protected:
|
||||
Vector<float> _last_weights;
|
||||
Plane _last_tangent;
|
||||
|
||||
Ref<VoxelmanLibrary> _library;
|
||||
Ref<VoxelLibrary> _library;
|
||||
Ref<Material> _material;
|
||||
|
||||
float _voxel_scale;
|
||||
|
9
nodes/voxel_light_node.cpp
Normal file
9
nodes/voxel_light_node.cpp
Normal file
@ -0,0 +1,9 @@
|
||||
#include "voxel_light_node.h"
|
||||
|
||||
VoxelLightNode::VoxelLightNode() {
|
||||
}
|
||||
VoxelLightNode::~VoxelLightNode() {
|
||||
}
|
||||
|
||||
void VoxelLightNode::_bind_methods() {
|
||||
}
|
@ -20,8 +20,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef VOXELMAN_LIGHT_H
|
||||
#define VOXELMAN_LIGHT_H
|
||||
#ifndef VOXEL_LIGHT_NODE_H
|
||||
#define VOXEL_LIGHT_NODE_H
|
||||
|
||||
#include "core/version.h"
|
||||
|
||||
@ -35,15 +35,15 @@ SOFTWARE.
|
||||
|
||||
#include "core/math/vector3.h"
|
||||
|
||||
class VoxelmanLight : public Spatial {
|
||||
GDCLASS(VoxelmanLight, Spatial);
|
||||
class VoxelLightNode : public Spatial {
|
||||
GDCLASS(VoxelLightNode, Spatial);
|
||||
OBJ_CATEGORY("Props");
|
||||
|
||||
public:
|
||||
//make it turn into a normal light if voxelman isn't present?
|
||||
|
||||
VoxelmanLight();
|
||||
~VoxelmanLight();
|
||||
VoxelLightNode();
|
||||
~VoxelLightNode();
|
||||
|
||||
protected:
|
||||
static void _bind_methods();
|
@ -1,9 +0,0 @@
|
||||
#include "voxelman_light.h"
|
||||
|
||||
VoxelmanLight::VoxelmanLight() {
|
||||
}
|
||||
VoxelmanLight::~VoxelmanLight() {
|
||||
}
|
||||
|
||||
void VoxelmanLight::_bind_methods() {
|
||||
}
|
@ -25,12 +25,12 @@ SOFTWARE.
|
||||
#include "library/voxel_surface.h"
|
||||
#include "library/voxel_surface_simple.h"
|
||||
|
||||
#include "library/voxelman_library.h"
|
||||
#include "library/voxelman_library_simple.h"
|
||||
#include "library/voxel_library.h"
|
||||
#include "library/voxel_library_simple.h"
|
||||
|
||||
#ifdef TEXTURE_PACKER_PRESENT
|
||||
#include "library/voxel_surface_merger.h"
|
||||
#include "library/voxelman_library_merger.h"
|
||||
#include "library/voxel_library_merger.h"
|
||||
#endif
|
||||
|
||||
#include "data/voxel_light.h"
|
||||
@ -51,8 +51,8 @@ SOFTWARE.
|
||||
#include "meshers/cubic/voxel_cube_points.h"
|
||||
#include "meshers/cubic/voxel_mesher_cubic.h"
|
||||
|
||||
#include "level_generator/voxelman_level_generator.h"
|
||||
#include "level_generator/voxelman_level_generator_flat.h"
|
||||
#include "level_generator/voxel_level_generator.h"
|
||||
#include "level_generator/voxel_level_generator_flat.h"
|
||||
|
||||
#include "areas/world_area.h"
|
||||
|
||||
@ -70,12 +70,12 @@ SOFTWARE.
|
||||
#include "world/marching_cubes/voxel_chunk_marching_cubes.h"
|
||||
#include "world/marching_cubes/voxel_world_marching_cubes.h"
|
||||
|
||||
#include "nodes/voxelman_light.h"
|
||||
#include "nodes/voxel_light_node.h"
|
||||
|
||||
#include "world/jobs/voxel_job.h"
|
||||
#include "world/jobs/voxel_light_job.h"
|
||||
#include "world/jobs/voxel_prop_job.h"
|
||||
#include "world/jobs/voxel_terrarin_job.h"
|
||||
#include "world/jobs/voxel_terrain_job.h"
|
||||
|
||||
void register_voxelman_types() {
|
||||
ClassDB::register_class<VoxelMesher>();
|
||||
@ -87,16 +87,16 @@ void register_voxelman_types() {
|
||||
ClassDB::register_class<VoxelSurface>();
|
||||
ClassDB::register_class<VoxelSurfaceSimple>();
|
||||
|
||||
ClassDB::register_class<VoxelmanLibrary>();
|
||||
ClassDB::register_class<VoxelmanLibrarySimple>();
|
||||
ClassDB::register_class<VoxelLibrary>();
|
||||
ClassDB::register_class<VoxelLibrarySimple>();
|
||||
|
||||
#ifdef TEXTURE_PACKER_PRESENT
|
||||
ClassDB::register_class<VoxelSurfaceMerger>();
|
||||
ClassDB::register_class<VoxelmanLibraryMerger>();
|
||||
ClassDB::register_class<VoxelLibraryMerger>();
|
||||
#endif
|
||||
|
||||
ClassDB::register_class<VoxelLight>();
|
||||
ClassDB::register_class<VoxelmanLight>();
|
||||
ClassDB::register_class<VoxelLightNode>();
|
||||
|
||||
ClassDB::register_class<VoxelWorld>();
|
||||
ClassDB::register_class<VoxelChunk>();
|
||||
@ -121,13 +121,13 @@ void register_voxelman_types() {
|
||||
ClassDB::register_class<VoxelWorldCubic>();
|
||||
ClassDB::register_class<VoxelChunkCubic>();
|
||||
|
||||
ClassDB::register_class<VoxelmanLevelGenerator>();
|
||||
ClassDB::register_class<VoxelmanLevelGeneratorFlat>();
|
||||
ClassDB::register_class<VoxelLevelGenerator>();
|
||||
ClassDB::register_class<VoxelLevelGeneratorFlat>();
|
||||
|
||||
ClassDB::register_class<WorldArea>();
|
||||
|
||||
ClassDB::register_class<VoxelJob>();
|
||||
ClassDB::register_class<VoxelTerrarinJob>();
|
||||
ClassDB::register_class<VoxelTerrainJob>();
|
||||
ClassDB::register_class<VoxelLightJob>();
|
||||
ClassDB::register_class<VoxelPropJob>();
|
||||
|
||||
|
@ -20,8 +20,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef VOXELMAN_REGISTER_TYPES_H
|
||||
#define VOXELMAN_REGISTER_TYPES_H
|
||||
#ifndef VOXEL_REGISTER_TYPES_H
|
||||
#define VOXEL_REGISTER_TYPES_H
|
||||
|
||||
void register_voxelman_types();
|
||||
void unregister_voxelman_types();
|
||||
|
@ -28,7 +28,8 @@ SOFTWARE.
|
||||
#include "../../meshers/blocky/voxel_mesher_liquid_blocky.h"
|
||||
#include "../jobs/voxel_light_job.h"
|
||||
#include "../jobs/voxel_prop_job.h"
|
||||
#include "../jobs/voxel_terrarin_job.h"
|
||||
#include "../jobs/voxel_terrain_job.h"
|
||||
#include "../../defines.h"
|
||||
|
||||
Ref<VoxelChunk> VoxelWorldBlocky::_create_chunk(int x, int y, int z, Ref<VoxelChunk> chunk) {
|
||||
|
||||
@ -37,14 +38,14 @@ Ref<VoxelChunk> VoxelWorldBlocky::_create_chunk(int x, int y, int z, Ref<VoxelCh
|
||||
}
|
||||
|
||||
if (chunk->job_get_count() == 0) {
|
||||
Ref<VoxelTerrarinJob> tj;
|
||||
tj.instance();
|
||||
Ref<VoxelTerrainJob> tj;
|
||||
tj.INSTANCE();
|
||||
|
||||
Ref<VoxelLightJob> lj;
|
||||
lj.instance();
|
||||
lj.INSTANCE();
|
||||
|
||||
Ref<VoxelPropJob> pj;
|
||||
pj.instance();
|
||||
pj.INSTANCE();
|
||||
pj->set_prop_mesher(Ref<VoxelMesher>(memnew(VoxelMesherBlocky)));
|
||||
|
||||
tj->add_mesher(Ref<VoxelMesher>(memnew(VoxelMesherBlocky())));
|
||||
|
@ -27,7 +27,7 @@ SOFTWARE.
|
||||
#include "../../meshers/cubic/voxel_mesher_cubic.h"
|
||||
#include "../jobs/voxel_light_job.h"
|
||||
#include "../jobs/voxel_prop_job.h"
|
||||
#include "../jobs/voxel_terrarin_job.h"
|
||||
#include "../jobs/voxel_terrain_job.h"
|
||||
|
||||
Ref<VoxelChunk> VoxelWorldCubic::_create_chunk(int x, int y, int z, Ref<VoxelChunk> chunk) {
|
||||
|
||||
@ -36,14 +36,14 @@ Ref<VoxelChunk> VoxelWorldCubic::_create_chunk(int x, int y, int z, Ref<VoxelChu
|
||||
}
|
||||
|
||||
if (chunk->job_get_count() == 0) {
|
||||
Ref<VoxelTerrarinJob> tj;
|
||||
tj.instance();
|
||||
Ref<VoxelTerrainJob> tj;
|
||||
tj.INSTANCE();
|
||||
|
||||
Ref<VoxelLightJob> lj;
|
||||
lj.instance();
|
||||
lj.INSTANCE();
|
||||
|
||||
Ref<VoxelPropJob> pj;
|
||||
pj.instance();
|
||||
pj.INSTANCE();
|
||||
pj->set_prop_mesher(Ref<VoxelMesher>(memnew(VoxelMesherCubic)));
|
||||
|
||||
Ref<VoxelMesher> m = Ref<VoxelMesher>(memnew(VoxelMesherCubic()));
|
||||
|
@ -37,7 +37,7 @@ SOFTWARE.
|
||||
|
||||
#include "../jobs/voxel_light_job.h"
|
||||
#include "../jobs/voxel_prop_job.h"
|
||||
#include "../jobs/voxel_terrarin_job.h"
|
||||
#include "../jobs/voxel_terrain_job.h"
|
||||
|
||||
const String VoxelChunkDefault::BINDING_STRING_BUILD_FLAGS = "Use Isolevel,Use Lighting,Use AO,Use RAO,Generate AO,Generate RAO,Bake Lights,Create Collider,Create Lods";
|
||||
|
||||
@ -83,7 +83,7 @@ void VoxelChunkDefault::set_current_lod_level(const int value) {
|
||||
if (i == _current_lod_level)
|
||||
vis = true;
|
||||
|
||||
RID rid = mesh_rid_get_index(MESH_INDEX_TERRARIN, MESH_TYPE_INDEX_MESH_INSTANCE, i);
|
||||
RID rid = mesh_rid_get_index(MESH_INDEX_TERRAIN, MESH_TYPE_INDEX_MESH_INSTANCE, i);
|
||||
|
||||
if (rid != RID())
|
||||
VisualServer::get_singleton()->instance_set_visible(rid, vis);
|
||||
@ -378,7 +378,12 @@ void VoxelChunkDefault::colliders_create(const int mesh_index, const int layer_m
|
||||
ERR_FAIL_COND(m.has(MESH_TYPE_INDEX_SHAPE));
|
||||
|
||||
RID shape_rid = PhysicsServer::get_singleton()->shape_create(PhysicsServer::SHAPE_CONCAVE_POLYGON);
|
||||
#if VERSION_MAJOR < 4
|
||||
RID body_rid = PhysicsServer::get_singleton()->body_create(PhysicsServer::BODY_MODE_STATIC);
|
||||
#else
|
||||
RID body_rid = PhysicsServer::get_singleton()->body_create();
|
||||
PhysicsServer::get_singleton()->body_set_mode(body_rid, PhysicsServer::BODY_MODE_STATIC);
|
||||
#endif
|
||||
|
||||
PhysicsServer::get_singleton()->body_set_collision_layer(body_rid, layer_mask);
|
||||
PhysicsServer::get_singleton()->body_set_collision_mask(body_rid, layer_mask);
|
||||
@ -712,7 +717,7 @@ void VoxelChunkDefault::_visibility_changed(bool visible) {
|
||||
}
|
||||
|
||||
for (int i = 0; i < _lod_num + 1; ++i) {
|
||||
RID rid = mesh_rid_get_index(MESH_INDEX_TERRARIN, MESH_TYPE_INDEX_MESH_INSTANCE, i);
|
||||
RID rid = mesh_rid_get_index(MESH_INDEX_TERRAIN, MESH_TYPE_INDEX_MESH_INSTANCE, i);
|
||||
|
||||
if (rid != RID())
|
||||
VisualServer::get_singleton()->instance_set_visible(rid, false);
|
||||
@ -833,7 +838,11 @@ void VoxelChunkDefault::_world_light_removed(const Ref<VoxelLight> &light) {
|
||||
int index = _lights.find(light);
|
||||
|
||||
if (index != -1) {
|
||||
#if VERSION_MAJOR < 4
|
||||
_lights.remove(index);
|
||||
#else
|
||||
_lights.remove_at(index);
|
||||
#endif
|
||||
|
||||
set_lights_dirty(true);
|
||||
}
|
||||
@ -975,7 +984,7 @@ void VoxelChunkDefault::_bind_methods() {
|
||||
BIND_ENUM_CONSTANT(DEFAULT_CHANNEL_LIQUID_FLOW);
|
||||
BIND_ENUM_CONSTANT(MAX_DEFAULT_CHANNELS);
|
||||
|
||||
BIND_CONSTANT(MESH_INDEX_TERRARIN);
|
||||
BIND_CONSTANT(MESH_INDEX_TERRAIN);
|
||||
BIND_CONSTANT(MESH_INDEX_PROP);
|
||||
BIND_CONSTANT(MESH_INDEX_LIQUID);
|
||||
BIND_CONSTANT(MESH_INDEX_CLUTTER);
|
||||
|
@ -49,7 +49,7 @@ SOFTWARE.
|
||||
#include "../../data/voxel_light.h"
|
||||
#include "../../meshers/voxel_mesher.h"
|
||||
#include "../../library/voxel_surface.h"
|
||||
#include "../../library/voxelman_library.h"
|
||||
#include "../../library/voxel_library.h"
|
||||
|
||||
class VoxelWorld;
|
||||
class VoxelJob;
|
||||
@ -77,7 +77,7 @@ public:
|
||||
};
|
||||
|
||||
enum {
|
||||
MESH_INDEX_TERRARIN = 0,
|
||||
MESH_INDEX_TERRAIN = 0,
|
||||
MESH_INDEX_PROP,
|
||||
MESH_INDEX_LIQUID,
|
||||
MESH_INDEX_CLUTTER,
|
||||
|
@ -29,7 +29,7 @@ SOFTWARE.
|
||||
#include "../../meshers/default/voxel_mesher_default.h"
|
||||
#include "../jobs/voxel_light_job.h"
|
||||
#include "../jobs/voxel_prop_job.h"
|
||||
#include "../jobs/voxel_terrarin_job.h"
|
||||
#include "../jobs/voxel_terrain_job.h"
|
||||
|
||||
_FORCE_INLINE_ int VoxelWorldDefault::get_build_flags() const {
|
||||
return _build_flags;
|
||||
@ -62,7 +62,11 @@ void VoxelWorldDefault::set_num_lods(const int value) {
|
||||
}
|
||||
|
||||
void VoxelWorldDefault::update_lods() {
|
||||
#if VERSION_MAJOR < 4
|
||||
call("_update_lods");
|
||||
#else
|
||||
GDVIRTUAL_CALL(_update_lods);
|
||||
#endif
|
||||
}
|
||||
|
||||
int VoxelWorldDefault::get_chunk_lod_falloff() const {
|
||||
@ -178,7 +182,7 @@ Ref<VoxelChunk> VoxelWorldDefault::_create_chunk(int x, int y, int z, Ref<VoxelC
|
||||
}
|
||||
|
||||
if (chunk->job_get_count() == 0) {
|
||||
Ref<VoxelTerrarinJob> tj;
|
||||
Ref<VoxelTerrainJob> tj;
|
||||
#if VERSION_MAJOR < 4
|
||||
tj.instance();
|
||||
#else
|
||||
@ -298,7 +302,12 @@ void VoxelWorldDefault::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("set_num_lods", "value"), &VoxelWorldDefault::set_num_lods);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "num_lods"), "set_num_lods", "get_num_lods");
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
BIND_VMETHOD(MethodInfo("_update_lods"));
|
||||
#else
|
||||
GDVIRTUAL_BIND(_update_lods);
|
||||
#endif
|
||||
|
||||
ClassDB::bind_method(D_METHOD("update_lods"), &VoxelWorldDefault::update_lods);
|
||||
ClassDB::bind_method(D_METHOD("_update_lods"), &VoxelWorldDefault::_update_lods);
|
||||
|
||||
|
@ -45,6 +45,10 @@ public:
|
||||
|
||||
PoolColorArray get_vertex_colors(const Transform &transform, const PoolVector3Array &vertices, const float base_light_value = 0.45, const float ao_strength = 0.2);
|
||||
|
||||
#if VERSION_MAJOR >= 4
|
||||
GDVIRTUAL0(_update_lods);
|
||||
#endif
|
||||
|
||||
VoxelWorldDefault();
|
||||
~VoxelWorldDefault();
|
||||
|
||||
|
@ -64,7 +64,11 @@ void VoxelJob::next_job() {
|
||||
}
|
||||
|
||||
void VoxelJob::reset() {
|
||||
#if VERSION_MAJOR < 4
|
||||
call("_reset");
|
||||
#else
|
||||
GDVIRTUAL_CALL(_reset);
|
||||
#endif
|
||||
}
|
||||
void VoxelJob::_reset() {
|
||||
_build_done = false;
|
||||
@ -72,7 +76,6 @@ void VoxelJob::_reset() {
|
||||
}
|
||||
|
||||
void VoxelJob::_execute() {
|
||||
|
||||
ActiveBuildPhaseType origpt = _build_phase_type;
|
||||
|
||||
while (!get_cancelled() && _in_tree && !_build_done && origpt == _build_phase_type && !should_return()) {
|
||||
@ -85,7 +88,11 @@ void VoxelJob::_execute() {
|
||||
}
|
||||
|
||||
void VoxelJob::execute_phase() {
|
||||
#if VERSION_MAJOR < 4
|
||||
call("_execute_phase");
|
||||
#else
|
||||
GDVIRTUAL_CALL(_execute_phase);
|
||||
#endif
|
||||
}
|
||||
|
||||
void VoxelJob::_execute_phase() {
|
||||
@ -93,12 +100,22 @@ void VoxelJob::_execute_phase() {
|
||||
}
|
||||
|
||||
void VoxelJob::process(const float delta) {
|
||||
if (has_method("_process"))
|
||||
#if VERSION_MAJOR < 4
|
||||
if (has_method("_process")) {
|
||||
call("_process", delta);
|
||||
}
|
||||
#else
|
||||
GDVIRTUAL_CALL(_process, delta);
|
||||
#endif
|
||||
}
|
||||
void VoxelJob::physics_process(const float delta) {
|
||||
if (has_method("_physics_process"))
|
||||
#if VERSION_MAJOR < 4
|
||||
if (has_method("_physics_process")) {
|
||||
call("_physics_process", delta);
|
||||
}
|
||||
#else
|
||||
GDVIRTUAL_CALL(_physics_process, delta);
|
||||
#endif
|
||||
}
|
||||
|
||||
//Data Management functions
|
||||
@ -162,7 +179,7 @@ void VoxelJob::generate_random_ao(int seed, int octaves, int period, float persi
|
||||
int position_z = _chunk->get_position_z();
|
||||
|
||||
Ref<OpenSimplexNoise> noise;
|
||||
noise.instance();
|
||||
noise.INSTANCE();
|
||||
|
||||
noise->set_seed(seed);
|
||||
noise->set_octaves(octaves);
|
||||
@ -217,14 +234,14 @@ Array VoxelJob::merge_mesh_array(Array arr) const {
|
||||
int rem = equals[k];
|
||||
int remk = rem - k;
|
||||
|
||||
verts.remove(remk);
|
||||
verts.VREMOVE(remk);
|
||||
|
||||
if (has_normals)
|
||||
normals.remove(remk);
|
||||
normals.VREMOVE(remk);
|
||||
if (has_uvs)
|
||||
uvs.remove(remk);
|
||||
uvs.VREMOVE(remk);
|
||||
if (has_colors)
|
||||
colors.remove(remk);
|
||||
colors.VREMOVE(remk);
|
||||
|
||||
for (int j = 0; j < indices.size(); ++j) {
|
||||
int indx = indices[j];
|
||||
@ -256,7 +273,11 @@ Array VoxelJob::bake_mesh_array_uv(Array arr, Ref<Texture> tex, const float mul_
|
||||
ERR_FAIL_COND_V(arr.size() != VisualServer::ARRAY_MAX, arr);
|
||||
ERR_FAIL_COND_V(!tex.is_valid(), arr);
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
Ref<Image> img = tex->get_data();
|
||||
#else
|
||||
Ref<Image> img = tex->get_image();
|
||||
#endif
|
||||
|
||||
ERR_FAIL_COND_V(!img.is_valid(), arr);
|
||||
|
||||
@ -294,7 +315,6 @@ Array VoxelJob::bake_mesh_array_uv(Array arr, Ref<Texture> tex, const float mul_
|
||||
}
|
||||
|
||||
void VoxelJob::chunk_exit_tree() {
|
||||
|
||||
_in_tree = false;
|
||||
|
||||
if (get_complete()) {
|
||||
@ -328,8 +348,13 @@ VoxelJob::~VoxelJob() {
|
||||
}
|
||||
|
||||
void VoxelJob::_bind_methods() {
|
||||
#if VERSION_MAJOR < 4
|
||||
BIND_VMETHOD(MethodInfo("_process", PropertyInfo(Variant::REAL, "delta")));
|
||||
BIND_VMETHOD(MethodInfo("_physics_process", PropertyInfo(Variant::REAL, "delta")));
|
||||
#else
|
||||
GDVIRTUAL_BIND(_process, "delta");
|
||||
GDVIRTUAL_BIND(_physics_process, "delta");
|
||||
#endif
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_build_phase_type"), &VoxelJob::get_build_phase_type);
|
||||
ClassDB::bind_method(D_METHOD("set_build_phase_type", "value"), &VoxelJob::set_build_phase_type);
|
||||
@ -346,14 +371,22 @@ void VoxelJob::_bind_methods() {
|
||||
|
||||
ClassDB::bind_method(D_METHOD("next_job"), &VoxelJob::next_job);
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
BIND_VMETHOD(MethodInfo("_reset"));
|
||||
#else
|
||||
GDVIRTUAL_BIND(_reset);
|
||||
#endif
|
||||
|
||||
ClassDB::bind_method(D_METHOD("reset"), &VoxelJob::reset);
|
||||
ClassDB::bind_method(D_METHOD("_reset"), &VoxelJob::_reset);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("_execute"), &VoxelJob::_execute);
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
BIND_VMETHOD(MethodInfo("_execute_phase"));
|
||||
#else
|
||||
GDVIRTUAL_BIND(_execute_phase);
|
||||
#endif
|
||||
|
||||
ClassDB::bind_method(D_METHOD("execute_phase"), &VoxelJob::execute_phase);
|
||||
ClassDB::bind_method(D_METHOD("_execute_phase"), &VoxelJob::_execute_phase);
|
||||
@ -385,7 +418,12 @@ void VoxelJob::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("should_do", "just_check"), &VoxelJob::should_do, DEFVAL(false));
|
||||
ClassDB::bind_method(D_METHOD("should_return"), &VoxelJob::should_return);
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
BIND_VMETHOD(MethodInfo("_execute"));
|
||||
#else
|
||||
GDVIRTUAL_BIND(_execute);
|
||||
#endif
|
||||
|
||||
ClassDB::bind_method(D_METHOD("execute"), &VoxelJob::execute);
|
||||
|
||||
ADD_SIGNAL(MethodInfo("completed"));
|
||||
@ -457,7 +495,11 @@ bool VoxelJob::should_return() {
|
||||
void VoxelJob::execute() {
|
||||
ERR_FAIL_COND(!has_method("_execute"));
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
call("_execute");
|
||||
#else
|
||||
GDVIRTUAL_CALL(_execute);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
@ -100,6 +100,14 @@ public:
|
||||
|
||||
void chunk_exit_tree();
|
||||
|
||||
#if VERSION_MAJOR >= 4
|
||||
GDVIRTUAL1(_process, float);
|
||||
GDVIRTUAL1(_physics_process, float);
|
||||
|
||||
GDVIRTUAL0(_reset);
|
||||
GDVIRTUAL0(_execute_phase);
|
||||
#endif
|
||||
|
||||
VoxelJob();
|
||||
~VoxelJob();
|
||||
|
||||
@ -141,6 +149,10 @@ public:
|
||||
|
||||
void execute();
|
||||
|
||||
#if VERSION_MAJOR >= 4
|
||||
GDVIRTUAL0(_execute);
|
||||
#endif
|
||||
|
||||
private:
|
||||
bool _complete;
|
||||
bool _cancelled;
|
||||
|
@ -25,7 +25,7 @@ SOFTWARE.
|
||||
#include "../../defines.h"
|
||||
|
||||
#include "../../library/voxel_surface.h"
|
||||
#include "../../library/voxelman_library.h"
|
||||
#include "../../library/voxel_library.h"
|
||||
|
||||
#include "../../meshers/voxel_mesher.h"
|
||||
#include "../default/voxel_chunk_default.h"
|
||||
@ -74,7 +74,7 @@ void VoxelLightJob::phase_light() {
|
||||
void VoxelLightJob::_execute_phase() {
|
||||
ERR_FAIL_COND(!_chunk.is_valid());
|
||||
|
||||
Ref<VoxelmanLibrary> library = _chunk->get_library();
|
||||
Ref<VoxelLibrary> library = _chunk->get_library();
|
||||
|
||||
ERR_FAIL_COND(!library.is_valid());
|
||||
|
||||
|
@ -25,7 +25,7 @@ SOFTWARE.
|
||||
#include "../../defines.h"
|
||||
|
||||
#include "../../library/voxel_surface.h"
|
||||
#include "../../library/voxelman_library.h"
|
||||
#include "../../library/voxel_library.h"
|
||||
|
||||
#include "../../meshers/voxel_mesher.h"
|
||||
#include "../default/voxel_chunk_default.h"
|
||||
@ -69,7 +69,12 @@ void VoxelPropJob::phase_physics_process() {
|
||||
continue;
|
||||
}
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
RID body = PhysicsServer::get_singleton()->body_create(PhysicsServer::BODY_MODE_STATIC);
|
||||
#else
|
||||
RID body = PhysicsServer::get_singleton()->body_create();
|
||||
PhysicsServer::get_singleton()->body_set_mode(body, PhysicsServer::BODY_MODE_STATIC);
|
||||
#endif
|
||||
|
||||
Transform transform = chunk->mesh_data_resource_get_transform(i);
|
||||
transform *= offset;
|
||||
@ -223,7 +228,6 @@ void VoxelPropJob::phase_prop() {
|
||||
}
|
||||
|
||||
if (should_do()) {
|
||||
|
||||
VS::get_singleton()->mesh_add_surface_from_arrays(mesh_rid, VisualServer::PRIMITIVE_TRIANGLES, temp_mesh_arr);
|
||||
|
||||
if (chunk->get_library()->prop_material_get(0).is_valid())
|
||||
@ -236,7 +240,6 @@ void VoxelPropJob::phase_prop() {
|
||||
|
||||
if ((chunk->get_build_flags() & VoxelChunkDefault::BUILD_FLAG_CREATE_LODS) != 0) {
|
||||
if (should_do()) {
|
||||
|
||||
if (chunk->get_lod_num() >= 1) {
|
||||
//for lod 1 just remove uv2
|
||||
temp_mesh_arr[VisualServer::ARRAY_TEX_UV2] = Variant();
|
||||
@ -294,7 +297,7 @@ void VoxelPropJob::phase_prop() {
|
||||
if (should_do()) {
|
||||
if (chunk->get_lod_num() > 4) {
|
||||
Ref<FastQuadraticMeshSimplifier> fqms;
|
||||
fqms.instance();
|
||||
fqms.INSTANCE();
|
||||
fqms->set_preserve_border_edges(true);
|
||||
fqms->initialize(temp_mesh_arr);
|
||||
|
||||
@ -303,12 +306,12 @@ void VoxelPropJob::phase_prop() {
|
||||
temp_mesh_arr = fqms->get_arrays();
|
||||
|
||||
VisualServer::get_singleton()->mesh_add_surface_from_arrays(
|
||||
chunk->mesh_rid_get_index(VoxelChunkDefault::MESH_INDEX_TERRARIN, VoxelChunkDefault::MESH_TYPE_INDEX_MESH, i),
|
||||
chunk->mesh_rid_get_index(VoxelChunkDefault::MESH_INDEX_TERRAIN, VoxelChunkDefault::MESH_TYPE_INDEX_MESH, i),
|
||||
VisualServer::PRIMITIVE_TRIANGLES, temp_mesh_arr);
|
||||
|
||||
if (chunk->get_library()->prop_material_get(i).is_valid())
|
||||
VisualServer::get_singleton()->mesh_surface_set_material(
|
||||
chunk->mesh_rid_get_index(VoxelChunkDefault::MESH_INDEX_TERRARIN, VoxelChunkDefault::MESH_TYPE_INDEX_MESH, i), 0,
|
||||
chunk->mesh_rid_get_index(VoxelChunkDefault::MESH_INDEX_TERRAIN, VoxelChunkDefault::MESH_TYPE_INDEX_MESH, i), 0,
|
||||
chunk->get_library()->prop_material_get(i)->get_rid());
|
||||
}
|
||||
}
|
||||
@ -335,7 +338,7 @@ void VoxelPropJob::_physics_process(float delta) {
|
||||
void VoxelPropJob::_execute_phase() {
|
||||
ERR_FAIL_COND(!_chunk.is_valid());
|
||||
|
||||
Ref<VoxelmanLibrary> library = _chunk->get_library();
|
||||
Ref<VoxelLibrary> library = _chunk->get_library();
|
||||
|
||||
ERR_FAIL_COND(!library.is_valid());
|
||||
|
||||
|
@ -20,10 +20,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "voxel_terrarin_job.h"
|
||||
#include "voxel_terrain_job.h"
|
||||
|
||||
#include "../../library/voxel_surface.h"
|
||||
#include "../../library/voxelman_library.h"
|
||||
#include "../../library/voxel_library.h"
|
||||
|
||||
#include "../../meshers/default/voxel_mesher_default.h"
|
||||
#include "../../meshers/voxel_mesher.h"
|
||||
@ -34,51 +34,51 @@ SOFTWARE.
|
||||
#include "../../../mesh_utils/fast_quadratic_mesh_simplifier.h"
|
||||
#endif
|
||||
|
||||
Ref<VoxelMesher> VoxelTerrarinJob::get_mesher(int index) const {
|
||||
Ref<VoxelMesher> VoxelTerrainJob::get_mesher(int index) const {
|
||||
ERR_FAIL_INDEX_V(index, _meshers.size(), Ref<VoxelMesher>());
|
||||
|
||||
return _meshers.get(index);
|
||||
}
|
||||
void VoxelTerrarinJob::set_mesher(int index, const Ref<VoxelMesher> &mesher) {
|
||||
void VoxelTerrainJob::set_mesher(int index, const Ref<VoxelMesher> &mesher) {
|
||||
ERR_FAIL_INDEX(index, _meshers.size());
|
||||
|
||||
_meshers.set(index, mesher);
|
||||
}
|
||||
void VoxelTerrarinJob::remove_mesher(const int index) {
|
||||
void VoxelTerrainJob::remove_mesher(const int index) {
|
||||
ERR_FAIL_INDEX(index, _meshers.size());
|
||||
|
||||
_meshers.remove(index);
|
||||
_meshers.VREMOVE(index);
|
||||
}
|
||||
void VoxelTerrarinJob::add_mesher(const Ref<VoxelMesher> &mesher) {
|
||||
void VoxelTerrainJob::add_mesher(const Ref<VoxelMesher> &mesher) {
|
||||
_meshers.push_back(mesher);
|
||||
}
|
||||
int VoxelTerrarinJob::get_mesher_count() const {
|
||||
int VoxelTerrainJob::get_mesher_count() const {
|
||||
return _meshers.size();
|
||||
}
|
||||
|
||||
Ref<VoxelMesher> VoxelTerrarinJob::get_liquid_mesher(int index) const {
|
||||
Ref<VoxelMesher> VoxelTerrainJob::get_liquid_mesher(int index) const {
|
||||
ERR_FAIL_INDEX_V(index, _liquid_meshers.size(), Ref<VoxelMesher>());
|
||||
|
||||
return _liquid_meshers.get(index);
|
||||
}
|
||||
void VoxelTerrarinJob::set_liquid_mesher(int index, const Ref<VoxelMesher> &mesher) {
|
||||
void VoxelTerrainJob::set_liquid_mesher(int index, const Ref<VoxelMesher> &mesher) {
|
||||
ERR_FAIL_INDEX(index, _liquid_meshers.size());
|
||||
|
||||
_liquid_meshers.set(index, mesher);
|
||||
}
|
||||
void VoxelTerrarinJob::remove_liquid_mesher(const int index) {
|
||||
void VoxelTerrainJob::remove_liquid_mesher(const int index) {
|
||||
ERR_FAIL_INDEX(index, _liquid_meshers.size());
|
||||
|
||||
_liquid_meshers.remove(index);
|
||||
_liquid_meshers.VREMOVE(index);
|
||||
}
|
||||
void VoxelTerrarinJob::add_liquid_mesher(const Ref<VoxelMesher> &mesher) {
|
||||
void VoxelTerrainJob::add_liquid_mesher(const Ref<VoxelMesher> &mesher) {
|
||||
_liquid_meshers.push_back(mesher);
|
||||
}
|
||||
int VoxelTerrarinJob::get_liquid_mesher_count() const {
|
||||
int VoxelTerrainJob::get_liquid_mesher_count() const {
|
||||
return _liquid_meshers.size();
|
||||
}
|
||||
|
||||
void VoxelTerrarinJob::phase_setup() {
|
||||
void VoxelTerrainJob::phase_setup() {
|
||||
for (int i = 0; i < _meshers.size(); ++i) {
|
||||
Ref<VoxelMesher> mesher = _meshers.get(i);
|
||||
|
||||
@ -100,7 +100,7 @@ void VoxelTerrarinJob::phase_setup() {
|
||||
next_phase();
|
||||
}
|
||||
|
||||
void VoxelTerrarinJob::phase_terrarin_mesh_setup() {
|
||||
void VoxelTerrainJob::phase_terrain_mesh_setup() {
|
||||
int starti = 0;
|
||||
|
||||
if (has_meta("tms_m")) {
|
||||
@ -150,7 +150,7 @@ void VoxelTerrarinJob::phase_terrarin_mesh_setup() {
|
||||
next_phase();
|
||||
}
|
||||
|
||||
void VoxelTerrarinJob::phase_collider() {
|
||||
void VoxelTerrainJob::phase_collider() {
|
||||
Ref<VoxelChunkDefault> chunk = _chunk;
|
||||
|
||||
if ((chunk->get_build_flags() & VoxelChunkDefault::BUILD_FLAG_CREATE_COLLIDER) == 0) {
|
||||
@ -216,15 +216,15 @@ void VoxelTerrarinJob::phase_collider() {
|
||||
next_phase();
|
||||
}
|
||||
|
||||
void VoxelTerrarinJob::phase_physics_process() {
|
||||
void VoxelTerrainJob::phase_physics_process() {
|
||||
Ref<VoxelChunkDefault> chunk = _chunk;
|
||||
|
||||
if (temp_arr_collider.size() != 0) {
|
||||
if (!chunk->meshes_has(VoxelChunkDefault::MESH_INDEX_TERRARIN, VoxelChunkDefault::MESH_TYPE_INDEX_BODY)) {
|
||||
chunk->colliders_create(VoxelChunkDefault::MESH_INDEX_TERRARIN);
|
||||
if (!chunk->meshes_has(VoxelChunkDefault::MESH_INDEX_TERRAIN, VoxelChunkDefault::MESH_TYPE_INDEX_BODY)) {
|
||||
chunk->colliders_create(VoxelChunkDefault::MESH_INDEX_TERRAIN);
|
||||
}
|
||||
|
||||
PhysicsServer::get_singleton()->shape_set_data(chunk->mesh_rid_get(VoxelChunkDefault::MESH_INDEX_TERRARIN, VoxelChunkDefault::MESH_TYPE_INDEX_SHAPE), temp_arr_collider);
|
||||
PhysicsServer::get_singleton()->shape_set_data(chunk->mesh_rid_get(VoxelChunkDefault::MESH_INDEX_TERRAIN, VoxelChunkDefault::MESH_TYPE_INDEX_SHAPE), temp_arr_collider);
|
||||
|
||||
temp_arr_collider.resize(0);
|
||||
}
|
||||
@ -251,7 +251,7 @@ void VoxelTerrarinJob::phase_physics_process() {
|
||||
next_phase();
|
||||
}
|
||||
|
||||
void VoxelTerrarinJob::phase_terrarin_mesh() {
|
||||
void VoxelTerrainJob::phase_terrain_mesh() {
|
||||
Ref<VoxelChunkDefault> chunk = _chunk;
|
||||
|
||||
if ((chunk->get_build_flags() & VoxelChunkDefault::BUILD_FLAG_USE_LIGHTING) != 0) {
|
||||
@ -378,16 +378,16 @@ void VoxelTerrarinJob::phase_terrarin_mesh() {
|
||||
}
|
||||
}
|
||||
|
||||
RID mesh_rid = chunk->mesh_rid_get_index(VoxelChunkDefault::MESH_INDEX_TERRARIN, VoxelChunkDefault::MESH_TYPE_INDEX_MESH, 0);
|
||||
RID mesh_rid = chunk->mesh_rid_get_index(VoxelChunkDefault::MESH_INDEX_TERRAIN, VoxelChunkDefault::MESH_TYPE_INDEX_MESH, 0);
|
||||
|
||||
if (should_do()) {
|
||||
if (mesh_rid == RID()) {
|
||||
if ((chunk->get_build_flags() & VoxelChunkDefault::BUILD_FLAG_CREATE_LODS) != 0)
|
||||
chunk->meshes_create(VoxelChunkDefault::MESH_INDEX_TERRARIN, chunk->get_lod_num() + 1);
|
||||
chunk->meshes_create(VoxelChunkDefault::MESH_INDEX_TERRAIN, chunk->get_lod_num() + 1);
|
||||
else
|
||||
chunk->meshes_create(VoxelChunkDefault::MESH_INDEX_TERRARIN, 1);
|
||||
chunk->meshes_create(VoxelChunkDefault::MESH_INDEX_TERRAIN, 1);
|
||||
|
||||
mesh_rid = chunk->mesh_rid_get_index(VoxelChunkDefault::MESH_INDEX_TERRARIN, VoxelChunkDefault::MESH_TYPE_INDEX_MESH, 0);
|
||||
mesh_rid = chunk->mesh_rid_get_index(VoxelChunkDefault::MESH_INDEX_TERRAIN, VoxelChunkDefault::MESH_TYPE_INDEX_MESH, 0);
|
||||
}
|
||||
|
||||
if (VS::get_singleton()->mesh_get_surface_count(mesh_rid) > 0)
|
||||
@ -419,10 +419,10 @@ void VoxelTerrarinJob::phase_terrarin_mesh() {
|
||||
//for lod 1 just remove uv2
|
||||
temp_mesh_arr[VisualServer::ARRAY_TEX_UV2] = Variant();
|
||||
|
||||
VisualServer::get_singleton()->mesh_add_surface_from_arrays(chunk->mesh_rid_get_index(VoxelChunkDefault::MESH_INDEX_TERRARIN, VoxelChunkDefault::MESH_TYPE_INDEX_MESH, 1), VisualServer::PRIMITIVE_TRIANGLES, temp_mesh_arr);
|
||||
VisualServer::get_singleton()->mesh_add_surface_from_arrays(chunk->mesh_rid_get_index(VoxelChunkDefault::MESH_INDEX_TERRAIN, VoxelChunkDefault::MESH_TYPE_INDEX_MESH, 1), VisualServer::PRIMITIVE_TRIANGLES, temp_mesh_arr);
|
||||
|
||||
if (chunk->get_library()->material_get(1).is_valid())
|
||||
VisualServer::get_singleton()->mesh_surface_set_material(chunk->mesh_rid_get_index(VoxelChunkDefault::MESH_INDEX_TERRARIN, VoxelChunkDefault::MESH_TYPE_INDEX_MESH, 1), 0, chunk->get_library()->material_get(1)->get_rid());
|
||||
VisualServer::get_singleton()->mesh_surface_set_material(chunk->mesh_rid_get_index(VoxelChunkDefault::MESH_INDEX_TERRAIN, VoxelChunkDefault::MESH_TYPE_INDEX_MESH, 1), 0, chunk->get_library()->material_get(1)->get_rid());
|
||||
}
|
||||
if (should_return()) {
|
||||
return;
|
||||
@ -434,10 +434,10 @@ void VoxelTerrarinJob::phase_terrarin_mesh() {
|
||||
Array temp_mesh_arr2 = merge_mesh_array(temp_mesh_arr);
|
||||
temp_mesh_arr = temp_mesh_arr2;
|
||||
|
||||
VisualServer::get_singleton()->mesh_add_surface_from_arrays(chunk->mesh_rid_get_index(VoxelChunkDefault::MESH_INDEX_TERRARIN, VoxelChunkDefault::MESH_TYPE_INDEX_MESH, 2), VisualServer::PRIMITIVE_TRIANGLES, temp_mesh_arr2);
|
||||
VisualServer::get_singleton()->mesh_add_surface_from_arrays(chunk->mesh_rid_get_index(VoxelChunkDefault::MESH_INDEX_TERRAIN, VoxelChunkDefault::MESH_TYPE_INDEX_MESH, 2), VisualServer::PRIMITIVE_TRIANGLES, temp_mesh_arr2);
|
||||
|
||||
if (chunk->get_library()->material_get(2).is_valid())
|
||||
VisualServer::get_singleton()->mesh_surface_set_material(chunk->mesh_rid_get_index(VoxelChunkDefault::MESH_INDEX_TERRARIN, VoxelChunkDefault::MESH_TYPE_INDEX_MESH, 2), 0, chunk->get_library()->material_get(2)->get_rid());
|
||||
VisualServer::get_singleton()->mesh_surface_set_material(chunk->mesh_rid_get_index(VoxelChunkDefault::MESH_INDEX_TERRAIN, VoxelChunkDefault::MESH_TYPE_INDEX_MESH, 2), 0, chunk->get_library()->material_get(2)->get_rid());
|
||||
}
|
||||
|
||||
if (should_return()) {
|
||||
@ -462,12 +462,12 @@ void VoxelTerrarinJob::phase_terrarin_mesh() {
|
||||
temp_mesh_arr[VisualServer::ARRAY_TEX_UV] = Variant();
|
||||
|
||||
VisualServer::get_singleton()->mesh_add_surface_from_arrays(
|
||||
chunk->mesh_rid_get_index(VoxelChunkDefault::MESH_INDEX_TERRARIN, VoxelChunkDefault::MESH_TYPE_INDEX_MESH, 3),
|
||||
chunk->mesh_rid_get_index(VoxelChunkDefault::MESH_INDEX_TERRAIN, VoxelChunkDefault::MESH_TYPE_INDEX_MESH, 3),
|
||||
VisualServer::PRIMITIVE_TRIANGLES, temp_mesh_arr);
|
||||
|
||||
if (chunk->get_library()->material_get(3).is_valid())
|
||||
VisualServer::get_singleton()->mesh_surface_set_material(
|
||||
chunk->mesh_rid_get_index(VoxelChunkDefault::MESH_INDEX_TERRARIN, VoxelChunkDefault::MESH_TYPE_INDEX_MESH, 3), 0,
|
||||
chunk->mesh_rid_get_index(VoxelChunkDefault::MESH_INDEX_TERRAIN, VoxelChunkDefault::MESH_TYPE_INDEX_MESH, 3), 0,
|
||||
chunk->get_library()->material_get(3)->get_rid());
|
||||
}
|
||||
}
|
||||
@ -481,7 +481,7 @@ void VoxelTerrarinJob::phase_terrarin_mesh() {
|
||||
if (should_do()) {
|
||||
if (chunk->get_lod_num() > 4) {
|
||||
Ref<FastQuadraticMeshSimplifier> fqms;
|
||||
fqms.instance();
|
||||
fqms.INSTANCE();
|
||||
fqms->set_preserve_border_edges(true);
|
||||
fqms->initialize(temp_mesh_arr);
|
||||
|
||||
@ -490,12 +490,12 @@ void VoxelTerrarinJob::phase_terrarin_mesh() {
|
||||
temp_mesh_arr = fqms->get_arrays();
|
||||
|
||||
VisualServer::get_singleton()->mesh_add_surface_from_arrays(
|
||||
chunk->mesh_rid_get_index(VoxelChunkDefault::MESH_INDEX_TERRARIN, VoxelChunkDefault::MESH_TYPE_INDEX_MESH, i),
|
||||
chunk->mesh_rid_get_index(VoxelChunkDefault::MESH_INDEX_TERRAIN, VoxelChunkDefault::MESH_TYPE_INDEX_MESH, i),
|
||||
VisualServer::PRIMITIVE_TRIANGLES, temp_mesh_arr);
|
||||
|
||||
if (chunk->get_library()->material_get(i).is_valid())
|
||||
VisualServer::get_singleton()->mesh_surface_set_material(
|
||||
chunk->mesh_rid_get_index(VoxelChunkDefault::MESH_INDEX_TERRARIN, VoxelChunkDefault::MESH_TYPE_INDEX_MESH, i), 0,
|
||||
chunk->mesh_rid_get_index(VoxelChunkDefault::MESH_INDEX_TERRAIN, VoxelChunkDefault::MESH_TYPE_INDEX_MESH, i), 0,
|
||||
chunk->get_library()->material_get(i)->get_rid());
|
||||
}
|
||||
}
|
||||
@ -570,37 +570,37 @@ void VoxelTerrarinJob::phase_terrarin_mesh() {
|
||||
next_phase();
|
||||
}
|
||||
|
||||
void VoxelTerrarinJob::phase_finalize() {
|
||||
void VoxelTerrainJob::phase_finalize() {
|
||||
set_complete(true); //So threadpool knows it's done
|
||||
|
||||
next_job();
|
||||
}
|
||||
|
||||
void VoxelTerrarinJob::_execute_phase() {
|
||||
void VoxelTerrainJob::_execute_phase() {
|
||||
ERR_FAIL_COND(!_chunk.is_valid());
|
||||
|
||||
Ref<VoxelmanLibrary> library = _chunk->get_library();
|
||||
Ref<VoxelLibrary> library = _chunk->get_library();
|
||||
|
||||
ERR_FAIL_COND(!library.is_valid());
|
||||
|
||||
if (_phase == 0) {
|
||||
phase_setup();
|
||||
} else if (_phase == 1) {
|
||||
phase_terrarin_mesh_setup();
|
||||
phase_terrain_mesh_setup();
|
||||
} else if (_phase == 2) {
|
||||
phase_collider();
|
||||
} else if (_phase == 4) {
|
||||
phase_terrarin_mesh();
|
||||
phase_terrain_mesh();
|
||||
} else if (_phase == 5) {
|
||||
phase_finalize();
|
||||
} else if (_phase > 5) {
|
||||
set_complete(true); //So threadpool knows it's done
|
||||
next_job();
|
||||
ERR_FAIL_MSG("VoxelTerrarinJob: _phase is too high!");
|
||||
ERR_FAIL_MSG("VoxelTerrainJob: _phase is too high!");
|
||||
}
|
||||
}
|
||||
|
||||
void VoxelTerrarinJob::_reset() {
|
||||
void VoxelTerrainJob::_reset() {
|
||||
VoxelJob::_reset();
|
||||
|
||||
_build_done = false;
|
||||
@ -637,31 +637,31 @@ void VoxelTerrarinJob::_reset() {
|
||||
}
|
||||
}
|
||||
|
||||
void VoxelTerrarinJob::_physics_process(float delta) {
|
||||
void VoxelTerrainJob::_physics_process(float delta) {
|
||||
if (_phase == 3)
|
||||
phase_physics_process();
|
||||
}
|
||||
|
||||
VoxelTerrarinJob::VoxelTerrarinJob() {
|
||||
VoxelTerrainJob::VoxelTerrainJob() {
|
||||
}
|
||||
|
||||
VoxelTerrarinJob::~VoxelTerrarinJob() {
|
||||
VoxelTerrainJob::~VoxelTerrainJob() {
|
||||
_meshers.clear();
|
||||
_liquid_meshers.clear();
|
||||
}
|
||||
|
||||
void VoxelTerrarinJob::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("get_mesher", "index"), &VoxelTerrarinJob::get_mesher);
|
||||
ClassDB::bind_method(D_METHOD("set_mesher", "index", "mesher"), &VoxelTerrarinJob::set_mesher);
|
||||
ClassDB::bind_method(D_METHOD("remove_mesher", "index"), &VoxelTerrarinJob::remove_mesher);
|
||||
ClassDB::bind_method(D_METHOD("add_mesher", "mesher"), &VoxelTerrarinJob::add_mesher);
|
||||
ClassDB::bind_method(D_METHOD("get_mesher_count"), &VoxelTerrarinJob::get_mesher_count);
|
||||
void VoxelTerrainJob::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("get_mesher", "index"), &VoxelTerrainJob::get_mesher);
|
||||
ClassDB::bind_method(D_METHOD("set_mesher", "index", "mesher"), &VoxelTerrainJob::set_mesher);
|
||||
ClassDB::bind_method(D_METHOD("remove_mesher", "index"), &VoxelTerrainJob::remove_mesher);
|
||||
ClassDB::bind_method(D_METHOD("add_mesher", "mesher"), &VoxelTerrainJob::add_mesher);
|
||||
ClassDB::bind_method(D_METHOD("get_mesher_count"), &VoxelTerrainJob::get_mesher_count);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_liquid_mesher", "index"), &VoxelTerrarinJob::get_liquid_mesher);
|
||||
ClassDB::bind_method(D_METHOD("set_liquid_mesher", "index", "mesher"), &VoxelTerrarinJob::set_liquid_mesher);
|
||||
ClassDB::bind_method(D_METHOD("remove_liquid_mesher", "index"), &VoxelTerrarinJob::remove_liquid_mesher);
|
||||
ClassDB::bind_method(D_METHOD("add_liquid_mesher", "mesher"), &VoxelTerrarinJob::add_liquid_mesher);
|
||||
ClassDB::bind_method(D_METHOD("get_liquid_mesher_count"), &VoxelTerrarinJob::get_liquid_mesher_count);
|
||||
ClassDB::bind_method(D_METHOD("get_liquid_mesher", "index"), &VoxelTerrainJob::get_liquid_mesher);
|
||||
ClassDB::bind_method(D_METHOD("set_liquid_mesher", "index", "mesher"), &VoxelTerrainJob::set_liquid_mesher);
|
||||
ClassDB::bind_method(D_METHOD("remove_liquid_mesher", "index"), &VoxelTerrainJob::remove_liquid_mesher);
|
||||
ClassDB::bind_method(D_METHOD("add_liquid_mesher", "mesher"), &VoxelTerrainJob::add_liquid_mesher);
|
||||
ClassDB::bind_method(D_METHOD("get_liquid_mesher_count"), &VoxelTerrainJob::get_liquid_mesher_count);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("_physics_process", "delta"), &VoxelTerrarinJob::_physics_process);
|
||||
ClassDB::bind_method(D_METHOD("_physics_process", "delta"), &VoxelTerrainJob::_physics_process);
|
||||
}
|
@ -20,8 +20,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef VOXEL_TERRARIN_JOB_H
|
||||
#define VOXEL_TERRARIN_JOB_H
|
||||
#ifndef VOXEL_TERRAIN_JOB_H
|
||||
#define VOXEL_TERRAIN_JOB_H
|
||||
|
||||
#include "voxel_job.h"
|
||||
|
||||
@ -33,8 +33,8 @@ include_pool_vector
|
||||
|
||||
class VoxelMesher;
|
||||
|
||||
class VoxelTerrarinJob : public VoxelJob {
|
||||
GDCLASS(VoxelTerrarinJob, VoxelJob);
|
||||
class VoxelTerrainJob : public VoxelJob {
|
||||
GDCLASS(VoxelTerrainJob, VoxelJob);
|
||||
|
||||
public:
|
||||
//Meshers
|
||||
@ -52,10 +52,10 @@ public:
|
||||
int get_liquid_mesher_count() const;
|
||||
|
||||
void phase_setup();
|
||||
void phase_terrarin_mesh_setup();
|
||||
void phase_terrain_mesh_setup();
|
||||
void phase_collider();
|
||||
void phase_physics_proces();
|
||||
void phase_terrarin_mesh();
|
||||
void phase_terrain_mesh();
|
||||
void phase_finalize();
|
||||
void phase_physics_process();
|
||||
|
||||
@ -63,8 +63,8 @@ public:
|
||||
void _reset();
|
||||
void _physics_process(float delta);
|
||||
|
||||
VoxelTerrarinJob();
|
||||
~VoxelTerrarinJob();
|
||||
VoxelTerrainJob();
|
||||
~VoxelTerrainJob();
|
||||
|
||||
protected:
|
||||
static void _bind_methods();
|
@ -27,7 +27,7 @@ SOFTWARE.
|
||||
#include "../../meshers/marching_cubes/voxel_mesher_marching_cubes.h"
|
||||
#include "../jobs/voxel_light_job.h"
|
||||
#include "../jobs/voxel_prop_job.h"
|
||||
#include "../jobs/voxel_terrarin_job.h"
|
||||
#include "../jobs/voxel_terrain_job.h"
|
||||
|
||||
Ref<VoxelChunk> VoxelWorldMarchingCubes::_create_chunk(int x, int y, int z, Ref<VoxelChunk> chunk) {
|
||||
if (!chunk.is_valid()) {
|
||||
@ -35,14 +35,14 @@ Ref<VoxelChunk> VoxelWorldMarchingCubes::_create_chunk(int x, int y, int z, Ref<
|
||||
}
|
||||
|
||||
if (chunk->job_get_count() == 0) {
|
||||
Ref<VoxelTerrarinJob> tj;
|
||||
tj.instance();
|
||||
Ref<VoxelTerrainJob> tj;
|
||||
tj.INSTANCE();
|
||||
|
||||
Ref<VoxelLightJob> lj;
|
||||
lj.instance();
|
||||
lj.INSTANCE();
|
||||
|
||||
Ref<VoxelPropJob> pj;
|
||||
pj.instance();
|
||||
pj.INSTANCE();
|
||||
pj->set_prop_mesher(Ref<VoxelMesher>(memnew(VoxelMesherMarchingCubes)));
|
||||
|
||||
Ref<VoxelMesher> m = Ref<VoxelMesher>(memnew(VoxelMesherMarchingCubes()));
|
||||
|
@ -188,10 +188,10 @@ _FORCE_INLINE_ void VoxelChunk::set_margin_end(const int value) {
|
||||
_margin_end = value;
|
||||
}
|
||||
|
||||
Ref<VoxelmanLibrary> VoxelChunk::get_library() {
|
||||
Ref<VoxelLibrary> VoxelChunk::get_library() {
|
||||
return _library;
|
||||
}
|
||||
void VoxelChunk::set_library(const Ref<VoxelmanLibrary> &value) {
|
||||
void VoxelChunk::set_library(const Ref<VoxelLibrary> &value) {
|
||||
_library = value;
|
||||
}
|
||||
|
||||
@ -905,7 +905,11 @@ int VoxelChunk::mesh_data_resource_get_count() const {
|
||||
void VoxelChunk::mesh_data_resource_remove(const int index) {
|
||||
ERR_FAIL_INDEX(index, _mesh_data_resources.size());
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
_mesh_data_resources.remove(index);
|
||||
#else
|
||||
_mesh_data_resources.remove_at(index);
|
||||
#endif
|
||||
}
|
||||
void VoxelChunk::mesh_data_resource_clear() {
|
||||
_mesh_data_resources.clear();
|
||||
@ -1379,7 +1383,11 @@ void VoxelChunk::_bind_methods() {
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_transform"), &VoxelChunk::get_transform);
|
||||
ClassDB::bind_method(D_METHOD("set_transform", "value"), &VoxelChunk::set_transform);
|
||||
#if VERSION_MAJOR < 4
|
||||
ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM, "transform"), "set_transform", "get_transform");
|
||||
#else
|
||||
ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM3D, "transform"), "set_transform", "get_transform");
|
||||
#endif
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_visible"), &VoxelChunk::get_visible);
|
||||
ClassDB::bind_method(D_METHOD("set_visible", "value"), &VoxelChunk::set_visible);
|
||||
@ -1450,7 +1458,7 @@ void VoxelChunk::_bind_methods() {
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_library"), &VoxelChunk::get_library);
|
||||
ClassDB::bind_method(D_METHOD("set_library", "value"), &VoxelChunk::set_library);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "library", PROPERTY_HINT_RESOURCE_TYPE, "VoxelmanLibrary"), "set_library", "get_library");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "library", PROPERTY_HINT_RESOURCE_TYPE, "VoxelLibrary"), "set_library", "get_library");
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_voxel_scale"), &VoxelChunk::get_voxel_scale);
|
||||
ClassDB::bind_method(D_METHOD("set_voxel_scale", "value"), &VoxelChunk::set_voxel_scale);
|
||||
|
@ -68,7 +68,7 @@ include_pool_vector
|
||||
#endif
|
||||
|
||||
#include "../library/voxel_surface.h"
|
||||
#include "../library/voxelman_library.h"
|
||||
#include "../library/voxel_library.h"
|
||||
; //hackfix for a clang format issue
|
||||
|
||||
class VoxelJob;
|
||||
@ -144,8 +144,8 @@ public:
|
||||
void set_margin_start(const int value);
|
||||
void set_margin_end(const int value);
|
||||
|
||||
Ref<VoxelmanLibrary> get_library();
|
||||
void set_library(const Ref<VoxelmanLibrary> &value);
|
||||
Ref<VoxelLibrary> get_library();
|
||||
void set_library(const Ref<VoxelLibrary> &value);
|
||||
|
||||
float get_voxel_scale() const;
|
||||
void set_voxel_scale(const float value);
|
||||
@ -402,7 +402,7 @@ protected:
|
||||
int _current_job;
|
||||
Vector<Ref<VoxelJob>> _jobs;
|
||||
|
||||
Ref<VoxelmanLibrary> _library;
|
||||
Ref<VoxelLibrary> _library;
|
||||
|
||||
Vector<Ref<VoxelStructure>> _voxel_structures;
|
||||
|
||||
|
@ -122,10 +122,10 @@ void VoxelWorld::set_max_frame_chunk_build_steps(const int value) {
|
||||
_max_frame_chunk_build_steps = value;
|
||||
}
|
||||
|
||||
Ref<VoxelmanLibrary> VoxelWorld::get_library() {
|
||||
Ref<VoxelLibrary> VoxelWorld::get_library() {
|
||||
return _library;
|
||||
}
|
||||
void VoxelWorld::set_library(const Ref<VoxelmanLibrary> &library) {
|
||||
void VoxelWorld::set_library(const Ref<VoxelLibrary> &library) {
|
||||
_library = library;
|
||||
|
||||
for (int i = 0; i < chunk_get_count(); ++i) {
|
||||
@ -138,10 +138,10 @@ void VoxelWorld::set_library(const Ref<VoxelmanLibrary> &library) {
|
||||
}
|
||||
}
|
||||
|
||||
Ref<VoxelmanLevelGenerator> VoxelWorld::get_level_generator() const {
|
||||
Ref<VoxelLevelGenerator> VoxelWorld::get_level_generator() const {
|
||||
return _level_generator;
|
||||
}
|
||||
void VoxelWorld::set_level_generator(const Ref<VoxelmanLevelGenerator> &level_generator) {
|
||||
void VoxelWorld::set_level_generator(const Ref<VoxelLevelGenerator> &level_generator) {
|
||||
_level_generator = level_generator;
|
||||
}
|
||||
|
||||
@ -667,7 +667,11 @@ void VoxelWorld::prop_add(Transform tarnsform, const Ref<PropData> &prop, const
|
||||
|
||||
if (light_data.is_valid()) {
|
||||
Ref<VoxelLight> light;
|
||||
#if VERSION_MAJOR < 4
|
||||
light.instance();
|
||||
#else
|
||||
light.instantiate();
|
||||
#endif
|
||||
|
||||
light->set_world_position(wp.x / get_voxel_scale(), wp.y / get_voxel_scale(), wp.z / get_voxel_scale());
|
||||
light->set_color(light_data->get_light_color());
|
||||
@ -684,8 +688,9 @@ void VoxelWorld::prop_add(Transform tarnsform, const Ref<PropData> &prop, const
|
||||
if (mesh_data.is_valid()) {
|
||||
Ref<MeshDataResource> mdr = mesh_data->get_mesh();
|
||||
|
||||
if (!mdr.is_valid())
|
||||
if (!mdr.is_valid()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
chunk->mesh_data_resource_add(t, mdr, mesh_data->get_texture());
|
||||
|
||||
@ -1159,11 +1164,11 @@ void VoxelWorld::_bind_methods() {
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_library"), &VoxelWorld::get_library);
|
||||
ClassDB::bind_method(D_METHOD("set_library", "library"), &VoxelWorld::set_library);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "library", PROPERTY_HINT_RESOURCE_TYPE, "VoxelmanLibrary"), "set_library", "get_library");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "library", PROPERTY_HINT_RESOURCE_TYPE, "VoxelLibrary"), "set_library", "get_library");
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_level_generator"), &VoxelWorld::get_level_generator);
|
||||
ClassDB::bind_method(D_METHOD("set_level_generator", "level_generator"), &VoxelWorld::set_level_generator);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "level_generator", PROPERTY_HINT_RESOURCE_TYPE, "VoxelmanLevelGenerator"), "set_level_generator", "get_level_generator");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "level_generator", PROPERTY_HINT_RESOURCE_TYPE, "VoxelLevelGenerator"), "set_level_generator", "get_level_generator");
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_voxel_scale"), &VoxelWorld::get_voxel_scale);
|
||||
ClassDB::bind_method(D_METHOD("set_voxel_scale", "value"), &VoxelWorld::set_voxel_scale);
|
||||
|
@ -38,8 +38,8 @@ SOFTWARE.
|
||||
#include navigation_h
|
||||
|
||||
#include "../areas/world_area.h"
|
||||
#include "../level_generator/voxelman_level_generator.h"
|
||||
#include "../library/voxelman_library.h"
|
||||
#include "../level_generator/voxel_level_generator.h"
|
||||
#include "../library/voxel_library.h"
|
||||
|
||||
#include "core/os/os.h"
|
||||
|
||||
@ -94,11 +94,11 @@ public:
|
||||
int get_max_frame_chunk_build_steps() const;
|
||||
void set_max_frame_chunk_build_steps(const int value);
|
||||
|
||||
Ref<VoxelmanLibrary> get_library();
|
||||
void set_library(const Ref<VoxelmanLibrary> &library);
|
||||
Ref<VoxelLibrary> get_library();
|
||||
void set_library(const Ref<VoxelLibrary> &library);
|
||||
|
||||
Ref<VoxelmanLevelGenerator> get_level_generator() const;
|
||||
void set_level_generator(const Ref<VoxelmanLevelGenerator> &level_generator);
|
||||
Ref<VoxelLevelGenerator> get_level_generator() const;
|
||||
void set_level_generator(const Ref<VoxelLevelGenerator> &level_generator);
|
||||
|
||||
float get_voxel_scale() const;
|
||||
void set_voxel_scale(const float value);
|
||||
@ -262,8 +262,8 @@ private:
|
||||
int _data_margin_start;
|
||||
int _data_margin_end;
|
||||
|
||||
Ref<VoxelmanLibrary> _library;
|
||||
Ref<VoxelmanLevelGenerator> _level_generator;
|
||||
Ref<VoxelLibrary> _library;
|
||||
Ref<VoxelLevelGenerator> _level_generator;
|
||||
float _voxel_scale;
|
||||
int _chunk_spawn_range;
|
||||
|
||||
|
@ -34,7 +34,7 @@ SOFTWARE.
|
||||
#include "voxel_chunk.h"
|
||||
|
||||
#include "../library/voxel_surface.h"
|
||||
#include "../library/voxelman_library.h"
|
||||
#include "../library/voxel_library.h"
|
||||
|
||||
#include "../defines.h"
|
||||
|
||||
@ -52,7 +52,7 @@ bool VoxelWorldEditor::forward_spatial_input_event(Camera *p_camera, const Ref<I
|
||||
|
||||
if (mb.is_valid()) {
|
||||
if (mb->is_pressed()) {
|
||||
Ref<VoxelmanLibrary> lib = _world->get_library();
|
||||
Ref<VoxelLibrary> lib = _world->get_library();
|
||||
|
||||
if (!lib.is_valid())
|
||||
return false;
|
||||
@ -79,7 +79,7 @@ EditorPlugin::AfterGUIInput VoxelWorldEditor::forward_spatial_input_event(Camera
|
||||
|
||||
if (mb.is_valid()) {
|
||||
if (mb->is_pressed()) {
|
||||
Ref<VoxelmanLibrary> lib = _world->get_library();
|
||||
Ref<VoxelLibrary> lib = _world->get_library();
|
||||
|
||||
if (!lib.is_valid())
|
||||
return EditorPlugin::AFTER_GUI_INPUT_PASS;
|
||||
@ -184,7 +184,7 @@ void VoxelWorldEditor::edit(VoxelWorld *p_world) {
|
||||
}
|
||||
}
|
||||
|
||||
Ref<VoxelmanLibrary> library = _world->get_library();
|
||||
Ref<VoxelLibrary> library = _world->get_library();
|
||||
|
||||
if (!library.is_valid())
|
||||
return;
|
||||
@ -268,9 +268,9 @@ VoxelWorldEditor::VoxelWorldEditor(EditorNode *p_editor) {
|
||||
add_button->CONNECT("button_up", this, VoxelWorldEditor, _on_tool_button_pressed);
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
add_button->set_shortcut(ED_SHORTCUT("voxelman_world_editor/add_mode", "Add Mode", KEY_A));
|
||||
add_button->set_shortcut(ED_SHORTCUT("voxel_world_editor/add_mode", "Add Mode", KEY_A));
|
||||
#else
|
||||
add_button->set_shortcut(ED_SHORTCUT("voxelman_world_editor/add_mode", "Add Mode", Key::A));
|
||||
add_button->set_shortcut(ED_SHORTCUT("voxel_world_editor/add_mode", "Add Mode", Key::A));
|
||||
#endif
|
||||
|
||||
spatial_editor_hb->add_child(add_button);
|
||||
@ -284,9 +284,9 @@ VoxelWorldEditor::VoxelWorldEditor(EditorNode *p_editor) {
|
||||
remove_button->CONNECT("button_up", this, VoxelWorldEditor, _on_tool_button_pressed);
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
remove_button->set_shortcut(ED_SHORTCUT("voxelman_world_editor/remove_mode", "Remove Mode", KEY_S));
|
||||
remove_button->set_shortcut(ED_SHORTCUT("voxel_world_editor/remove_mode", "Remove Mode", KEY_S));
|
||||
#else
|
||||
remove_button->set_shortcut(ED_SHORTCUT("voxelman_world_editor/remove_mode", "Remove Mode", Key::S));
|
||||
remove_button->set_shortcut(ED_SHORTCUT("voxel_world_editor/remove_mode", "Remove Mode", Key::S));
|
||||
#endif
|
||||
|
||||
spatial_editor_hb->add_child(remove_button);
|
||||
@ -297,9 +297,9 @@ VoxelWorldEditor::VoxelWorldEditor(EditorNode *p_editor) {
|
||||
insert_buton->CONNECT("button_up", this, VoxelWorldEditor, _on_insert_block_at_camera_button_pressed);
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
insert_buton->set_shortcut(ED_SHORTCUT("voxelman_world_editor/instert_block_at_camera", "Insert at camera", KEY_B));
|
||||
insert_buton->set_shortcut(ED_SHORTCUT("voxel_world_editor/instert_block_at_camera", "Insert at camera", KEY_B));
|
||||
#else
|
||||
insert_buton->set_shortcut(ED_SHORTCUT("voxelman_world_editor/instert_block_at_camera", "Insert at camera", Key::B));
|
||||
insert_buton->set_shortcut(ED_SHORTCUT("voxel_world_editor/instert_block_at_camera", "Insert at camera", Key::B));
|
||||
#endif
|
||||
|
||||
spatial_editor_hb->add_child(insert_buton);
|
||||
@ -410,7 +410,7 @@ void VoxelWorldEditor::_bind_methods() {
|
||||
|
||||
void VoxelWorldEditorPlugin::_notification(int p_what) {
|
||||
if (p_what == EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) {
|
||||
switch ((int)EditorSettings::get_singleton()->get("editors/voxelman/editor_side")) {
|
||||
switch ((int)EditorSettings::get_singleton()->get("editors/voxel/editor_side")) {
|
||||
#if VERSION_MAJOR <= 3 && VERSION_MINOR < 5
|
||||
case 0: { // Left.
|
||||
SpatialEditor::get_singleton()->get_palette_split()->move_child(voxel_world_editor, 0);
|
||||
@ -459,11 +459,11 @@ void VoxelWorldEditorPlugin::make_visible(bool p_visible) {
|
||||
VoxelWorldEditorPlugin::VoxelWorldEditorPlugin(EditorNode *p_node) {
|
||||
editor = p_node;
|
||||
|
||||
EDITOR_DEF("editors/voxelman/editor_side", 1);
|
||||
EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::INT, "editors/voxelman/editor_side", PROPERTY_HINT_ENUM, "Left,Right"));
|
||||
EDITOR_DEF("editors/voxel/editor_side", 1);
|
||||
EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::INT, "editors/voxel/editor_side", PROPERTY_HINT_ENUM, "Left,Right"));
|
||||
|
||||
voxel_world_editor = memnew(VoxelWorldEditor(editor));
|
||||
switch ((int)EditorSettings::get_singleton()->get("editors/voxelman/editor_side")) {
|
||||
switch ((int)EditorSettings::get_singleton()->get("editors/voxel/editor_side")) {
|
||||
case 0: { // Left.
|
||||
add_control_to_container(CONTAINER_SPATIAL_EDITOR_SIDE_LEFT, voxel_world_editor);
|
||||
} break;
|
||||
|
@ -101,10 +101,10 @@ protected:
|
||||
|
||||
public:
|
||||
#if VERSION_MAJOR < 4
|
||||
bool forward_spatial_input_event(Camera *p_camera, const Ref<InputEvent> &p_event);
|
||||
bool forward_spatial_input_event(Camera *p_camera, const Ref<InputEvent> &p_event) { return voxel_world_editor->forward_spatial_input_event(p_camera, p_event); }
|
||||
virtual bool forward_spatial_gui_input(int p_index, Camera *p_camera, const Ref<InputEvent> &p_event) { return voxel_world_editor->forward_spatial_input_event(p_camera, p_event); }
|
||||
#else
|
||||
EditorPlugin::AfterGUIInput forward_spatial_input_event(Camera *p_camera, const Ref<InputEvent> &p_event);
|
||||
EditorPlugin::AfterGUIInput forward_spatial_input_event(Camera *p_camera, const Ref<InputEvent> &p_event) { return voxel_world_editor->forward_spatial_input_event(p_camera, p_event); }
|
||||
virtual EditorPlugin::AfterGUIInput forward_spatial_gui_input(int p_index, Camera *p_camera, const Ref<InputEvent> &p_event) { return voxel_world_editor->forward_spatial_input_event(p_camera, p_event); }
|
||||
#endif
|
||||
virtual String get_name() const { return "VoxelWorldEditor"; }
|
||||
|
Loading…
Reference in New Issue
Block a user