summaryrefslogtreecommitdiff
path: root/servers
diff options
context:
space:
mode:
Diffstat (limited to 'servers')
-rw-r--r--servers/arvr_server.cpp6
-rw-r--r--servers/physics_2d/collision_object_2d_sw.h45
-rw-r--r--servers/register_server_types.cpp8
-rw-r--r--servers/visual_server.cpp1
4 files changed, 48 insertions, 12 deletions
diff --git a/servers/arvr_server.cpp b/servers/arvr_server.cpp
index aa879f8aed..4dfc40e9e4 100644
--- a/servers/arvr_server.cpp
+++ b/servers/arvr_server.cpp
@@ -53,10 +53,10 @@ void ARVRServer::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_tracker_count"), &ARVRServer::get_tracker_count);
ClassDB::bind_method(D_METHOD("get_tracker", "idx"), &ARVRServer::get_tracker);
- ClassDB::bind_method(D_METHOD("set_primary_interface"), &ARVRServer::set_primary_interface);
+ ClassDB::bind_method(D_METHOD("set_primary_interface", "interface"), &ARVRServer::set_primary_interface);
- ClassDB::bind_method(D_METHOD("add_interface"), &ARVRServer::add_interface);
- ClassDB::bind_method(D_METHOD("remove_interface"), &ARVRServer::remove_interface);
+ ClassDB::bind_method(D_METHOD("add_interface", "interface"), &ARVRServer::add_interface);
+ ClassDB::bind_method(D_METHOD("remove_interface", "interface"), &ARVRServer::remove_interface);
BIND_ENUM_CONSTANT(TRACKER_CONTROLLER);
BIND_ENUM_CONSTANT(TRACKER_BASESTATION);
diff --git a/servers/physics_2d/collision_object_2d_sw.h b/servers/physics_2d/collision_object_2d_sw.h
index db1270633f..627ba8ea15 100644
--- a/servers/physics_2d/collision_object_2d_sw.h
+++ b/servers/physics_2d/collision_object_2d_sw.h
@@ -110,21 +110,48 @@ public:
void set_shape_metadata(int p_index, const Variant &p_metadata);
_FORCE_INLINE_ int get_shape_count() const { return shapes.size(); }
- _FORCE_INLINE_ Shape2DSW *get_shape(int p_index) const { return shapes[p_index].shape; }
- _FORCE_INLINE_ const Transform2D &get_shape_transform(int p_index) const { return shapes[p_index].xform; }
- _FORCE_INLINE_ const Transform2D &get_shape_inv_transform(int p_index) const { return shapes[p_index].xform_inv; }
- _FORCE_INLINE_ const Rect2 &get_shape_aabb(int p_index) const { return shapes[p_index].aabb_cache; }
- _FORCE_INLINE_ const Variant &get_shape_metadata(int p_index) const { return shapes[p_index].metadata; }
+ _FORCE_INLINE_ Shape2DSW *get_shape(int p_index) const {
+ ERR_FAIL_INDEX_V(p_index, shapes.size(), NULL);
+ return shapes[p_index].shape;
+ }
+ _FORCE_INLINE_ const Transform2D &get_shape_transform(int p_index) const {
+ ERR_FAIL_INDEX_V(p_index, shapes.size(), Transform2D());
+ return shapes[p_index].xform;
+ }
+ _FORCE_INLINE_ const Transform2D &get_shape_inv_transform(int p_index) const {
+ ERR_FAIL_INDEX_V(p_index, shapes.size(), Transform2D());
+ return shapes[p_index].xform_inv;
+ }
+ _FORCE_INLINE_ const Rect2 &get_shape_aabb(int p_index) const {
+ ERR_FAIL_INDEX_V(p_index, shapes.size(), Rect2());
+ return shapes[p_index].aabb_cache;
+ }
+ _FORCE_INLINE_ const Variant &get_shape_metadata(int p_index) const {
+ ERR_FAIL_INDEX_V(p_index, shapes.size(), Variant());
+ return shapes[p_index].metadata;
+ }
_FORCE_INLINE_ Transform2D get_transform() const { return transform; }
_FORCE_INLINE_ Transform2D get_inv_transform() const { return inv_transform; }
_FORCE_INLINE_ Space2DSW *get_space() const { return space; }
- _FORCE_INLINE_ void set_shape_as_disabled(int p_idx, bool p_disabled) { shapes[p_idx].disabled = p_disabled; }
- _FORCE_INLINE_ bool is_shape_set_as_disabled(int p_idx) const { return shapes[p_idx].disabled; }
+ _FORCE_INLINE_ void set_shape_as_disabled(int p_idx, bool p_disabled) {
+ ERR_FAIL_INDEX(p_idx, shapes.size());
+ shapes[p_idx].disabled = p_disabled;
+ }
+ _FORCE_INLINE_ bool is_shape_set_as_disabled(int p_idx) const {
+ ERR_FAIL_INDEX_V(p_idx, shapes.size(), false);
+ return shapes[p_idx].disabled;
+ }
- _FORCE_INLINE_ void set_shape_as_one_way_collision(int p_idx, bool p_one_way_collision) { shapes[p_idx].one_way_collision = p_one_way_collision; }
- _FORCE_INLINE_ bool is_shape_set_as_one_way_collision(int p_idx) const { return shapes[p_idx].one_way_collision; }
+ _FORCE_INLINE_ void set_shape_as_one_way_collision(int p_idx, bool p_one_way_collision) {
+ ERR_FAIL_INDEX(p_idx, shapes.size());
+ shapes[p_idx].one_way_collision = p_one_way_collision;
+ }
+ _FORCE_INLINE_ bool is_shape_set_as_one_way_collision(int p_idx) const {
+ ERR_FAIL_INDEX_V(p_idx, shapes.size(), false);
+ return shapes[p_idx].one_way_collision;
+ }
void set_collision_mask(uint32_t p_mask) { collision_mask = p_mask; }
_FORCE_INLINE_ uint32_t get_collision_mask() const { return collision_mask; }
diff --git a/servers/register_server_types.cpp b/servers/register_server_types.cpp
index 845a3443b7..1aee2144aa 100644
--- a/servers/register_server_types.cpp
+++ b/servers/register_server_types.cpp
@@ -79,6 +79,12 @@ ARVRServer *arvr_server = NULL;
void register_server_types() {
arvr_server = memnew(ARVRServer);
+ ClassDB::register_virtual_class<VisualServer>();
+ ClassDB::register_class<AudioServer>();
+ ClassDB::register_virtual_class<PhysicsServer>();
+ ClassDB::register_virtual_class<Physics2DServer>();
+ ClassDB::register_class<ARVRServer>();
+
ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("VisualServer", VisualServer::get_singleton()));
ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("AudioServer", AudioServer::get_singleton()));
ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("PhysicsServer", PhysicsServer::get_singleton()));
@@ -95,6 +101,8 @@ void register_server_types() {
ClassDB::register_virtual_class<AudioStreamPlayback>();
ClassDB::register_class<AudioStreamRandomPitch>();
ClassDB::register_virtual_class<AudioEffect>();
+ ClassDB::register_class<AudioEffectEQ>();
+ ClassDB::register_class<AudioEffectFilter>();
ClassDB::register_class<AudioBusLayout>();
{
diff --git a/servers/visual_server.cpp b/servers/visual_server.cpp
index 47a5f4c7f3..2b34aa0e42 100644
--- a/servers/visual_server.cpp
+++ b/servers/visual_server.cpp
@@ -1445,6 +1445,7 @@ Array VisualServer::mesh_surface_get_blend_shape_arrays(RID p_mesh, int p_surfac
void VisualServer::_bind_methods() {
+ ClassDB::bind_method(D_METHOD("force_sync"), &VisualServer::sync);
ClassDB::bind_method(D_METHOD("force_draw"), &VisualServer::draw);
ClassDB::bind_method(D_METHOD("texture_create"), &VisualServer::texture_create);
ClassDB::bind_method(D_METHOD("texture_create_from_image", "image", "flags"), &VisualServer::texture_create_from_image, DEFVAL(TEXTURE_FLAGS_DEFAULT));