summaryrefslogtreecommitdiff
path: root/scene/3d
diff options
context:
space:
mode:
Diffstat (limited to 'scene/3d')
-rw-r--r--scene/3d/collision_polygon.cpp4
-rw-r--r--scene/3d/collision_polygon.h4
-rw-r--r--scene/3d/gi_probe.cpp32
-rw-r--r--scene/3d/gi_probe.h12
-rw-r--r--scene/3d/immediate_geometry.cpp2
-rw-r--r--scene/3d/immediate_geometry.h4
-rw-r--r--scene/3d/light.cpp10
-rw-r--r--scene/3d/light.h2
-rw-r--r--scene/3d/mesh_instance.cpp4
-rw-r--r--scene/3d/mesh_instance.h2
-rw-r--r--scene/3d/multimesh_instance.cpp4
-rw-r--r--scene/3d/multimesh_instance.h2
-rw-r--r--scene/3d/particles.cpp14
-rw-r--r--scene/3d/particles.h10
-rw-r--r--scene/3d/portal.cpp2
-rw-r--r--scene/3d/portal.h4
-rw-r--r--scene/3d/reflection_probe.cpp4
-rw-r--r--scene/3d/reflection_probe.h2
-rw-r--r--scene/3d/room_instance.cpp6
-rw-r--r--scene/3d/room_instance.h2
-rw-r--r--scene/3d/sprite_3d.cpp6
-rw-r--r--scene/3d/sprite_3d.h6
-rw-r--r--scene/3d/visibility_notifier.cpp8
-rw-r--r--scene/3d/visibility_notifier.h6
-rw-r--r--scene/3d/visual_instance.cpp2
-rw-r--r--scene/3d/visual_instance.h4
26 files changed, 79 insertions, 79 deletions
diff --git a/scene/3d/collision_polygon.cpp b/scene/3d/collision_polygon.cpp
index 382cbb8f38..a6d812efec 100644
--- a/scene/3d/collision_polygon.cpp
+++ b/scene/3d/collision_polygon.cpp
@@ -117,7 +117,7 @@ Vector<Point2> CollisionPolygon::get_polygon() const {
return polygon;
}
-Rect3 CollisionPolygon::get_item_rect() const {
+AABB CollisionPolygon::get_item_rect() const {
return aabb;
}
@@ -176,7 +176,7 @@ void CollisionPolygon::_bind_methods() {
CollisionPolygon::CollisionPolygon() {
- aabb = Rect3(Vector3(-1, -1, -1), Vector3(2, 2, 2));
+ aabb = AABB(Vector3(-1, -1, -1), Vector3(2, 2, 2));
depth = 1.0;
set_notify_local_transform(true);
parent = NULL;
diff --git a/scene/3d/collision_polygon.h b/scene/3d/collision_polygon.h
index dbed1d7154..14d8c3aba6 100644
--- a/scene/3d/collision_polygon.h
+++ b/scene/3d/collision_polygon.h
@@ -40,7 +40,7 @@ class CollisionPolygon : public Spatial {
protected:
float depth;
- Rect3 aabb;
+ AABB aabb;
Vector<Point2> polygon;
uint32_t owner_id;
@@ -64,7 +64,7 @@ public:
void set_disabled(bool p_disabled);
bool is_disabled() const;
- virtual Rect3 get_item_rect() const;
+ virtual AABB get_item_rect() const;
String get_configuration_warning() const;
diff --git a/scene/3d/gi_probe.cpp b/scene/3d/gi_probe.cpp
index bc70feaffb..05d5d52d28 100644
--- a/scene/3d/gi_probe.cpp
+++ b/scene/3d/gi_probe.cpp
@@ -31,12 +31,12 @@
#include "mesh_instance.h"
-void GIProbeData::set_bounds(const Rect3 &p_bounds) {
+void GIProbeData::set_bounds(const AABB &p_bounds) {
VS::get_singleton()->gi_probe_set_bounds(probe, p_bounds);
}
-Rect3 GIProbeData::get_bounds() const {
+AABB GIProbeData::get_bounds() const {
return VS::get_singleton()->gi_probe_get_bounds(probe);
}
@@ -180,7 +180,7 @@ void GIProbeData::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_compress", "compress"), &GIProbeData::set_compress);
ClassDB::bind_method(D_METHOD("is_compressed"), &GIProbeData::is_compressed);
- ADD_PROPERTY(PropertyInfo(Variant::RECT3, "bounds", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_bounds", "get_bounds");
+ ADD_PROPERTY(PropertyInfo(Variant::AABB, "bounds", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_bounds", "get_bounds");
ADD_PROPERTY(PropertyInfo(Variant::REAL, "cell_size", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_cell_size", "get_cell_size");
ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM, "to_cell_xform", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_to_cell_xform", "get_to_cell_xform");
@@ -542,7 +542,7 @@ static _FORCE_INLINE_ Vector2 get_uv(const Vector3 &p_pos, const Vector3 *p_vtx,
return p_uv[0] * u + p_uv[1] * v + p_uv[2] * w;
}
-void GIProbe::_plot_face(int p_idx, int p_level, int p_x, int p_y, int p_z, const Vector3 *p_vtx, const Vector2 *p_uv, const Baker::MaterialCache &p_material, const Rect3 &p_aabb, Baker *p_baker) {
+void GIProbe::_plot_face(int p_idx, int p_level, int p_x, int p_y, int p_z, const Vector3 *p_vtx, const Vector2 *p_uv, const Baker::MaterialCache &p_material, const AABB &p_aabb, Baker *p_baker) {
if (p_level == p_baker->cell_subdiv - 1) {
//plot the face by guessing it's albedo and emission value
@@ -702,7 +702,7 @@ void GIProbe::_plot_face(int p_idx, int p_level, int p_x, int p_y, int p_z, cons
int half = (1 << (p_baker->cell_subdiv - 1)) >> (p_level + 1);
for (int i = 0; i < 8; i++) {
- Rect3 aabb = p_aabb;
+ AABB aabb = p_aabb;
aabb.size *= 0.5;
int nx = p_x;
@@ -726,7 +726,7 @@ void GIProbe::_plot_face(int p_idx, int p_level, int p_x, int p_y, int p_z, cons
continue;
{
- Rect3 test_aabb = aabb;
+ AABB test_aabb = aabb;
//test_aabb.grow_by(test_aabb.get_longest_axis_size()*0.05); //grow a bit to avoid numerical error in real-time
Vector3 qsize = test_aabb.size * 0.5; //quarter size, for fast aabb test
@@ -1083,11 +1083,11 @@ void GIProbe::_find_meshes(Node *p_at_node, Baker *p_baker) {
Ref<Mesh> mesh = mi->get_mesh();
if (mesh.is_valid()) {
- Rect3 aabb = mesh->get_aabb();
+ AABB aabb = mesh->get_aabb();
Transform xf = get_global_transform().affine_inverse() * mi->get_global_transform();
- if (Rect3(-extents, extents * 2).intersects(xf.xform(aabb))) {
+ if (AABB(-extents, extents * 2).intersects(xf.xform(aabb))) {
Baker::PlotMesh pm;
pm.local_xform = xf;
pm.mesh = mesh;
@@ -1113,11 +1113,11 @@ void GIProbe::_find_meshes(Node *p_at_node, Baker *p_baker) {
if (!mesh.is_valid())
continue;
- Rect3 aabb = mesh->get_aabb();
+ AABB aabb = mesh->get_aabb();
Transform xf = get_global_transform().affine_inverse() * (s->get_global_transform() * mxf);
- if (Rect3(-extents, extents * 2).intersects(xf.xform(aabb))) {
+ if (AABB(-extents, extents * 2).intersects(xf.xform(aabb))) {
Baker::PlotMesh pm;
pm.local_xform = xf;
pm.mesh = mesh;
@@ -1151,7 +1151,7 @@ void GIProbe::bake(Node *p_from_node, bool p_create_visual_debug) {
baker.bake_cells.resize(1);
//find out the actual real bounds, power of 2, which gets the highest subdivision
- baker.po2_bounds = Rect3(-extents, extents * 2.0);
+ baker.po2_bounds = AABB(-extents, extents * 2.0);
int longest_axis = baker.po2_bounds.get_longest_axis_index();
baker.axis_cell_size[longest_axis] = (1 << (baker.cell_subdiv - 1));
baker.leaf_voxel_count = 0;
@@ -1286,7 +1286,7 @@ void GIProbe::bake(Node *p_from_node, bool p_create_visual_debug) {
Ref<GIProbeData> probe_data;
probe_data.instance();
- probe_data->set_bounds(Rect3(-extents, extents * 2.0));
+ probe_data->set_bounds(AABB(-extents, extents * 2.0));
probe_data->set_cell_size(baker.po2_bounds.size[longest_axis] / baker.axis_cell_size[longest_axis]);
probe_data->set_dynamic_data(data);
probe_data->set_dynamic_range(dynamic_range);
@@ -1306,7 +1306,7 @@ void GIProbe::bake(Node *p_from_node, bool p_create_visual_debug) {
}
}
-void GIProbe::_debug_mesh(int p_idx, int p_level, const Rect3 &p_aabb, Ref<MultiMesh> &p_multimesh, int &idx, Baker *p_baker) {
+void GIProbe::_debug_mesh(int p_idx, int p_level, const AABB &p_aabb, Ref<MultiMesh> &p_multimesh, int &idx, Baker *p_baker) {
if (p_level == p_baker->cell_subdiv - 1) {
@@ -1328,7 +1328,7 @@ void GIProbe::_debug_mesh(int p_idx, int p_level, const Rect3 &p_aabb, Ref<Multi
if (p_baker->bake_cells[p_idx].childs[i] == Baker::CHILD_EMPTY)
continue;
- Rect3 aabb = p_aabb;
+ AABB aabb = p_aabb;
aabb.size *= 0.5;
if (i & 1)
@@ -1440,9 +1440,9 @@ void GIProbe::_debug_bake() {
bake(NULL, true);
}
-Rect3 GIProbe::get_aabb() const {
+AABB GIProbe::get_aabb() const {
- return Rect3(-extents, extents * 2);
+ return AABB(-extents, extents * 2);
}
PoolVector<Face3> GIProbe::get_faces(uint32_t p_usage_flags) const {
diff --git a/scene/3d/gi_probe.h b/scene/3d/gi_probe.h
index 8f13960b67..324ff8e917 100644
--- a/scene/3d/gi_probe.h
+++ b/scene/3d/gi_probe.h
@@ -43,8 +43,8 @@ protected:
static void _bind_methods();
public:
- void set_bounds(const Rect3 &p_bounds);
- Rect3 get_bounds() const;
+ void set_bounds(const AABB &p_bounds);
+ AABB get_bounds() const;
void set_cell_size(float p_size);
float get_cell_size() const;
@@ -146,7 +146,7 @@ private:
MaterialCache _get_material_cache(Ref<Material> p_material);
int leaf_voxel_count;
- Rect3 po2_bounds;
+ AABB po2_bounds;
int axis_cell_size[3];
struct PlotMesh {
@@ -180,12 +180,12 @@ private:
Vector<Color> _get_bake_texture(Ref<Image> p_image, const Color &p_color_mul, const Color &p_color_add);
Baker::MaterialCache _get_material_cache(Ref<Material> p_material, Baker *p_baker);
- void _plot_face(int p_idx, int p_level, int p_x, int p_y, int p_z, const Vector3 *p_vtx, const Vector2 *p_uv, const Baker::MaterialCache &p_material, const Rect3 &p_aabb, Baker *p_baker);
+ void _plot_face(int p_idx, int p_level, int p_x, int p_y, int p_z, const Vector3 *p_vtx, const Vector2 *p_uv, const Baker::MaterialCache &p_material, const AABB &p_aabb, Baker *p_baker);
void _plot_mesh(const Transform &p_xform, Ref<Mesh> &p_mesh, Baker *p_baker, const Vector<Ref<Material> > &p_materials, const Ref<Material> &p_override_material);
void _find_meshes(Node *p_at_node, Baker *p_baker);
void _fixup_plot(int p_idx, int p_level, int p_x, int p_y, int p_z, Baker *p_baker);
- void _debug_mesh(int p_idx, int p_level, const Rect3 &p_aabb, Ref<MultiMesh> &p_multimesh, int &idx, Baker *p_baker);
+ void _debug_mesh(int p_idx, int p_level, const AABB &p_aabb, Ref<MultiMesh> &p_multimesh, int &idx, Baker *p_baker);
void _create_debug_mesh(Baker *p_baker);
void _debug_bake();
@@ -230,7 +230,7 @@ public:
void bake(Node *p_from_node = NULL, bool p_create_visual_debug = false);
- virtual Rect3 get_aabb() const;
+ virtual AABB get_aabb() const;
virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const;
GIProbe();
diff --git a/scene/3d/immediate_geometry.cpp b/scene/3d/immediate_geometry.cpp
index 11f7efe066..092ed8f0b2 100644
--- a/scene/3d/immediate_geometry.cpp
+++ b/scene/3d/immediate_geometry.cpp
@@ -85,7 +85,7 @@ void ImmediateGeometry::clear() {
cached_textures.clear();
}
-Rect3 ImmediateGeometry::get_aabb() const {
+AABB ImmediateGeometry::get_aabb() const {
return aabb;
}
diff --git a/scene/3d/immediate_geometry.h b/scene/3d/immediate_geometry.h
index 93ef726c6d..1ff4e05e82 100644
--- a/scene/3d/immediate_geometry.h
+++ b/scene/3d/immediate_geometry.h
@@ -42,7 +42,7 @@ class ImmediateGeometry : public GeometryInstance {
// in VisualServer from becoming invalid if the texture is no longer used
List<Ref<Texture> > cached_textures;
bool empty;
- Rect3 aabb;
+ AABB aabb;
protected:
static void _bind_methods();
@@ -62,7 +62,7 @@ public:
void add_sphere(int p_lats, int p_lons, float p_radius, bool p_add_uv = true);
- virtual Rect3 get_aabb() const;
+ virtual AABB get_aabb() const;
virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const;
ImmediateGeometry();
diff --git a/scene/3d/light.cpp b/scene/3d/light.cpp
index 389d87cd90..324411c5cc 100644
--- a/scene/3d/light.cpp
+++ b/scene/3d/light.cpp
@@ -117,24 +117,24 @@ bool Light::get_shadow_reverse_cull_face() const {
return reverse_cull;
}
-Rect3 Light::get_aabb() const {
+AABB Light::get_aabb() const {
if (type == VisualServer::LIGHT_DIRECTIONAL) {
- return Rect3(Vector3(-1, -1, -1), Vector3(2, 2, 2));
+ return AABB(Vector3(-1, -1, -1), Vector3(2, 2, 2));
} else if (type == VisualServer::LIGHT_OMNI) {
- return Rect3(Vector3(-1, -1, -1) * param[PARAM_RANGE], Vector3(2, 2, 2) * param[PARAM_RANGE]);
+ return AABB(Vector3(-1, -1, -1) * param[PARAM_RANGE], Vector3(2, 2, 2) * param[PARAM_RANGE]);
} else if (type == VisualServer::LIGHT_SPOT) {
float len = param[PARAM_RANGE];
float size = Math::tan(Math::deg2rad(param[PARAM_SPOT_ANGLE])) * len;
- return Rect3(Vector3(-size, -size, -len), Vector3(size * 2, size * 2, len));
+ return AABB(Vector3(-size, -size, -len), Vector3(size * 2, size * 2, len));
}
- return Rect3();
+ return AABB();
}
PoolVector<Face3> Light::get_faces(uint32_t p_usage_flags) const {
diff --git a/scene/3d/light.h b/scene/3d/light.h
index 2f3ac8a5e7..37c17cbbe3 100644
--- a/scene/3d/light.h
+++ b/scene/3d/light.h
@@ -113,7 +113,7 @@ public:
void set_shadow_reverse_cull_face(bool p_enable);
bool get_shadow_reverse_cull_face() const;
- virtual Rect3 get_aabb() const;
+ virtual AABB get_aabb() const;
virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const;
Light();
diff --git a/scene/3d/mesh_instance.cpp b/scene/3d/mesh_instance.cpp
index c8215971c4..1e52ccc6e0 100644
--- a/scene/3d/mesh_instance.cpp
+++ b/scene/3d/mesh_instance.cpp
@@ -165,12 +165,12 @@ NodePath MeshInstance::get_skeleton_path() {
return skeleton_path;
}
-Rect3 MeshInstance::get_aabb() const {
+AABB MeshInstance::get_aabb() const {
if (!mesh.is_null())
return mesh->get_aabb();
- return Rect3();
+ return AABB();
}
PoolVector<Face3> MeshInstance::get_faces(uint32_t p_usage_flags) const {
diff --git a/scene/3d/mesh_instance.h b/scene/3d/mesh_instance.h
index 8e8c12a592..970a10aaf3 100644
--- a/scene/3d/mesh_instance.h
+++ b/scene/3d/mesh_instance.h
@@ -85,7 +85,7 @@ public:
void create_debug_tangents();
- virtual Rect3 get_aabb() const;
+ virtual AABB get_aabb() const;
virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const;
MeshInstance();
diff --git a/scene/3d/multimesh_instance.cpp b/scene/3d/multimesh_instance.cpp
index f90489f1f0..ce7b97be7f 100644
--- a/scene/3d/multimesh_instance.cpp
+++ b/scene/3d/multimesh_instance.cpp
@@ -55,10 +55,10 @@ PoolVector<Face3> MultiMeshInstance::get_faces(uint32_t p_usage_flags) const {
return PoolVector<Face3>();
}
-Rect3 MultiMeshInstance::get_aabb() const {
+AABB MultiMeshInstance::get_aabb() const {
if (multimesh.is_null())
- return Rect3();
+ return AABB();
else
return multimesh->get_aabb();
}
diff --git a/scene/3d/multimesh_instance.h b/scene/3d/multimesh_instance.h
index cd0e7b463c..9b2b1ff9a7 100644
--- a/scene/3d/multimesh_instance.h
+++ b/scene/3d/multimesh_instance.h
@@ -52,7 +52,7 @@ public:
void set_multimesh(const Ref<MultiMesh> &p_multimesh);
Ref<MultiMesh> get_multimesh() const;
- virtual Rect3 get_aabb() const;
+ virtual AABB get_aabb() const;
MultiMeshInstance();
~MultiMeshInstance();
diff --git a/scene/3d/particles.cpp b/scene/3d/particles.cpp
index 6ac6e52367..915a10328b 100644
--- a/scene/3d/particles.cpp
+++ b/scene/3d/particles.cpp
@@ -31,9 +31,9 @@
#include "scene/resources/surface_tool.h"
#include "servers/visual_server.h"
-Rect3 Particles::get_aabb() const {
+AABB Particles::get_aabb() const {
- return Rect3();
+ return AABB();
}
PoolVector<Face3> Particles::get_faces(uint32_t p_usage_flags) const {
@@ -82,7 +82,7 @@ void Particles::set_randomness_ratio(float p_ratio) {
randomness_ratio = p_ratio;
VS::get_singleton()->particles_set_randomness_ratio(particles, randomness_ratio);
}
-void Particles::set_visibility_aabb(const Rect3 &p_aabb) {
+void Particles::set_visibility_aabb(const AABB &p_aabb) {
visibility_aabb = p_aabb;
VS::get_singleton()->particles_set_custom_aabb(particles, visibility_aabb);
@@ -140,7 +140,7 @@ float Particles::get_randomness_ratio() const {
return randomness_ratio;
}
-Rect3 Particles::get_visibility_aabb() const {
+AABB Particles::get_visibility_aabb() const {
return visibility_aabb;
}
@@ -252,7 +252,7 @@ void Particles::restart() {
VisualServer::get_singleton()->particles_restart(particles);
}
-Rect3 Particles::capture_aabb() const {
+AABB Particles::capture_aabb() const {
return VS::get_singleton()->particles_get_current_aabb(particles);
}
@@ -335,7 +335,7 @@ void Particles::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::INT, "fixed_fps", PROPERTY_HINT_RANGE, "0,1000,1"), "set_fixed_fps", "get_fixed_fps");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "fract_delta"), "set_fractional_delta", "get_fractional_delta");
ADD_GROUP("Drawing", "");
- ADD_PROPERTY(PropertyInfo(Variant::RECT3, "visibility_aabb"), "set_visibility_aabb", "get_visibility_aabb");
+ ADD_PROPERTY(PropertyInfo(Variant::AABB, "visibility_aabb"), "set_visibility_aabb", "get_visibility_aabb");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "local_coords"), "set_use_local_coordinates", "get_use_local_coordinates");
ADD_PROPERTY(PropertyInfo(Variant::INT, "draw_order", PROPERTY_HINT_ENUM, "Index,Lifetime,View Depth"), "set_draw_order", "get_draw_order");
ADD_GROUP("Process Material", "");
@@ -367,7 +367,7 @@ Particles::Particles() {
set_pre_process_time(0);
set_explosiveness_ratio(0);
set_randomness_ratio(0);
- set_visibility_aabb(Rect3(Vector3(-4, -4, -4), Vector3(8, 8, 8)));
+ set_visibility_aabb(AABB(Vector3(-4, -4, -4), Vector3(8, 8, 8)));
set_use_local_coordinates(true);
set_draw_passes(1);
set_draw_order(DRAW_ORDER_INDEX);
diff --git a/scene/3d/particles.h b/scene/3d/particles.h
index e3109f470f..30080360bb 100644
--- a/scene/3d/particles.h
+++ b/scene/3d/particles.h
@@ -65,7 +65,7 @@ private:
float explosiveness_ratio;
float randomness_ratio;
float speed_scale;
- Rect3 visibility_aabb;
+ AABB visibility_aabb;
bool local_coords;
int fixed_fps;
bool fractional_delta;
@@ -82,7 +82,7 @@ protected:
virtual void _validate_property(PropertyInfo &property) const;
public:
- Rect3 get_aabb() const;
+ AABB get_aabb() const;
PoolVector<Face3> get_faces(uint32_t p_usage_flags) const;
void set_emitting(bool p_emitting);
@@ -92,7 +92,7 @@ public:
void set_pre_process_time(float p_time);
void set_explosiveness_ratio(float p_ratio);
void set_randomness_ratio(float p_ratio);
- void set_visibility_aabb(const Rect3 &p_aabb);
+ void set_visibility_aabb(const AABB &p_aabb);
void set_use_local_coordinates(bool p_enable);
void set_process_material(const Ref<Material> &p_material);
void set_speed_scale(float p_scale);
@@ -104,7 +104,7 @@ public:
float get_pre_process_time() const;
float get_explosiveness_ratio() const;
float get_randomness_ratio() const;
- Rect3 get_visibility_aabb() const;
+ AABB get_visibility_aabb() const;
bool get_use_local_coordinates() const;
Ref<Material> get_process_material() const;
float get_speed_scale() const;
@@ -128,7 +128,7 @@ public:
void restart();
- Rect3 capture_aabb() const;
+ AABB capture_aabb() const;
Particles();
~Particles();
};
diff --git a/scene/3d/portal.cpp b/scene/3d/portal.cpp
index 6c14f7dbc9..4fde29aab9 100644
--- a/scene/3d/portal.cpp
+++ b/scene/3d/portal.cpp
@@ -98,7 +98,7 @@ void Portal::_get_property_list(List<PropertyInfo> *p_list) const {
p_list->push_back(PropertyInfo(Variant::REAL, "connect_range", PROPERTY_HINT_RANGE, "0.1,4096,0.01"));
}
-Rect3 Portal::get_aabb() const {
+AABB Portal::get_aabb() const {
return aabb;
}
diff --git a/scene/3d/portal.h b/scene/3d/portal.h
index 6de3df8553..4ea208a718 100644
--- a/scene/3d/portal.h
+++ b/scene/3d/portal.h
@@ -53,7 +53,7 @@ class Portal : public VisualInstance {
Color disabled_color;
float connect_range;
- Rect3 aabb;
+ AABB aabb;
protected:
bool _set(const StringName &p_name, const Variant &p_value);
@@ -63,7 +63,7 @@ protected:
static void _bind_methods();
public:
- virtual Rect3 get_aabb() const;
+ virtual AABB get_aabb() const;
virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const;
void set_enabled(bool p_enabled);
diff --git a/scene/3d/reflection_probe.cpp b/scene/3d/reflection_probe.cpp
index 46b105cd21..0e575ec152 100644
--- a/scene/3d/reflection_probe.cpp
+++ b/scene/3d/reflection_probe.cpp
@@ -178,9 +178,9 @@ ReflectionProbe::UpdateMode ReflectionProbe::get_update_mode() const {
return update_mode;
}
-Rect3 ReflectionProbe::get_aabb() const {
+AABB ReflectionProbe::get_aabb() const {
- Rect3 aabb;
+ AABB aabb;
aabb.position = -origin_offset;
aabb.size = origin_offset + extents;
return aabb;
diff --git a/scene/3d/reflection_probe.h b/scene/3d/reflection_probe.h
index 7c328a8f16..26f17fdcf9 100644
--- a/scene/3d/reflection_probe.h
+++ b/scene/3d/reflection_probe.h
@@ -101,7 +101,7 @@ public:
void set_update_mode(UpdateMode p_mode);
UpdateMode get_update_mode() const;
- virtual Rect3 get_aabb() const;
+ virtual AABB get_aabb() const;
virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const;
ReflectionProbe();
diff --git a/scene/3d/room_instance.cpp b/scene/3d/room_instance.cpp
index 439b6bfdf8..47a7b8bfb9 100644
--- a/scene/3d/room_instance.cpp
+++ b/scene/3d/room_instance.cpp
@@ -66,12 +66,12 @@ void Room::_notification(int p_what) {
}
}
-Rect3 Room::get_aabb() const {
+AABB Room::get_aabb() const {
if (room.is_null())
- return Rect3();
+ return AABB();
- return Rect3();
+ return AABB();
}
PoolVector<Face3> Room::get_faces(uint32_t p_usage_flags) const {
diff --git a/scene/3d/room_instance.h b/scene/3d/room_instance.h
index b9a64b6670..3069ea2eba 100644
--- a/scene/3d/room_instance.h
+++ b/scene/3d/room_instance.h
@@ -71,7 +71,7 @@ public:
NOTIFICATION_AREA_CHANGED = 60
};
- virtual Rect3 get_aabb() const;
+ virtual AABB get_aabb() const;
virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const;
void set_room(const Ref<RoomBounds> &p_room);
diff --git a/scene/3d/sprite_3d.cpp b/scene/3d/sprite_3d.cpp
index 49a3205f21..18ebc22c8b 100644
--- a/scene/3d/sprite_3d.cpp
+++ b/scene/3d/sprite_3d.cpp
@@ -188,7 +188,7 @@ void SpriteBase3D::_queue_update() {
call_deferred(SceneStringNames::get_singleton()->_im_update);
}
-Rect3 SpriteBase3D::get_aabb() const {
+AABB SpriteBase3D::get_aabb() const {
return aabb;
}
@@ -407,7 +407,7 @@ void Sprite3D::_draw() {
}
}
- Rect3 aabb;
+ AABB aabb;
for (int i = 0; i < 4; i++) {
VS::get_singleton()->immediate_normal(immediate, normal);
@@ -698,7 +698,7 @@ void AnimatedSprite3D::_draw() {
}
}
- Rect3 aabb;
+ AABB aabb;
for (int i = 0; i < 4; i++) {
VS::get_singleton()->immediate_normal(immediate, normal);
diff --git a/scene/3d/sprite_3d.h b/scene/3d/sprite_3d.h
index 1165392cb2..d18553a504 100644
--- a/scene/3d/sprite_3d.h
+++ b/scene/3d/sprite_3d.h
@@ -71,7 +71,7 @@ private:
Vector3::Axis axis;
float pixel_size;
- Rect3 aabb;
+ AABB aabb;
RID immediate;
@@ -87,7 +87,7 @@ protected:
void _notification(int p_what);
static void _bind_methods();
virtual void _draw() = 0;
- _FORCE_INLINE_ void set_aabb(const Rect3 &p_aabb) { aabb = p_aabb; }
+ _FORCE_INLINE_ void set_aabb(const AABB &p_aabb) { aabb = p_aabb; }
_FORCE_INLINE_ RID &get_immediate() { return immediate; }
void _queue_update();
@@ -130,7 +130,7 @@ public:
virtual Rect2 get_item_rect() const = 0;
- virtual Rect3 get_aabb() const;
+ virtual AABB get_aabb() const;
virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const;
SpriteBase3D();
diff --git a/scene/3d/visibility_notifier.cpp b/scene/3d/visibility_notifier.cpp
index e60b32a92a..47144c4b78 100644
--- a/scene/3d/visibility_notifier.cpp
+++ b/scene/3d/visibility_notifier.cpp
@@ -60,7 +60,7 @@ void VisibilityNotifier::_exit_camera(Camera *p_camera) {
}
}
-void VisibilityNotifier::set_aabb(const Rect3 &p_aabb) {
+void VisibilityNotifier::set_aabb(const AABB &p_aabb) {
if (aabb == p_aabb)
return;
@@ -74,7 +74,7 @@ void VisibilityNotifier::set_aabb(const Rect3 &p_aabb) {
update_gizmo();
}
-Rect3 VisibilityNotifier::get_aabb() const {
+AABB VisibilityNotifier::get_aabb() const {
return aabb;
}
@@ -108,7 +108,7 @@ void VisibilityNotifier::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_aabb"), &VisibilityNotifier::get_aabb);
ClassDB::bind_method(D_METHOD("is_on_screen"), &VisibilityNotifier::is_on_screen);
- ADD_PROPERTY(PropertyInfo(Variant::RECT3, "aabb"), "set_aabb", "get_aabb");
+ ADD_PROPERTY(PropertyInfo(Variant::AABB, "aabb"), "set_aabb", "get_aabb");
ADD_SIGNAL(MethodInfo("camera_entered", PropertyInfo(Variant::OBJECT, "camera", PROPERTY_HINT_RESOURCE_TYPE, "Camera")));
ADD_SIGNAL(MethodInfo("camera_exited", PropertyInfo(Variant::OBJECT, "camera", PROPERTY_HINT_RESOURCE_TYPE, "Camera")));
@@ -118,7 +118,7 @@ void VisibilityNotifier::_bind_methods() {
VisibilityNotifier::VisibilityNotifier() {
- aabb = Rect3(Vector3(-1, -1, -1), Vector3(2, 2, 2));
+ aabb = AABB(Vector3(-1, -1, -1), Vector3(2, 2, 2));
set_notify_transform(true);
}
diff --git a/scene/3d/visibility_notifier.h b/scene/3d/visibility_notifier.h
index 0b83e0534e..fc06cf5aec 100644
--- a/scene/3d/visibility_notifier.h
+++ b/scene/3d/visibility_notifier.h
@@ -39,7 +39,7 @@ class VisibilityNotifier : public Spatial {
Set<Camera *> cameras;
- Rect3 aabb;
+ AABB aabb;
protected:
virtual void _screen_enter() {}
@@ -53,8 +53,8 @@ protected:
void _exit_camera(Camera *p_camera);
public:
- void set_aabb(const Rect3 &p_aabb);
- Rect3 get_aabb() const;
+ void set_aabb(const AABB &p_aabb);
+ AABB get_aabb() const;
bool is_on_screen() const;
VisibilityNotifier();
diff --git a/scene/3d/visual_instance.cpp b/scene/3d/visual_instance.cpp
index fa35d982eb..b92e7ead04 100644
--- a/scene/3d/visual_instance.cpp
+++ b/scene/3d/visual_instance.cpp
@@ -33,7 +33,7 @@
#include "servers/visual_server.h"
#include "skeleton.h"
-Rect3 VisualInstance::get_transformed_aabb() const {
+AABB VisualInstance::get_transformed_aabb() const {
return get_global_transform().xform(get_aabb());
}
diff --git a/scene/3d/visual_instance.h b/scene/3d/visual_instance.h
index c405236d2c..5827f1e1fb 100644
--- a/scene/3d/visual_instance.h
+++ b/scene/3d/visual_instance.h
@@ -62,10 +62,10 @@ public:
};
RID get_instance() const;
- virtual Rect3 get_aabb() const = 0;
+ virtual AABB get_aabb() const = 0;
virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const = 0;
- virtual Rect3 get_transformed_aabb() const; // helper
+ virtual AABB get_transformed_aabb() const; // helper
void set_base(const RID &p_base);