summaryrefslogtreecommitdiff
path: root/scene/resources
diff options
context:
space:
mode:
Diffstat (limited to 'scene/resources')
-rw-r--r--scene/resources/animation.cpp12
-rw-r--r--scene/resources/box_shape.cpp2
-rw-r--r--scene/resources/default_theme/default_theme.cpp33
-rw-r--r--scene/resources/material.cpp27
-rw-r--r--scene/resources/material.h12
-rw-r--r--scene/resources/mesh.cpp24
-rw-r--r--scene/resources/mesh.h18
-rw-r--r--scene/resources/multimesh.cpp2
-rw-r--r--scene/resources/multimesh.h2
-rw-r--r--scene/resources/primitive_meshes.cpp4
-rw-r--r--scene/resources/primitive_meshes.h4
-rw-r--r--scene/resources/scene_format_text.cpp2
-rw-r--r--scene/resources/tile_set.cpp20
-rw-r--r--scene/resources/tile_set.h3
-rw-r--r--scene/resources/world.cpp10
-rw-r--r--scene/resources/world.h4
16 files changed, 97 insertions, 82 deletions
diff --git a/scene/resources/animation.cpp b/scene/resources/animation.cpp
index 21e4a85cd1..8192074c17 100644
--- a/scene/resources/animation.cpp
+++ b/scene/resources/animation.cpp
@@ -1125,14 +1125,14 @@ Variant Animation::_cubic_interpolate(const Variant &p_pre_a, const Variant &p_a
return a.cubic_slerp(b, pa, pb, p_c);
} break;
- case Variant::RECT3: {
+ case Variant::AABB: {
- Rect3 a = p_a;
- Rect3 b = p_b;
- Rect3 pa = p_pre_a;
- Rect3 pb = p_post_b;
+ AABB a = p_a;
+ AABB b = p_b;
+ AABB pa = p_pre_a;
+ AABB pb = p_post_b;
- return Rect3(
+ return AABB(
a.position.cubic_interpolate(b.position, pa.position, pb.position, p_c),
a.size.cubic_interpolate(b.size, pa.size, pb.size, p_c));
} break;
diff --git a/scene/resources/box_shape.cpp b/scene/resources/box_shape.cpp
index bbc85ce0f6..4b9843f3f5 100644
--- a/scene/resources/box_shape.cpp
+++ b/scene/resources/box_shape.cpp
@@ -33,7 +33,7 @@
Vector<Vector3> BoxShape::_gen_debug_mesh_lines() {
Vector<Vector3> lines;
- Rect3 aabb;
+ AABB aabb;
aabb.position = -get_extents();
aabb.size = aabb.position * -2;
diff --git a/scene/resources/default_theme/default_theme.cpp b/scene/resources/default_theme/default_theme.cpp
index ce439fece6..cd28c9d203 100644
--- a/scene/resources/default_theme/default_theme.cpp
+++ b/scene/resources/default_theme/default_theme.cpp
@@ -836,39 +836,6 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
theme->set_constant("autohide", "HSplitContainer", 1 * scale);
theme->set_constant("autohide", "VSplitContainer", 1 * scale);
- // HButtonArray
- theme->set_stylebox("normal", "HButtonArray", sb_button_normal);
- theme->set_stylebox("selected", "HButtonArray", sb_button_pressed);
- theme->set_stylebox("hover", "HButtonArray", sb_button_hover);
-
- theme->set_font("font", "HButtonArray", default_font);
- theme->set_font("font_selected", "HButtonArray", default_font);
-
- theme->set_color("font_color", "HButtonArray", control_font_color_low);
- theme->set_color("font_color_selected", "HButtonArray", control_font_color_hover);
-
- theme->set_constant("icon_separator", "HButtonArray", 2 * scale);
- theme->set_constant("button_separator", "HButtonArray", 4 * scale);
-
- theme->set_stylebox("focus", "HButtonArray", focus);
-
- // VButtonArray
-
- theme->set_stylebox("normal", "VButtonArray", sb_button_normal);
- theme->set_stylebox("selected", "VButtonArray", sb_button_pressed);
- theme->set_stylebox("hover", "VButtonArray", sb_button_hover);
-
- theme->set_font("font", "VButtonArray", default_font);
- theme->set_font("font_selected", "VButtonArray", default_font);
-
- theme->set_color("font_color", "VButtonArray", control_font_color_low);
- theme->set_color("font_color_selected", "VButtonArray", control_font_color_hover);
-
- theme->set_constant("icon_separator", "VButtonArray", 2 * scale);
- theme->set_constant("button_separator", "VButtonArray", 4 * scale);
-
- theme->set_stylebox("focus", "VButtonArray", focus);
-
// ReferenceRect
Ref<StyleBoxTexture> ttnc = make_stylebox(full_panel_bg_png, 8, 8, 8, 8);
diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp
index 12434b39fa..286840656b 100644
--- a/scene/resources/material.cpp
+++ b/scene/resources/material.cpp
@@ -723,7 +723,11 @@ void SpatialMaterial::_update_shader() {
} else {
code += "\tvec3 emission_tex = texture(texture_emission,base_uv).rgb;\n";
}
- code += "\tEMISSION = (emission.rgb+emission_tex)*emission_energy;\n";
+ if (emission_op == EMISSION_OP_ADD) {
+ code += "\tEMISSION = (emission.rgb+emission_tex)*emission_energy;\n";
+ } else {
+ code += "\tEMISSION = (emission.rgb*emission_tex)*emission_energy;\n";
+ }
}
if (features[FEATURE_REFRACTION] && !flags[FLAG_UV1_USE_TRIPLANAR]) { //refraction not supported with triplanar
@@ -1635,6 +1639,19 @@ float SpatialMaterial::get_distance_fade_min_distance() const {
return distance_fade_min_distance;
}
+void SpatialMaterial::set_emission_operator(EmissionOperator p_op) {
+
+ if (emission_op == p_op)
+ return;
+ emission_op = p_op;
+ _queue_shader_change();
+}
+
+SpatialMaterial::EmissionOperator SpatialMaterial::get_emission_operator() const {
+
+ return emission_op;
+}
+
RID SpatialMaterial::get_shader_rid() const {
ERR_FAIL_COND_V(!shader_map.has(current_key), RID());
@@ -1769,6 +1786,9 @@ void SpatialMaterial::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_grow", "amount"), &SpatialMaterial::set_grow);
ClassDB::bind_method(D_METHOD("get_grow"), &SpatialMaterial::get_grow);
+ ClassDB::bind_method(D_METHOD("set_emission_operator", "operator"), &SpatialMaterial::set_emission_operator);
+ ClassDB::bind_method(D_METHOD("get_emission_operator"), &SpatialMaterial::get_emission_operator);
+
ClassDB::bind_method(D_METHOD("set_ao_light_affect", "amount"), &SpatialMaterial::set_ao_light_affect);
ClassDB::bind_method(D_METHOD("get_ao_light_affect"), &SpatialMaterial::get_ao_light_affect);
@@ -1854,6 +1874,7 @@ void SpatialMaterial::_bind_methods() {
ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "emission_enabled"), "set_feature", "get_feature", FEATURE_EMISSION);
ADD_PROPERTY(PropertyInfo(Variant::COLOR, "emission", PROPERTY_HINT_COLOR_NO_ALPHA), "set_emission", "get_emission");
ADD_PROPERTY(PropertyInfo(Variant::REAL, "emission_energy", PROPERTY_HINT_RANGE, "0,16,0.01"), "set_emission_energy", "get_emission_energy");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "emission_operator", PROPERTY_HINT_ENUM, "Add,Multiply"), "set_emission_operator", "get_emission_operator");
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "emission_texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture"), "set_texture", "get_texture", TEXTURE_EMISSION);
ADD_GROUP("NormalMap", "normal_");
@@ -2022,6 +2043,9 @@ void SpatialMaterial::_bind_methods() {
BIND_ENUM_CONSTANT(TEXTURE_CHANNEL_BLUE);
BIND_ENUM_CONSTANT(TEXTURE_CHANNEL_ALPHA);
BIND_ENUM_CONSTANT(TEXTURE_CHANNEL_GRAYSCALE);
+
+ BIND_ENUM_CONSTANT(EMISSION_OP_ADD);
+ BIND_ENUM_CONSTANT(EMISSION_OP_MULTIPLY);
}
SpatialMaterial::SpatialMaterial()
@@ -2057,6 +2081,7 @@ SpatialMaterial::SpatialMaterial()
set_particles_anim_v_frames(1);
set_particles_anim_loop(false);
set_alpha_scissor_threshold(0.98);
+ emission_op = EMISSION_OP_ADD;
proximity_fade_enabled = false;
distance_fade_enabled = false;
diff --git a/scene/resources/material.h b/scene/resources/material.h
index 2425f1a174..877d4dfd41 100644
--- a/scene/resources/material.h
+++ b/scene/resources/material.h
@@ -215,6 +215,11 @@ public:
TEXTURE_CHANNEL_GRAYSCALE
};
+ enum EmissionOperator {
+ EMISSION_OP_ADD,
+ EMISSION_OP_MULTIPLY
+ };
+
private:
union MaterialKey {
@@ -234,6 +239,7 @@ private:
uint64_t grow : 1;
uint64_t proximity_fade : 1;
uint64_t distance_fade : 1;
+ uint64_t emission_op : 1;
};
uint64_t key;
@@ -278,6 +284,7 @@ private:
mk.grow = grow_enabled;
mk.proximity_fade = proximity_fade_enabled;
mk.distance_fade = distance_fade_enabled;
+ mk.emission_op = emission_op;
return mk;
}
@@ -394,6 +401,7 @@ private:
SpecularMode specular_mode;
DiffuseMode diffuse_mode;
BillboardMode billboard_mode;
+ EmissionOperator emission_op;
TextureChannel metallic_texture_channel;
TextureChannel roughness_texture_channel;
@@ -571,6 +579,9 @@ public:
void set_distance_fade_min_distance(float p_distance);
float get_distance_fade_min_distance() const;
+ void set_emission_operator(EmissionOperator p_op);
+ EmissionOperator get_emission_operator() const;
+
void set_metallic_texture_channel(TextureChannel p_channel);
TextureChannel get_metallic_texture_channel() const;
void set_roughness_texture_channel(TextureChannel p_channel);
@@ -603,6 +614,7 @@ VARIANT_ENUM_CAST(SpatialMaterial::DiffuseMode)
VARIANT_ENUM_CAST(SpatialMaterial::SpecularMode)
VARIANT_ENUM_CAST(SpatialMaterial::BillboardMode)
VARIANT_ENUM_CAST(SpatialMaterial::TextureChannel)
+VARIANT_ENUM_CAST(SpatialMaterial::EmissionOperator)
//////////////////////
diff --git a/scene/resources/mesh.cpp b/scene/resources/mesh.cpp
index 3e86daf3a7..06b147ba41 100644
--- a/scene/resources/mesh.cpp
+++ b/scene/resources/mesh.cpp
@@ -594,9 +594,9 @@ bool ArrayMesh::_set(const StringName &p_name, const Variant &p_value) {
}
ERR_FAIL_COND_V(!d.has("aabb"), false);
- Rect3 aabb = d["aabb"];
+ AABB aabb = d["aabb"];
- Vector<Rect3> bone_aabb;
+ Vector<AABB> bone_aabb;
if (d.has("skeleton_aabb")) {
Array baabb = d["skeleton_aabb"];
bone_aabb.resize(baabb.size());
@@ -676,7 +676,7 @@ bool ArrayMesh::_get(const StringName &p_name, Variant &r_ret) const {
d["format"] = VS::get_singleton()->mesh_surface_get_format(mesh, idx);
d["aabb"] = VS::get_singleton()->mesh_surface_get_aabb(mesh, idx);
- Vector<Rect3> skel_aabb = VS::get_singleton()->mesh_surface_get_skeleton_aabb(mesh, idx);
+ Vector<AABB> skel_aabb = VS::get_singleton()->mesh_surface_get_skeleton_aabb(mesh, idx);
Array arr;
for (int i = 0; i < skel_aabb.size(); i++) {
arr[i] = skel_aabb[i];
@@ -725,13 +725,13 @@ void ArrayMesh::_get_property_list(List<PropertyInfo> *p_list) const {
}
}
- p_list->push_back(PropertyInfo(Variant::RECT3, "custom_aabb/custom_aabb"));
+ p_list->push_back(PropertyInfo(Variant::AABB, "custom_aabb/custom_aabb"));
}
void ArrayMesh::_recompute_aabb() {
// regenerate AABB
- aabb = Rect3();
+ aabb = AABB();
for (int i = 0; i < surfaces.size(); i++) {
@@ -742,7 +742,7 @@ void ArrayMesh::_recompute_aabb() {
}
}
-void ArrayMesh::add_surface(uint32_t p_format, PrimitiveType p_primitive, const PoolVector<uint8_t> &p_array, int p_vertex_count, const PoolVector<uint8_t> &p_index_array, int p_index_count, const Rect3 &p_aabb, const Vector<PoolVector<uint8_t> > &p_blend_shapes, const Vector<Rect3> &p_bone_aabbs) {
+void ArrayMesh::add_surface(uint32_t p_format, PrimitiveType p_primitive, const PoolVector<uint8_t> &p_array, int p_vertex_count, const PoolVector<uint8_t> &p_index_array, int p_index_count, const AABB &p_aabb, const Vector<PoolVector<uint8_t> > &p_blend_shapes, const Vector<AABB> &p_bone_aabbs) {
Surface s;
s.aabb = p_aabb;
@@ -772,7 +772,7 @@ void ArrayMesh::add_surface_from_arrays(PrimitiveType p_primitive, const Array &
const Vector3 *vtx = r.ptr();
// check AABB
- Rect3 aabb;
+ AABB aabb;
for (int i = 0; i < len; i++) {
if (i == 0)
@@ -926,7 +926,7 @@ void ArrayMesh::surface_update_region(int p_surface, int p_offset, const PoolVec
VS::get_singleton()->mesh_surface_update_region(mesh, p_surface, p_offset, p_data);
}
-void ArrayMesh::surface_set_custom_aabb(int p_idx, const Rect3 &p_aabb) {
+void ArrayMesh::surface_set_custom_aabb(int p_idx, const AABB &p_aabb) {
ERR_FAIL_INDEX(p_idx, surfaces.size());
surfaces[p_idx].aabb = p_aabb;
@@ -942,7 +942,7 @@ Ref<Material> ArrayMesh::surface_get_material(int p_idx) const {
void ArrayMesh::add_surface_from_mesh_data(const Geometry::MeshData &p_mesh_data) {
VisualServer::get_singleton()->mesh_add_surface_from_mesh_data(mesh, p_mesh_data);
- Rect3 aabb;
+ AABB aabb;
for (int i = 0; i < p_mesh_data.vertices.size(); i++) {
if (i == 0)
@@ -970,18 +970,18 @@ RID ArrayMesh::get_rid() const {
return mesh;
}
-Rect3 ArrayMesh::get_aabb() const {
+AABB ArrayMesh::get_aabb() const {
return aabb;
}
-void ArrayMesh::set_custom_aabb(const Rect3 &p_custom) {
+void ArrayMesh::set_custom_aabb(const AABB &p_custom) {
custom_aabb = p_custom;
VS::get_singleton()->mesh_set_custom_aabb(mesh, custom_aabb);
}
-Rect3 ArrayMesh::get_custom_aabb() const {
+AABB ArrayMesh::get_custom_aabb() const {
return custom_aabb;
}
diff --git a/scene/resources/mesh.h b/scene/resources/mesh.h
index 75927079c7..b85a6a84af 100644
--- a/scene/resources/mesh.h
+++ b/scene/resources/mesh.h
@@ -136,7 +136,7 @@ public:
Ref<Mesh> create_outline(float p_margin) const;
- virtual Rect3 get_aabb() const = 0;
+ virtual AABB get_aabb() const = 0;
Mesh();
};
@@ -149,16 +149,16 @@ class ArrayMesh : public Mesh {
private:
struct Surface {
String name;
- Rect3 aabb;
+ AABB aabb;
Ref<Material> material;
bool is_2d;
};
Vector<Surface> surfaces;
RID mesh;
- Rect3 aabb;
+ AABB aabb;
BlendShapeMode blend_shape_mode;
Vector<StringName> blend_shapes;
- Rect3 custom_aabb;
+ AABB custom_aabb;
void _recompute_aabb();
@@ -173,7 +173,7 @@ protected:
public:
void add_surface_from_arrays(PrimitiveType p_primitive, const Array &p_arrays, const Array &p_blend_shapes = Array(), uint32_t p_flags = ARRAY_COMPRESS_DEFAULT);
- void add_surface(uint32_t p_format, PrimitiveType p_primitive, const PoolVector<uint8_t> &p_array, int p_vertex_count, const PoolVector<uint8_t> &p_index_array, int p_index_count, const Rect3 &p_aabb, const Vector<PoolVector<uint8_t> > &p_blend_shapes = Vector<PoolVector<uint8_t> >(), const Vector<Rect3> &p_bone_aabbs = Vector<Rect3>());
+ void add_surface(uint32_t p_format, PrimitiveType p_primitive, const PoolVector<uint8_t> &p_array, int p_vertex_count, const PoolVector<uint8_t> &p_index_array, int p_index_count, const AABB &p_aabb, const Vector<PoolVector<uint8_t> > &p_blend_shapes = Vector<PoolVector<uint8_t> >(), const Vector<AABB> &p_bone_aabbs = Vector<AABB>());
Array surface_get_arrays(int p_surface) const;
Array surface_get_blend_shape_arrays(int p_surface) const;
@@ -191,7 +191,7 @@ public:
int get_surface_count() const;
void surface_remove(int p_idx);
- void surface_set_custom_aabb(int p_idx, const Rect3 &p_aabb); //only recognized by driver
+ void surface_set_custom_aabb(int p_idx, const AABB &p_aabb); //only recognized by driver
int surface_get_array_len(int p_idx) const;
int surface_get_array_index_len(int p_idx) const;
@@ -207,10 +207,10 @@ public:
void add_surface_from_mesh_data(const Geometry::MeshData &p_mesh_data);
- void set_custom_aabb(const Rect3 &p_custom);
- Rect3 get_custom_aabb() const;
+ void set_custom_aabb(const AABB &p_custom);
+ AABB get_custom_aabb() const;
- Rect3 get_aabb() const;
+ AABB get_aabb() const;
virtual RID get_rid() const;
void center_geometry();
diff --git a/scene/resources/multimesh.cpp b/scene/resources/multimesh.cpp
index 15f1e15542..ee6efa6e85 100644
--- a/scene/resources/multimesh.cpp
+++ b/scene/resources/multimesh.cpp
@@ -155,7 +155,7 @@ Color MultiMesh::get_instance_color(int p_instance) const {
return VisualServer::get_singleton()->multimesh_instance_get_color(multimesh, p_instance);
}
-Rect3 MultiMesh::get_aabb() const {
+AABB MultiMesh::get_aabb() const {
return VisualServer::get_singleton()->multimesh_get_aabb(multimesh);
}
diff --git a/scene/resources/multimesh.h b/scene/resources/multimesh.h
index 7ca66b0b46..0a5310f641 100644
--- a/scene/resources/multimesh.h
+++ b/scene/resources/multimesh.h
@@ -84,7 +84,7 @@ public:
void set_instance_color(int p_instance, const Color &p_color);
Color get_instance_color(int p_instance) const;
- virtual Rect3 get_aabb() const;
+ virtual AABB get_aabb() const;
virtual RID get_rid() const;
diff --git a/scene/resources/primitive_meshes.cpp b/scene/resources/primitive_meshes.cpp
index 8e3899315c..3b80db291c 100644
--- a/scene/resources/primitive_meshes.cpp
+++ b/scene/resources/primitive_meshes.cpp
@@ -42,7 +42,7 @@ void PrimitiveMesh::_update() const {
PoolVector<Vector3> points = arr[VS::ARRAY_VERTEX];
- aabb = Rect3();
+ aabb = AABB();
int pc = points.size();
ERR_FAIL_COND(pc == 0);
@@ -141,7 +141,7 @@ StringName PrimitiveMesh::get_blend_shape_name(int p_index) const {
return StringName();
}
-Rect3 PrimitiveMesh::get_aabb() const {
+AABB PrimitiveMesh::get_aabb() const {
if (pending_request) {
_update();
}
diff --git a/scene/resources/primitive_meshes.h b/scene/resources/primitive_meshes.h
index f0c8935261..b38c247827 100644
--- a/scene/resources/primitive_meshes.h
+++ b/scene/resources/primitive_meshes.h
@@ -47,7 +47,7 @@ class PrimitiveMesh : public Mesh {
private:
RID mesh;
- mutable Rect3 aabb;
+ mutable AABB aabb;
Ref<Material> material;
@@ -73,7 +73,7 @@ public:
virtual Ref<Material> surface_get_material(int p_idx) const;
virtual int get_blend_shape_count() const;
virtual StringName get_blend_shape_name(int p_index) const;
- virtual Rect3 get_aabb() const;
+ virtual AABB get_aabb() const;
virtual RID get_rid() const;
void set_material(const Ref<Material> &p_material);
diff --git a/scene/resources/scene_format_text.cpp b/scene/resources/scene_format_text.cpp
index f0304bfaa5..fe23fbf6b3 100644
--- a/scene/resources/scene_format_text.cpp
+++ b/scene/resources/scene_format_text.cpp
@@ -33,7 +33,7 @@
#include "project_settings.h"
#include "version.h"
-//version 2: changed names for basis, rect3, poolvectors, etc.
+//version 2: changed names for basis, aabb, poolvectors, etc.
#define FORMAT_VERSION 2
#include "os/dir_access.h"
diff --git a/scene/resources/tile_set.cpp b/scene/resources/tile_set.cpp
index 50e8c28c22..29ac7852bf 100644
--- a/scene/resources/tile_set.cpp
+++ b/scene/resources/tile_set.cpp
@@ -57,11 +57,9 @@ bool TileSet::_set(const StringName &p_name, const Variant &p_value) {
tile_set_region(id, p_value);
else if (what == "shape")
tile_set_shape(id, 0, p_value);
- else if (what == "shape_offset") {
- Transform2D xform = tile_get_shape_transform(id, 0);
- xform.set_origin(p_value);
- tile_set_shape_transform(id, 0, xform);
- } else if (what == "shape_transform")
+ else if (what == "shape_offset")
+ tile_set_shape_offset(id, 0, p_value);
+ else if (what == "shape_transform")
tile_set_shape_transform(id, 0, p_value);
else if (what == "shape_one_way")
tile_set_shape_one_way(id, 0, p_value);
@@ -110,7 +108,7 @@ bool TileSet::_get(const StringName &p_name, Variant &r_ret) const {
else if (what == "shape")
r_ret = tile_get_shape(id, 0);
else if (what == "shape_offset")
- r_ret = tile_get_shape_transform(id, 0).get_origin();
+ r_ret = tile_get_shape_offset(id, 0);
else if (what == "shape_transform")
r_ret = tile_get_shape_transform(id, 0);
else if (what == "shape_one_way")
@@ -313,6 +311,16 @@ Transform2D TileSet::tile_get_shape_transform(int p_id, int p_shape_id) const {
return Transform2D();
}
+void TileSet::tile_set_shape_offset(int p_id, int p_shape_id, const Vector2 &p_offset) {
+ Transform2D transform = tile_get_shape_transform(p_id, p_shape_id);
+ transform.set_origin(p_offset);
+ tile_set_shape_transform(p_id, p_shape_id, transform);
+}
+
+Vector2 TileSet::tile_get_shape_offset(int p_id, int p_shape_id) const {
+ return tile_get_shape_transform(p_id, p_shape_id).get_origin();
+}
+
void TileSet::tile_set_shape_one_way(int p_id, int p_shape_id, const bool p_one_way) {
ERR_FAIL_COND(!tile_map.has(p_id));
diff --git a/scene/resources/tile_set.h b/scene/resources/tile_set.h
index fe782ff987..3ef3f00cef 100644
--- a/scene/resources/tile_set.h
+++ b/scene/resources/tile_set.h
@@ -108,6 +108,9 @@ public:
void tile_set_shape_transform(int p_id, int p_shape_id, const Transform2D &p_offset);
Transform2D tile_get_shape_transform(int p_id, int p_shape_id) const;
+ void tile_set_shape_offset(int p_id, int p_shape_id, const Vector2 &p_offset);
+ Vector2 tile_get_shape_offset(int p_id, int p_shape_id) const;
+
void tile_set_shape_one_way(int p_id, int p_shape_id, bool p_one_way);
bool tile_get_shape_one_way(int p_id, int p_shape_id) const;
diff --git a/scene/resources/world.cpp b/scene/resources/world.cpp
index af159975ca..86b32a5cdd 100644
--- a/scene/resources/world.cpp
+++ b/scene/resources/world.cpp
@@ -41,7 +41,7 @@ struct SpatialIndexer {
struct NotifierData {
- Rect3 aabb;
+ AABB aabb;
OctreeElementID id;
};
@@ -63,7 +63,7 @@ struct SpatialIndexer {
uint64_t pass;
uint64_t last_frame;
- void _notifier_add(VisibilityNotifier *p_notifier, const Rect3 &p_rect) {
+ void _notifier_add(VisibilityNotifier *p_notifier, const AABB &p_rect) {
ERR_FAIL_COND(notifiers.has(p_notifier));
notifiers[p_notifier].aabb = p_rect;
@@ -71,7 +71,7 @@ struct SpatialIndexer {
changed = true;
}
- void _notifier_update(VisibilityNotifier *p_notifier, const Rect3 &p_rect) {
+ void _notifier_update(VisibilityNotifier *p_notifier, const AABB &p_rect) {
Map<VisibilityNotifier *, NotifierData>::Element *E = notifiers.find(p_notifier);
ERR_FAIL_COND(!E);
@@ -229,14 +229,14 @@ void World::_remove_camera(Camera *p_camera) {
#endif
}
-void World::_register_notifier(VisibilityNotifier *p_notifier, const Rect3 &p_rect) {
+void World::_register_notifier(VisibilityNotifier *p_notifier, const AABB &p_rect) {
#ifndef _3D_DISABLED
indexer->_notifier_add(p_notifier, p_rect);
#endif
}
-void World::_update_notifier(VisibilityNotifier *p_notifier, const Rect3 &p_rect) {
+void World::_update_notifier(VisibilityNotifier *p_notifier, const AABB &p_rect) {
#ifndef _3D_DISABLED
indexer->_notifier_update(p_notifier, p_rect);
diff --git a/scene/resources/world.h b/scene/resources/world.h
index 767d1b5b6e..e0f1de1fd0 100644
--- a/scene/resources/world.h
+++ b/scene/resources/world.h
@@ -60,8 +60,8 @@ protected:
void _update_camera(Camera *p_camera);
void _remove_camera(Camera *p_camera);
- void _register_notifier(VisibilityNotifier *p_notifier, const Rect3 &p_rect);
- void _update_notifier(VisibilityNotifier *p_notifier, const Rect3 &p_rect);
+ void _register_notifier(VisibilityNotifier *p_notifier, const AABB &p_rect);
+ void _update_notifier(VisibilityNotifier *p_notifier, const AABB &p_rect);
void _remove_notifier(VisibilityNotifier *p_notifier);
friend class Viewport;
void _update(uint64_t p_frame);