diff options
Diffstat (limited to 'scene/3d')
29 files changed, 97 insertions, 99 deletions
diff --git a/scene/3d/audio_stream_player_3d.cpp b/scene/3d/audio_stream_player_3d.cpp index 87ea018425..6abc2caac8 100644 --- a/scene/3d/audio_stream_player_3d.cpp +++ b/scene/3d/audio_stream_player_3d.cpp @@ -807,7 +807,7 @@ AudioStreamPlayer3D::DopplerTracking AudioStreamPlayer3D::get_doppler_tracking() void AudioStreamPlayer3D::_bind_methods() { - ClassDB::bind_method(D_METHOD("set_stream", "stream:AudioStream"), &AudioStreamPlayer3D::set_stream); + ClassDB::bind_method(D_METHOD("set_stream", "stream"), &AudioStreamPlayer3D::set_stream); ClassDB::bind_method(D_METHOD("get_stream"), &AudioStreamPlayer3D::get_stream); ClassDB::bind_method(D_METHOD("set_unit_db", "unit_db"), &AudioStreamPlayer3D::set_unit_db); diff --git a/scene/3d/camera.cpp b/scene/3d/camera.cpp index 697d91c863..3c5eb21d38 100644 --- a/scene/3d/camera.cpp +++ b/scene/3d/camera.cpp @@ -556,8 +556,8 @@ void Camera::_bind_methods() { ClassDB::bind_method(D_METHOD("get_v_offset"), &Camera::get_v_offset); ClassDB::bind_method(D_METHOD("set_cull_mask", "mask"), &Camera::set_cull_mask); ClassDB::bind_method(D_METHOD("get_cull_mask"), &Camera::get_cull_mask); - ClassDB::bind_method(D_METHOD("set_environment", "env:Environment"), &Camera::set_environment); - ClassDB::bind_method(D_METHOD("get_environment:Environment"), &Camera::get_environment); + ClassDB::bind_method(D_METHOD("set_environment", "env"), &Camera::set_environment); + ClassDB::bind_method(D_METHOD("get_environment"), &Camera::get_environment); ClassDB::bind_method(D_METHOD("set_keep_aspect_mode", "mode"), &Camera::set_keep_aspect_mode); ClassDB::bind_method(D_METHOD("get_keep_aspect_mode"), &Camera::get_keep_aspect_mode); ClassDB::bind_method(D_METHOD("set_doppler_tracking", "mode"), &Camera::set_doppler_tracking); diff --git a/scene/3d/camera.h b/scene/3d/camera.h index 43975892b4..70849791e5 100644 --- a/scene/3d/camera.h +++ b/scene/3d/camera.h @@ -126,9 +126,9 @@ public: virtual Transform get_camera_transform() const; - Vector3 project_ray_normal(const Point2 &p_point) const; - Vector3 project_ray_origin(const Point2 &p_point) const; - Vector3 project_local_ray_normal(const Point2 &p_point) const; + Vector3 project_ray_normal(const Point2 &p_pos) const; + Vector3 project_ray_origin(const Point2 &p_pos) const; + Vector3 project_local_ray_normal(const Point2 &p_pos) const; Point2 unproject_position(const Vector3 &p_pos) const; bool is_position_behind(const Vector3 &p_pos) const; Vector3 project_position(const Point2 &p_point) const; diff --git a/scene/3d/collision_object.cpp b/scene/3d/collision_object.cpp index 2686cd81df..1aba26673c 100644 --- a/scene/3d/collision_object.cpp +++ b/scene/3d/collision_object.cpp @@ -128,15 +128,15 @@ void CollisionObject::_bind_methods() { ClassDB::bind_method(D_METHOD("set_capture_input_on_drag", "enable"), &CollisionObject::set_capture_input_on_drag); ClassDB::bind_method(D_METHOD("get_capture_input_on_drag"), &CollisionObject::get_capture_input_on_drag); ClassDB::bind_method(D_METHOD("get_rid"), &CollisionObject::get_rid); - ClassDB::bind_method(D_METHOD("create_shape_owner", "owner:Object"), &CollisionObject::create_shape_owner); + ClassDB::bind_method(D_METHOD("create_shape_owner", "owner"), &CollisionObject::create_shape_owner); ClassDB::bind_method(D_METHOD("remove_shape_owner", "owner_id"), &CollisionObject::remove_shape_owner); ClassDB::bind_method(D_METHOD("get_shape_owners"), &CollisionObject::_get_shape_owners); - ClassDB::bind_method(D_METHOD("shape_owner_set_transform", "owner_id", "transform:Transform"), &CollisionObject::shape_owner_set_transform); + ClassDB::bind_method(D_METHOD("shape_owner_set_transform", "owner_id", "transform"), &CollisionObject::shape_owner_set_transform); ClassDB::bind_method(D_METHOD("shape_owner_get_transform", "owner_id"), &CollisionObject::shape_owner_get_transform); ClassDB::bind_method(D_METHOD("shape_owner_get_owner", "owner_id"), &CollisionObject::shape_owner_get_owner); ClassDB::bind_method(D_METHOD("shape_owner_set_disabled", "owner_id", "disabled"), &CollisionObject::shape_owner_set_disabled); ClassDB::bind_method(D_METHOD("is_shape_owner_disabled", "owner_id"), &CollisionObject::is_shape_owner_disabled); - ClassDB::bind_method(D_METHOD("shape_owner_add_shape", "owner_id", "shape:Shape"), &CollisionObject::shape_owner_add_shape); + ClassDB::bind_method(D_METHOD("shape_owner_add_shape", "owner_id", "shape"), &CollisionObject::shape_owner_add_shape); ClassDB::bind_method(D_METHOD("shape_owner_get_shape_count", "owner_id"), &CollisionObject::shape_owner_get_shape_count); ClassDB::bind_method(D_METHOD("shape_owner_get_shape", "owner_id", "shape_id"), &CollisionObject::shape_owner_get_shape); ClassDB::bind_method(D_METHOD("shape_owner_get_shape_index", "owner_id", "shape_id"), &CollisionObject::shape_owner_get_shape_index); diff --git a/scene/3d/collision_shape.cpp b/scene/3d/collision_shape.cpp index a7cfc6fef2..2aa6a95718 100644 --- a/scene/3d/collision_shape.cpp +++ b/scene/3d/collision_shape.cpp @@ -89,13 +89,6 @@ void CollisionShape::_notification(int p_what) { parent->shape_owner_set_transform(owner_id, get_transform()); } } break; - case NOTIFICATION_EXIT_TREE: { - if (parent) { - parent->remove_shape_owner(owner_id); - } - owner_id = 0; - parent = NULL; - } break; case NOTIFICATION_UNPARENTED: { if (parent) { parent->remove_shape_owner(owner_id); @@ -127,9 +120,9 @@ String CollisionShape::get_configuration_warning() const { void CollisionShape::_bind_methods() { //not sure if this should do anything - ClassDB::bind_method(D_METHOD("resource_changed", "resource:Resource"), &CollisionShape::resource_changed); - ClassDB::bind_method(D_METHOD("set_shape", "shape:Shape"), &CollisionShape::set_shape); - ClassDB::bind_method(D_METHOD("get_shape:Shape"), &CollisionShape::get_shape); + ClassDB::bind_method(D_METHOD("resource_changed", "resource"), &CollisionShape::resource_changed); + ClassDB::bind_method(D_METHOD("set_shape", "shape"), &CollisionShape::set_shape); + ClassDB::bind_method(D_METHOD("get_shape"), &CollisionShape::get_shape); ClassDB::bind_method(D_METHOD("set_disabled", "enable"), &CollisionShape::set_disabled); ClassDB::bind_method(D_METHOD("is_disabled"), &CollisionShape::is_disabled); ClassDB::bind_method(D_METHOD("make_convex_from_brothers"), &CollisionShape::make_convex_from_brothers); diff --git a/scene/3d/gi_probe.cpp b/scene/3d/gi_probe.cpp index 7aaf4a6e3d..2174f924ac 100644 --- a/scene/3d/gi_probe.cpp +++ b/scene/3d/gi_probe.cpp @@ -1443,8 +1443,8 @@ PoolVector<Face3> GIProbe::get_faces(uint32_t p_usage_flags) const { void GIProbe::_bind_methods() { - ClassDB::bind_method(D_METHOD("set_probe_data", "data:GIProbeData"), &GIProbe::set_probe_data); - ClassDB::bind_method(D_METHOD("get_probe_data:GIProbeData"), &GIProbe::get_probe_data); + ClassDB::bind_method(D_METHOD("set_probe_data", "data"), &GIProbe::set_probe_data); + ClassDB::bind_method(D_METHOD("get_probe_data"), &GIProbe::get_probe_data); ClassDB::bind_method(D_METHOD("set_subdiv", "subdiv"), &GIProbe::set_subdiv); ClassDB::bind_method(D_METHOD("get_subdiv"), &GIProbe::get_subdiv); @@ -1473,7 +1473,7 @@ void GIProbe::_bind_methods() { ClassDB::bind_method(D_METHOD("set_compress", "enable"), &GIProbe::set_compress); ClassDB::bind_method(D_METHOD("is_compressed"), &GIProbe::is_compressed); - ClassDB::bind_method(D_METHOD("bake", "from_node:Node", "create_visual_debug"), &GIProbe::bake, DEFVAL(Variant()), DEFVAL(false)); + ClassDB::bind_method(D_METHOD("bake", "from_node", "create_visual_debug"), &GIProbe::bake, DEFVAL(Variant()), DEFVAL(false)); ClassDB::bind_method(D_METHOD("debug_bake"), &GIProbe::_debug_bake); ClassDB::set_method_flags(get_class_static(), _scs_create("debug_bake"), METHOD_FLAGS_DEFAULT | METHOD_FLAG_EDITOR); diff --git a/scene/3d/immediate_geometry.cpp b/scene/3d/immediate_geometry.cpp index 128c8b44c3..060e088750 100644 --- a/scene/3d/immediate_geometry.cpp +++ b/scene/3d/immediate_geometry.cpp @@ -143,7 +143,7 @@ void ImmediateGeometry::add_sphere(int p_lats, int p_lons, float p_radius, bool void ImmediateGeometry::_bind_methods() { - ClassDB::bind_method(D_METHOD("begin", "primitive", "texture:Texture"), &ImmediateGeometry::begin, DEFVAL(Ref<Texture>())); + ClassDB::bind_method(D_METHOD("begin", "primitive", "texture"), &ImmediateGeometry::begin, DEFVAL(Ref<Texture>())); ClassDB::bind_method(D_METHOD("set_normal", "normal"), &ImmediateGeometry::set_normal); ClassDB::bind_method(D_METHOD("set_tangent", "tangent"), &ImmediateGeometry::set_tangent); ClassDB::bind_method(D_METHOD("set_color", "color"), &ImmediateGeometry::set_color); diff --git a/scene/3d/immediate_geometry.h b/scene/3d/immediate_geometry.h index 2eb4bf1e6b..bc8452c7e0 100644 --- a/scene/3d/immediate_geometry.h +++ b/scene/3d/immediate_geometry.h @@ -52,8 +52,8 @@ public: void set_normal(const Vector3 &p_normal); void set_tangent(const Plane &p_tangent); void set_color(const Color &p_color); - void set_uv(const Vector2 &tex_uv); - void set_uv2(const Vector2 &tex_uv); + void set_uv(const Vector2 &p_uv); + void set_uv2(const Vector2 &p_uv2); void add_vertex(const Vector3 &p_vertex); diff --git a/scene/3d/interpolated_camera.cpp b/scene/3d/interpolated_camera.cpp index 3855244787..36a6660bf9 100644 --- a/scene/3d/interpolated_camera.cpp +++ b/scene/3d/interpolated_camera.cpp @@ -132,7 +132,7 @@ void InterpolatedCamera::_bind_methods() { ClassDB::bind_method(D_METHOD("set_target_path", "target_path"), &InterpolatedCamera::set_target_path); ClassDB::bind_method(D_METHOD("get_target_path"), &InterpolatedCamera::get_target_path); - ClassDB::bind_method(D_METHOD("set_target", "target:Camera"), &InterpolatedCamera::_set_target); + ClassDB::bind_method(D_METHOD("set_target", "target"), &InterpolatedCamera::_set_target); ClassDB::bind_method(D_METHOD("set_speed", "speed"), &InterpolatedCamera::set_speed); ClassDB::bind_method(D_METHOD("get_speed"), &InterpolatedCamera::get_speed); diff --git a/scene/3d/mesh_instance.cpp b/scene/3d/mesh_instance.cpp index 51237c0bc3..da25afbf57 100644 --- a/scene/3d/mesh_instance.cpp +++ b/scene/3d/mesh_instance.cpp @@ -352,13 +352,13 @@ void MeshInstance::create_debug_tangents() { void MeshInstance::_bind_methods() { - ClassDB::bind_method(D_METHOD("set_mesh", "mesh:Mesh"), &MeshInstance::set_mesh); - ClassDB::bind_method(D_METHOD("get_mesh:Mesh"), &MeshInstance::get_mesh); - ClassDB::bind_method(D_METHOD("set_skeleton_path", "skeleton_path:NodePath"), &MeshInstance::set_skeleton_path); - ClassDB::bind_method(D_METHOD("get_skeleton_path:NodePath"), &MeshInstance::get_skeleton_path); + ClassDB::bind_method(D_METHOD("set_mesh", "mesh"), &MeshInstance::set_mesh); + ClassDB::bind_method(D_METHOD("get_mesh"), &MeshInstance::get_mesh); + ClassDB::bind_method(D_METHOD("set_skeleton_path", "skeleton_path"), &MeshInstance::set_skeleton_path); + ClassDB::bind_method(D_METHOD("get_skeleton_path"), &MeshInstance::get_skeleton_path); - ClassDB::bind_method(D_METHOD("set_surface_material", "surface", "material:Material"), &MeshInstance::set_surface_material); - ClassDB::bind_method(D_METHOD("get_surface_material:Material", "surface"), &MeshInstance::get_surface_material); + ClassDB::bind_method(D_METHOD("set_surface_material", "surface", "material"), &MeshInstance::set_surface_material); + ClassDB::bind_method(D_METHOD("get_surface_material", "surface"), &MeshInstance::get_surface_material); ClassDB::bind_method(D_METHOD("create_trimesh_collision"), &MeshInstance::create_trimesh_collision); ClassDB::set_method_flags("MeshInstance", "create_trimesh_collision", METHOD_FLAGS_DEFAULT); diff --git a/scene/3d/multimesh_instance.cpp b/scene/3d/multimesh_instance.cpp index b4558698cc..b51953f27c 100644 --- a/scene/3d/multimesh_instance.cpp +++ b/scene/3d/multimesh_instance.cpp @@ -31,8 +31,8 @@ void MultiMeshInstance::_bind_methods() { - ClassDB::bind_method(D_METHOD("set_multimesh", "multimesh:MultiMesh"), &MultiMeshInstance::set_multimesh); - ClassDB::bind_method(D_METHOD("get_multimesh:MultiMesh"), &MultiMeshInstance::get_multimesh); + ClassDB::bind_method(D_METHOD("set_multimesh", "multimesh"), &MultiMeshInstance::set_multimesh); + ClassDB::bind_method(D_METHOD("get_multimesh"), &MultiMeshInstance::get_multimesh); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "multimesh", PROPERTY_HINT_RESOURCE_TYPE, "MultiMesh"), "set_multimesh", "get_multimesh"); } diff --git a/scene/3d/navigation.cpp b/scene/3d/navigation.cpp index de6b242bfe..a1183326d7 100644 --- a/scene/3d/navigation.cpp +++ b/scene/3d/navigation.cpp @@ -690,7 +690,7 @@ Vector3 Navigation::get_up_vector() const { void Navigation::_bind_methods() { - ClassDB::bind_method(D_METHOD("navmesh_create", "mesh:NavigationMesh", "xform", "owner"), &Navigation::navmesh_create, DEFVAL(Variant())); + ClassDB::bind_method(D_METHOD("navmesh_create", "mesh", "xform", "owner"), &Navigation::navmesh_create, DEFVAL(Variant())); ClassDB::bind_method(D_METHOD("navmesh_set_transform", "id", "xform"), &Navigation::navmesh_set_transform); ClassDB::bind_method(D_METHOD("navmesh_remove", "id"), &Navigation::navmesh_remove); diff --git a/scene/3d/navigation.h b/scene/3d/navigation.h index 53e0b6399a..80699fce72 100644 --- a/scene/3d/navigation.h +++ b/scene/3d/navigation.h @@ -58,9 +58,9 @@ class Navigation : public Spatial { return (a.key == p_key.a.key) ? (b.key < p_key.b.key) : (a.key < p_key.a.key); }; - EdgeKey(const Point &p_a = Point(), const Point &p_b = Point()) { - a = p_a; - b = p_b; + EdgeKey(const Point &p_a = Point(), const Point &p_b = Point()) + : a(p_a), + b(p_b) { if (a.key > b.key) { SWAP(a, b); } diff --git a/scene/3d/navigation_mesh.cpp b/scene/3d/navigation_mesh.cpp index 7392998d57..5d4568f5d3 100644 --- a/scene/3d/navigation_mesh.cpp +++ b/scene/3d/navigation_mesh.cpp @@ -208,6 +208,8 @@ void NavigationMesh::_bind_methods() { ClassDB::bind_method(D_METHOD("get_polygon", "idx"), &NavigationMesh::get_polygon); ClassDB::bind_method(D_METHOD("clear_polygons"), &NavigationMesh::clear_polygons); + ClassDB::bind_method(D_METHOD("create_from_mesh", "mesh"), &NavigationMesh::create_from_mesh); + ClassDB::bind_method(D_METHOD("_set_polygons", "polygons"), &NavigationMesh::_set_polygons); ClassDB::bind_method(D_METHOD("_get_polygons"), &NavigationMesh::_get_polygons); @@ -374,8 +376,8 @@ String NavigationMeshInstance::get_configuration_warning() const { void NavigationMeshInstance::_bind_methods() { - ClassDB::bind_method(D_METHOD("set_navigation_mesh", "navmesh:NavigationMesh"), &NavigationMeshInstance::set_navigation_mesh); - ClassDB::bind_method(D_METHOD("get_navigation_mesh:NavigationMesh"), &NavigationMeshInstance::get_navigation_mesh); + ClassDB::bind_method(D_METHOD("set_navigation_mesh", "navmesh"), &NavigationMeshInstance::set_navigation_mesh); + ClassDB::bind_method(D_METHOD("get_navigation_mesh"), &NavigationMeshInstance::get_navigation_mesh); ClassDB::bind_method(D_METHOD("set_enabled", "enabled"), &NavigationMeshInstance::set_enabled); ClassDB::bind_method(D_METHOD("is_enabled"), &NavigationMeshInstance::is_enabled); diff --git a/scene/3d/particles.cpp b/scene/3d/particles.cpp index bab23d013b..e88a52c76a 100644 --- a/scene/3d/particles.cpp +++ b/scene/3d/particles.cpp @@ -63,6 +63,8 @@ void Particles::set_one_shot(bool p_one_shot) { one_shot = p_one_shot; VS::get_singleton()->particles_set_one_shot(particles, one_shot); + if (!one_shot && emitting) + VisualServer::get_singleton()->particles_restart(particles); } void Particles::set_pre_process_time(float p_time) { @@ -291,7 +293,7 @@ void Particles::_bind_methods() { ClassDB::bind_method(D_METHOD("set_use_local_coordinates", "enable"), &Particles::set_use_local_coordinates); ClassDB::bind_method(D_METHOD("set_fixed_fps", "fps"), &Particles::set_fixed_fps); ClassDB::bind_method(D_METHOD("set_fractional_delta", "enable"), &Particles::set_fractional_delta); - ClassDB::bind_method(D_METHOD("set_process_material", "material:Material"), &Particles::set_process_material); + ClassDB::bind_method(D_METHOD("set_process_material", "material"), &Particles::set_process_material); ClassDB::bind_method(D_METHOD("set_speed_scale", "scale"), &Particles::set_speed_scale); ClassDB::bind_method(D_METHOD("is_emitting"), &Particles::is_emitting); @@ -305,7 +307,7 @@ void Particles::_bind_methods() { ClassDB::bind_method(D_METHOD("get_use_local_coordinates"), &Particles::get_use_local_coordinates); ClassDB::bind_method(D_METHOD("get_fixed_fps"), &Particles::get_fixed_fps); ClassDB::bind_method(D_METHOD("get_fractional_delta"), &Particles::get_fractional_delta); - ClassDB::bind_method(D_METHOD("get_process_material:Material"), &Particles::get_process_material); + ClassDB::bind_method(D_METHOD("get_process_material"), &Particles::get_process_material); ClassDB::bind_method(D_METHOD("get_speed_scale"), &Particles::get_speed_scale); ClassDB::bind_method(D_METHOD("set_draw_order", "order"), &Particles::set_draw_order); @@ -313,10 +315,10 @@ void Particles::_bind_methods() { ClassDB::bind_method(D_METHOD("get_draw_order"), &Particles::get_draw_order); ClassDB::bind_method(D_METHOD("set_draw_passes", "passes"), &Particles::set_draw_passes); - ClassDB::bind_method(D_METHOD("set_draw_pass_mesh", "pass", "mesh:Mesh"), &Particles::set_draw_pass_mesh); + ClassDB::bind_method(D_METHOD("set_draw_pass_mesh", "pass", "mesh"), &Particles::set_draw_pass_mesh); ClassDB::bind_method(D_METHOD("get_draw_passes"), &Particles::get_draw_passes); - ClassDB::bind_method(D_METHOD("get_draw_pass_mesh:Mesh", "pass"), &Particles::get_draw_pass_mesh); + ClassDB::bind_method(D_METHOD("get_draw_pass_mesh", "pass"), &Particles::get_draw_pass_mesh); ClassDB::bind_method(D_METHOD("restart"), &Particles::restart); ClassDB::bind_method(D_METHOD("capture_aabb"), &Particles::capture_aabb); @@ -406,7 +408,7 @@ void ParticlesMaterial::init_shaders() { shader_names->anim_speed = "anim_speed"; shader_names->anim_offset = "anim_offset"; - shader_names->initial_linear_velocity = "initial_linear_velocity_random"; + shader_names->initial_linear_velocity_random = "initial_linear_velocity_random"; shader_names->initial_angle_random = "initial_angle_random"; shader_names->angular_velocity_random = "angular_velocity_random"; shader_names->orbit_velocity_random = "orbit_velocity_random"; @@ -753,18 +755,20 @@ void ParticlesMaterial::_update_shader() { code += " pos.z=0.0; \n"; } code += " //apply linear acceleration\n"; - code += " force+=normalize(VELOCITY) * (linear_accel+tex_linear_accel)*mix(1.0,rand_from_seed(alt_seed),linear_accel_random);\n"; + code += " force+= length(VELOCITY) > 0.0 ? normalize(VELOCITY) * (linear_accel+tex_linear_accel)*mix(1.0,rand_from_seed(alt_seed),linear_accel_random) : vec3(0.0);\n"; code += " //apply radial acceleration\n"; code += " vec3 org = vec3(0.0);\n"; - code += " // if (!p_system->local_coordinates)\n"; - code += " //org=p_transform.origin;\n"; - code += " force+=normalize(pos-org) * (radial_accel+tex_radial_accel)*mix(1.0,rand_from_seed(alt_seed),radial_accel_random);\n"; + code += " // if (!p_system->local_coordinates)\n"; + code += " //org=p_transform.origin;\n"; + code += " vec3 diff = pos-org;\n"; + code += " force+=length(diff) > 0.0 ? normalize(diff) * (radial_accel+tex_radial_accel)*mix(1.0,rand_from_seed(alt_seed),radial_accel_random) : vec3(0.0);\n"; code += " //apply tangential acceleration;\n"; if (flags[FLAG_DISABLE_Z]) { - code += " force+=vec3(normalize((pos-org).yx * vec2(-1.0,1.0)),0.0) * ((tangent_accel+tex_tangent_accel)*mix(1.0,rand_from_seed(alt_seed),radial_accel_random));\n"; + code += " force+=length(diff.yx) > 0.0 ? vec3(normalize(diff.yx * vec2(-1.0,1.0)),0.0) * ((tangent_accel+tex_tangent_accel)*mix(1.0,rand_from_seed(alt_seed),radial_accel_random)) : vec3(0.0);\n"; } else { - code += " force+=normalize(cross(normalize(pos-org),normalize(gravity))) * ((tangent_accel+tex_tangent_accel)*mix(1.0,rand_from_seed(alt_seed),radial_accel_random));\n"; + code += " vec3 crossDiff = cross(normalize(diff),normalize(gravity));\n"; + code += " force+=length(crossDiff) > 0.0 ? normalize(crossDiff) * ((tangent_accel+tex_tangent_accel)*mix(1.0,rand_from_seed(alt_seed),radial_accel_random)) : vec3(0.0);\n"; } code += " //apply attractor forces\n"; code += " VELOCITY+=force * DELTA;\n"; @@ -1264,9 +1268,8 @@ int ParticlesMaterial::get_emission_point_count() const { void ParticlesMaterial::set_trail_divisor(int p_divisor) { - VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->trail_divisor, p_divisor); trail_divisor = p_divisor; - _change_notify(); + VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->trail_divisor, p_divisor); } int ParticlesMaterial::get_trail_divisor() const { @@ -1372,8 +1375,8 @@ void ParticlesMaterial::_bind_methods() { ClassDB::bind_method(D_METHOD("set_color", "color"), &ParticlesMaterial::set_color); ClassDB::bind_method(D_METHOD("get_color"), &ParticlesMaterial::get_color); - ClassDB::bind_method(D_METHOD("set_color_ramp", "ramp:Texture"), &ParticlesMaterial::set_color_ramp); - ClassDB::bind_method(D_METHOD("get_color_ramp:Texture"), &ParticlesMaterial::get_color_ramp); + ClassDB::bind_method(D_METHOD("set_color_ramp", "ramp"), &ParticlesMaterial::set_color_ramp); + ClassDB::bind_method(D_METHOD("get_color_ramp"), &ParticlesMaterial::get_color_ramp); ClassDB::bind_method(D_METHOD("set_flag", "flag", "enable"), &ParticlesMaterial::set_flag); ClassDB::bind_method(D_METHOD("get_flag", "flag"), &ParticlesMaterial::get_flag); @@ -1387,14 +1390,14 @@ void ParticlesMaterial::_bind_methods() { ClassDB::bind_method(D_METHOD("set_emission_box_extents", "extents"), &ParticlesMaterial::set_emission_box_extents); ClassDB::bind_method(D_METHOD("get_emission_box_extents"), &ParticlesMaterial::get_emission_box_extents); - ClassDB::bind_method(D_METHOD("set_emission_point_texture", "texture:Texture"), &ParticlesMaterial::set_emission_point_texture); - ClassDB::bind_method(D_METHOD("get_emission_point_texture:Texture"), &ParticlesMaterial::get_emission_point_texture); + ClassDB::bind_method(D_METHOD("set_emission_point_texture", "texture"), &ParticlesMaterial::set_emission_point_texture); + ClassDB::bind_method(D_METHOD("get_emission_point_texture"), &ParticlesMaterial::get_emission_point_texture); - ClassDB::bind_method(D_METHOD("set_emission_normal_texture", "texture:Texture"), &ParticlesMaterial::set_emission_normal_texture); - ClassDB::bind_method(D_METHOD("get_emission_normal_texture:Texture"), &ParticlesMaterial::get_emission_normal_texture); + ClassDB::bind_method(D_METHOD("set_emission_normal_texture", "texture"), &ParticlesMaterial::set_emission_normal_texture); + ClassDB::bind_method(D_METHOD("get_emission_normal_texture"), &ParticlesMaterial::get_emission_normal_texture); - ClassDB::bind_method(D_METHOD("set_emission_color_texture", "texture:Texture"), &ParticlesMaterial::set_emission_color_texture); - ClassDB::bind_method(D_METHOD("get_emission_color_texture:Texture"), &ParticlesMaterial::get_emission_color_texture); + ClassDB::bind_method(D_METHOD("set_emission_color_texture", "texture"), &ParticlesMaterial::set_emission_color_texture); + ClassDB::bind_method(D_METHOD("get_emission_color_texture"), &ParticlesMaterial::get_emission_color_texture); ClassDB::bind_method(D_METHOD("set_emission_point_count", "point_count"), &ParticlesMaterial::set_emission_point_count); ClassDB::bind_method(D_METHOD("get_emission_point_count"), &ParticlesMaterial::get_emission_point_count); @@ -1402,11 +1405,11 @@ void ParticlesMaterial::_bind_methods() { ClassDB::bind_method(D_METHOD("set_trail_divisor", "divisor"), &ParticlesMaterial::set_trail_divisor); ClassDB::bind_method(D_METHOD("get_trail_divisor"), &ParticlesMaterial::get_trail_divisor); - ClassDB::bind_method(D_METHOD("set_trail_size_modifier", "texture:CurveTexture"), &ParticlesMaterial::set_trail_size_modifier); - ClassDB::bind_method(D_METHOD("get_trail_size_modifier:CurveTexture"), &ParticlesMaterial::get_trail_size_modifier); + ClassDB::bind_method(D_METHOD("set_trail_size_modifier", "texture"), &ParticlesMaterial::set_trail_size_modifier); + ClassDB::bind_method(D_METHOD("get_trail_size_modifier"), &ParticlesMaterial::get_trail_size_modifier); - ClassDB::bind_method(D_METHOD("set_trail_color_modifier", "texture:GradientTexture"), &ParticlesMaterial::set_trail_color_modifier); - ClassDB::bind_method(D_METHOD("get_trail_color_modifier:GradientTexture"), &ParticlesMaterial::get_trail_color_modifier); + ClassDB::bind_method(D_METHOD("set_trail_color_modifier", "texture"), &ParticlesMaterial::set_trail_color_modifier); + ClassDB::bind_method(D_METHOD("get_trail_color_modifier"), &ParticlesMaterial::get_trail_color_modifier); ClassDB::bind_method(D_METHOD("get_gravity"), &ParticlesMaterial::get_gravity); ClassDB::bind_method(D_METHOD("set_gravity", "accel_vec"), &ParticlesMaterial::set_gravity); diff --git a/scene/3d/particles.h b/scene/3d/particles.h index 31ca85a59a..9c1436a47b 100644 --- a/scene/3d/particles.h +++ b/scene/3d/particles.h @@ -88,7 +88,7 @@ public: void set_emitting(bool p_emitting); void set_amount(int p_amount); void set_lifetime(float p_lifetime); - void set_one_shot(bool p_enabled); + void set_one_shot(bool p_one_shot); void set_pre_process_time(float p_time); void set_explosiveness_ratio(float p_ratio); void set_randomness_ratio(float p_ratio); diff --git a/scene/3d/path.cpp b/scene/3d/path.cpp index 5c29918118..f8df21004e 100644 --- a/scene/3d/path.cpp +++ b/scene/3d/path.cpp @@ -78,8 +78,8 @@ Ref<Curve3D> Path::get_curve() const { void Path::_bind_methods() { - ClassDB::bind_method(D_METHOD("set_curve", "curve:Curve3D"), &Path::set_curve); - ClassDB::bind_method(D_METHOD("get_curve:Curve3D", "curve"), &Path::get_curve); + ClassDB::bind_method(D_METHOD("set_curve", "curve"), &Path::set_curve); + ClassDB::bind_method(D_METHOD("get_curve"), &Path::get_curve); ClassDB::bind_method(D_METHOD("_curve_changed"), &Path::_curve_changed); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve3D"), "set_curve", "get_curve"); diff --git a/scene/3d/physics_body.cpp b/scene/3d/physics_body.cpp index 9feed2fe7b..dc8f72d77e 100644 --- a/scene/3d/physics_body.cpp +++ b/scene/3d/physics_body.cpp @@ -229,8 +229,8 @@ void StaticBody::_bind_methods() { ClassDB::bind_method(D_METHOD("set_bounce", "bounce"), &StaticBody::set_bounce); ClassDB::bind_method(D_METHOD("get_bounce"), &StaticBody::get_bounce); - ClassDB::bind_method(D_METHOD("add_collision_exception_with", "body:PhysicsBody"), &PhysicsBody::add_collision_exception_with); - ClassDB::bind_method(D_METHOD("remove_collision_exception_with", "body:PhysicsBody"), &PhysicsBody::remove_collision_exception_with); + ClassDB::bind_method(D_METHOD("add_collision_exception_with", "body"), &PhysicsBody::add_collision_exception_with); + ClassDB::bind_method(D_METHOD("remove_collision_exception_with", "body"), &PhysicsBody::remove_collision_exception_with); ADD_PROPERTY(PropertyInfo(Variant::REAL, "friction", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_friction", "get_friction"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "bounce", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_bounce", "get_bounce"); @@ -1138,7 +1138,7 @@ void KinematicBody::_bind_methods() { ClassDB::bind_method(D_METHOD("get_floor_velocity"), &KinematicBody::get_floor_velocity); ClassDB::bind_method(D_METHOD("set_safe_margin", "pixels"), &KinematicBody::set_safe_margin); - ClassDB::bind_method(D_METHOD("get_safe_margin", "pixels"), &KinematicBody::get_safe_margin); + ClassDB::bind_method(D_METHOD("get_safe_margin"), &KinematicBody::get_safe_margin); ClassDB::bind_method(D_METHOD("get_collision_count"), &KinematicBody::get_collision_count); ClassDB::bind_method(D_METHOD("get_collision_position", "collision"), &KinematicBody::get_collision_position); diff --git a/scene/3d/proximity_group.cpp b/scene/3d/proximity_group.cpp index 5441904d81..d0410f2c55 100644 --- a/scene/3d/proximity_group.cpp +++ b/scene/3d/proximity_group.cpp @@ -116,9 +116,9 @@ void ProximityGroup::set_group_name(String p_group_name) { group_name = p_group_name; }; -void ProximityGroup::_notification(int what) { +void ProximityGroup::_notification(int p_what) { - switch (what) { + switch (p_what) { case NOTIFICATION_EXIT_TREE: ++group_version; diff --git a/scene/3d/room_instance.cpp b/scene/3d/room_instance.cpp index 7827768c09..c5ea6c54da 100644 --- a/scene/3d/room_instance.cpp +++ b/scene/3d/room_instance.cpp @@ -143,8 +143,8 @@ void Room::_bounds_changed() { void Room::_bind_methods() { - ClassDB::bind_method(D_METHOD("set_room", "room:Room"), &Room::set_room); - ClassDB::bind_method(D_METHOD("get_room:Room"), &Room::get_room); + ClassDB::bind_method(D_METHOD("set_room", "room"), &Room::set_room); + ClassDB::bind_method(D_METHOD("get_room"), &Room::get_room); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "room/room", PROPERTY_HINT_RESOURCE_TYPE, "Area"), "set_room", "get_room"); } diff --git a/scene/3d/scenario_fx.cpp b/scene/3d/scenario_fx.cpp index abc7766ecb..0780ce22ff 100644 --- a/scene/3d/scenario_fx.cpp +++ b/scene/3d/scenario_fx.cpp @@ -93,8 +93,8 @@ String WorldEnvironment::get_configuration_warning() const { void WorldEnvironment::_bind_methods() { - ClassDB::bind_method(D_METHOD("set_environment", "env:Environment"), &WorldEnvironment::set_environment); - ClassDB::bind_method(D_METHOD("get_environment:Environment"), &WorldEnvironment::get_environment); + ClassDB::bind_method(D_METHOD("set_environment", "env"), &WorldEnvironment::set_environment); + ClassDB::bind_method(D_METHOD("get_environment"), &WorldEnvironment::get_environment); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "environment", PROPERTY_HINT_RESOURCE_TYPE, "Environment"), "set_environment", "get_environment"); } diff --git a/scene/3d/skeleton.cpp b/scene/3d/skeleton.cpp index ea5d21cd4e..cee97af244 100644 --- a/scene/3d/skeleton.cpp +++ b/scene/3d/skeleton.cpp @@ -82,9 +82,9 @@ bool Skeleton::_set(const StringName &p_path, const Variant &p_value) { return true; } -bool Skeleton::_get(const StringName &p_name, Variant &r_ret) const { +bool Skeleton::_get(const StringName &p_path, Variant &r_ret) const { - String path = p_name; + String path = p_path; if (!path.begins_with("bones/")) return false; @@ -518,8 +518,8 @@ void Skeleton::_bind_methods() { ClassDB::bind_method(D_METHOD("set_bone_disable_rest", "bone_idx", "disable"), &Skeleton::set_bone_disable_rest); ClassDB::bind_method(D_METHOD("is_bone_rest_disabled", "bone_idx"), &Skeleton::is_bone_rest_disabled); - ClassDB::bind_method(D_METHOD("bind_child_node_to_bone", "bone_idx", "node:Node"), &Skeleton::bind_child_node_to_bone); - ClassDB::bind_method(D_METHOD("unbind_child_node_from_bone", "bone_idx", "node:Node"), &Skeleton::unbind_child_node_from_bone); + ClassDB::bind_method(D_METHOD("bind_child_node_to_bone", "bone_idx", "node"), &Skeleton::bind_child_node_to_bone); + ClassDB::bind_method(D_METHOD("unbind_child_node_from_bone", "bone_idx", "node"), &Skeleton::unbind_child_node_from_bone); ClassDB::bind_method(D_METHOD("get_bound_child_nodes_to_bone", "bone_idx"), &Skeleton::_get_bound_child_nodes_to_bone); ClassDB::bind_method(D_METHOD("clear_bones"), &Skeleton::clear_bones); diff --git a/scene/3d/skeleton.h b/scene/3d/skeleton.h index dc0adbb337..a6546af64e 100644 --- a/scene/3d/skeleton.h +++ b/scene/3d/skeleton.h @@ -91,8 +91,8 @@ class Skeleton : public Spatial { } protected: - bool _get(const StringName &p_name, Variant &r_ret) const; - bool _set(const StringName &p_name, const Variant &p_value); + bool _get(const StringName &p_path, Variant &r_ret) const; + bool _set(const StringName &p_path, const Variant &p_value); void _get_property_list(List<PropertyInfo> *p_list) const; void _notification(int p_what); static void _bind_methods(); @@ -113,7 +113,7 @@ public: void set_bone_parent(int p_bone, int p_parent); int get_bone_parent(int p_bone) const; - void unparent_bone_and_rest(int p_idx); + void unparent_bone_and_rest(int p_bone); void set_bone_disable_rest(int p_bone, bool p_disable); bool is_bone_rest_disabled(int p_bone) const; diff --git a/scene/3d/spatial.cpp b/scene/3d/spatial.cpp index 2f2dd12a18..848b08eb8f 100644 --- a/scene/3d/spatial.cpp +++ b/scene/3d/spatial.cpp @@ -720,11 +720,11 @@ void Spatial::_bind_methods() { ClassDB::bind_method(D_METHOD("get_scale"), &Spatial::get_scale); ClassDB::bind_method(D_METHOD("set_global_transform", "global"), &Spatial::set_global_transform); ClassDB::bind_method(D_METHOD("get_global_transform"), &Spatial::get_global_transform); - ClassDB::bind_method(D_METHOD("get_parent_spatial:Spatial"), &Spatial::get_parent_spatial); + ClassDB::bind_method(D_METHOD("get_parent_spatial"), &Spatial::get_parent_spatial); ClassDB::bind_method(D_METHOD("set_ignore_transform_notification", "enabled"), &Spatial::set_ignore_transform_notification); ClassDB::bind_method(D_METHOD("set_as_toplevel", "enable"), &Spatial::set_as_toplevel); ClassDB::bind_method(D_METHOD("is_set_as_toplevel"), &Spatial::is_set_as_toplevel); - ClassDB::bind_method(D_METHOD("get_world:World"), &Spatial::get_world); + ClassDB::bind_method(D_METHOD("get_world"), &Spatial::get_world); // TODO: Obsolete those two methods (old name) properly (GH-4397) ClassDB::bind_method(D_METHOD("_set_rotation_deg", "rotation_deg"), &Spatial::_set_rotation_deg); @@ -735,8 +735,8 @@ void Spatial::_bind_methods() { #endif ClassDB::bind_method(D_METHOD("update_gizmo"), &Spatial::update_gizmo); - ClassDB::bind_method(D_METHOD("set_gizmo", "gizmo:SpatialGizmo"), &Spatial::set_gizmo); - ClassDB::bind_method(D_METHOD("get_gizmo:SpatialGizmo"), &Spatial::get_gizmo); + ClassDB::bind_method(D_METHOD("set_gizmo", "gizmo"), &Spatial::set_gizmo); + ClassDB::bind_method(D_METHOD("get_gizmo"), &Spatial::get_gizmo); ClassDB::bind_method(D_METHOD("set_visible", "visible"), &Spatial::set_visible); ClassDB::bind_method(D_METHOD("is_visible"), &Spatial::is_visible); diff --git a/scene/3d/spatial_velocity_tracker.h b/scene/3d/spatial_velocity_tracker.h index 65f3eaca93..b8237613a7 100644 --- a/scene/3d/spatial_velocity_tracker.h +++ b/scene/3d/spatial_velocity_tracker.h @@ -20,7 +20,7 @@ protected: public: void reset(const Vector3 &p_new_pos); - void set_track_fixed_step(bool p_use_fixed_step); + void set_track_fixed_step(bool p_track_fixed_step); bool is_tracking_fixed_step() const; void update_position(const Vector3 &p_position); Vector3 get_tracked_linear_velocity() const; diff --git a/scene/3d/sprite_3d.cpp b/scene/3d/sprite_3d.cpp index b4e045e43f..978662f7dc 100644 --- a/scene/3d/sprite_3d.cpp +++ b/scene/3d/sprite_3d.cpp @@ -562,8 +562,8 @@ void Sprite3D::_validate_property(PropertyInfo &property) const { void Sprite3D::_bind_methods() { - ClassDB::bind_method(D_METHOD("set_texture", "texture:Texture"), &Sprite3D::set_texture); - ClassDB::bind_method(D_METHOD("get_texture:Texture"), &Sprite3D::get_texture); + ClassDB::bind_method(D_METHOD("set_texture", "texture"), &Sprite3D::set_texture); + ClassDB::bind_method(D_METHOD("get_texture"), &Sprite3D::get_texture); ClassDB::bind_method(D_METHOD("set_region", "enabled"), &Sprite3D::set_region); ClassDB::bind_method(D_METHOD("is_region"), &Sprite3D::is_region); @@ -724,8 +724,8 @@ void AnimatedSprite3D::_draw() { void AnimatedSprite3D::_bind_methods(){ - ClassDB::bind_method(D_METHOD("set_sprite_frames","sprite_frames:SpriteFrames"),&AnimatedSprite3D::set_sprite_frames); - ClassDB::bind_method(D_METHOD("get_sprite_frames:Texture"),&AnimatedSprite3D::get_sprite_frames); + ClassDB::bind_method(D_METHOD("set_sprite_frames","sprite_frames"),&AnimatedSprite3D::set_sprite_frames); + ClassDB::bind_method(D_METHOD("get_sprite_frames"),&AnimatedSprite3D::get_sprite_frames); ClassDB::bind_method(D_METHOD("set_frame","frame"),&AnimatedSprite3D::set_frame); ClassDB::bind_method(D_METHOD("get_frame"),&AnimatedSprite3D::get_frame); @@ -1246,8 +1246,8 @@ String AnimatedSprite3D::get_configuration_warning() const { void AnimatedSprite3D::_bind_methods() { - ClassDB::bind_method(D_METHOD("set_sprite_frames", "sprite_frames:SpriteFrames"), &AnimatedSprite3D::set_sprite_frames); - ClassDB::bind_method(D_METHOD("get_sprite_frames:SpriteFrames"), &AnimatedSprite3D::get_sprite_frames); + ClassDB::bind_method(D_METHOD("set_sprite_frames", "sprite_frames"), &AnimatedSprite3D::set_sprite_frames); + ClassDB::bind_method(D_METHOD("get_sprite_frames"), &AnimatedSprite3D::get_sprite_frames); ClassDB::bind_method(D_METHOD("set_animation", "animation"), &AnimatedSprite3D::set_animation); ClassDB::bind_method(D_METHOD("get_animation"), &AnimatedSprite3D::get_animation); diff --git a/scene/3d/sprite_3d.h b/scene/3d/sprite_3d.h index b4600c00b8..7dc4cd4ffb 100644 --- a/scene/3d/sprite_3d.h +++ b/scene/3d/sprite_3d.h @@ -119,7 +119,7 @@ public: void set_pixel_size(float p_amount); float get_pixel_size() const; - void set_axis(Vector3::Axis p_amount); + void set_axis(Vector3::Axis p_axis); Vector3::Axis get_axis() const; void set_draw_flag(DrawFlags p_flag, bool p_enable); diff --git a/scene/3d/vehicle_body.cpp b/scene/3d/vehicle_body.cpp index 8d927e529e..adf235c525 100644 --- a/scene/3d/vehicle_body.cpp +++ b/scene/3d/vehicle_body.cpp @@ -893,9 +893,9 @@ real_t VehicleBody::get_friction() const { return friction; } -void VehicleBody::set_engine_force(float p_force) { +void VehicleBody::set_engine_force(float p_engine_force) { - engine_force = p_force; + engine_force = p_engine_force; } float VehicleBody::get_engine_force() const { diff --git a/scene/3d/vehicle_body.h b/scene/3d/vehicle_body.h index 7ed9bce730..d778800814 100644 --- a/scene/3d/vehicle_body.h +++ b/scene/3d/vehicle_body.h @@ -196,7 +196,7 @@ public: void set_engine_force(float p_engine_force); float get_engine_force() const; - void set_brake(float p_force); + void set_brake(float p_brake); float get_brake() const; void set_steering(float p_steering); |