summaryrefslogtreecommitdiff
path: root/servers/visual
diff options
context:
space:
mode:
Diffstat (limited to 'servers/visual')
-rw-r--r--servers/visual/rasterizer.h36
-rw-r--r--servers/visual/visual_server_raster.h32
-rw-r--r--servers/visual/visual_server_scene.cpp12
-rw-r--r--servers/visual/visual_server_scene.h6
-rw-r--r--servers/visual/visual_server_wrap_mt.h24
5 files changed, 55 insertions, 55 deletions
diff --git a/servers/visual/rasterizer.h b/servers/visual/rasterizer.h
index 333fe1e72a..21d059c48e 100644
--- a/servers/visual/rasterizer.h
+++ b/servers/visual/rasterizer.h
@@ -234,7 +234,7 @@ public:
virtual RID mesh_create() = 0;
- virtual void mesh_add_surface(RID p_mesh, uint32_t p_format, VS::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>()) = 0;
+ virtual void mesh_add_surface(RID p_mesh, uint32_t p_format, VS::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>()) = 0;
virtual void mesh_set_blend_shape_count(RID p_mesh, int p_amount) = 0;
virtual int mesh_get_blend_shape_count(RID p_mesh) const = 0;
@@ -256,17 +256,17 @@ public:
virtual uint32_t mesh_surface_get_format(RID p_mesh, int p_surface) const = 0;
virtual VS::PrimitiveType mesh_surface_get_primitive_type(RID p_mesh, int p_surface) const = 0;
- virtual Rect3 mesh_surface_get_aabb(RID p_mesh, int p_surface) const = 0;
+ virtual AABB mesh_surface_get_aabb(RID p_mesh, int p_surface) const = 0;
virtual Vector<PoolVector<uint8_t> > mesh_surface_get_blend_shapes(RID p_mesh, int p_surface) const = 0;
- virtual Vector<Rect3> mesh_surface_get_skeleton_aabb(RID p_mesh, int p_surface) const = 0;
+ virtual Vector<AABB> mesh_surface_get_skeleton_aabb(RID p_mesh, int p_surface) const = 0;
virtual void mesh_remove_surface(RID p_mesh, int p_index) = 0;
virtual int mesh_get_surface_count(RID p_mesh) const = 0;
- virtual void mesh_set_custom_aabb(RID p_mesh, const Rect3 &p_aabb) = 0;
- virtual Rect3 mesh_get_custom_aabb(RID p_mesh) const = 0;
+ virtual void mesh_set_custom_aabb(RID p_mesh, const AABB &p_aabb) = 0;
+ virtual AABB mesh_get_custom_aabb(RID p_mesh) const = 0;
- virtual Rect3 mesh_get_aabb(RID p_mesh, RID p_skeleton) const = 0;
+ virtual AABB mesh_get_aabb(RID p_mesh, RID p_skeleton) const = 0;
virtual void mesh_clear(RID p_mesh) = 0;
/* MULTIMESH API */
@@ -290,7 +290,7 @@ public:
virtual void multimesh_set_visible_instances(RID p_multimesh, int p_visible) = 0;
virtual int multimesh_get_visible_instances(RID p_multimesh) const = 0;
- virtual Rect3 multimesh_get_aabb(RID p_multimesh) const = 0;
+ virtual AABB multimesh_get_aabb(RID p_multimesh) const = 0;
/* IMMEDIATE API */
@@ -306,7 +306,7 @@ public:
virtual void immediate_clear(RID p_immediate) = 0;
virtual void immediate_set_material(RID p_immediate, RID p_material) = 0;
virtual RID immediate_get_material(RID p_immediate) const = 0;
- virtual Rect3 immediate_get_aabb(RID p_immediate) const = 0;
+ virtual AABB immediate_get_aabb(RID p_immediate) const = 0;
/* SKELETON API */
@@ -350,7 +350,7 @@ public:
virtual bool light_has_shadow(RID p_light) const = 0;
virtual VS::LightType light_get_type(RID p_light) const = 0;
- virtual Rect3 light_get_aabb(RID p_light) const = 0;
+ virtual AABB light_get_aabb(RID p_light) const = 0;
virtual float light_get_param(RID p_light, VS::LightParam p_param) = 0;
virtual Color light_get_color(RID p_light) = 0;
virtual uint64_t light_get_version(RID p_light) const = 0;
@@ -372,7 +372,7 @@ public:
virtual void reflection_probe_set_enable_shadows(RID p_probe, bool p_enable) = 0;
virtual void reflection_probe_set_cull_mask(RID p_probe, uint32_t p_layers) = 0;
- virtual Rect3 reflection_probe_get_aabb(RID p_probe) const = 0;
+ virtual AABB reflection_probe_get_aabb(RID p_probe) const = 0;
virtual VS::ReflectionProbeUpdateMode reflection_probe_get_update_mode(RID p_probe) const = 0;
virtual uint32_t reflection_probe_get_cull_mask(RID p_probe) const = 0;
virtual Vector3 reflection_probe_get_extents(RID p_probe) const = 0;
@@ -390,8 +390,8 @@ public:
virtual RID gi_probe_create() = 0;
- virtual void gi_probe_set_bounds(RID p_probe, const Rect3 &p_bounds) = 0;
- virtual Rect3 gi_probe_get_bounds(RID p_probe) const = 0;
+ virtual void gi_probe_set_bounds(RID p_probe, const AABB &p_bounds) = 0;
+ virtual AABB gi_probe_get_bounds(RID p_probe) const = 0;
virtual void gi_probe_set_cell_size(RID p_probe, float p_range) = 0;
virtual float gi_probe_get_cell_size(RID p_probe) const = 0;
@@ -446,7 +446,7 @@ public:
virtual void particles_set_pre_process_time(RID p_particles, float p_time) = 0;
virtual void particles_set_explosiveness_ratio(RID p_particles, float p_ratio) = 0;
virtual void particles_set_randomness_ratio(RID p_particles, float p_ratio) = 0;
- virtual void particles_set_custom_aabb(RID p_particles, const Rect3 &p_aabb) = 0;
+ virtual void particles_set_custom_aabb(RID p_particles, const AABB &p_aabb) = 0;
virtual void particles_set_speed_scale(RID p_particles, float p_scale) = 0;
virtual void particles_set_use_local_coordinates(RID p_particles, bool p_enable) = 0;
virtual void particles_set_process_material(RID p_particles, RID p_material) = 0;
@@ -460,8 +460,8 @@ public:
virtual void particles_set_draw_pass_mesh(RID p_particles, int p_pass, RID p_mesh) = 0;
virtual void particles_request_process(RID p_particles) = 0;
- virtual Rect3 particles_get_current_aabb(RID p_particles) = 0;
- virtual Rect3 particles_get_aabb(RID p_particles) const = 0;
+ virtual AABB particles_get_current_aabb(RID p_particles) = 0;
+ virtual AABB particles_get_aabb(RID p_particles) const = 0;
virtual void particles_set_emission_transform(RID p_particles, const Transform &p_transform) = 0;
@@ -882,7 +882,7 @@ public:
case Item::Command::TYPE_MESH: {
const Item::CommandMesh *mesh = static_cast<const Item::CommandMesh *>(c);
- Rect3 aabb = RasterizerStorage::base_singleton->mesh_get_aabb(mesh->mesh, mesh->skeleton);
+ AABB aabb = RasterizerStorage::base_singleton->mesh_get_aabb(mesh->mesh, mesh->skeleton);
r = Rect2(aabb.position.x, aabb.position.y, aabb.size.x, aabb.size.y);
@@ -890,7 +890,7 @@ public:
case Item::Command::TYPE_MULTIMESH: {
const Item::CommandMultiMesh *multimesh = static_cast<const Item::CommandMultiMesh *>(c);
- Rect3 aabb = RasterizerStorage::base_singleton->multimesh_get_aabb(multimesh->multimesh);
+ AABB aabb = RasterizerStorage::base_singleton->multimesh_get_aabb(multimesh->multimesh);
r = Rect2(aabb.position.x, aabb.position.y, aabb.size.x, aabb.size.y);
@@ -899,7 +899,7 @@ public:
const Item::CommandParticles *particles_cmd = static_cast<const Item::CommandParticles *>(c);
if (particles_cmd->particles.is_valid()) {
- Rect3 aabb = RasterizerStorage::base_singleton->particles_get_aabb(particles_cmd->particles);
+ AABB aabb = RasterizerStorage::base_singleton->particles_get_aabb(particles_cmd->particles);
r = Rect2(aabb.position.x, aabb.position.y, aabb.size.x, aabb.size.y);
}
diff --git a/servers/visual/visual_server_raster.h b/servers/visual/visual_server_raster.h
index 67375e81b6..08a0cfa269 100644
--- a/servers/visual/visual_server_raster.h
+++ b/servers/visual/visual_server_raster.h
@@ -77,8 +77,8 @@ class VisualServerRaster : public VisualServer {
static void _changes_changed() {}
public:
-//if editor is redrawing when it shouldn't, enable this and put a breakpoint in _changes_changed()
-//#define DEBUG_CHANGES
+ //if editor is redrawing when it shouldn't, enable this and put a breakpoint in _changes_changed()
+ //#define DEBUG_CHANGES
#ifdef DEBUG_CHANGES
_FORCE_INLINE_ static void redraw_request() {
@@ -96,7 +96,7 @@ public:
#define DISPLAY_CHANGED \
changes++;
#endif
-// print_line(String("CHANGED: ") + __FUNCTION__);
+ // print_line(String("CHANGED: ") + __FUNCTION__);
#define BIND0R(m_r, m_name) \
m_r m_name() { return BINDBASE->m_name(); }
@@ -203,7 +203,7 @@ public:
BIND0R(RID, mesh_create)
- BIND10(mesh_add_surface, RID, uint32_t, PrimitiveType, const PoolVector<uint8_t> &, int, const PoolVector<uint8_t> &, int, const Rect3 &, const Vector<PoolVector<uint8_t> > &, const Vector<Rect3> &)
+ BIND10(mesh_add_surface, RID, uint32_t, PrimitiveType, const PoolVector<uint8_t> &, int, const PoolVector<uint8_t> &, int, const AABB &, const Vector<PoolVector<uint8_t> > &, const Vector<AABB> &)
BIND2(mesh_set_blend_shape_count, RID, int)
BIND1RC(int, mesh_get_blend_shape_count, RID)
@@ -225,15 +225,15 @@ public:
BIND2RC(uint32_t, mesh_surface_get_format, RID, int)
BIND2RC(PrimitiveType, mesh_surface_get_primitive_type, RID, int)
- BIND2RC(Rect3, mesh_surface_get_aabb, RID, int)
+ BIND2RC(AABB, mesh_surface_get_aabb, RID, int)
BIND2RC(Vector<PoolVector<uint8_t> >, mesh_surface_get_blend_shapes, RID, int)
- BIND2RC(Vector<Rect3>, mesh_surface_get_skeleton_aabb, RID, int)
+ BIND2RC(Vector<AABB>, mesh_surface_get_skeleton_aabb, RID, int)
BIND2(mesh_remove_surface, RID, int)
BIND1RC(int, mesh_get_surface_count, RID)
- BIND2(mesh_set_custom_aabb, RID, const Rect3 &)
- BIND1RC(Rect3, mesh_get_custom_aabb, RID)
+ BIND2(mesh_set_custom_aabb, RID, const AABB &)
+ BIND1RC(AABB, mesh_get_custom_aabb, RID)
BIND1(mesh_clear, RID)
@@ -250,7 +250,7 @@ public:
BIND3(multimesh_instance_set_color, RID, int, const Color &)
BIND1RC(RID, multimesh_get_mesh, RID)
- BIND1RC(Rect3, multimesh_get_aabb, RID)
+ BIND1RC(AABB, multimesh_get_aabb, RID)
BIND2RC(Transform, multimesh_instance_get_transform, RID, int)
BIND2RC(Transform2D, multimesh_instance_get_transform_2d, RID, int)
@@ -327,8 +327,8 @@ public:
BIND0R(RID, gi_probe_create)
- BIND2(gi_probe_set_bounds, RID, const Rect3 &)
- BIND1RC(Rect3, gi_probe_get_bounds, RID)
+ BIND2(gi_probe_set_bounds, RID, const AABB &)
+ BIND1RC(AABB, gi_probe_get_bounds, RID)
BIND2(gi_probe_set_cell_size, RID, float)
BIND1RC(float, gi_probe_get_cell_size, RID)
@@ -371,7 +371,7 @@ public:
BIND2(particles_set_pre_process_time, RID, float)
BIND2(particles_set_explosiveness_ratio, RID, float)
BIND2(particles_set_randomness_ratio, RID, float)
- BIND2(particles_set_custom_aabb, RID, const Rect3 &)
+ BIND2(particles_set_custom_aabb, RID, const AABB &)
BIND2(particles_set_speed_scale, RID, float)
BIND2(particles_set_use_local_coordinates, RID, bool)
BIND2(particles_set_process_material, RID, RID)
@@ -384,7 +384,7 @@ public:
BIND2(particles_set_draw_passes, RID, int)
BIND3(particles_set_draw_pass_mesh, RID, int, RID)
- BIND1R(Rect3, particles_get_current_aabb, RID)
+ BIND1R(AABB, particles_get_current_aabb, RID)
BIND2(particles_set_emission_transform, RID, const Transform &)
#undef BINDBASE
@@ -449,7 +449,7 @@ public:
BIND2R(int, viewport_get_render_info, RID, ViewportRenderInfo)
BIND2(viewport_set_debug_draw, RID, ViewportDebugDraw)
-/* ENVIRONMENT API */
+ /* ENVIRONMENT API */
#undef BINDBASE
//from now on, calls forwarded to this singleton
@@ -479,7 +479,7 @@ public:
BIND6(environment_set_fog_depth, RID, bool, float, float, bool, float)
BIND5(environment_set_fog_height, RID, bool, float, float, float)
-/* SCENARIO API */
+ /* SCENARIO API */
#undef BINDBASE
#define BINDBASE VSG::scene
@@ -510,7 +510,7 @@ public:
BIND2(instance_set_extra_visibility_margin, RID, real_t)
// don't use these in a game!
- BIND2RC(Vector<ObjectID>, instances_cull_aabb, const Rect3 &, RID)
+ BIND2RC(Vector<ObjectID>, instances_cull_aabb, const AABB &, RID)
BIND3RC(Vector<ObjectID>, instances_cull_ray, const Vector3 &, const Vector3 &, RID)
BIND2RC(Vector<ObjectID>, instances_cull_convex, const Vector<Plane> &, RID)
diff --git a/servers/visual/visual_server_scene.cpp b/servers/visual/visual_server_scene.cpp
index e49baf0763..3e46705ff8 100644
--- a/servers/visual/visual_server_scene.cpp
+++ b/servers/visual/visual_server_scene.cpp
@@ -614,7 +614,7 @@ void VisualServerScene::instance_set_exterior(RID p_instance, bool p_enabled) {
void VisualServerScene::instance_set_extra_visibility_margin(RID p_instance, real_t p_margin) {
}
-Vector<ObjectID> VisualServerScene::instances_cull_aabb(const Rect3 &p_aabb, RID p_scenario) const {
+Vector<ObjectID> VisualServerScene::instances_cull_aabb(const AABB &p_aabb, RID p_scenario) const {
Vector<ObjectID> instances;
Scenario *scenario = scenario_owner.get(p_scenario);
@@ -772,7 +772,7 @@ void VisualServerScene::_update_instance(Instance *p_instance) {
p_instance->mirror = p_instance->transform.basis.determinant() < 0.0;
- Rect3 new_aabb;
+ AABB new_aabb;
new_aabb = p_instance->transform.xform(p_instance->aabb);
@@ -817,7 +817,7 @@ void VisualServerScene::_update_instance(Instance *p_instance) {
void VisualServerScene::_update_instance_aabb(Instance *p_instance) {
- Rect3 new_aabb;
+ AABB new_aabb;
ERR_FAIL_COND(p_instance->base_type != VS::INSTANCE_NONE && !p_instance->base.is_valid());
@@ -1279,7 +1279,7 @@ void VisualServerScene::render_camera(RID p_camera, RID p_scenario, Size2 p_view
camera->zfar,
camera->vaspect
- );
+ );
ortho = true;
} break;
case Camera::PERSPECTIVE: {
@@ -1291,7 +1291,7 @@ void VisualServerScene::render_camera(RID p_camera, RID p_scenario, Size2 p_view
camera->zfar,
camera->vaspect
- );
+ );
ortho = false;
} break;
@@ -1863,7 +1863,7 @@ void VisualServerScene::_setup_gi_probe(Instance *p_instance) {
probe->dynamic.enabled = true;
Transform cell_to_xform = VSG::storage->gi_probe_get_to_cell_xform(p_instance->base);
- Rect3 bounds = VSG::storage->gi_probe_get_bounds(p_instance->base);
+ AABB bounds = VSG::storage->gi_probe_get_bounds(p_instance->base);
float cell_size = VSG::storage->gi_probe_get_cell_size(p_instance->base);
probe->dynamic.light_to_cell_xform = cell_to_xform * p_instance->transform.affine_inverse();
diff --git a/servers/visual/visual_server_scene.h b/servers/visual/visual_server_scene.h
index d30a2108a5..2738fa058d 100644
--- a/servers/visual/visual_server_scene.h
+++ b/servers/visual/visual_server_scene.h
@@ -195,8 +195,8 @@ public:
SelfList<Instance> update_item;
- Rect3 aabb;
- Rect3 transformed_aabb;
+ AABB aabb;
+ AABB transformed_aabb;
float extra_margin;
uint32_t object_ID;
@@ -466,7 +466,7 @@ public:
virtual void instance_set_extra_visibility_margin(RID p_instance, real_t p_margin);
// don't use these in a game!
- virtual Vector<ObjectID> instances_cull_aabb(const Rect3 &p_aabb, RID p_scenario = RID()) const;
+ virtual Vector<ObjectID> instances_cull_aabb(const AABB &p_aabb, RID p_scenario = RID()) const;
virtual Vector<ObjectID> instances_cull_ray(const Vector3 &p_from, const Vector3 &p_to, RID p_scenario = RID()) const;
virtual Vector<ObjectID> instances_cull_convex(const Vector<Plane> &p_convex, RID p_scenario = RID()) const;
diff --git a/servers/visual/visual_server_wrap_mt.h b/servers/visual/visual_server_wrap_mt.h
index 1dddef7bd4..509b77cf9c 100644
--- a/servers/visual/visual_server_wrap_mt.h
+++ b/servers/visual/visual_server_wrap_mt.h
@@ -63,7 +63,7 @@ class VisualServerWrapMT : public VisualServer {
int pool_max_size;
-//#define DEBUG_SYNC
+ //#define DEBUG_SYNC
#ifdef DEBUG_SYNC
#define SYNC_DEBUG print_line("sync on: " + String(__FUNCTION__));
@@ -136,7 +136,7 @@ public:
FUNCRID(mesh)
- FUNC10(mesh_add_surface, RID, uint32_t, PrimitiveType, const PoolVector<uint8_t> &, int, const PoolVector<uint8_t> &, int, const Rect3 &, const Vector<PoolVector<uint8_t> > &, const Vector<Rect3> &)
+ FUNC10(mesh_add_surface, RID, uint32_t, PrimitiveType, const PoolVector<uint8_t> &, int, const PoolVector<uint8_t> &, int, const AABB &, const Vector<PoolVector<uint8_t> > &, const Vector<AABB> &)
FUNC2(mesh_set_blend_shape_count, RID, int)
FUNC1RC(int, mesh_get_blend_shape_count, RID)
@@ -158,15 +158,15 @@ public:
FUNC2RC(uint32_t, mesh_surface_get_format, RID, int)
FUNC2RC(PrimitiveType, mesh_surface_get_primitive_type, RID, int)
- FUNC2RC(Rect3, mesh_surface_get_aabb, RID, int)
+ FUNC2RC(AABB, mesh_surface_get_aabb, RID, int)
FUNC2RC(Vector<PoolVector<uint8_t> >, mesh_surface_get_blend_shapes, RID, int)
- FUNC2RC(Vector<Rect3>, mesh_surface_get_skeleton_aabb, RID, int)
+ FUNC2RC(Vector<AABB>, mesh_surface_get_skeleton_aabb, RID, int)
FUNC2(mesh_remove_surface, RID, int)
FUNC1RC(int, mesh_get_surface_count, RID)
- FUNC2(mesh_set_custom_aabb, RID, const Rect3 &)
- FUNC1RC(Rect3, mesh_get_custom_aabb, RID)
+ FUNC2(mesh_set_custom_aabb, RID, const AABB &)
+ FUNC1RC(AABB, mesh_get_custom_aabb, RID)
FUNC1(mesh_clear, RID)
@@ -183,7 +183,7 @@ public:
FUNC3(multimesh_instance_set_color, RID, int, const Color &)
FUNC1RC(RID, multimesh_get_mesh, RID)
- FUNC1RC(Rect3, multimesh_get_aabb, RID)
+ FUNC1RC(AABB, multimesh_get_aabb, RID)
FUNC2RC(Transform, multimesh_instance_get_transform, RID, int)
FUNC2RC(Transform2D, multimesh_instance_get_transform_2d, RID, int)
@@ -260,8 +260,8 @@ public:
FUNCRID(gi_probe)
- FUNC2(gi_probe_set_bounds, RID, const Rect3 &)
- FUNC1RC(Rect3, gi_probe_get_bounds, RID)
+ FUNC2(gi_probe_set_bounds, RID, const AABB &)
+ FUNC1RC(AABB, gi_probe_get_bounds, RID)
FUNC2(gi_probe_set_cell_size, RID, float)
FUNC1RC(float, gi_probe_get_cell_size, RID)
@@ -304,7 +304,7 @@ public:
FUNC2(particles_set_pre_process_time, RID, float)
FUNC2(particles_set_explosiveness_ratio, RID, float)
FUNC2(particles_set_randomness_ratio, RID, float)
- FUNC2(particles_set_custom_aabb, RID, const Rect3 &)
+ FUNC2(particles_set_custom_aabb, RID, const AABB &)
FUNC2(particles_set_speed_scale, RID, float)
FUNC2(particles_set_use_local_coordinates, RID, bool)
FUNC2(particles_set_process_material, RID, RID)
@@ -318,7 +318,7 @@ public:
FUNC3(particles_set_draw_pass_mesh, RID, int, RID)
FUNC2(particles_set_emission_transform, RID, const Transform &)
- FUNC1R(Rect3, particles_get_current_aabb, RID)
+ FUNC1R(AABB, particles_get_current_aabb, RID)
/* CAMERA API */
@@ -431,7 +431,7 @@ public:
FUNC2(instance_set_extra_visibility_margin, RID, real_t)
// don't use these in a game!
- FUNC2RC(Vector<ObjectID>, instances_cull_aabb, const Rect3 &, RID)
+ FUNC2RC(Vector<ObjectID>, instances_cull_aabb, const AABB &, RID)
FUNC3RC(Vector<ObjectID>, instances_cull_ray, const Vector3 &, const Vector3 &, RID)
FUNC2RC(Vector<ObjectID>, instances_cull_convex, const Vector<Plane> &, RID)