diff options
Diffstat (limited to 'scene/resources')
-rw-r--r-- | scene/resources/height_map_shape_3d.cpp (renamed from scene/resources/height_map_shape.cpp) | 38 | ||||
-rw-r--r-- | scene/resources/height_map_shape_3d.h (renamed from scene/resources/height_map_shape.h) | 8 | ||||
-rw-r--r-- | scene/resources/ray_shape_3d.cpp (renamed from scene/resources/ray_shape.cpp) | 4 | ||||
-rw-r--r-- | scene/resources/ray_shape_3d.h (renamed from scene/resources/ray_shape.h) | 2 | ||||
-rw-r--r-- | scene/resources/style_box.cpp | 3 | ||||
-rw-r--r-- | scene/resources/tile_set.h | 2 | ||||
-rw-r--r-- | scene/resources/world_3d.cpp (renamed from scene/resources/world.cpp) | 64 | ||||
-rw-r--r-- | scene/resources/world_3d.h (renamed from scene/resources/world.h) | 17 |
8 files changed, 69 insertions, 69 deletions
diff --git a/scene/resources/height_map_shape.cpp b/scene/resources/height_map_shape_3d.cpp index 34f5ed8558..85c081238d 100644 --- a/scene/resources/height_map_shape.cpp +++ b/scene/resources/height_map_shape_3d.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* height_map_shape.cpp */ +/* height_map_shape_3d.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -28,10 +28,10 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include "height_map_shape.h" +#include "height_map_shape_3d.h" #include "servers/physics_server.h" -Vector<Vector3> HeightMapShape::get_debug_mesh_lines() { +Vector<Vector3> HeightMapShape3D::get_debug_mesh_lines() { Vector<Vector3> points; if ((map_width != 0) && (map_depth != 0)) { @@ -76,11 +76,11 @@ Vector<Vector3> HeightMapShape::get_debug_mesh_lines() { return points; } -real_t HeightMapShape::get_enclosing_radius() const { +real_t HeightMapShape3D::get_enclosing_radius() const { return Vector3(real_t(map_width), max_height - min_height, real_t(map_depth)).length(); } -void HeightMapShape::_update_shape() { +void HeightMapShape3D::_update_shape() { Dictionary d; d["width"] = map_width; @@ -92,7 +92,7 @@ void HeightMapShape::_update_shape() { Shape3D::_update_shape(); } -void HeightMapShape::set_map_width(int p_new) { +void HeightMapShape3D::set_map_width(int p_new) { if (p_new < 1) { // ignore } else if (map_width != p_new) { @@ -114,11 +114,11 @@ void HeightMapShape::set_map_width(int p_new) { } } -int HeightMapShape::get_map_width() const { +int HeightMapShape3D::get_map_width() const { return map_width; } -void HeightMapShape::set_map_depth(int p_new) { +void HeightMapShape3D::set_map_depth(int p_new) { if (p_new < 1) { // ignore } else if (map_depth != p_new) { @@ -140,11 +140,11 @@ void HeightMapShape::set_map_depth(int p_new) { } } -int HeightMapShape::get_map_depth() const { +int HeightMapShape3D::get_map_depth() const { return map_depth; } -void HeightMapShape::set_map_data(PackedFloat32Array p_new) { +void HeightMapShape3D::set_map_data(PackedFloat32Array p_new) { int size = (map_width * map_depth); if (p_new.size() != size) { // fail @@ -174,24 +174,24 @@ void HeightMapShape::set_map_data(PackedFloat32Array p_new) { _change_notify("map_data"); } -PackedFloat32Array HeightMapShape::get_map_data() const { +PackedFloat32Array HeightMapShape3D::get_map_data() const { return map_data; } -void HeightMapShape::_bind_methods() { - ClassDB::bind_method(D_METHOD("set_map_width", "width"), &HeightMapShape::set_map_width); - ClassDB::bind_method(D_METHOD("get_map_width"), &HeightMapShape::get_map_width); - ClassDB::bind_method(D_METHOD("set_map_depth", "height"), &HeightMapShape::set_map_depth); - ClassDB::bind_method(D_METHOD("get_map_depth"), &HeightMapShape::get_map_depth); - ClassDB::bind_method(D_METHOD("set_map_data", "data"), &HeightMapShape::set_map_data); - ClassDB::bind_method(D_METHOD("get_map_data"), &HeightMapShape::get_map_data); +void HeightMapShape3D::_bind_methods() { + ClassDB::bind_method(D_METHOD("set_map_width", "width"), &HeightMapShape3D::set_map_width); + ClassDB::bind_method(D_METHOD("get_map_width"), &HeightMapShape3D::get_map_width); + ClassDB::bind_method(D_METHOD("set_map_depth", "height"), &HeightMapShape3D::set_map_depth); + ClassDB::bind_method(D_METHOD("get_map_depth"), &HeightMapShape3D::get_map_depth); + ClassDB::bind_method(D_METHOD("set_map_data", "data"), &HeightMapShape3D::set_map_data); + ClassDB::bind_method(D_METHOD("get_map_data"), &HeightMapShape3D::get_map_data); ADD_PROPERTY(PropertyInfo(Variant::INT, "map_width", PROPERTY_HINT_RANGE, "1,4096,1"), "set_map_width", "get_map_width"); ADD_PROPERTY(PropertyInfo(Variant::INT, "map_depth", PROPERTY_HINT_RANGE, "1,4096,1"), "set_map_depth", "get_map_depth"); ADD_PROPERTY(PropertyInfo(Variant::PACKED_FLOAT32_ARRAY, "map_data"), "set_map_data", "get_map_data"); } -HeightMapShape::HeightMapShape() : +HeightMapShape3D::HeightMapShape3D() : Shape3D(PhysicsServer::get_singleton()->shape_create(PhysicsServer::SHAPE_HEIGHTMAP)) { map_width = 2; diff --git a/scene/resources/height_map_shape.h b/scene/resources/height_map_shape_3d.h index e740388a02..291d41a34e 100644 --- a/scene/resources/height_map_shape.h +++ b/scene/resources/height_map_shape_3d.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* height_map_shape.h */ +/* height_map_shape_3d.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -33,8 +33,8 @@ #include "scene/resources/shape_3d.h" -class HeightMapShape : public Shape3D { - GDCLASS(HeightMapShape, Shape3D); +class HeightMapShape3D : public Shape3D { + GDCLASS(HeightMapShape3D, Shape3D); int map_width; int map_depth; @@ -57,7 +57,7 @@ public: virtual Vector<Vector3> get_debug_mesh_lines(); virtual real_t get_enclosing_radius() const; - HeightMapShape(); + HeightMapShape3D(); }; #endif /* !HEIGHT_MAP_SHAPE_H */ diff --git a/scene/resources/ray_shape.cpp b/scene/resources/ray_shape_3d.cpp index f4f8eff1bd..ad927afd58 100644 --- a/scene/resources/ray_shape.cpp +++ b/scene/resources/ray_shape_3d.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* ray_shape.cpp */ +/* ray_shape_3d.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -28,7 +28,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include "ray_shape.h" +#include "ray_shape_3d.h" #include "servers/physics_server.h" diff --git a/scene/resources/ray_shape.h b/scene/resources/ray_shape_3d.h index 1d8c482c93..83bb71cca3 100644 --- a/scene/resources/ray_shape.h +++ b/scene/resources/ray_shape_3d.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* ray_shape.h */ +/* ray_shape_3d.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/scene/resources/style_box.cpp b/scene/resources/style_box.cpp index 119cbcd098..0cd2bed71d 100644 --- a/scene/resources/style_box.cpp +++ b/scene/resources/style_box.cpp @@ -29,7 +29,8 @@ /*************************************************************************/ #include "style_box.h" -#include "scene/2d/canvas_item.h" + +#include "scene/main/canvas_item.h" #include <limits.h> diff --git a/scene/resources/tile_set.h b/scene/resources/tile_set.h index 3c964ec667..5252c560a4 100644 --- a/scene/resources/tile_set.h +++ b/scene/resources/tile_set.h @@ -34,7 +34,7 @@ #include "core/array.h" #include "core/resource.h" #include "scene/2d/light_occluder_2d.h" -#include "scene/2d/navigation_polygon.h" +#include "scene/2d/navigation_region_2d.h" #include "scene/resources/convex_polygon_shape_2d.h" #include "scene/resources/shape_2d.h" #include "scene/resources/texture.h" diff --git a/scene/resources/world.cpp b/scene/resources/world_3d.cpp index 43903db277..0a687af803 100644 --- a/scene/resources/world.cpp +++ b/scene/resources/world_3d.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* world.cpp */ +/* world_3d.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -28,7 +28,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include "world.h" +#include "world_3d.h" #include "core/math/camera_matrix.h" #include "core/math/octree.h" @@ -210,65 +210,65 @@ struct SpatialIndexer { } }; -void World::_register_camera(Camera3D *p_camera) { +void World3D::_register_camera(Camera3D *p_camera) { #ifndef _3D_DISABLED indexer->_add_camera(p_camera); #endif } -void World::_update_camera(Camera3D *p_camera) { +void World3D::_update_camera(Camera3D *p_camera) { #ifndef _3D_DISABLED indexer->_update_camera(p_camera); #endif } -void World::_remove_camera(Camera3D *p_camera) { +void World3D::_remove_camera(Camera3D *p_camera) { #ifndef _3D_DISABLED indexer->_remove_camera(p_camera); #endif } -void World::_register_notifier(VisibilityNotifier3D *p_notifier, const AABB &p_rect) { +void World3D::_register_notifier(VisibilityNotifier3D *p_notifier, const AABB &p_rect) { #ifndef _3D_DISABLED indexer->_notifier_add(p_notifier, p_rect); #endif } -void World::_update_notifier(VisibilityNotifier3D *p_notifier, const AABB &p_rect) { +void World3D::_update_notifier(VisibilityNotifier3D *p_notifier, const AABB &p_rect) { #ifndef _3D_DISABLED indexer->_notifier_update(p_notifier, p_rect); #endif } -void World::_remove_notifier(VisibilityNotifier3D *p_notifier) { +void World3D::_remove_notifier(VisibilityNotifier3D *p_notifier) { #ifndef _3D_DISABLED indexer->_notifier_remove(p_notifier); #endif } -void World::_update(uint64_t p_frame) { +void World3D::_update(uint64_t p_frame) { #ifndef _3D_DISABLED indexer->_update(p_frame); #endif } -RID World::get_space() const { +RID World3D::get_space() const { return space; } -RID World::get_scenario() const { +RID World3D::get_scenario() const { return scenario; } -void World::set_environment(const Ref<Environment> &p_environment) { +void World3D::set_environment(const Ref<Environment> &p_environment) { if (environment == p_environment) { return; } @@ -282,12 +282,12 @@ void World::set_environment(const Ref<Environment> &p_environment) { emit_changed(); } -Ref<Environment> World::get_environment() const { +Ref<Environment> World3D::get_environment() const { return environment; } -void World::set_fallback_environment(const Ref<Environment> &p_environment) { +void World3D::set_fallback_environment(const Ref<Environment> &p_environment) { if (fallback_environment == p_environment) { return; } @@ -301,12 +301,12 @@ void World::set_fallback_environment(const Ref<Environment> &p_environment) { emit_changed(); } -Ref<Environment> World::get_fallback_environment() const { +Ref<Environment> World3D::get_fallback_environment() const { return fallback_environment; } -void World::set_camera_effects(const Ref<CameraEffects> &p_camera_effects) { +void World3D::set_camera_effects(const Ref<CameraEffects> &p_camera_effects) { camera_effects = p_camera_effects; if (camera_effects.is_valid()) @@ -315,34 +315,34 @@ void World::set_camera_effects(const Ref<CameraEffects> &p_camera_effects) { VS::get_singleton()->scenario_set_camera_effects(scenario, RID()); } -Ref<CameraEffects> World::get_camera_effects() const { +Ref<CameraEffects> World3D::get_camera_effects() const { return camera_effects; } -PhysicsDirectSpaceState *World::get_direct_space_state() { +PhysicsDirectSpaceState *World3D::get_direct_space_state() { return PhysicsServer::get_singleton()->space_get_direct_state(space); } -void World::get_camera_list(List<Camera3D *> *r_cameras) { +void World3D::get_camera_list(List<Camera3D *> *r_cameras) { for (Map<Camera3D *, SpatialIndexer::CameraData>::Element *E = indexer->cameras.front(); E; E = E->next()) { r_cameras->push_back(E->key()); } } -void World::_bind_methods() { - - ClassDB::bind_method(D_METHOD("get_space"), &World::get_space); - ClassDB::bind_method(D_METHOD("get_scenario"), &World::get_scenario); - ClassDB::bind_method(D_METHOD("set_environment", "env"), &World::set_environment); - ClassDB::bind_method(D_METHOD("get_environment"), &World::get_environment); - ClassDB::bind_method(D_METHOD("set_fallback_environment", "env"), &World::set_fallback_environment); - ClassDB::bind_method(D_METHOD("get_fallback_environment"), &World::get_fallback_environment); - ClassDB::bind_method(D_METHOD("set_camera_effects", "env"), &World::set_camera_effects); - ClassDB::bind_method(D_METHOD("get_camera_effects"), &World::get_camera_effects); - ClassDB::bind_method(D_METHOD("get_direct_space_state"), &World::get_direct_space_state); +void World3D::_bind_methods() { + + ClassDB::bind_method(D_METHOD("get_space"), &World3D::get_space); + ClassDB::bind_method(D_METHOD("get_scenario"), &World3D::get_scenario); + ClassDB::bind_method(D_METHOD("set_environment", "env"), &World3D::set_environment); + ClassDB::bind_method(D_METHOD("get_environment"), &World3D::get_environment); + ClassDB::bind_method(D_METHOD("set_fallback_environment", "env"), &World3D::set_fallback_environment); + ClassDB::bind_method(D_METHOD("get_fallback_environment"), &World3D::get_fallback_environment); + ClassDB::bind_method(D_METHOD("set_camera_effects", "env"), &World3D::set_camera_effects); + ClassDB::bind_method(D_METHOD("get_camera_effects"), &World3D::get_camera_effects); + ClassDB::bind_method(D_METHOD("get_direct_space_state"), &World3D::get_direct_space_state); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "environment", PROPERTY_HINT_RESOURCE_TYPE, "Environment"), "set_environment", "get_environment"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "fallback_environment", PROPERTY_HINT_RESOURCE_TYPE, "Environment"), "set_fallback_environment", "get_fallback_environment"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "camera_effects", PROPERTY_HINT_RESOURCE_TYPE, "CameraEffects"), "set_camera_effects", "get_camera_effects"); @@ -351,7 +351,7 @@ void World::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "direct_space_state", PROPERTY_HINT_RESOURCE_TYPE, "PhysicsDirectSpaceState", 0), "", "get_direct_space_state"); } -World::World() { +World3D::World3D() { space = PhysicsServer::get_singleton()->space_create(); scenario = VisualServer::get_singleton()->scenario_create(); @@ -371,7 +371,7 @@ World::World() { #endif } -World::~World() { +World3D::~World3D() { PhysicsServer::get_singleton()->free(space); VisualServer::get_singleton()->free(scenario); diff --git a/scene/resources/world.h b/scene/resources/world_3d.h index 8132a018d2..4c18ba9cea 100644 --- a/scene/resources/world.h +++ b/scene/resources/world_3d.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* world.h */ +/* world_3d.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -28,8 +28,8 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#ifndef WORLD_H -#define WORLD_H +#ifndef WORLD_3D_H +#define WORLD_3D_H #include "core/resource.h" #include "scene/resources/environment.h" @@ -40,9 +40,8 @@ class Camera3D; class VisibilityNotifier3D; struct SpatialIndexer; -class World : public Resource { - GDCLASS(World, Resource); - RES_BASE_EXTENSION("world"); +class World3D : public Resource { + GDCLASS(World3D, Resource); private: RID space; @@ -85,8 +84,8 @@ public: PhysicsDirectSpaceState *get_direct_space_state(); - World(); - ~World(); + World3D(); + ~World3D(); }; -#endif // WORLD_H +#endif // WORLD_3D_H |